2010-10-26 5 views
0

Une fonction simple définie dans l'utilisateur-extensions.js:CHECKPOINT-FAIL com.thoughtworks.selenium.SeleniumException: this.waitForCondition est pas une fonction

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

Le fichier Selenium.java:

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

l'exécution du test lance une SeleniumException:

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

cette exception pourrait-il être évité?

Réglages:

  • serveur sélénium 2.0a5
  • Firefox 3.6.11

Après avoir ajouté le; J'ai toujours la même exception.

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

Le problème a été résolu en utilisant un accesseur au lieu d'une action: http: // seleniumhq. org/docs/08_user_extensions.html # accesseurs-assertions – naxos

Répondre

0

Il semble que vous devez ajouter un ; à la fin de votre fonction doGetThis:

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