2011-06-09 92 views
0

我有一個由junit4,FireFox3.5的selenium2測試,當輸入一些註冊信息,然後點擊一個按鈕提交,它會變成HTTPS身份驗證需要彈出。我怎樣才能處理這個安全彈出輸入用戶名和密碼。那麼它將轉到https頁面並註冊成功。 Image like that需要身份驗證彈出Firefox中的Selenium時註冊

public void testUntitled() throws Exception { 
selenium.open("/"); 
selenium.waitForPageToLoad("30000"); 
selenium.select("year", "label=2014"); 
selenium.select("day", "label=03"); 
selenium.type("firstName", "asd"); 
selenium.type("lastName", "df"); 
selenium.click("//div[@id='page-body']/div[1]/input"); 
Thread.sleep(30000); 
+0

[Firefox認證彈出 - 使用Windows/Linux中的Sikuli腳本解析](http://stackoverflow.com/a/22628748/3458698) – Ramkumar 2014-03-25 08:25:33

回答

0

好了,你可以讓你使用AutoIt腳本來處理這個彈出。

AutoIt腳本

WinWaitActive("Authentication Required") 

Send("username") 

Send("{TAB}") 

Send("password") 

Send("{ENTER}") 

通過這個腳本,我希望你能夠處理。