Display results as :

Rechercher Advanced Search


Soft Assert and returning whether it passes or not

View previous topic View next topic Go down

Soft Assert and returning whether it passes or not

Post by wilnicm on Mon Aug 18, 2014 8:26 pm

Hi i've been trying to find a way to implement soft assert that returns something so i can tell whether it passed or fail

Currently i'm using the

import org.testng.asserts.SoftAssert;
import org.testng.Assert;

I don't really want to use the hard assert since i don't want my test to stop when fail, I only want to use the hard
assert in certain situations where i feel like its feasible.  I'd like to use the soft assert for atleast 70% of my situation. I want to have a return

Almost all of the return value in this import org.testng.asserts.SoftAssert; class returns void.
Is there is something i'm not thinking about or using.  I'd like something that have some type of return value that i can use
to distinguish whether the test passed or failed.

When using those soft assert the only thing i see when i hover over the soft assert code i'm doing is.

LinkedHashMap - Type
Name m_errors - Name
"size=0" - Value

I dont know if i can even use that.
I"m currently using the ieWebdriver to do my automation testing.

Any help would be greatly apprecieated. Thanks


Posts : 1
Join date : 2014-08-18

Back to top Go down

Re: Soft Assert and returning whether it passes or not

Post by nabhanya.varma on Tue Dec 16, 2014 12:19 am

Asserts are to Say if the test is PASS or FAIL. To make them more meaning full you can have Loggers or Update TestListeners based on your needs.

Active particpant
Active particpant

Posts : 13
Join date : 2014-03-02

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum