Test Case Editor:
The Command, Target and Value entry fields display the currently selected command along with its
parameters.
These are entry fields where you can modify the currently selected command.
Your script is displayed in the test case editor. It has two tabs.
Table View
Source View
Table View:
This is where you create and modify Selenese commands.
After playback, each step is color-coded.
If you start typing in the Command field, a drop-down list will be populated based on the first
characters you type; you can then select your desired command from the drop-down.
Source View:
It displays the steps in HTML (default) format.
It also allows you to edit your script just like in the Table View.
Log/Reference/UI-Element/Rollup Pane/Expert/Stored-Vars:
The bottom pane is used for six different functions
Log
Reference
UI-Element
Rollup
Stored-Vars
Expert
Log:
When you run your test case, error messages and information messages showing the progress are
displayed in this pane automatically, even if you do not first select the Log tab.
These messages are often useful for test case debugging
Clear button is used for clearing the Log.
Info button is a drop-down allowing selection of different levels of information to log.
Reference:
The Reference tab is the default selection whenever you are entering or modifying Selenese commands and parameters in Table mode.
In Table mode, the Reference pane will display documentation on the current command.
When entering or modifying commands, whether from Table or Source mode, it is important to ensure that the parameters specified in the Target and Value fields match those specified in the parameter list in the Reference pane.
If there is a mismatch in any of these three areas, the command will not run correctly.
We will discuss remaining tabs in the pane later in the posts
How to create Test Suites?
Step 1: Open Selenium IDE and go to Menu.
Step 2: Click on File -> New Test Suite
Scripting in Selenium IDE
Selenium IDE is case sensitive and we should type values/attributes exactly as in the application.
Now we will see about –
Scripting by recording option.
Scripting manually using Firebug.
To explain clearly, I am taking the IRCTC website as our web application under test.
It is an online railway reservation system. Its URL is https://www.irctc.co.in/ and this will be our Base URL.
Scripting by recording option
We will create our first test script in Selenium IDE using recording option.
Afterwards, we shall execute our script using the playback feature.
Step 1:
Launch Mozilla Firefox browser and Selenium IDE.
Type the value for our Base URL: https://www.irctc.co.in/
Toggle the record button
Step 2:
In Firefox, navigate to https://www.irctc.co.in/.
Firefox should take you to the page similar to the one shown below
Step 3:
Right-click on IRCTC logo on the upper left corner. This will bring up the Selenium IDE context
menu.
Select the “Show Available Commands” option.
Then, select “assertTitle IRCTC Next Generation eTicketing System”.
This is a command that makes sure that the page title is correct and validating that we entered into the home page
After Selecting the command the TestCase pane is updated as below
Step 4:
In the “User Name” text box, type the username, “TestUser”.
In the “Password” text box, type a password, “123456”.
The Command, Target and Value entry fields display the currently selected command along with its
parameters.
These are entry fields where you can modify the currently selected command.
Your script is displayed in the test case editor. It has two tabs.
Table View
Source View
Table View:
This is where you create and modify Selenese commands.
After playback, each step is color-coded.
If you start typing in the Command field, a drop-down list will be populated based on the first
characters you type; you can then select your desired command from the drop-down.
Source View:
It displays the steps in HTML (default) format.
It also allows you to edit your script just like in the Table View.
Log/Reference/UI-Element/Rollup Pane/Expert/Stored-Vars:
The bottom pane is used for six different functions
Log
Reference
UI-Element
Rollup
Stored-Vars
Expert
Log:
When you run your test case, error messages and information messages showing the progress are
displayed in this pane automatically, even if you do not first select the Log tab.
These messages are often useful for test case debugging
Clear button is used for clearing the Log.
Info button is a drop-down allowing selection of different levels of information to log.
Reference:
The Reference tab is the default selection whenever you are entering or modifying Selenese commands and parameters in Table mode.
In Table mode, the Reference pane will display documentation on the current command.
When entering or modifying commands, whether from Table or Source mode, it is important to ensure that the parameters specified in the Target and Value fields match those specified in the parameter list in the Reference pane.
If there is a mismatch in any of these three areas, the command will not run correctly.
We will discuss remaining tabs in the pane later in the posts
How to create Test Suites?
Step 1: Open Selenium IDE and go to Menu.
Step 2: Click on File -> New Test Suite
Remember:
By default the suit name is “untitled”.
Right click on untitled and add the test cases.
Finally save the Test Suite with the extension .html.
We can drag and drop the Test cases for the order of execution.
Even if a Test case fails in the middle, the remaining test cases will execute.
Scripting in Selenium IDE
Selenium IDE is case sensitive and we should type values/attributes exactly as in the application.
Now we will see about –
Scripting by recording option.
Scripting manually using Firebug.
To explain clearly, I am taking the IRCTC website as our web application under test.
It is an online railway reservation system. Its URL is https://www.irctc.co.in/ and this will be our Base URL.
Scripting by recording option
We will create our first test script in Selenium IDE using recording option.
Afterwards, we shall execute our script using the playback feature.
Step 1:
Launch Mozilla Firefox browser and Selenium IDE.
Type the value for our Base URL: https://www.irctc.co.in/
Toggle the record button
Step 2:
In Firefox, navigate to https://www.irctc.co.in/.
Firefox should take you to the page similar to the one shown below
Step 3:
Right-click on IRCTC logo on the upper left corner. This will bring up the Selenium IDE context
menu.
Select the “Show Available Commands” option.
Then, select “assertTitle IRCTC Next Generation eTicketing System”.
This is a command that makes sure that the page title is correct and validating that we entered into the home page
After Selecting the command the TestCase pane is updated as below
Step 4:
In the “User Name” text box, type the username, “TestUser”.
In the “Password” text box, type a password, “123456”.










No comments:
Post a Comment