Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
SoftAssert
has all the methods of assert class but all of them are non static.
When we use softassert statement(assertequals) it will only compare actual result with
expected result. And it will not report the status.
String etitle=sc.nectLine();
Driver.get(http://www.google.com);
String title=driver.getTitle();
Reporter.log(title,true);
Sa.assertEquals(title,etitle);
Driver.close();
Sa.assertAll();
@test
Reporter.log(“testB”,true);
}
What are the differences b/w assert and SoftAssert?
1.It will not execute remaining statements of current test method if the comparison fails.
It will execute remaining statemnts of current test method even if the comparison fails.
If we are testing basic and critical features then we use assert statements. When ever
we are testing minor features then we use SoftAssert.
NOTE: While comparing the results we take actual results from application and we take
expected result from excel sheet. In order to handle excel file we use API given by APACHE called POI.
If the OS is windows download the zip file or else download the tar.gz file.
Note: After extracting we get 19 jar files out of that following 6 jar files are mandatory to read
and write the data in excel.
1.commons-collections4-4.2.jar
2.commons-compress-1.18.jar.
3.poi-4.0.1.jar.
4.poi-ooxml-4.0.1.jar.
Poi-ooxml-schemas-4.0.1.jar.
6.xmlbeans-3.0.2.jar.===