我已经在我的机器上安装了testlink安装程序,我正在尝试学习它。问题是在创建和编辑测试用例时,它显示了以下警告框,其中包含:
OptionTransfer init(): Left select list does not exist in form!当点击添加/编辑测试用例按钮时,我会发出警告。我调查了这个问题,并从它的出现中找到了根源。
//function OT_init(theform){this.form = theform;if(!theform[this.left]){alert("OptionTransfer init(): Left select list does not exist in form!");return false;}if(!theform[this.right]){alert("OptionTransfer init(): Right select list does not exist in form!");return false;}this.left=theform[this.left];this.right=theform[this.right];for(var i=0;i<this.left.options.length;i++){this.originalLeftValues[this.left.options[i].value]=1;}for(var i=0;i<this.right.options.length;i++){this.originalRightValues[this.right.options[i].value]=1;}if(this.removedLeftField!=null){this.removedLeftField=theform[this.removedLeftField];}if(this.removedRightField!=null){this.removedRightField=theform[this.removedRightField];}if(this.addedLeftField!=null){this.addedLeftField=theform[this.addedLeftField];}if(this.addedRightField!=null){this.addedRightField=theform[this.addedRightField];}if(this.newLeftField!=null){this.newLeftField=theform[this.newLeftField];}if(this.newRightField!=null){this.newRightField=theform[this.newRightField];}this.update();}因此,我只是在那里对该函数进行了注释,但问题仍然存在,并且仍然显示错误。
我还检查了添加/编辑(两者都在同一个文件中),发现没有任何问题。
我从过去2天开始搜索,没有得到任何解决方案:
所以我的问题是:
1)为什么会显示以下警报?
2)我注释了这个函数,为什么它会显示警报?
3)是否与html <select>标签相关?
4)如何预防?
任何帮助都将不胜感激。
发布于 2013-02-08 23:45:01
您有一个使用Matt Kruse's OptionTransfer widget的页面。当它初始化时,它在小部件的html中查找select元素。应该使用父表单元素作为参数来调用init函数。
我也有这个问题。在我的例子中,init函数是用错误的参数(附近的div)调用的,所以没有找到select,因此出现了这个错误。可能和你的情况类似。
https://stackoverflow.com/questions/13853104
复制相似问题