- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试存储当前 url( http://example.com)in 变量,并将其与另一个字符串作为 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 应该返回一个字符串,那么为什么我会收到此错误,语法有什么问题以及如何声明此命令?
最佳答案
错误消息显示:
eval("http://example.com==\"http://example.com\"")
您可能应该将表达式更改为:
gotoIf || "${url}"=="http://example.com" || label
这样你就会得到一个有效的表达式:
eval("\"http://example.com\"==\"http://example.com\"")
关于javascript - Selenium IDE - 将 URL 字符串变量传递到条件 'gotoIf' 语句会引发语法错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2653815/
感谢您查看此内容。 我一直在编写一个读取网页的脚本,检查是否存在指定的文本字符串,如果不存在,则会重复该脚本。但是,我必须粘贴字符串的每个单词,以便 gotoif 命令才能读取它。有没有办法让 got
我已经尝试了以下 gotoIf "${oneoff}"=="Jeff Della Rosa" gotoIf ${oneoff}=="Jeff Della Rosa" gotoIf ${oneoff}=
好吧,我在用户扩展中使用汇总规则,由于某种原因,Selenium 会一直说我的 gotoIF 标签不存在。有谁知道为什么或如何解决这个问题?语言是JS(JavaScript) var manager
我正在尝试存储当前 url( http://example.com)in 变量,并将其与另一个字符串作为 gotoIf 命令中的条件进行比较(gotoIf extension.js 的一部分):
我是一名优秀的程序员,十分优秀!