Running a TestNG Program using main() is very simple. We just need to use the object of TestNG class in main() and all set. Till now we have used below steps to run a TestNG program: Create class files and XML file Rightclick on XML file Select Run As Click on TestNG Suite If youRead More
Selenium Tutorials
Users can find help on many topics in selenium.
TestNG -19 || Concept of Parallel Execution.
The fundamental concept of parallel execution is based on the fact that each process should have its own processor. To understand this observe the two different scenarios in the below image: Scenario – 1: We have three containers and one truck to move from Source to Destination. If it takes 1 hour to cover theRead More
TestNG – 18 || Multiple Browser and Parallel Execution in TestNG.
Parallel execution of the script on multiple browser can be handled using the TestNG very easily and in a simple way. It means same set of test cases can be run over the more than one web browser. Multiple Browser Handling First of all, we need to understand the concept of Multiple Browser Handling. ItRead More
TestNG – 17 || Passing multiple Parameters in testng xml.
We can also pass parameters via TestNG XML file. These could be accessible using @Parameters annotation. This has been used in combination with the <parameter> tag in XML File. Parameters Annotation Parameters in TestNG XML File The process of using the Parameter is very simple. In the XML file, we have to use <parameter> tagRead More
TestNG – 16 || Access data from Excel sheet using DataProvider.
We can use an Excel sheet as a source of input. We can access data from excel sheet using DataProvider annotation and pass arguments through @Test methods. Mainly this approach is used in Data Driven Framework. Data Driven Framework: A data-driven framework is used to run the same script for a huge amountRead More
TestNG – 15 || DataProvider with parameters.
DataProvider with parameters provides ways to work with different type of datasets using single DataProvider. In our last chapter, we have learned how to use DataProvider annotation and attribute in a TestNG program. I would recommend to go through with the previous chapter then move with this. DataProvider Parameter Types DataProvider method supports two typesRead More
TestNG – 14 || DataProvider annotation & attribute.
DataProvider is the most important annotation while using TestNG framework. It helps to execute same Test Case on multiple Test Data. @DataProvider annotation defines the data source in the same class file or separate class file. While dataProvider attribute provides access to that data source in any Test Method defined under @Test annotation. DataProvider SampleRead More
TestNG – 13 || Use of @BeforeSuite & @AfterSuite.
Methods defined under @BeforeSuite & @AfterSuite get execute before and after all tests defined in a TestSuite.xml file. The better way to understand this by comparing the process of @BeforeTest and @BeforeSuite. Look at below images. In both programs, we have used two tests(Test-1 and Test-2) in the TestSuite.xml file. The only difference what weRead More
TestNG – 12 || Use of @BeforeGroups & @AfterGroups.
Executing specific methods before and after of a test group is possible using @BeforeGroups and @AfterGroups annotations. We have learned that using groups attribute we can create groups of test methods from multiple classes. I would recommend please go through with the previous chapter if want to learn implementation of groups attributes. Above example isRead More
TestNG – 11 || Groups attribute with @Test Annotation.
Groups attribute is used to create groups using various methods from multiple Classess. Mainly this attribute is used with @Test Annotations. In the above example, we have created two groups Alpha and Regression. In the Alpha group, we have added all the methods from both the classes(myProfile.java and myOrders.java). On the other hand, we haveRead More