January 2018
Beginner to intermediate
354 pages
7h 59m
English
A simple example of Selenium WebDriver implicit exception handling can be described as follows:
// create a method to retrieve the text from an element on a page@FindBy(id="submit")protected M submit;public String getText(WebElement element) throws Exception { return element.getText();}// use the methodLoginPO.getText(submit);
Now, when using an assertion method, TestNG will implicitly throw an exception if the condition is not met:
Read now
Unlock full access