这是我的第一篇文章,因为我是Selenium的新手。目前我正在阅读一本名为Selenium tool :初学者指南的书。在书中,它讲述了如何使用Selenium IDE扩展,使用.js文件来存储您的JS函数等。
给出了以下示例,并将其保存为user-extsion.js文件。我已经在Selenium > Option > Selenium IDE扩展字段中定义了文件。
但是当我重新启动selenium时,我得到了以下错误:
"error loading Selenium IDE extensions: ReferenceError: Selenium is not defined" 我使用的例子是:
Selenium.prototype.doTypeTodaysDate = function(locator){
var dates = new Date();
var day = dates.getDate();
if (day < 10){
day = '0' + day;
}
month = dates.getMonth() + 1;
if (month < 10){
month = '0' + month;
}
var year = dates.getFullYear();
var prettyDay = day + '/' + month + '/' + year;
this.doType(locator, prettyDay);
}任何帮助都将不胜感激。
提前谢谢。
Rohit
发布于 2011-07-17 17:44:07
删除Selenium IDE扩展。并从Selenium Core扩展中浏览到相同的文件。这将会解决你的问题。我在我的浏览器上重现了你的错误。你的代码没问题。
https://stackoverflow.com/questions/5904973
复制相似问题