47312/how-exception-handling-can-be-done-in-selenium
@Suresh, Selenium exceptions can be handled in following ways:
public static void anyFunction() throws Exception{ try{ // write your code here }catch (Exception e){ // Do whatever you wish to do here // Now throw the exception back to the system throw(e); } }
Multiple Catch blocks: You can have multiple @catch() blocks to catch different types of exception.
try { //Some code }catch(ExceptionType1 e1){ //Code for Handling the Exception 1 }catch(ExceptionType2 e2){ //Code for Handling the Exception 2 }
try { // Some code }catch(Exception e){ // Code for Handling the exception }
try { //Protected code }catch(ExceptionType1 e1) { //Catch block }catch(ExceptionType2 e2) { //Catch block }catch(ExceptionType3 e3) { //Catch block }finally { //The finally block always executes. }
Hello Megha, to demonstrate how AJAX calls are ...READ MORE
Hi Vijay, to create Custom Firefox Profile ...READ MORE
Hi Randeep, CSS Selectors are string patterns ...READ MORE
Hey Dhvani, Page Synchronization can be achieved ...READ MORE
The better way to handle this element ...READ MORE
enable trusted connection in internet explorer by ...READ MORE
To Allow or Block the notification, access using Selenium and you have to ...READ MORE
xpath are two types. 1) Absolute XPath: /html/b ...READ MORE
Hey Catherine, as we know that a ...READ MORE
Hi Babita, try using this piece of ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.