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

How can I execute few tests every time after Test method which is using Data Provider

@Test(dataProvider="LInData",dataProviderClass=LInDataProvider.class) public void testLIn(String fname) throws InterruptedException// return 3 fname and this test executed 10 times { System.out.println("test start"); …
0
votes
1 answer
0
votes
3 answers

How to write TestNG DataProvider annotation for Excel sheet with different column numbers for different rows

I have an Excel sheet with data as below LoginPageValidation| LoginPage_login | username1 | password1 LoginPage_login | username2 | password2 LoginPage_login | username3 | password3 I am returning "array of arrays" to…
0
votes
1 answer

How to Handle with the single arguments in Test Method when the Data Provider returns multiple value?

Consider i am having the data provider and test method as below @DataProvider(name="Login1") public Object[][] passData() throws IOException { ExcelDataConfig config=new…
Subburaj
  • 2,294
  • 3
  • 20
  • 37
0
votes
1 answer

TestNG "getCurrentXmlTest()).getAllParameters()" API using very old testng-5.4-jdk15.jar TestNG library

For some reason I have to use old TestNG library which doesn't have "getCurrentXmlTest()).getAllParameters()" API How should I get all TestXML parameter using testng-5.4-jdk15.jar For latest TestNG version, this is how we get all params but how…
Swapnil Kotwal
  • 5,418
  • 6
  • 48
  • 92
0
votes
1 answer

Testng Data Provider(reading from excel) is not retrieving latest value updated recently by another class

I have a problem accessing the excel data from testng Data Provider. In simple words, There are two classes and the first class is to write some data into excel file and second class is used to retrieve the data from the same file. Testng executes…
0
votes
2 answers

Data Provider annotation of Testing

I'm new to Selenium... Can anyone please explain me Data Provider annotation of Testing in easy way with examples. P.S.: I have searched in your site for this topic but I didn't get the basic leveler explanation Your help is much appreciated.
Anisha
  • 1
  • 1
0
votes
2 answers

TestNG is skipping the method "MakemytripHome" although there are no dependencies. Why is it not executing?

I have written the following testcase using TestNG but it is skipping the MakemyTrip test case. I have no clue why.There are no dependencies and the test data is kept at the right path. Why TestNG is not executing it? public class Secattempt { …
0
votes
1 answer

Selenium- TestNG

I am trying to write a Excel Reading program, but for in static manner. When I run this program through TestNG, it throws an Exception- "argument type mismatch". Please suggest me, where I went wrong. import…
0
votes
3 answers

Can TestNG tests serve as DataProviders?

I have pairs of tests in my project which I would like to run sequentially in separate methods. Normally I would use a DataProvider to generate the input for the test: @DataProvider public Object[][] getUsers() { // generate input for…
Eugene A
  • 330
  • 4
  • 16
0
votes
1 answer

Parellel testing with TestNG - Tests only run on one browser

I have created a test suite using DataProvider DataFactory and my TestNG file is sending browser details as parameters. In testNG XML I'm calling my data factory class. I'm also using browsestack for testing (although I doubt this has anything to do…
0
votes
2 answers

Selenium TestNG Passing in parameters from Excel sheet

I am creating a functionality test were selenium will act as a user registering an account on a website, however, the website registration has 16 input fields to fill in. Some Int values and some String. Is there an easier way of doing this? …
0
votes
1 answer

How to custom objects from TestNG Dataprovider

I have the below DataProvider in TestNG. It has List of custom Objects called DataSheet[]. I need to pass it to Test method individually but it returns as array. @DataProvider(name="accountsDetails") public static Object[][] getData() {…
Beginner
  • 313
  • 1
  • 4
  • 15
0
votes
1 answer

How to send specific rows of excel to data provider in testNG?

I have created an excel containing multiple rows, each row corresponding to a test case. The Excel has around 22 columns (parameters) including a "Flag" column. I want the Dataprovider to return only those columns which has a value 'Y' in the excel…
0
votes
1 answer

How to write TestNG to pass values from an excel sheet

What am I doing wrong??? I have no idea why the parameters aren't passed!!! Am trying to pass the values from an external excel sheet... Please help!! And guys please don't mark this as duplicate!! Thanks in advance P.S I am trying not to use…