我在使用安全网址时遇到了问题:
I am having an issue with a secure URL:
打开URL将创建一个需要身份验证"警报框,其中包含用户名和密码字段.
Opening the URL creates an "Authentication Required" alert box with username and password fields.
我对Selenium Webdriver和Python还是陌生的.我不熟悉处理警报,目前正在手动输入凭据,直到我能弄清楚为止. 我已经尝试过将用户名/密码添加到URL中.这对我不起作用.
I am fairly new to Selenium Webdriver and Python. I am not familiar with handling alerts and am currently manually typing in credentials until I can get this figured out. I have already tried adding my username/password into the URL. This does not work for me.
有人可以指出我向在警报框中的用户名和密码字段中输入密钥的方向吗?
Could someone please point me in the direction of entering keys into username and password fields in an alertbox?
推荐答案感谢所有答复.不幸的是,这些解决方案都不适合我.我怀疑每次webdriver打开firefox时,它可能与创建新的配置文件有关.
Thanks for all of the responses. Unfortunately, none of these solutions worked for me. I suspect it may have something to do with the creation of a new profile every time firefox was opened by webdriver.
我的解决方法: 安装32位IE驱动程序后,我将驱动程序从Firefox更改为IE( selenium-release.storage.googleapis/index.html?path=2.44/).通过不再创建警报框并允许我继续进行单元测试,这解决了我的问题.
My workaround: I changed the driver from Firefox to IE, after installing the 32bit IE driver(selenium-release.storage.googleapis/index.html?path=2.44/). This solved my issue by no longer creating the alertbox, and allowing me to continue with my unittest.
更多推荐
处理“需要认证".带有Python 2.7 + Selenium Webdriver的警报框
发布评论