2

- 得到这个错误OpenQA.Selenium.WebDriverException: No response from server for url硒 - 试图网站的安全证书

driver.Navigate().GoToUrl("javascript:document.getElementById('overridelink').click()"); 

末编辑

需要被测试的网站有一个自签名证书。因此,Internet Explorer(Windows 7中的8)显示下面的消息消息以及这应该如何处理任何线索?

The security certificate presented by this website was not issued by a trusted certificate authority. The security certificate presented by this website was issued for a different website's address.

enter image description here

如果重写通过点击"Continue to this website (no recommended)"的链接,然后将其重定向页面,我得到这个窗口,它说:

Do you want to view only the webpage content that was delivered securely? - with YES | NO button以及是否单击是/否,我收到错误信息其中说:

Unable to open the Internet site <site_name> Operation aborted

有帮助吗?

回答

1

在IE的情况下,您应该先在您的本地机器上手动安装证书,然后使用它。 AFAIK没有其他方法来规避这个问题。

+1

我从哪里获得证书?以及如何安装? –

1

如果您使用硒rc ..您可以在启动硒服务器时使用-trustAllSSSlCertificates选项。

+0

我正在使用硒2(webdriver) –

+1

这还没有在IE中实现。为了在Firefox中实现同样的功能,你可以参考这个链接http://code.google.com/p/selenium/wiki/UntrustedSSLCertificates –

+0

我不用对FF没有任何问题 –

0

如果上面的“证书安装”过程没有帮助,请尝试下面的备用解决方案。在我的情况下,由于我的机器上有一些客户端受限制的设置,这没有帮助。所以我在我的Webdriver代码中使用了下面的行。

driver.get(baseUrl"); 
driver.findElement(By.name("overridelink")).sendKeys(Keys.ENTER); 

//上述行用于点击“继续浏览本网站(不推荐)”链接。

+0

我尝试了上面的代码,但它没有点击''(覆盖链接)' –

+0

任何运气,因为我试图与硒rc相同,但服务器挂断在那一点。请让我知道如果您发现锻炼 – sam

+0

您是否安装了cybervillainsCA证书? – Hemanth