小编Gou*_*nha的帖子

无法创建新的远程会话

如何解决此问题.早些时候我的代码正在运行,但IE设置被某人重置.现在我得到了这个例外.

Started InternetExplorerDriver server (32-bit)
2.53.1.0
Listening on port 16183
Only local connections are allowed
Oct 21, 2016 10:14:12 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
Oct 21, 2016 10:14:12 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Falling back to straight W3C remote end connection
Oct 21, 2016 10:14:12 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Falling back to original OSS JSON Wire Protocol.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities …
Run Code Online (Sandbox Code Playgroud)

selenium-webdriver remotewebdriver

12
推荐指数
1
解决办法
5万
查看次数

想用飞碟生成风景pdf

我在下面给出了 html,当我使用飞碟将其转换为 PDF 时,它不适合 A4 纵向尺寸。如何生成风景pdf文件。

<html>

<head>
  <title>
    Selenium Test SC
  </title>
</head>

<body style='font-family:Tahoma;font-size:9pt;letter-spacing:0.5px'>
  <table border='1' style='color:black;font-size:12px;'>
    <tr>
      <td>
        <a href="file:///C:/Users/611066167/Documents/Sel%20Test%20Result/Screenshots/Screen1.png" target="_blank">
NGSD:TMD (Search)
<img src="file:///C:/Users/611066167/Documents/Sel%20Test%20Result/Screenshots/Screen1.png" title="NGSD:TMD (Search)" style="width:100%;height:100%" alt="NGSD:TMD (Search)" border="0">
</a>
      </td>
    </tr>
  </table>
</body>

</html>
Run Code Online (Sandbox Code Playgroud)

我正在使用下面给定的代码将 html 转换为 pdf

inputFile = "C:/Users/611066167/Documents/Sel Test Result/screenfile.html"; 
outputFile = "C:/Users/611066167/Documents/Sel Test Result/screenfile.pdf"; 
generatePDF(inputFile, outputFile); 


public void generatePDF(String inputHtmlPath, String outputPdfPath)
{
    try
    {     
        String url = new File(inputHtmlPath).toURI().toURL().toString(); 
        System.out.println("URL: " + url);
        OutputStream out = new FileOutputStream(outputPdfPath); 

        // …
Run Code Online (Sandbox Code Playgroud)

itext flying-saucer

1
推荐指数
1
解决办法
2486
查看次数