Questions tagged [testng]

TestNG is a testing framework, inspired by the JUnit/NUnit unit testing frameworks. TestNG is intended to support more than just unit testing, allowing functional, end-to-end, integration, etc.

TestNG was created by Cedric Beust.

More information is available on the TestNG website.

385 questions
4
votes
3 answers

Running failed test cases in TestNG

I have a suite which consists of 2 test cases. When I run this suite, the results should be 1 passed and 1 failed. When I am trying to run the failed test cases through TestNG-failed.xml file, it is executing the both testcases instead of failed…
QAMember
  • 1,520
  • 14
  • 37
  • 57
3
votes
1 answer

TestNG reports email after test executions

I've found various links for sending TestNG reports to be emailed after test executions here are two of the…
Hassan
  • 327
  • 1
  • 8
  • 21
2
votes
2 answers

What is the difference between Priority and Depends on Method in TestNG?

I am lagging behind to understand the concept of dependsOnMethods and priority. I googled but I didn't get enough info about this. A one line answer will be greatly appreciated. Can we write multiple methods with the same priority?
sameer joshi
  • 524
  • 2
  • 11
  • 31
1
vote
0 answers

Feed TestNG tests

Recently, I used feed4testng in order to run multiple instances of test using a data provider with feed4testng tool. But this tool only iterates through external resources. Is there any other tool for reading external resources like easytest?
1
vote
2 answers

Passing arguments to a DataProvider method using TestNG

Given my data CSV file: jones;1293039, smith;2938949, johnson;1203939, clark;8293044 And my DataProvider: @DataProvider(name="data") public Iterator custDataProvider(){ try{ Scanner scanner = new Scanner(new…
Steerpike
  • 393
  • 2
  • 8
  • 20
1
vote
2 answers

TestNG @Test can have a testID?

I'm trying to adapt testrail api. I want to set a integer testID value for a @Test and get the value at iTestListener. In testNG, is there a way to specify a test id for each @Test? I tried getTestName, but it seems that it's not designed to use…
junghan
  • 102
  • 7
1
vote
1 answer

java.lang.nullpointerexception

lang.nullpointerexception while running the below code. package aditi; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import…
1
vote
1 answer

TestNG--java.lang.AssertionError: expected [5] but found [5]

My TestNG test implementation throws an error despite the expected value matches with the actual value. Here is the TestNG code: int…
user25316
  • 11
  • 1
  • 1
  • 2
1
vote
1 answer

dataprovider for key value pair to run same test for different dataset

I have a data file in selenium webdriver as below: [Contact_Buyer] Title = Madam Contact_language = French [Contact_Owner] Title = sir Contact_language = English I want my test to run for each keyset Contact_Buyer and Contact_Owner. suppose my…
1
vote
2 answers

@Parameters getting Skipped, just basic tests

Here is my testng.xml:
Sukhvinder
  • 11
  • 1
0
votes
0 answers

io.restassured.path.json.exception.JsonPathException: Failed to parse the JSON document

[RemoteTestNG] detected TestNG version 7.8.0 FAILED: files.Dynamic.addBook io.restassured.path.json.exception.JsonPathException: Failed to parse the JSON document at io.restassured.path.json.JsonPath$ExceptionCatcher.invoke(JsonPath.java:1002) …
0
votes
1 answer

My TestNG BeforeMethod and AfterMethod annotations are not executing before or after the @Test annotated method

Folksm I'm using TestNG 7.5 and Selenium 4.2.2, with IntelliJ and Java 11. I've got all my bits imported and my tests will run individually, but I'm trying to get my setup and cleanup methods to work with the before and after annotations. Here's a…
shaidyn
  • 1
  • 1
0
votes
1 answer

Unable to install the TestNG plugin in eclipse

Getting below error while installing TestNG: Can someone help me on this?
gowtham
  • 1
  • 1
0
votes
1 answer

TestNG Listener from one xml file is applied to another

I have two xml files to run tests - api.xml and ui.xml In ui.xml I have TestNG Listener, but this Listener also is applied when API tests run. I run tests using testng.xml ui.xml
Artur
  • 229
  • 6
  • 15
0
votes
2 answers

How to use TestNG (ITestContext context, Method)?

I found the below code snippet from a real-time project and tried to understand the use of TestData(ITestContext context, Method m) but I was not able to do this. I would like to know how to use ITestContext with Method, and…
Anu
  • 51
  • 3
  • 9
1
2