Questions tagged [testng-dataprovider]

TestNG @DataProvider annotation

Refers to @DataProvider, a TestNG annotation that allows combinations of parameters (test data) to be automatically injected into your test methods. It's encountered often with Selenium.

Related tags :

Reference links :

449 questions
0
votes
1 answer

Running a testng class file with many dependent test methods multiple times sequentially

I have a test class with multiple methods written in RestAssured and TestNG. And I want to execute these methods sequentially in a loop. How can we do that? The requirement is to fill up a train. I have an API which gives me the number of seats…
Mihir
  • 491
  • 5
  • 21
0
votes
2 answers

The method scenarios() is undefined for the type AbstractTestNGCucumberTests

I am trying to implement parallel test execution using cucumber 4.0, but observing issues. As per details on cucumbers website: https://cucumber.io/docs/guides/parallel-execution/#testng I included following dependency in pom.xml: (apart from other…
vsingh
  • 125
  • 1
  • 2
  • 16
0
votes
0 answers

How to run single @Test method in parallel using 1 dataprovider defined in same Testng class

I have a Test method which launches the browser and enters some text and performs remaining operations. Now I want to run the same Test method in multiple instances of the browser(both chrome or can be chrome, Mozilla). For this, I am passing the…
0
votes
1 answer

Update the Suite Name at RunTime

Is there any workaround to set the SuiteName at the time of test execution, same as we can achieve for Test Name using ITest Interface.
0
votes
1 answer

Test NG Cucumber Parallel Automation with Dynamic test tags and param

I am currently looking to run multiple test in cucumber in parallel using testng and I successfully managed to do that. Now my requirement is rather than having multiple Test TAGS in the testNG file with different parameters take it from the maven…
Chinthaka Devinda
  • 997
  • 5
  • 16
  • 36
0
votes
1 answer

TestNG - How to run setup once before all tests in a class for each parallel run

I am trying to see if it is possible to have a setup run once for each parallel class instantiated. If I have the following test class, because of the DataFactory (CSV has 2 rows of data, one for each test), two tests are started in parallel Is it…
dranobob
  • 796
  • 1
  • 5
  • 19
0
votes
1 answer

unable to handle blank cells while reading blank cell from excel in selenium?

I am trying to read values for excel but my excel file contains some blank cells when I try to read values for those files using dataprovider then I get nullpointer Please let me know how to deal with these blank cells in excel file?? Please find…
keshav dwivedi
  • 117
  • 4
  • 14
0
votes
1 answer

How to call instances of input arguments of TestNg @Test method, after test execution using TestNg ITestResult interface or any other testNg interface

I create a custom reporter implementing IReporter interface and would like to post test input params into final test report. My test input params are provided via TestNg Dataprovider. Every input param is an instance of TestCase class. I can get to…
Paulus
  • 138
  • 1
  • 11
0
votes
1 answer

How to properly test subclasses with phpspec dataprovider

I'm pretty new to Phpspec testing and I don't know what is the correct way to test multiple scenarios when transforming a object to different response structure. I need to check if price is correctly calculated. Here I have the Transformer spec…
WellBloud
  • 927
  • 4
  • 13
  • 29
0
votes
3 answers

How to pass bean class to a test method in testng?

I have an Excel Util which reads all the data from excel sheet. The excel sheet has 10 columns like time, sourceType, tid, message, severity, lastModify, entityName, operationType, replayId, recordIds. My DataProvider has code something like this…
0
votes
1 answer

Citrus-framework - DataProvider in a separate class

Can I create data provider in a separate class and the use it in a test class with @Factory annotation? For example: Data provider class: public class DataProvider { private static ServiceBase service; @Autowired public…
0
votes
1 answer

How to pass n number of parameters as a single parameter using TestNG DataProviders

I am reading data from Excel and passing the data to the Test using Dataproviders. I have 5 parameters, but the Test method looks clumpsy. So, I want to pass a single parameter instead of many. I have tried to do that but the Test got failed with…
Pranay
  • 21
  • 3
0
votes
1 answer

Excel used in testNG data provider is using old data even if new data is provided

I am using dataprovider to read data from and excel as inputs to my selenium script. I am basically adding systems to my application. Earlier i had about 110 rows and 7 columns worth of data in the excel. Now i have removed that and added 1 row and…
0
votes
1 answer

Execution of Data spread across multiple sheets of Excel in selenium

We are trying to run an automation script which would pick data from sheet1 of excel in run1, then signout of application, in second run data to be picked from second sheet of excel and so on.. we are trying achieve it through data provider. Can…
puja
  • 13
  • 4
0
votes
1 answer

Test with DataProvider repeated some number of times with a different DP parameter for each time

I have 20 or more tables. Number of tables could be different. To determine number of tables I use driver.findElements(By.xpath(...)).size() functionality. For one table I created DataProvider method, that returns an object: @DataProvider public…
Gryu
  • 2,102
  • 2
  • 16
  • 29