Selenium IDE - 将 URL 字符串变量传递到条件“gotoIf”中语句抛出语法错误?
我正在尝试将当前网址 (http://example.com) 存储在 变量中并将其与另一个字符串作为 gotoIf 命令中的条件(gotoIf extension.js 的一部分):
storeLocation || url
gotoIf || ${url}=="http://example.com" || label
当我运行此 seleniun ide 时会抛出此错误:
[error] Unexpected Exception: message -> syntax error, fileName -> chrome://selenium-ide/content/tools.js -> file:///C:/Users/David%20Cunningham/Desktop/extensions_js/extensions.js, lineNumber -> 183, stack -> eval("http://example.com==\"http://example.com\"")@:0 ("http://example.com==\"http://example.com\"","label1")@chrome://selenium-ide/content/tools.js -> file:///C:/Users/David%20Cunningham/Desktop/extensions_js/extensions.js:183 ("http://example.com==\"http://example.com\"","label1")@chrome://selenium-ide/content/selenium/scripts/htmlutils.js:60 ([object Object],[object Object])@chrome://selenium-ide/content/selenium/scripts/selenium-commandhandlers.js:310 ()@chrome://selenium-ide/content/selenium/scripts/selenium-executionloop.js:112 (6)@chrome://selenium-ide/content/selenium/scripts/selenium-executionloop.js:78 (6)@chrome://selenium-ide/content/selenium/scripts/htmlutils.js:60 , name -> SyntaxError
storeLocation 应返回一个字符串 那么为什么我会收到此错误,语法有什么问题以及如何解决我要声明这个命令吗?
I am trying to store the current url (http://example.com)in a variable and compare it with another string as a condition in the gotoIf command (part of the gotoIf extension.js):
storeLocation || url
gotoIf || ${url}=="http://example.com" || label
When I run this seleniun ide throws this error:
[error] Unexpected Exception: message -> syntax error, fileName -> chrome://selenium-ide/content/tools.js -> file:///C:/Users/David%20Cunningham/Desktop/extensions_js/extensions.js, lineNumber -> 183, stack -> eval("http://example.com==\"http://example.com\"")@:0 ("http://example.com==\"http://example.com\"","label1")@chrome://selenium-ide/content/tools.js -> file:///C:/Users/David%20Cunningham/Desktop/extensions_js/extensions.js:183 ("http://example.com==\"http://example.com\"","label1")@chrome://selenium-ide/content/selenium/scripts/htmlutils.js:60 ([object Object],[object Object])@chrome://selenium-ide/content/selenium/scripts/selenium-commandhandlers.js:310 ()@chrome://selenium-ide/content/selenium/scripts/selenium-executionloop.js:112 (6)@chrome://selenium-ide/content/selenium/scripts/selenium-executionloop.js:78 (6)@chrome://selenium-ide/content/selenium/scripts/htmlutils.js:60 , name -> SyntaxError
storeLocation should return a String so why am i getting this error, what is wrong with the syntax and how do I declare this command?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
错误消息显示:
您应该将表达式更改为:
这样您将获得有效的表达式:
The error message shows:
You should probably change your expression to:
So that you'll get a valid expression:
是的..这很好用
yeap.. this works fine