我想问为什么当我执行它时,它不会将值返回到numOfPeople。非常感谢。
People.prototype.deleteAllPeople = function(){
var numOfPeople = this.getNumOfPeole();
for (var i = 0; i < numOfPeople; i++) {
try{
this.click(this.By.xpath(this.getPeopleByOrder(i) + this.classContains('padding')
+ this.xPathContainText("Delete")));
}catch(error){
this.log("Cannot delete people " + i);
}
}
};
People.prototype.getNumOfPeole= function(){
return this.driver.executeScript(
"return jQuery(function($) { "
+ 'return $("div.single-pane").length;'
+ " }); "
);
};