How to generate Java source code from Selenium IDE (IDE code is in HTML extension)

I am using Selenium IDE (Firefox plugin) for testing. I can’t see the Java code when I start to write something. I always see HTML. Any idea what might be the best way to get java source code. Please anyone can help with this.

Thank you very much.

+4
source share
5 answers

Following are the steps:

  1. Options->Format → select format of your choice e.g. JUnit / TestNG / isfw
  2. Go to the Source tab .

To export a test case in a specific format, use

 File->Export Test Case As -> select format 

One of the useful features of the Selenium IDE is the ability to set the clipboard format so that you can copy commands from the table view and paste in the format of your choice of language.

 Options->Clipboard Format -> set format 

Here is the documentation on selenium IDE .

+6
source

There are two ways for Java code in the Selenium IDE:

1st way:. When exporting a recorded test case (HTML format) to a java file:

  • Record your HTML tests with the Selenium IDE
  • File -> Export Test Case As -> Java / JUnit4 / WebDriver
  • Save the file (it will be saved as .java and this will show your expected Java code)

Second way: To see Java code directly in the Selenium IDE

  • Go to "Options" → "Options" ...
  • In the "Selenium IDE Settings" window: check the box "Enable experimental functions" and click "OK"
  • Options -> Format -> Java / JUnit4 / WebDriver
  • Click “OK” from the “JavaScript Application” pop-up window → You will see the desired Java source code for the recorded tests.
+2
source

The current version of Selenium IDE ( version: 3.0.2 ) does not seem to support the export to code feature.

But there is an alternative plugin that also uses the new Selenium platform ( version: 3+ ) and still offers the ability to export tests directly to code (python, Java, etc.). It is called:

Katalon Recorder (available for Chrome and Firefox, free!)

As you can see in the picture below: there is an “Export” button in the top menu bar.

Katalon Recorder

+1
source

Go to the option, click "Enable experiment function", click "OK." Press ok when popUp. Now check the "Format"> "Select the desired format" box again. The code will be displayed on the tab "source"

0
source

Unable to export code in java via seleniu. After loading the plugin receiving this popup, there is no way to export the code in the IDE.

kindly suggest.

-1
source

Source: https://habr.com/ru/post/1379424/


All Articles