Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用selenium for python的IE webdriver(导航失败错误)?_Python_Internet Explorer_Selenium_Selenium Webdriver - Fatal编程技术网

如何使用selenium for python的IE webdriver(导航失败错误)?

如何使用selenium for python的IE webdriver(导航失败错误)?,python,internet-explorer,selenium,selenium-webdriver,Python,Internet Explorer,Selenium,Selenium Webdriver,我试图使用python selenium API(版本2.53.6)在不同的浏览器上执行GUI测试。当我尝试以以下方式使用IE(11.0.10240)时(Windows Server 2012 R2标准,64位);使用身份验证: driver = webdriver.Ie() driver.get("http://user:password@my.test.server.com") 然后我得到以下错误消息: selenium.common.exceptions.WebDriverExcepti

我试图使用python selenium API(版本2.53.6)在不同的浏览器上执行GUI测试。当我尝试以以下方式使用IE(11.0.10240)时(Windows Server 2012 R2标准,64位);使用身份验证:

driver = webdriver.Ie()
driver.get("http://user:password@my.test.server.com")
然后我得到以下错误消息:

selenium.common.exceptions.WebDriverException: Message: Failed to navigate to http://user:password@my.test.server.com. This usually means that a call to the COM method IWebBrowser2::Navigate2() failed.
有没有办法修复此错误

增编:

  • 我一直在尝试使用32位版本的IE驱动程序,没有成功(相同的错误)
  • 我已按说明更改注册表,未成功(相同错误)
  • 我已经为所有区域设置了“启用保护模式”(也建议)

没有直接回答这个问题,但在Windows 10上使用IE11时,我无法通过BrowserStack和打开:

没有错误,我看到了HTTP身份验证后面的图像


使用selenium 2.53.5。

您是否尝试过以这种方式使用它

驱动程序。当前\u url(“”)


如果您尝试导航到其他站点,它是否有效?这可能与使用http有关。。。另外,当您说您已经设置了“启用保护模式”时,您的意思是您正在禁用它,对吗?此外,请尝试在“Internet选项”>“高级”的“安全”部分中使用设置。如果我尝试此操作,则会在
webdriver.Remote
行中出现404错误。我还强烈希望获得示例代码中给出的驱动程序,也就是说,有一个方法可以返回正确的工作驱动程序(无需事先指定特定的URL…)@Alex这里的自定义
命令执行器
url只是因为我在mac上,使用远程browserstack selenium服务器,并在那里启动
IE
。然后,我导航到特定的
httpwatch
页面,以演示我可以访问基本http身份验证背后的图像。请注意,如果要运行此示例,则需要使用特定的browserstack凭据替换
用户名
。我不想使用browserstack。。。也许selenium故意不适用于IE?似乎“current_url”是一个我无法调用的字符串。我收到一个错误
TypeError:“str”对象不可调用
…您介意分享更多细节吗?例如>您使用的python版本是什么?>您在程序中调用了哪些标头导入?>如果可能的话,基本上发布你的全部代码?
from selenium import webdriver

desired_cap = {'os': 'Windows', 'os_version': '10', 'browser': 'IE', 'browser_version': '11.0'}

driver = webdriver.Remote(
    command_executor='http://usename:key@hub.browserstack.com:80/wd/hub',
    desired_capabilities=desired_cap)

driver.get("http://httpwatch:password1@www.httpwatch.com/httpgallery/authentication/authenticatedimage/default.aspx?0.7349707232788205")