2011-08-16 21 views
1

我是Selenium IDE的新手。我有以下按鈕功能的登錄表單:硒 - 測試登錄不啓用Javascript按鈕

function init() 
{ //attach the login validation to the password on change event 
getElem("Password").onkeyup = handleLoginButtonValidation; 
} 

function handleLoginButtonValidation() 
{ //if the password is of zero length then disable the button 
getElem("Login").disabled = (getElem("Password").value.length == 0); 
} 

我試着用下面的代碼與硒IDE來測試它:

type id=Username username 
type id=Password password 
clickAndWait id=login 

但eventhough密碼由硒填充,按鈕仍然沒有啓用,所以我的測試超時。

任何想法爲此解決方法?

回答

0

你可以按鈕啓用。

fireEvent id=Password change 
typeKeys id=Password password 
+0

這很好用!謝謝 – Gita