Importance of testng.xml file
In a Selenium TestNG project, we use testng.xml file to configure the complete test suite in a single file. Some of the features are as follows. testng.xml file allows to include or exclude the execution of test methods and test groups It allows to pass parameters to the test cases Allows to add group dependencies Allows to add priorities to the test cases Allows to configure parallel execution of test cases Allows to parameterize the test cases 7. How to pass parameter through testng.xml file to a test case? We could define the parameters in the testng.xml file and then reference those parameters in the source files. Create a java test class, say, ParameterizedTest. java and add a test method say parameterizedTest() to the test class. This method takes a string as input parameter. Add the annotation @Parameters(“browser”) to this method. 1 2 3 4 5 6 7 8 9 10 11 12 // ...

Comments
Post a Comment