[英]Python Selenium Firefox - Insecure Connection Error Alert
I am using Python Selenium with FireFox and am struggling to resolve an issue. 我正在将Python Selenium与FireFox结合使用,正在努力解决问题。 Occasionally during a test script I come across a form that submits from https to http which throws this error... 有时在测试脚本中,我遇到了一个表单,该表单从https提交到http,这会引发此错误...
The information you have entered on this page will be sent over an insecure connection and could be read by a third party
I have looked at using driver.switchTo().alert().accept(); 我看过使用driver.switchTo()。alert()。accept(); but it is not working, I assume it's because it's a FireFox generated alert rather than a java one from the site? 但是它不起作用,我认为是因为它是FireFox生成的警报,而不是站点中的Java警报? The error I receive is... 我收到的错误是...
AttributeError: 'WebDriver' object has no attribute 'switchTo'
Anyone have any experience getting around the issue? 任何人都有解决该问题的经验吗?
In Python, it is switch_to
. 在Python中,它是switch_to
。 Replace: 更换:
driver.switchTo().alert().accept();
with: 有:
driver.switch_to.alert.accept()
Though, I am not sure this is a regular alert you can switch to this way. 不过,我不确定这是否是常规警报,您可以切换到这种方式。 I suspect the behavior whether show the warning or not is controled via the specific firefox preference. 我怀疑是否显示警告的行为是通过特定的Firefox首选项控制的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.