Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
30 views3 pages

TestNG Interview Questions

TestNG is a testing framework that allows for parallel execution, dependency between tests, priority assignment, grouping, and parameterization using annotations. It supports built-in reporting and has annotations to control the test flow such as @BeforeSuite, @Test, and @AfterClass.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views3 pages

TestNG Interview Questions

TestNG is a testing framework that allows for parallel execution, dependency between tests, priority assignment, grouping, and parameterization using annotations. It supports built-in reporting and has annotations to control the test flow such as @BeforeSuite, @Test, and @AfterClass.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

TestNG:

## What is TestNG and its benefits?

Ans:-> TestNG is a Testing Framework which has lot of useful features like

 Parallel Execution.
 Dependency on one or more test Method.
public class Dependent {

@Test (dependsOnMethods = { "OpenBrowser" })


public void SignIn() {
System.out.println("This will execute second (SignIn)");
}
@Test
public void OpenBrowser() {
System.out.println("This will execute first (Open Browser)");
}
}

 We can assign priority to test methods also.

 It allow grouping of test methods.

 It supports parameterizing using @DataProvider Annotation.


 TestNG has a different assertions also which is helpful as check point.
 It has built in reporting as well.
## What are TestNG annotations?

o @BeforeSuite
o @BeforeTest
o @BeforeClass
o @BeforeMethod
o @Test
o @AfterMethod
o @AfterClass
o @AfterTest
o @AfterSuite

## What is correct order of TestNG tags in xml?

## What is TestNG xml file?

 using TestNG xml we can do:


o Test run.
o Set test dependency.
o Include or exclude any test, method, class or package.
o Set Priority
o Parallel execution
o Parameterize the test cases
o Group

## How to disable a run for any Test method?

Ans:-> @Test(enabled = false)

## How to run any specific test multiple times?

## Timeout at Test Level

@Test( timeOut = 700)


## Use of Parameterized in TestNG

 First we need to add @parameter annotation in test

 Below stuff need to be done in testNG xml file.

## Parallel run in TestNG

You might also like