2013-12-10 48 views
1

我正在开发使用java selenium web驱动程序的网站的自动化脚本。如何获得对硒浏览器窗口的控制

但该网站正在请求“需要验证”(窗口)两次。

我处理使用窗口修改如下面

http://username:[email protected] 

的URL,但处理第二个“Windows身份验证”,“需要验证”第一,我依赖于多处理。

我已经做了处理第二个“需要验证”窗口

Whenever the browser got stucks at "Authentication required" window, then I will be 
starting a small http server and opening a url, that opened url will type the username 
and password in the "Authentication required" window (i.e. I am triggering another 
process through a url by creating handler for that url which will copy username and 
password in the "Authentication Required" window) 

但我的问题是,在网络驱动程序窗口没有得到所有其他窗口的顶部下面的,所以我不能够复制用户名和密码在确切的地方使用机器人对象。

在此先感谢

+0

你为什么使用机器人?没有办法引用用户/传球领域?例如,也许这是一个flash或java小应用程序或硒实际上不支持的东西。 – MxyL

+0

做“ctrl v”,将用户名和密码复制到框 – user2753523

+0

窗口看起来像下面的链接http://stackoverflow.com/questions/12151958/login-popup-window-using-selenium-webdriver。 – user2753523

回答

0

可以使用的AutoIt自动调整窗口的对话框,并为您的方案,实际上你可以把一个特定的窗口成为焦点为好。

这是一个reference,但是这个主题有很多可用的帖子。