soft assertion on webdriver

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

soft assertion on webdriver

sreekumar
Hi Tarun

we are looking to handle exception thrown by isdisplay() method using selenium assertions.

if any method throws exception it should fail and show description statement in testng report. Also continue the our test case execution.

As per your 7th training session , soft assertions are supports.

can i use soft assertions as below?


customVerification.verifyTrue("Searchpage is displayed", driver.findElement(
                                By.xpath("//h1[contains(@class,'sn-tab-h1')]"))
                                .isDisplayed());

one more question:

Do i have to append customverification java file to my frame work or any exiting jar file provides this feature?
Reply | Threaded
Open this post in threaded view
|

Re: soft assertion on webdriver

softwaretestingforum
Administrator
Hi Sree,

driver.findelement would throw exception if element is not available.
What do you encounter if you use the method you mentioned in your post?

About customverification  java class, you can add it in your framework how I had it in Selenium project -

http://manual-and-automated-testing.1070.n6.nabble.com/Selenium-Training-Project-for-12th-December-Data-Driven-Testing-using-Selenium-tp5001553.html
~ seleniumtests.com