Welcome to C# Interview Questions. Here you will get so many questions related to c# interview and c# programs. It will definitely enhance your c# programming knowledge.
Adding Classes to testng.xml file
Adding Classes to testng.xml file, will explain you about creating and configuring TestNG test suite with classes which are developed/created in the java project. A Class may contain one or more methods in it. With this testng.xml configuration file we can include all the methods belongs to a particular class to the test suite. Below […]
Adding Methods to testng.xml file
Adding methods to testng.xml file, will explain you about creating and configuring TestNG test suite with methods which are developed/created in the java project. A Class may contain one or more methods in it. With this testng.xml configuration file we can include all the methods belongs to a particular class to the test suite. Below […]
TestNG Annotations
Annotation is a feature introduced in Java 5 and is used to add metadata to Java source code. This will allow you to add information to an existing data object in your source code. It can be applied for Classes, Methods, Variables and Parameters. Java allows users to define their own annotations too. TestNG made […]
Before And After Annotations
Before and After Annotations are very useful while writing the selenium programs. These will control the execution flow of your program. What should execute what time and which statement or block of code should execute first and which should be last. One of the important thing is the order of writing the annotations is not […]
Enabling and Disabling TestNG Test
In some scenarios you may need NOT to Execute/Run some of the tests or set of tests from getting executed in a particular class. For example, consider a scenario where a serious bug exists in application due to certain tests belonging to certain scenarios that cannot be executed. As the issue has already been identified […]
TestNG Test Annotation
The most important annotation of TestNG is Test annotation. This annotation marks a method or class as TestNG test. It you apply at class level then it will mark all the public methods present inside the class as test methods. It had lot of attributes which you can use along with the Test annotation, which […]
TestNG Exception Test
While writing automation tests there can be certain scenarios where we need to verify that an exception is being thrown by the program during execution. TestNG provides a feature to test such scenarios by allowing the user to specify the type of exceptions that are expected to be thrown by a test method during execution. […]
TestNG Time-Out Test
While running tests there is a chance of where certain tests get stuck or may take much more time than expected. In such a cases you may need to mark the said test case as fail and then continue. TestNG allows user to configure a time period to wait for a test to completely execute. […]
Parameterization using testng.xml file
There are two ways to pass the parameters in the TestNg. For this, need to use Parameters and DataProvider annotations of the TestNG. Parameterization using testng.xml file will allow users to pass parameters to the test methods as an arguments using xml file. Below are the two ways to pass the arguments. 1.Using testng.xml configuration […]
TestNG Optional Parameters
TestNG optional parameters option will provide optional values to a parameter, this value will be used if parameter value is not found or not provided in the xml configuration file. To achieve this we will use @Optional annotation in the test method as an argument. Below is the sample code: The above program contains a […]