Debugging & Exception/Error handling in Selenium

Ratings:
(4)
Views:0
Banner-Img
  • Share this blog:

Debug:-

It is a process of running the scripts in a step by step mode to identify the errors in runtime and we can also see the execution flow of the script.

2describe the scripts to run any class in debug mode

2Add the breakpoint at the specific line by double-clicking on the line number.

2From the breakpoint onwards the script will be executed line by line

2Right-click on the script

2click on debugsàselect java application

2Click yes in the “confirm perspective switch” window to run the script in debug mode

2Click on F1 to run the scripts in line by line

2Click on F5 to navigate into the method

2Click on F8 to run the script without debug mode

2TOI come back to the normal window click on redbutton[terminal] in the debug section then click on java.

2Double click on the breakpoint to remove.

These core tutorials will help you to learn the Debugging & Exception/Error handling in Selenium. 
For an in-depth understanding and practical experience,  explore Selenium Training Videos.

Exception/Error handling:-

2Exception means error .while running the scripts if any error identified the script execution will be block or break.

2To continue the execution while in exception we need to we try-catch block

2It is for both known and unknown exceptions

Public void  hindi() {

Try{

Selenium.click(“link=hindi123”);

English();

}

Catch(exception e) {   e.print stocktrace();}

}

Public void bengali(){

Try{

Selenium.click(“link=Bengali”);

Englidsh();

} catch(exception e){ }

}

Check out the top Selenium Interview Questions now!

Location:-

2In selenium RC we are having the below locators

1)ID

2)NAME

3)CSS

4)X path

5)DOM ->document object model:- it is only for selenium RC, not web load

2If ID ,Name, CSS, are not available (or) not working then  we can go for x path (or)DOM

For an In-depth knowledge on Selenium, click on below

You liked the article?

Like : 0

Vote for difficulty

Current difficulty (Avg): Medium

Recommended Courses

1/15

About Author
Authorlogo
Name
TekSlate
Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.


Stay Updated


Get stories of change makers and innovators from the startup ecosystem in your inbox