Difference between @Factory and @DataProvider annotations

Both the annotations belong to TestNg testing framework. Many people get confused while reading about these two annotations that why and where we have to use these two? Very basic difference between these two are- @DataProvider- DataProvider annotations parameterize the particular test method and execute the test number of times based on data provided byContinue reading “Difference between @Factory and @DataProvider annotations”

How to run Selenium + TestNG script from Command Line?

This is an alternate way to execute our selenium script from command prompt. Here, I am considering few points- Your project is already set-up in Eclipse Project already has testng.xml file. All selenium and other third party jar files are located under project home folder (lib folder). You are able to execute your script byContinue reading “How to run Selenium + TestNG script from Command Line?”

Difference between @BeforeTest and @BeforeClass annotation in TestNg

Ah ha…a topic which confused me also to understand the difference between BeforeTest and BeforeClass annotation. When we read first time it looks same and then we think if it is same then why TestNg included it. So clue is, it is not same and included for two different purposes- We will go through againContinue reading “Difference between @BeforeTest and @BeforeClass annotation in TestNg”

Significance of alwaysRun=true @Test annotation property.

alwaysRun=true property informs the system that TestNg should run the test method if depends on @Test method fails also. Basically it helps to achieve the soft dependency, the feature of TestNG which helps to execute the testng test methods in order. Below is the code example: So above code states that system will execute theContinue reading “Significance of alwaysRun=true @Test annotation property.”

Dependencies with TestNG

‘TestNG’ is a framework that built with different set of APIs that facilitates many testing needs. It has variety of features that makes ‘TestNG’ more convenient than ‘JUnit’ framework. Among all the features, TestNG has ‘dependencies’ feature that gives the facility to determine the @Test annotation methods order. For the dependencies, TestNG uses ‘dependsOnMethods’ optionContinue reading “Dependencies with TestNG”