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.
describe the scripts to run any class in debug mode
Add the breakpoint at the specific line by double-clicking on the line number.
From the breakpoint onwards the script will be executed line by line
Right-click on the script
click on debugsàselect java application
Click yes in the “confirm perspective switch” window to run the script in debug mode
Click on F1 to run the scripts in line by line
Click on F5 to navigate into the method
Click on F8 to run the script without debug mode
TOI come back to the normal window click on redbutton[terminal] in the debug section then click on java.
Double 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:-
Exception means error .while running the scripts if any error identified the script execution will be block or break.
To continue the execution while in exception we need to we try-catch block
It 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:-
In 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
If 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
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.