【问题标题】:Can I convert Selenium IDE testd to Selenium webdriver tests in Java我可以将 Selenium IDE 测试转换为 Java 中的 Selenium webdriver 测试吗
【发布时间】:2020-05-24 01:04:48
【问题描述】:

我正在使用 Ghost 检查器记录我的测试。它确实允许我以 Selenium IDE 格式导出测试。以后能不能用导出的测试写 Selenium web 驱动测试(JAVA)

导出的测试如下所示:

  1. 导航 等待页面加载
    waitForElementPresent css=.explore-nav-label
    点击 css=.explore-nav-label
    等待页面加载

【问题讨论】:

    标签: selenium-webdriver selenium-ide ghost-inspector


    【解决方案1】:

    全面披露:我在 Ghost Inspector 工作。

    看起来 Selenium IDE 团队最近从新的 Selenium IDE v3 中获得了added the ability to export tests,这太棒了!

    只涉及几个步骤:

    从 Ghost Inspector 导出

    Ghost Inspector dashboard,导航到您的测试并选择More > Export this test,然后选择New Selenium IDE (.side)格式:

    点击下载并将文件保存在方便的地方。

    使用 Selenium IDE 导入(和导出)

    导入 Selenium IDE 就像打开您刚刚从 Ghost Inspector 下载的 .side 文件一样简单。打开文件后,您可以右键单击测试并在左侧窗格中选择 Export。从那里您将获得多种格式可供选择,包括 Java JUnit:

    一些注意事项

    请记住,Ghost Inspector step actionsSelenium IDE commands 还不是完美的一对一匹配,因此 Ghost Inspector 中的一些操作将显示为 JavaScript 操作硒格式。您可能需要根据需要对最终测试进行一些调整。

    希望有帮助!

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-24
      • 2011-07-11
      • 2015-04-29
      • 2017-04-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多