Selenium-2 || Let’s learn Selenium IDE.

Selenium IDE stands for Selenium Integrated Development Environment, which helps a user to record and play the steps on a web page for making their work easy and handy. It is an extension that can be installed and used on chrome and firefox browser.

Selenium IDE:

  1. It stands for Selenium Integrated Development Environment.
  2. Easy to install as chrome and firefox extension.
  3. Having record and play ability.
  4. We can also edit and debug the script.
  5. Script can be converted into multiple languages.
  6. Simple commands to open URL, assert and verify titles, sending user-defined values, click on web elements.



Download Link on Chrome:

https://chrome.google.com/webstore/detail/selenium-ide/mooikfkahbdckldjjndioackbalphokd?hl=en

           Alternatively, you can download and install the IDE extension by searching the keyword “Selenium IDE extension” on chrome or firefox browser.

            Once you installed the same on your browser a small icon like  will appear at the top-right corner of the respective browser. To launch the IDE you just need to click on the above icon. It will launch a pop-up window which looks similar to below interface:

Selenium IDE Interface
Selenium IDE Interface

         In the above interface, various components have been highlighted which would be used to create and execute the test script.

  1. Recording Icon 

    : the Starting point of the test script, Click on the Red circle (Recording icon) to start the recording and the same icon will be used to Stop the recording.

  2. Testable URL: Shows the current web URL which needs to be tested.
  3. Test Steps: Display all the steps performed by the user and recorded by the IDE with the command name, locators, and Values.
  4. Project: User can save the entire project using the Save icon present in the right corner. Later on, he/she can browse the same project and use it.
  5. Test Suites/Test Cases: Drop-down  contains two values Test Case and Test Suite. All the steps performed by the user would be stored as a Test Case. Set of multiple test cases would create a Test Suite. A user can create as many as Test Suites and Test Cases by clicking on plus (+) icon.
  6. Test Execution Controls: User can play single step and even entire test suite using few buttons.

    It contains  “Run all Tests in Suites”, “Run Current Test”, “Run current command” and “Test execution speed” controls.

  7. Logs and Reports: Once a suite/test case or test step executed by the user IDE generates a report/log for the same to summarize the overall status.

Selenium Tutorials:

Window Handling: 

Test Frameworks: 

Related Links: 


Example-1 (Creating Sample Test Case):

  1. Click on the Red circle to start recording.
  2. Now move to the browser and type “www.allinoneblogs.com” in the address bar and press enter.
  3. After site launches an ad pop-up will appear, Click on the cross icon to close the pop-up.
  4. Navigate to the Menu bar.
  5. Mouse hover over myBlogs > Java Tutorials.

  6. Click on “File Handling” option.
  7. An ad pop-up will appear again, Click on the cross icon to close the pop-up.
  8. Scroll down the page and Select “File Handling | Writing data into an Excel(.XLSX or .XLS) File.” link.
  9. Now click on the Stop Recording icon.
  10. All the steps performed by the user would appear in the Test Steps section of the IDE.
  11. Default Test Case name would be “Untitled*”, you can save it with any name by clicking on three dots icon present beside the test case name. In this example “TC_1_FileHandling”.
  12. Click on the “Play” icon (Play current test)  from the Test execution Controls panel.
  13. All the steps recorded in the current test would execute one by one.
  14. We can see the current test step/test case status in the logs section.
  15. At the end, it will show “‘<Test Case>’ completed successfully.” message if none of the steps get fails.

Test Script will look like:

TC_1_File Handling Test Script
TC_1_File Handling Test Script

Report/Log after execution of Test Case:

TC_1_FileHandling Output
TC_1_FileHandling Output

Example 2(Creating Test Suite):

Create another test case and add both the test cases in a single test suite. So that both the test case can run in one go.

  1. The web browser should be at last step(that is step #8) so that we can continue from the same location.
  2. Make sure that “Tests” is selected in the drop-down. 
  3. Click on the Plus (+) icon to “Add new test”
  4. Enter a name of Test case “TC_2_AskAQuestion
  5. The right side screen gets clear, which means new test case has been added to the list and we are ready to record new steps.
  6. Click on “Start Recording” icon.
  7. Now move to the web browser and locate   link in the menu panel and click the same.
  8. Now Enter all the required fields like name, email id, subject, and message.
  9. Now Click on the Send button.

Test Script will look like:

Note: All the text entered by the user like name, email id, subject, and message would appear under Value column in the test steps section. Same content is underlined with Yellow color for the reference in below image.

TC_2_AskAQuestion Test Script
TC_2_AskAQuestion Test Script
Adding Test cases in the Test Suite:
  1. Click on the Tests drop-down and select Test Suites option. 
  2. Default Suite would get created automatically. (Optionally, a user can rename or add new test suite as per requirement.)
  3. Now click on three dots 

    beside the “Default Suite”, from here you can add/delete test cases in a test suite.

  4. Click on Add Tests options, a pop-up with all the test cases gets open.
  5. Select the required test cases as in this case we have to select “TC_1_FileHandling” and “TC_2_AskAQuestion”.
  6. Expand the “Default Suite” and click on the Test case under test suite, all the recorded test steps would appear in the right side.
  7. Now click on the “Run all tests in suite” button from the Test Execution controls panel.
  8. Note that all the test cases would get added and execute in the alphabetical order in a test suite.
  9. We can observe that all the selected test cases get executed one by one.
  10. We can see the result in the logs section simultaneously.

Once both the Test Cases get added in the Default Test Suite, it should appear below reference:

Default Test Suite
Default Test Suite

Output of the Test Suite:

It shows that Test Suite contains 2 test cases and both runs successfully as the count of Failures is 0.

Test Suite Output
Test Suite Output

2826total visits,15visits today

Leave a Reply

Your email address will not be published. Required fields are marked *