selenium - “gotoIf”命令在 selenium IDE 中不起作用

标签 selenium selenium-ide

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

如果没有选中,我将不会继续,否则我将继续。

这是代码

  <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>

在执行过程中显示此错误

[info] Executing: |gotoIf | storedVars['val']=='on' | true |

[error] Unknown command: 'gotoIf'

什么原因导致此错误?

最佳答案

Selenium IDE 不支持 gotoif 命令,这就是您收到错误的原因Unknown command: 'gotoIf'

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

您可以看看HERE供引用。

另请查看Xpath to determine checkbox "checked" attribute in Selenium IDE

关于selenium - “gotoIf”命令在 selenium IDE 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12566079/

相关文章:

java - Eclipse 中未收到 "Add unimplemented methods"错误

java - 抓取我们的网站以检查 Javascript 错误

selenium - 在 Selenium 自动化中,鼠标箭头移动是否可以用于测试用例

testing - 如何在 Selenium IDE 中循环测试?

java - 使用按键解决自动提示下拉方法的任何方法

python - Selenium:如何在 AWS 上使用 Headless Chrome?

java - Selenide ElementsCollection 抛出 StaleElementException

java - 获取NoSuchElementException : no such element: Unable to locate element

selenium - 如何使用selenium IDE录制弹出窗口

selenium-webdriver - 我可以将 Selenium IDE 测试转换为 Java 中的 Selenium webdriver 测试吗