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

Creating custom method names using ITest generates incorrect HTML report where a repetitive value has appended for all the tests

Facing a issue similar to this when trying to get unique method names using ITest. I have a factory method with a data provider defined to test the same test case with multiple data. When I try to generate unique method names for each test run…
0
votes
1 answer

Testng - Is it okay to have one data provider input per test method?

I understand that testng DataProviders are meant to provide multiple inputs/input arrays to test methods. But, is it ever okay to have only one input per test method ? Is that an anti-pattern ?
Erran Morad
  • 4,563
  • 10
  • 43
  • 72
0
votes
1 answer

Reporting consolidated TestNG result for testes that use data providers

I use data provider for parameterized tests. I understand that the test method execute once for every instance in the data provider returned array. I understand also that each test method execution is reported in TestNG report separately. I want to…
Ebeid ElSayed
  • 1,126
  • 2
  • 15
  • 32
0
votes
1 answer

how to execute test data level execution in parallel mode for one test case

I am opening multiple instance of browser for each data set but all the input data is getting entered only in one instance/session instead of each data set in each instance. I am using selenium and TestNG @DataProvider(name="URLprovider",…
0
votes
1 answer

TestNG - Can a dataprovider test method be ignored in the test execution report?

I am using a dataProvider method and forming a URL using this dataprovider and should pass this formed URL to next dataprovider . Can this dataprovider Test Method be ignored in the TestNG - test execution reports? The first DataProvider A should be…
rarunp04
  • 321
  • 2
  • 9
0
votes
1 answer

Hashmap in testNG dataprivider to reduce arguments passing to test method

I've been writing Test scripts using TestNG's DataProvider feature. Till now I was happy with the way I was doing it as the number of parameters I was passing was less than 10, but some of the new pages I am testing have more than 30-35 parameters,…
0
votes
1 answer

Getting null pointer in dataprovider using excel?

I am trying to read data from excel file and pass it to web page form using data driven framework, In my framework I am having baseclass and in which I am invoking browser instance and then destroying it by using custom methods and Further I have a…
keshav dwivedi
  • 117
  • 4
  • 14
0
votes
0 answers

Getting Data provider exception in appium

Getting Data provider exception in Appium, exception loag added below: org.testng.internal.reflect.MethodMatcherException: Data provider mismatch What I have tried, the code putted below: @DataProvider(name = "getDataFromExcel") public…
0
votes
1 answer

TestNG running on different threads when using timeout, Is there a possibility we can use same thread

I am trying to create a threadLocal webdriver. Trying to initialize and login into over application in @BeforeClass. @test is having functionality. This test is working properly but whenever i use @test(timeOut=1200) it is getting failed due to…
0
votes
2 answers

Using Test-ng priority when using data providers

I'm using a data provider with test-ng and I want the particular test to follow a series of steps for each of the elements within the data collection object. The test: For each element in the object, validate the form can input the values The…
Phorce
  • 4,424
  • 13
  • 57
  • 107
0
votes
0 answers

DataProvider mismatch Exception

Getting DataProvider mismatch exception. Below is the code can anyone help me? My Excel file is having 6 values where I am passing the same amount of values from the Excel. package newtoursProject; import java.io.FileInputStream; import…
0
votes
0 answers

Testng - Is it possible to pass have parameters of a Dataprovider method?

DataProvider(name = "sizerDefaults") public Object[][] getSizerDefaults() { } @Test(dataProvider = "sizerDefaults") public void sizerDefaults(String... args) { } Above is my DataProvider and the methods which uses a…
Melvin Richard
  • 403
  • 1
  • 7
  • 15
0
votes
0 answers

TestNG Selenium WebElement cannot find

Below is my code running script through TestNG. It fails to find the web element username and the error I get (screenshot attached). Please advise. @Test System.setProperty("webdriver.chrome.driver", "C:/Selenium/chromedriver.exe"); WebDriver…
Rocky
  • 51
  • 1
  • 4
0
votes
0 answers

Reading data from JSON Array for data provider in testng

I want to provide data in my dataProvider using json file which has Array in one parameter. For single ID it works fine But ex. JsonFile { "dataSet": [ { "testCase": "Verify the limit of IDListwith 11 IDList", "IDList":…
0
votes
0 answers

TestNg | compiler always skip @Test(dataprovider) annotation

When i run my maven project , output giving as 1 test skipped. when i double click on the output it highlighted the`@Test(dataprovider="testdata") part in my code. apart from this code and pom.xml i have tried several other testng with A Data…