There are 2 ways to convert a recorded tests(HTML format) into Java code in Selenium IDE:
1st way: To see the Java code directly in Selenium IDE
- Go to Options -> Options...
- At "Selenium IDE Options" window: Check the check box for "Enable experimental features" and click OK button
- Options -> Format -> Java / JUnit4 / WebDriver
- Click OK button from "JavaScript Application" pop up -> You will see the desired Java source code for your recorded tests
2nd way: By exporting recorded test case(HTML format) into java file:
- Record your tests in HTML format by using Selenium IDE
- File -> Export Test Case As -> Java / JUnit4/ WebDriver
- Save the file (it would be saved as .java)
- Open the java file you saved in any text editor or IDE such as, Notepad++, Notepad, Wordpad, Eclipse, IntelliJ IDEA etc. (You can see the expected Java Selenium source code)
There is another way to convert Selenium IDE command individually to any language. The following steps for java:
- Open Firefox -> Open Selenium IDE
- Record some steps of your test
- In Selenium IDE: Go to Options | Clipboard Format and select Java / TestNG / WebDriver
- Right click any command in Selenium IDE you recorded -> Click Copy
- Paste in any editor (such as NotePad, Wordpad etc. OR any IDE you are using such as eclipse, IntelliJ IDEA)
- The command will be pasted as Java format
Note: In similar way you can convert individual Selenium IDE command to C#, Python and many more you want.