• Skip to main content
  • Skip to primary sidebar

AutomationTestingHub

Selenium, Appium, Cucumber and more !!!

Understanding your Selenium IDE Test Script

May 15, 2017 by anish Leave a Comment

This is the third article on our Selenium IDE tutorial series, which will help you with understanding your Selenium IDE test script. In our previous article on Selenium IDE, you learned the step by step process of creating your first test script using Selenium IDE’s recording feature. This article is a continuation of that previous article, and here the primary focus would be to get an understanding of the script that you had recorded previously.

Open the test script you created in previous article

Let us first open the same test script which we had created in the last article on Selenium IDE. We had saved the test script as ‘Facebook Signup Test’, and we would be opening the same script here.

1. Open Selenium IDE by using Ctrl + Alt + S key combination, or select Tools > Selenium IDE from Firefox menu options.

2. Click on File > Open option from the menu bar

Selenium IDE - Open Existing Test Script

3. You will see that Select a File dialog box is opened. Navigate to the folder where you had previously saved the test script and open it.

Selenium IDE - Select a File dialog box

4. Once you open the test script, it would look something like this

Open existing script in Selenium

2 formats in which Test scripts are displayed in Selenium IDE

When you use Selenium IDE to record test scripts, your scripts will be displayed in the below 2 formats –

  • Table view: Here, the script is displayed in tabular format
  • Source view: In source view, your scripts is displayed in XML format

Both these views are displayed in different tabs in Selenium IDE as shown below.

Table and Source view tabs - Selenium IDE

Let us have a look at each of these views in more detail.

Representation of the Test Script in Table View

When you open a test script in Selenium IDE, its by default displayed in Table view (or Tabular format). Table view helps the user to easily understand the structure and flow of the test script in a better way.

In the tabular format, you can see that there are three columns and multiple rows. Each row represents one action that you perform on the web-page. Here, let us take the example from our test script “Facebook Signup Test”. Consider the 2nd row as highlighted in the below image to understand what the three columns represent.

tabular view of 2nd row from facebook signup script

Like every other row in the table view, this row also represents an action on the web-page. Let us now try to understand what this row represents. This row (again, like all other rows) contains 3 columns. These are –

1st column – Command tells us what action you performed, which in this case is “type”. Type command means that you are writing or typing a value in some field. In this case, you are writing the value in the First Name field on Facebook page as shown in the below image.

first column command to type on webpage

But how do you know that it’s the First Name field where Selenium IDE is entering the value? Well, that’s where you need to check the 2nd column.

2nd column – Target identifies the control. There are multiple ways in which a control can be identified, but in this case Selenium IDE by default has taken ‘id’ property to identify the control.

If you check the source code for the “First name” field on the Facebook.com signup page, you will see that there are multiple properties for identifying the control as marked on the below image (eg- id=”u_0_1″, name=”firstname”, aria-label=”First”)

target identifies the control attribute

As of now, if you don’t have an idea about the different types of identifiers used by Selenium, then please don’t worry about it. We will cover all these in detail in our upcoming articles. We are not going to that depth in this article, as we want to keep things simple for now.

3rd column- Value is the actual value to be entered in the field. In this case, the value is “Anish”, which would be set in “First name” text field. Also, please note that the value field would not be applicable to all types of actions or controls. For example, value field would make sense for text box & drop down kind of fields. These are the fields where you set some values.

But for fields like button, link etc where you just click on these controls, you would not need a value. So for these controls, Value field would be blank. You can see this in the below screenshot, where the Value field is blank for the last 2 rows.

3rd column value represents the values to be input or selected

Till now, we had only discussed about a single row and explained it in detail. But the same thing applies to all the rows in the Table view. All other rows in the script perform some action on the web page. From the above screenshot you can see that there are actions or commands like open, type, select, click etc, which represent different actions to be performed at each step on different fields on the web-page.

With this we complete the analysis of the script in Table view. Let us now have a look at the Source view.

Representation of the Test Script in Source View

In Source view, the entire test script is displayed in XML format. This xml format of the script is created automatically when you record the flow with Selenium IDE. The image below shows the corresponding structure of the first 2 rows from Table view –

understanding your selenium ide test script - source view of 2nd row from the test case script

Each row from Table view is represented by a “tr” in Source view. And each column within the row is represented with a “td”. Let us again consider the same row from Table view (row #2) as an example. You would notice from the below screenshot that the “tr” for this row contains three “td” entries, and each of these have the same value that was there in the columns.

source view of 2nd row

You can even change any of the values in the “td” entries directly from the Source view. But this practice is not encouraged as this is prone to errors. Also, most of the times people use the Table view more and don’t generally look at the Source view. This is because Table view is much more easy to understand and follow compared to Source view.

We would also recommend the same approach for you. You don’t need to use it much, but you should have a basic understanding of what it is. With this, we complete this article on understanding of your Selenium IDE test script. Our next articles on Selenium IDE would focus about how to modify your existing Selenium IDE test scripts. You can send us your feedback or issues with this article in the comments section.

Filed Under: Selenium

Primary Sidebar

Automation Testing Hub

Tutorials Guide

Write test scripts in BDD format using our Cucumber Selenium Tutorial

Use our Appium Tutorial Series to setup Appium from scratch

Categories

  • Android
  • Appium
  • Cucumber
  • Java
  • Playwright
  • Selenium
  • Tosca

Recent Posts

  • Appium Inspector – Download and Install
  • How to download Chromedriver for Selenium
  • Run Playwright tests on different browsers
  • Playwright Automation Testing Tutorial
  • Selenium IDE Chrome Download

Recent Comments

  • Run Playwright tests on different browsers - AutomationTestingHub on Playwright Automation Testing Tutorial
  • Confluence: CPSSoft Test Framework on Appium Inspector – Download and Install
  • Playwright Automation Testing Tutorial - AutomationTestingHub on Download and Install – Node.js and NPM
  • Chrome浏览器在使用Java的Appium中无法启动。 | JAVA语言的经验与见解 on 2 Ways to find appPackage and appActivity name of your App
  • Appium Inspector Tutorial - AutomationTestingHub on Download and Install Appium 2 Server

Archives

  • January 2024
  • July 2023
  • March 2023
  • February 2023
  • May 2018
  • April 2018
  • March 2018
  • February 2018
  • January 2018
  • November 2017
  • October 2017
  • September 2017
  • August 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • November 2016
  • October 2016
  • September 2016
  • August 2016
  • July 2016
  • June 2016

Latest Selenium 3 Guide

Are you using the latest version of Selenium WebDriver? It provides lot better support for the latest browser versions. Check it out here - Setup Latest Selenium WebDriver

Categories

  • Android
  • Appium
  • Cucumber
  • Java
  • Playwright
  • Selenium
  • Tosca

Copyright © 2025 · Genesis Sample on Genesis Framework · WordPress · Log in

Go to mobile version