In Page Object Model with Pagefactory Where to use softAssertassertall | Selenium Training|Java|WebDriver|TestNG|Frameworks|Videos
30% Mid August Discount Avail now

Selenium Training Forum

In Page Object Model with Pagefactory Where to use softAssertassertall

S
suhail.itm Post on 11/02/2019

I made a custom function in BasePage class for reportFailure() . i take screenShot inside the function and fail the test like test.log(Status.Fail, message) .

guide me where to use softAssert.assertall() .

S

Instructor

Support Team Reply on 12/02/2019

You can use it at after test annotation.

S
suhail.itm Reply on 14/02/2019

Hi Ashish ,

i have a confusion , some time i need to immediately stop the execution and sometime i do not stop the execution . if i use softassert.assertall() at @AfterTest annotation i will stop the execution at end . pls suggest .

and what if iwe want to use the softassert in Pages Class .

 

S

Instructor

Support Team Reply on 20/02/2019

After Test executes only after the test is done executing., in case you want to stop the execution immediately, you can use Assert.fail()