Ich habe versucht, einige grundlegende automatisierte Tests mit Ruby Selen-Webdriver zu laufen. Derselbe Code funktioniert perfekt auf meinem Heimcomputer, schlägt aber auf meinem Arbeitscomputer fehl, der hinter einem Proxy liegt (der keine Authentifizierung erfordert).Keine Verbindung zum Browser mit Ruby Selenium Webdriver
driver = Selen :: WebDriver.for: firefox,: Profil => 'default'
Der Fehler, den ich bekommen ist:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.24.0/lib/selenium/webdriver/remote/http/common.rb:66:in `create_response': unexpected response, code=
403, content-type="text/html" (Selenium::WebDriver::Error::WebDriverError)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The requested URL could not be retrieved</TITLE>
<STYLE type="text/css"><!--BODY{background-color:#ffffff;font-family:verdana,sans-serif}PRE{font-family:sans-serif}--></STYLE>
</HEAD><BODY>
<H1>ERROR</H1>
<H2>The requested URL could not be retrieved</H2>
<HR noshade size="1px">
<P>
While trying to retrieve the URL:
<A HREF="http://127.0.0.1:7055/hub/session">http://127.0.0.1:7055/hub/session</A>
<P>
The following error was encountered:
<UL>
<LI>
<STRONG>
Access Denied.
</STRONG>
<P>
Access control configuration prevents your request from
being allowed at this time. Please contact your service provider if
you feel this is incorrect.
</UL>
Der Browser mit dem richtigen Profil öffnet, aber Fahrer variable resultierende ist nichts. Ich habe sogar versucht, den Proxy auf dem Profil manuell einzurichten, ohne Glück.
Irgendwelche Ideen?
I Selen-WebDriver 2.26.0 bin mit, Einstellung NO_PROXY = 127.0.0.1 das Problem gelöst. –
Wow, das hat wirklich für mich funktioniert. –