相关疑难解决方法(0)

Chlenmedriver in Selenium和SSL证书

我正在使用Selenium来测试一个具有HTTP Auth的网站,现在甚至是SSL证书.

作为HTTP Basic Authentification的解决方法,我正在使用ChromeDriver - http://code.google.com/p/selenium/wiki/ChromeDriver并以格式打开网址

https://username:password@my-test-site.com
Run Code Online (Sandbox Code Playgroud)

但是现在出于安全原因,需要在PC上安装客户端证书才能登录该应用程序.

但是,ChromeDriver无法看到"选择证书"提示,我甚至无法将其切换为警报.

有人解决了这个问题吗?

selenium google-chrome ssl-certificate

8
推荐指数
2
解决办法
2万
查看次数

使用 Selenium 和 PHPUnit 对 http POST 到 /session 抛出卷曲错误:{"desiredCapability":{"browserName":"chrome","platform":"ANY"

我正在使用 PHPUnit 运行所有测试。创建了一个包装器,用于启动 Apache 实例,然后启动 Selenium 独立服务器,然后在http://localhost:4444/wd/hub创建 Chrome Remote Webdriver 实例。这个过程在我们的开发机器上 100% 的时间有效,在测试服务器上 90% 的时间有效,但有时测试会失败,如下所示:

 [exec] 1) Intranet\Pages\FinancialReportsSeleniumTest::test_changeMonthYear
 [exec] Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY","chromeOptions":{"binary":"","args":["--window-size=1400,900","--no-sandbox","--headless"]},"goog:chromeOptions":{"args":["--window-size=1400,900","--no-sandbox","--headless"]}}}
 [exec] 
 [exec] Failed to connect to localhost port 4444: Connection refused
 [exec] 
 [exec] C:\Jenkins\jobs\Intranet-Master\workspace\vendor\facebook\webdriver\lib\Remote\HttpCommandExecutor.php:292
 [exec] C:\Jenkins\jobs\Intranet-Master\workspace\vendor\facebook\webdriver\lib\Remote\RemoteWebDriver.php:126
 [exec] C:\Jenkins\jobs\Intranet-Master\workspace\phpunit\library\Intranet\Selenium.php:364
 [exec] C:\Jenkins\jobs\Intranet-Master\workspace\phpunit\library\Intranet\Selenium.php:51
 [exec] C:\Jenkins\jobs\Intranet-Master\workspace\phpunit\library\Intranet\SeleniumTestCase.php:9
Run Code Online (Sandbox Code Playgroud)

如果我们重新运行测试,下次就可以正常工作。

开发机器:

  • Windows 10 专业版 (1809)(64 位)
  • 阿帕奇 2.4.38(32 位)
  • PHP 7.2.15(32 位)
  • Java 1.8.0_192(64 位)
  • 硒 3.141.59
  • 硒 Chrome 驱动程序 73.0.3683.20

试验机

  • Windows Server …

windows selenium phpunit google-chrome selenium-chromedriver

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