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

Data Driven TestNG Passing in parameters from excel

I Am trying to pass in parameters from excel using a data driven approach using TestNG. My code runs fine, however, when my test gets to the section were the parameters are to be passed in to the fields on my form, they aren't passed in. My code is…
0
votes
2 answers

testng: how to design to run @test with multiple cases from dataprovider on different urls which are from another dataprovider?

Suppose I have a set of test cases, and I first open one url, and run the test: @BeforeMethod @Parameters("browser") public void start(String browser) throws Exception { driver = new FirefoxDriver(); …
yueran
  • 43
  • 8
0
votes
1 answer

How to ensure that DataProvider is initialized only once WITHOUT using Factory?

I have a test class in which all the methods use the same DataProvider. I want the DataProvider to be parallelized. I cannot use the Factory method because there is a defect in TestNg which makes it useless for my purpose. Right now, the data…
Selena
  • 2,208
  • 8
  • 29
  • 49
0
votes
2 answers

Session not found exception with Selenium Web driver parallel execution of Data Provider test case

This is my test class where I want to execute each input of Data Provider in new browser parallely. I am able to open new browsers but I get Session Not Found Exception and no such element exception public class DemoTest { private WebDriver…
Grishma Oswal
  • 303
  • 1
  • 7
  • 22
0
votes
1 answer

Is it possible to pass parameter and dataprovider for same test method in TestNG

/* testdataprovider will return the test2 and test3 parameter value */ @Parameters("test1") @Test(dataProvider = "testdataprovider") public void testMethod(String test1, String test2, String test3){}
0
votes
0 answers

Execute Testng tests in parallel with Data Provider

I am trying to execute testng tests in parallel with Data Provider. Each input of Data Provider will be a new test. For parallel execution, i have added attribute parallel to data provider & threadPoolSize to Test. I am passing command line…
Grishma Oswal
  • 303
  • 1
  • 7
  • 22
0
votes
1 answer

TestNG dataprovider optimizations

Our dataprovider is designed to retrieve a single row of data from an Excel file based on some key value that is passed in. This works fine for our test suites that have ~15 tests in it, but over the next couple of months, the tests will grow to a…
Greg
  • 3,861
  • 3
  • 23
  • 58
0
votes
1 answer

testng dataprovider and iretrylistener data issue

I've faced with an issue when my failed tests are getting retried using new test data (not original data from dataprovider). If I missed the appropriate existing topic feel free to point me on a right way. I've found out that dataprovider method is…
0
votes
0 answers

Modify surefire custom reporting console logging

At our organization we are following this DSL model Domain specific language and stuff where users can write tests from a spreadsheet and the underlying java code understands and executes those instructions. Now here is the problem. We have a single…
Shreejit
  • 11
  • 4
0
votes
0 answers

Nullpointer Exception in testNG data provider while executing through Jenkins job

I'm trying to execute my testng test which has data provider defined through Jenkins Job. I'm facing below null pointer exception. But, same test case executing without any errors in my local machine (from Eclipse) Exception…
0
votes
2 answers

How do I limit threads on a TestNG dataprovider method used as a factory

I'm using selenium to test a single page app. I'm loading the page in a @beforeClass method. Then running all the tests in the class. Then tearing down the driver in the @afterClass method. I've annotated my constructor as a @factory method using a…
Aidan Ewen
  • 13,049
  • 8
  • 63
  • 88
0
votes
1 answer

TestNG: initialise data provider once for all methods

Currently I have a test class which has multiple methods all using the same data provider. Each time testng loops through the different methods, it recomputes the data provider method. Is there any way I can make the data provider run…
jbwt
  • 384
  • 5
  • 14
0
votes
1 answer

Does ITest work when we use TestNG dataproviders rather than Factory

I am trying to use the ITest interface to get custom names (for Jenkins reports) for my test coming from a data-provider. I tried a sample program like below to understand at what points the gettestname() method gets called by TestNG. Pasting the…
sandee609
  • 3
  • 2
0
votes
3 answers

Get string from @Test annotation TestNG

I am trying to get a string from a TestNG annotation @Test(groups="Foo") and then use this as a name for a folder I am dynamically generating. How do I get the text "Foo" from the TestNG annotation so I can use it?
0
votes
2 answers

I am trying to use @DataProvider to run @test with Different Parameters, but getting exception

i want to pass parameter to @test to run multiple times with different data. so i am using @DataProvider which is retuning two dimensional Object array. i am having one dimensional string so at first i am converting it to two dimensional array…
Mona
  • 342
  • 1
  • 3
  • 17