好吧,所以我使用累计规则在userextension和由于某种原因Selenium将继续说我的标签为我的gotoIF不存在。有没有人有任何想法为什么或如何解决这个问题?语言是JS(JavaScript)的硒IDE汇总规则与gotoIf和标签
var manager = new RollupManager();
manager.addRollupRule({
name: 'FRLanguageCheck'
, description: 'Check the language to make sure its in french'
, args: [
], commandMatchers: [
]
, getExpandedCommands: function(args) {
var commands = [];
commands.push({
command: 'storeTextPresent'
, target: 'English'
, value: 'LanguageCheck'
});
commands.push({
command: 'gotoIf'
, target: '${LanguageCheck}==false'
, value: 'StepWithWrongLanguage'
});
commands.push({
command: 'gotoIf'
, target: '${LanguageCheck}==true'
, value: 'StepWithRightLanguage'
});
commands.push({
command: 'label'
, target: 'StepWithWrongLanguage'
, value: ''
});
commands.push({
command: 'click'
, target: 'TestLanguageChangeToFrench failed. The site was not in French.'
, value: ''
});
commands.push({
command: 'label'
, target: 'StepWithRightLanguage'
, value: ''
});
return commands;
}
});
这是错误信息,我从硒
[error] [selblocks] Error @1: [rollup|FRLanguageCheck] Target label 'StepWithRightLanguage' is not found.
[warn] [selblocks] __Stack Trace__
[error] Unexpected Exception: Error: @1: [rollup|FRLanguageCheck] Target label 'StepWithRightLanguage' is not found..
你的脚本似乎是正确的,虽然你似乎插入});命令.push({在一个straith行中,并忘记它在另一个bug中,我将通过该校正来测试它 编辑:新命令也返回相同的错误宣布标签不存在。标签到Selenium脚本运行它的过程,但相反,忽略标签完全去我的Click错误行straith。可能是汇总不能使用标签命令? –
注意:我尝试了你的想法再次与一个标签和gotoIf但汇总不要说标签不存在,如果我在Selenium脚本中添加了标签,它会忽略它并跳到点击错误行,尽管产生了'true'结果 –
谢谢你指出,我只用了xml的selenium我仍然在学习,我已经调整了我的代码,所以它的格式更好,我的歉意,所以你得到了你以前得到的完全相同的错误? – Brainles71