How to convert commands recorded in selenium IDE to Java?

Update: Starting from SeleniumIDE 3.x unfortunately both functions mentioned in previous answers "Export" and "Options->Format" were removed (reason is the porting to the new WebExtensions format of Firefox and Chrome).

But a current alternative is Katalon Recorder which is available for Chrome and Firefox.

Katalon Recorder has an "Export" button and can export 3 Selenium formats, with TestNG, with JUnit and even with Thoughtworks WebDriverBackedSelenium and JUnit.

Just press "Export", choose your format, than "Copy to Clipboard" or "Save as file...".


In my Selenium IDE version 2.4.0 it is easy as pie:

  1. Record testcase in Selenium IDE
  2. Click File - Export Test Case As - Java / JUnit4 / WebDriver
  3. Save File as .java

And here you go! Your testcase is converted to WebDriver ;)


In my Selenium IDE version 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

check image enter image description here