【问题标题】:Selenium user-extensions, Selenium IDESelenium 用户扩展,Selenium IDE
【发布时间】:2013-08-21 14:57:05
【问题描述】:

我使用 Selenium IDE。我需要 if-else 构造,我找到了一个 Javascript 文件。我很容易在 IDE 中使用该文件。但是,当我尝试将文件与 Selenium RC 一起使用时,我按照以下步骤操作:

  1. 打开 selenium.jar 文件并用我从互联网上找到的(包括 if-else 函数)更改了用户扩展文件(该文件位于 core->scripts->user-extensions 中)。

  2. 我使用以下命令启动 selenium rc:

-java -jar selenium.jar -userExtensions user-extensions.js -htmlSuite "*chrome" "linkofsite" "staj\Projects\SikayetTestleri.html" "result2.html" -port 4445

Selenium 服务器启动了 firefox,但什么也没发生...

【问题讨论】:

    标签: selenium selenium-rc selenium-ide user-extensions.js


    【解决方案1】:

    我找到了另一种方法来解决我的问题。我使用 storeEval 命令并编写了 2 行 javascript 代码而不是用户扩展。我使用条件语句而不是 if 语句。

    Selenium IDE 命令:

    <tr>
       <td>storeEval</td>
       <td>
           selenium.isElementPresent('Element I control')?selenium.doClick('Element which will be clicked if the element present'):seleniumdoClick('Element which will be clicked if the element NOT present')
       </td>
    </tr>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-05-04
      • 2019-12-07
      • 2013-08-20
      • 1970-01-01
      • 2011-11-12
      • 2013-05-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多