我正在使用 Ghost 检查器记录我的测试。它确实允许我以 Selenium IDE 格式导出测试。我将来可以使用导出的测试来编写 Selenium Web 驱动程序测试吗(JAVA)
导出的测试看起来像这样:
- 导航
waitForPageToLoad
waitForElementPresent css=.explore-nav-label
单击 css=.explore-nav-label
等待页面加载
最佳答案
全面披露:我在 Ghost Inspector 工作。
看起来 Selenium IDE 团队最近 added the ability to export tests来自新的 Selenium IDE v3,太棒了!
只涉及几个步骤:
从 Ghost Inspector 导出
来自Ghost Inspector dashboard ,导航到您的测试并选择更多 > 导出此测试,然后选择新 Selenium IDE (.side) 格式:
点击下载并将文件保存在方便的地方。
使用 Selenium IDE 导入(和导出)
导入到 Selenium IDE 中就像打开刚刚从 Ghost Inspector 下载的 .side
文件一样简单。打开文件后,您可以右键单击测试并在左侧 Pane 中选择导出。从那里您将有多种格式可供选择,包括 Java JUnit:
一些注意事项
请记住 Ghost Inspector step actions和 Selenium IDE commands还不是完美的一对一匹配,因此 Ghost Inspector 中的一些操作将显示为 Selenium 格式的 JavaScript 操作。您可能需要根据需要对最终测试进行一些调整。
希望有帮助!
关于selenium-webdriver - 我可以将 Selenium IDE 测试转换为 Java 中的 Selenium webdriver 测试吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60121153/