Tag Info

New answers tagged

0

Are you trying to add TestNG parameters anoonationa to pass parameters to your test method? TestNG use @Parameter annotation. Try with capitalized. import org.testng.annotations.Parameters; @Parameters public class helloWorldTest { @Parameters(value="blah") public void testHelloWord() { } }


1

In the data provider, pass another string to indicate whether to execute the assert or not. Change your assertTrue to check for that. Something like following: @DataProvider(name = "VINNumbers") public String[][] VINNumbers() { return new String[][] { {"2T1BU4ECC834670", "true" }, {"1GKS2JKJR543989", "false" }, ...


1

Slightly different approach, this worked for me @AfterMethod public void writeResult(ITestResult result) { try { if(result.getStatus() == ITestResult.SUCCESS) { //Do your excel writing stuff here } else if(result.getStatus() == ITestResult.FAILURE) { ...


1

If you can alter your approach to include a configuration method using @AfterMethod, then you can pass in a paramater for ITestResult, which holds the results for the most recently completed test method. That class has a method called getStatus() that will give you the status of that test. Here's an example of how to use this: @AfterMethod public void ...


1

TestNG has been created as an alternative to JUnit in unit testing. While, RobotFramework has been created for acceptance testing. Each has remarkable features: TestNG TestNG is easily integrated into maven cycle and used mostly with Data Driven testing TestNG is pure Java Annotations are easier to understand Test cases can be grouped more easily ...



Top 50 recent answers are included