使用硒网络驱动程序登录弹出窗口? [英] Login popup window using selenium webdriver?

查看:98
本文介绍了使用硒网络驱动程序登录弹出窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

仅当我使用Fire Fox浏览器时才会弹出窗口,是否有办法解决此问题?每当我使用FF作为浏览器时,我都必须输入用户名/密码.

the popup window is only happening if I use the Fire Fox browser otherwise, is there a way to fix this problem? I have to enter userid/password every time the i use FF as my browser.

当前,每次运行测试时我都会进入,这非常痛苦,但是希望使其自动化....

currently, I am entering every time i run my test which is very painful but looking to make it more automated....

我已经看了一眼,并在此处此处,但无济于事

I have goggled and found two links here and here but no avail

推荐答案

花了几个小时阅读之后,我终于找到了效果很好的解决方案,希望对其他人也有帮助. -享受吧!

After spending hours reading I finally found the solution which works pretty well and I hope this will help others too. - Enjoy!!

首先-请按照以下步骤操作:

First - follow this steps:

1) Open the FireFox browser
2) Type the following `about:config`
3) Look for `network.http.phishy-userpass-length` if you don't find then create a new Integer key 
Create a new Integer key (right-click->New->Integer): `network.http.phishy-userpass-length` with value `255`

第二:您需要使用以下内容创建Firefox驱动程序:

Second: You need to create a Firefox driver with the following:

FirefoxProfile profile = new FirefoxProfile();
profile.SetPreference("network.http.phishy-userpass-length", 255);
profile.SetPreference("network.automatic-ntlm-auth.trusted-uris", "YOUR HOST ADDRESS HERE");
_driver = new FirefoxDriver(profile);

如果您有任何疑问,请告诉我.

let me know if you have any questions.

这篇关于使用硒网络驱动程序登录弹出窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆