2014-09-05 82 views
0

我正在使用CFSELENIUM和MXUNIT創建測試用例。運行時,在執行CLICK命令後失敗:執行CLICK命令後CFSelenium會中斷

selenium.click("//button[@id='Submit']"); 

它引發以下錯誤消息。

Application: The Response of the Selenium RC is invalid: ERROR: Command execution failure. Please search the user group at https://groups.google.com/forum/#!forum/selenium-users for error details from the log window. The error message is: Argument 1 of EventTarget.dispatchEvent does not implement interface Event.

請在下面找到代碼。

component extends="cfselenium.CFSeleniumTestCase" displayName="seleniumBase" { 

    public void function beforeTests() { 

     //your local host 
     variables.browserUrl = "url"; 
     variables.browserCommand = "*firefox"; 

     super.beforeTests(); 
     selenium.setTimeout(50000); 
     selenium.setSpeed(500); 
    } 

    public void function afterTests() { 
     super.afterTests(); 
    } 

    private void function logIn(){ 
     selenium.open(variables.browserUrl); 
     selenium.waitForPageToLoad("30000"); 

     //your username 
     variables.backofficeUserName = "test"; 
     selenium.type("id=UserName", variables.backofficeUserName); 

     //your password 
     variables.backofficePassword = "test"; 
     selenium.type("//input[@type = 'password']", variables.backofficePassword); 

     selenium.click("//button[@id='Submit']"); 
     selenium.waitForPageToLoad("30000"); 
    } 
} 

回答

0

它可以在所有瀏覽器上運行。試試吧...

selenium.click("//input[@id='Submit']");