TYPES OF EXECUTION
TYPES OF EXECUTION
TYPES OF EXECUTION:
1.Batch Execution.
2.Parallel Execution.
3.Group Execution.
4.Cross Browser Execution.
i. Series.
ii. Parallel.
2.Parallel Execution:
3.Group Execution:
How to achieve?
24/03:
How To Achieve?
if (browser.equals(browser)) {
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(1
0));
driver.get("https://demowebshop.tricentis.com/");
}
EX:
<suite name="Suite">
<test thread-count="5" name="Test1">
<parameter name="browser" value="edge"></parameter>
<classes>
<class name="project_DWS.DWS_Cart"/>
<class name="project_DWS.DWS_Address"/>
</classes>
</test> <!-- Test -->
<test thread-count="5" name="Test2">
<parameter name="browser" value="firefox"></parameter>
<classes>
<class name="project_DWS.DWS_Cart"/>
<class name="project_DWS.DWS_Address"/>
</classes>
</test> <!-- Test -->
<test thread-count="5" name="Test3">
<parameter name="browser" value="chrome"></parameter>
<classes>
<class name="project_DWS.DWS_Cart"/>
<class name="project_DWS.DWS_Address"/>
</classes>
</test> <!-- Test -->
</suite> <!-- Suite -->
Parameter Tag:
@Parameters Annotation:
26/03:
III) Assertions: -
Hard Assert:
*. We can use hard assert for Blocker and Critical defect.
*. To use this TestNG has provided Assert class.
*. Methods of Assert class are static methods.
*. To use this no need to create any object.
*. If hard assert will get fail execution will stop immediately.
How To Use?
Assert.assertEquals(driver.getTitle(), "Demo Web Shop",
"Welcome Page displayed Successfully...");
Soft Assert:
*. We can use soft assert for major and minor defect.
*. To use this TestNG has provided Soft Assert class.
*. Methods of Soft Assert class are non-static methods.
*. To use this need to create an object of soft Assert class.
*. If soft assert will get fail then also execution will continues.
How To Use?
SoftAssert ast = new SoftAssert();
ast.assertEquals(driver.getTitle(), "Demo Web Shop",
"Welcome Page displayed Successfully...");
assertAll():
*. It is a compulsory present in Soft Assert class.
*. This we have to use at the last of the script.
*. It will only print the assertions failure in console or report.