As part of exploring the other Selenium IDE features in-depth, I will explain the below different debugging options in Selenium IDE:
- Toggle breakpoints
- Disable/Enable all breakpoints
- Step Over
- pause/resume
- pause on exceptions
- stop
- play to this point
- record from here
- play from here
Let’s get started with a practical demonstration.
New Selenium IDE – Debugging options
Follow the below steps for exploring the Selenium IDE’s debugging options.
1) Launch the Selenium IDE having any Test Recorded init as shown below:
2) Right-click on any step say Step 4 and select ‘Toggle breakpoint’ option as shown below:
3) Observe that a breakpoint will be added to the selected step as shown below:
4) Click on the ‘Run Current Test’ option and observe that the execution will stop at the step having the breakpoint as shown below:
5) Now click on ‘Resume Test Execution’ option to continue with the execution as shown below:
Note: In real-time, where we have to investigate the issues which come during the execution, we need to place breakpoints at the required steps, identify the route cause of the issue and then resume the test execution.
6) Observe that the complete Test got executed as shown below on clicking the ‘Resume Test Execution’ option in the previous step.
7) Let’s remove the breakpoint which is added in step 4.
Right-click on Step 4 having the breakpoint added and select ‘Toggle breakpoint’ option as shown below:
8) Observe that the breakpoint which got added to the step 4 earlier got removed as shown below:
9) Instead of right-clicking and selecting ‘Toggle Breakpoint’ option, we can also click on the numbers of the steps in Selenium IDE to add the breakpoints.
Click on the numbers 2, 3, 4 and 5 shown below:
Observe that the breakpoints got added on clicking the above numbers as shown below:
10) We can also remove the existing breakpoints by clicking on the numbers.
Let’s click on the numbers 3 & 4 to remove the breakpoints as shown below:
Observe that the breakpoints got removed on clicking the said numbers as shown below:
11) Click on the ‘Run Current Test’ option and observe that the execution will stop at the step having the first breakpoint as shown below:
12) Click on ‘Step over current command’ option as shown below:
13) Observe that the current paused step (Step 2) got executed and the execution paused at the next step (i.e. Step 3) as shown below:
Note: We can use this ‘Step over current command’ option multiple times, to execute the Selenium IDE steps one after the other with the intention of investigating and identifying the issue.
14) Now click on ‘Resume Test Execution’ option to continue with the execution as shown below:
Observe that the execution will be resumed and will be paused at the next breakpoint as shown below:
15) Stop the execution by clicking on ‘Stop’ option as shown below:
Observe that the execution has been aborted as shown below:
16) Now let’s click on ‘Disable breakpoints’ option as shown below:
Observe that the breakpoint options got disabled as shown below:
Click on the ‘Run Current Test’ option and observe that all the steps will get executed without pausing as all the breakpoints are disabled:
17) Now let’s turn off the ‘Disable breakpoints’ option by clicking it as shown below:
Observe that the breakpoint options got enabled again as shown below:
Click on the ‘Run Current Test’ option and observe that the execution will be paused at the first breakpoint as shown below:
Click on the ‘Resume test execution’ option until all the steps got executed successfully as shown below:
Remove the existing breakpoints by clicking on the step numbers having the breakpoints added and observe that the breakpoints got removed as shown below:
18) Right-click on Step 2 and select ‘Play to this point’ option as shown below:
Observe that the execution will start and pause at the selected step point as shown below:
Note: breakpoint will be automatically added by the Selenium IDE during execution as shown below.
Remove the breakpoint and run the current test until the complete test got executed successfully as shown below:
19) Right-click on any step say Step 1 and select ‘Play from here’ option as shown below:
Observe that the execution started from the selected step and all the steps following the selected step got executed successfully as shown below:
20) Right-click on any step say Step 2 and select ‘Record from here’ option as shown below:
Observe that the execution will happen until the selected step and a dialog in Selenium IDE asking to start recording will be displayed. Click on ‘Start Recording’ button as shown below:
Observe that the recording will start as shown below:
While the recording is on, select any option say ‘Volvo’ in the multiselection box field as shown below:
Switch to Selenium IDE and observe that the above selection got recorded at step 3 and click on the ‘Stop Recording’ option as shown below:
21) Now, let’s try the last option ‘Pause on exceptions’.
In order to get an exception, select any step say Step 3 and modify the value to a non-existing value (i.e. xyz) as shown below:
Click on ‘Pause on exceptions’ as shown below:
Observe that an exception will occur while executing step 3 as the lable=xyz is not available in the multiselection box field. As the exception occurs in step 3, the execution will be paused as shown below.
Here concludes the practical demonstration of all the Debugging options in Selenium IDE.
In the next article, I will practically demonstrate another Selenium IDE feature to be explored (Refer other features to be explored here)
Next Steps:
- > Check complete Selenium Tutorial Contents here (Click here)
Please leave your questions/comments/feedback below.
Happy Learning ?
On a mission to contribute to the Software Testing Community in all possible ways.