2013-12-10 44 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,但是這個主題有很多可用的帖子。