First test case of Selenium-IDE

First Test Case of Selenium-IDE:

In this part, we are discussing how to create a basic test case in Selenium-IDE:

The entire test script execution process in Selenium -IDE can be divided into the following steps:

  • Recording (record the user interactions with the browser)
  • Playing back (executing the recorded script)
  • Save the test case suite
  • Export the test script

Now, we will look into the implementation of the above three steps.

Recording:

  • Launch the Firefox browser.
  • Click on the Selenium icon, which was present on the top right corner of the Firefox browser.
  • The browser will launch the default interface of Selenium-IDE, and asking you to create a project.
default interface of Selenium-IDE
  • Give a project name, e.g., first_test_case
  • Give a test name, e.g.-tutorialandexample_test.
Give a test name
  • Click on the Start Recording Button, which is present at the top right corner on the Selenium-IDE interface.
Start Recording Button
  • After click on the start recording button, one pop-up window will be shown where you have to give a base URL. e.g., https://www.google.com/ and again click on the start recording button.
one pop-up window will be shown
  • It will redirect you to the Google search page, where you can type tutorial and example.com and click on the first link.
you can type tutorial and example.com and click on the first link
  • It will redirect to the home page of tutorial and examples .com.
  • Go to selenium –IDE and click on the stop recording button, it will stop your action with browser immediately. 
  • And the text editor box has recorded all the action performs on the browser.
text editor box has recorded all the action

Now, we are going to the next step, which includes executing the recorded script.

Playing Back:

  • Click on Run Current test button, which is present on the toolbar menu of the Selenium-IDE.
  • It will execute all the interactions with the browser and gives you an overall summary of the completed test scripts.
  • Executed test scripts summary will be displayed on the log pane.
Executed test scripts summary

Now, we are coming to our next segment, where we can learn about how we can save the project.

Save Project:

  • Click on the save project button present on the extreme right corner of the menu bar.
  • Save the test case suite as First_Test_case.
Save the test case suite as First_Test_case
  • The test case suite can be found at the location provided in the above steps. Notice that the test script saved as .side format.
test case suite can be found at the location

Export Test Script

There is no export option in the latest version of Selenium IDE because there is no file menu present in the IDE interface.

 But it is available in the test suit box which is shown in the below snapshot:

latest version of Selenium IDE

To export our test case in different languages in selenium ide, follow below steps:

For our better understating that how we export our test script in a different language, we are considering the above example

  • First right click on the existing test case tutorialandexample_test and click on the export button.
selenium ide first test case
  • After click on the export button, one pop-up window will be opened and ask you to select one of the programming languages.
  • Select one of the options and click on the export button.
Select one of the options and click on the export button
  • Export your test case file in your local system and save it with a particular name.
Export your test case file in your local system
  • After saving the exported file in our local system, we will open that file. You can open that exported file, go to your Selenium IDE interface and click on the particular file.
After saving the exported file in our local system
  • When we click on the saved file, one pop-up window will appear and ask you to open your file in a different text editor.
  • Select one of the text editors and click on the ok button.
Select one of the text editors and click on the ok button
  • Your test script will look like this in java language.