2010-10-26 34 views
0

在用戶定義extensions.js的簡單函數:CHECKPOINT-FAIL com.thoughtworks.selenium.SeleniumException:this.waitForCondition不是函數

Selenium.prototype.doGetThis = function(){ 
    var errors = ""; 
    if (browserVersion.isChrome) { 
     errors = true; 
    } else { 
     throw new SeleniumError("TODO: Non-FF browser..."); 
    } 
    return errors; 
} 

的Selenium.java文件:

String getThis() { 
    return this.commandProcessor.doCommand("getThis", EMPTY_STRING_ARRAY); 
} 

運行測試拋出一個SeleniumException:

CHECKPOINT-FAIL com.thoughtworks.selenium.SeleniumException: this.waitForCondition is not a function 

可避免此異常?

設置:

  • 硒服務器2.0a5
  • 火狐3.6.11

我添加了後;我仍然有同樣的例外。

Selenium.prototype.doGetThis = function(){ 
    var errors = ""; 
    if (browserVersion.isChrome) { 
     errors = true; 
    } else { 
     throw new SeleniumError("TODO: Non-FF browser..."); 
    } 
    return errors; 
}; 
+0

問題已經通過使用訪問而不是操作的解決。組織/文檔/ 08_user_extensions.html#存取,斷言 – naxos 2010-10-28 15:37:11

回答

0

看來你需要一個;添加到您的doGetThis函數的末尾:HTTP:// seleniumhq

Selenium.prototype.doGetThis = function(){ 
    var errors = ""; 
    if (browserVersion.isChrome) { 
     errors = true; 
    } else { 
     throw new SeleniumError("TODO: Non-FF browser..."); 
    } 
    return errors; 
};