【问题标题】:'gotoIf' Command is not working in selenium IDE“gotoIf”命令在 selenium IDE 中不起作用
【发布时间】:2012-09-24 13:29:25
【问题描述】:

在我的测试用例中,我想检查一个复选框是否已被选中。

如果未选中,则我将不继续,否则我将继续。

这里是代码

  <tr>

             <td>storeValue</td>

           <td>//div[@id='insurance_type_selected']/div[@class='prod_type_list']/p[@class='groupTtl']/label[@for='prod_insurance_types_1']/input[@type='checkbox']/</td>
        <td>val</td>

    </tr>


    <tr>    

         <td>echo</td>
         <td>${val}</td>
         <td></td>
    </tr>

    <tr>

        <td>gotoIf</td>

        <td>storedVars['val']=='on'</td>

        <td>true</td>
    </tr>

在执行过程中显示此错误

[信息] 执行:|gotoIf |存储变量['val']=='on' |真的 |

[错误] 未知命令:'gotoIf'

是什么导致了这个错误?

【问题讨论】:

    标签: selenium selenium-ide


    【解决方案1】:

    Selenium IDE 不支持 gotoif 命令,这就是为什么您收到错误 Unknown command: 'gotoIf'

    要在 selenium IDE 中使用gotoif 命令,您需要导入文件。 您可以从HERE 获取该文件

    您可以查看HERE 以供参考。

    也可以关注Xpath to determine checkbox "checked" attribute in Selenium IDE

    【讨论】:

    • 我将文件下载到我的桌​​面并解压缩。之后我打开 selenium ide 并通过选项>选项>硒核心扩展我在通过 ide 执行我的测试用例期间上传了文件 goto_sel_ide.js 我收到以下错误 [错误] 意外异常:文件名 - > chrome://selenium- ide/content/tools.js -> file:///C:/Users/Neil/Desktop/New%20folder/goto_sel_ide.js?1348644882283, lineNumber -> 90 你能告诉我如何删除这个错误吗?我做错了。
    • 我使用的是 Selenium IDE 1.9.0 版本。
    • 使用哪个文件??仅使用 goto_sel_ide.js 文件
    • 这件事最近发生在我身上。我发现,缺少打开的附加组件 - Selenium Flow Control。安装后,它工作了。
    【解决方案2】:
    if (assertChecked(label="prod_insurance_types_1")) {
        assertTrue(False) // this way it would fail and don't proceed
    } else {
        // do sth
    

    据我所知,这样的事情应该可以工作

    【讨论】:

    【解决方案3】:

    您需要 SeleniumHQ 下载页面上列出的 Flow Control 插件:http://docs.seleniumhq.org/download/#side_plugins

    直接链接:https://addons.mozilla.org/en-US/firefox/addon/85794/

    【讨论】:

      猜你喜欢
      • 2013-01-23
      • 2014-11-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-25
      • 2019-03-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多