Quality Testing

Quality is delighting customers

What are all different types of exceptions we have in Selenium Webdriver?

Can any one explain with example

Views: 5671

Reply to This

Replies to This Discussion


Sorry, I don't know to explain or help, but I have read this article about:


All? Well... there is nearly unlimited number of those. Webdriver can throw also system exceptions like out of memory, but plenty of others also. All Java exceptions are inherited from java.lang.Exception and if you want to catch ALL exceptions, you have to catch that at the last catch part. But I recommend you to think twice because it can cause different kind of problems.

In my opinion you should study how exceptions are working in Java. (I supposed you are using Java - if you're not, then investigate how your used language is using exceptions.) See good tutorial for Java Exceptions

If you want to do good test automation, you should learn to program very well also. So study the language you're using really well.

Never said it is all, but your respond was what was I expected. I'm just a beginner, so I wanted more opinions on this theme as well.

Thanks for the eye opening. :)

Why Exceptions are important means:

1) In One of a situation like where you have got an exception and you want to print some custom message in your logs, so that it can be understandable by the whole team.

2) In some situations where you want to just take up the exception and want you test to carry on with rest of the code/script execution.

Some different exceptions are mentioned below:

1) NoSuchElementException : FindBy method can’t find the element.

2) StaleElementReferenceException : This tells that element is no longer appearing on the DOM page.

3) TimeoutException: This tells that the execution is failed because the command did not complete in enough time.

4) ElementNotVisibleException: Thrown to indicate that although an element is present on the DOM, it is not visible, and so is not able to be interacted with

5) ElementNotSelectableException: Thrown to indicate that may be the element is disabled, and so is not able to select.

In my view above mentioned exceptions are mainly used in webdriver.

Hope this will helpful to u ...correct me if i wrong....

It is helping me, too. Thanks. :) 


TTWT Magazine





© 2019   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service