是否有任何应用程序或简单的方法将Selenium IDE
记录的所有命令转换为Java (Selenium WebDriver)
?这将更容易,并将节省大量时间。
任何建议将不胜感激。谢谢!
在我的Selenium IDE版本2.4.0中,它很容易:
你走吧!您的测试用例转换为WebDriver;)
更新:从SeleniumIDE 3.x开始,遗憾的是前面的答案“Export”和“Options-> Format”中提到的两个函数都被删除了(原因是移植到Firefox和Chrome的新WebExtensions格式)。
但目前的替代方案是Katalon Recorder,可用于Chrome和Firefox。
Katalon Recorder有一个“导出”按钮,可以使用TestNG,JUnit以及Thoughtworks WebDriverBackedSelenium和JUnit导出3种Selenium格式。
只需按“导出”,选择您的格式,而不是“复制到剪贴板”或“另存为文件...”。
在我的Selenium IDE版本2.4.0中
Record a new test case with the help of Selenium IDE
1) Click on File a primary nav bar
2) check drop down is displayed
3) select on Export test case as
4) Check you can convert selenium test case in any language EG: Java / JUnit4 / WebDriver
Save File as .java
Your testcase is converted to WebDriver
检查图像
在Selenium IDE中有两种方法可以将记录的测试(HTML格式)转换为Java代码:
第一种方式:直接在Selenium IDE中查看Java代码
第二种方式:通过将记录的测试用例(HTML格式)导出到java文件中:
还有另一种将Selenium IDE命令单独转换为任何语言的方法。 java的以下步骤:
注意:以类似的方式,您可以将单个Selenium IDE命令转换为C#,Python以及您想要的更多内容。