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

Received Data Provider Mismatch error

Tried below code but receiving Data Provider Mismatch error. Could anyone help out on this? package appModules; import org.testng.annotations.Test; import jxl.Sheet; import jxl.Workbook; import jxl.read.biff.BiffException; import…
sweta dhama
  • 13
  • 1
  • 3
0
votes
0 answers

Using Data provider in the second @test method in the same class file is not running successfully

In my requirement, I have "Add" button in the screen comes in "ClassC". It opens the popup module. where I can add more numbers of values and save. My code runs with one @Test method with data provider iteration. But it failed after one iteration.…
0
votes
0 answers

Java - Pass column 1 of array to driver.get() and assert to column 2

I'm writing a script that will verify URL redirects. I have a spreadsheet with two columns. One column is URL I need to pass to driver.get() and the second column is URL is the expected URL. My question is with VerifyRedirectURL. How would I pass…
TheAutomator
  • 67
  • 1
  • 1
  • 7
0
votes
1 answer

how to pass dataprovider to any test in testNG when dataset has data not specific to this testcase

I am trying to build a Selenium hybrid framework using TestNG wherein i am getting data from my excel datasheet. I am trying to use DataProvider of testNG, But problem is since my datasheet contains data which belongs to different test case (for eg.…
Ankit Singh
  • 77
  • 2
  • 7
0
votes
1 answer

How can we pass less parameters than the method require us to do using DataProvider?

How can we pass less parameters than the method require us to do using DataProvider? I will try to explain, let say for an example i created a Method called fetchData(string objectype,string object value, String locatortype,String…
Im Nobody
  • 43
  • 1
  • 9
0
votes
0 answers

How Can I verify response for different data?

I am using DataProvider concept in testng. The below method will run 5 times for a different users. The same method will run for 5 times but different input and different output.I want to assert the response. Is there any best way to capture…
selvi
  • 1,271
  • 2
  • 21
  • 41
0
votes
1 answer

testNG multiple dataproviders passing data to one class having multiple test methods

EDIT1: I have an ExcelUtility.java class to get cell data from it and pass it on to the tests methods in my test class. I am reading from 1 excel file. The excel file has 3 worksheets. Every worksheet has 1 unique working table inside. I have 1 Test…
0
votes
2 answers

Need help in modifying the Testng Report

In my report the last Test name in excel sheet is getting appended in my results. Here is my code public class Test_suite implements ITest { private String testInstanceName=""; public String getTestName() { return…
aviral
  • 1
0
votes
1 answer

TestNG Factory, DataProvider, and valargs on constructor is causing "java.lang.IllegalArgumentException: wrong number of arguments"2

I am using TestNG to create a test case that uses a DataProvider to feed data to a Factory that is used on a constructor for the test case class to set variables in the class. I have put my DataProvider in a separate class for modularity (as I am…
0
votes
0 answers

Factory dataprovider - test results in testng

Factory dataprovider test results. package kill.me.later; import static org.testng.Assert.assertTrue; import org.testng.annotations.Test; public class SomeTest { private int id = 0; private String account = ""; public SomeTest(int…
bvr
  • 249
  • 2
  • 4
  • 15
0
votes
1 answer

How to compare the data in two excel sheets using data provider in Selenium

I am already having data in excel sheet . New excel sheet will be downloaded on running the selenium script .I need to compare these two excel sheets .
0
votes
2 answers

data provider mismatch error

I am using below code for data provider but it's not working. Please help to me how to resolve data provider mismatch issue. here mentioned complete details about all the methods reading xls , test , data provider . @DataProvider public…
0
votes
1 answer

TESTNG IF statement not working with Passed Paramters from xml

Research : Selenium/Testng - IF statement not working when using parameter from testng.xml already gone through the above post , but could not find the answer. Problem : Here's my TestNG.xml
0
votes
1 answer

Validate login page in selenium webdriver

Hi I need to automate my login page and validate all error messages. ie. With valid login and invalid password. without entering the email and password. here i need to validate the error messages displayed on the browser for all my login…
sai
  • 1
  • 2
0
votes
1 answer

TestNG Parameterized Test and PowerMockito causes MethodMatcherException

I'm using org.powermock:powermock-module-testng:1.7.3 org.powermock:powermock-api-mockito:1.7.3 org.testng:testng:6.11 Eveything works fine untill I add org.powermock.core.classloader.annotations.PrepareForTest annotation and extend the class…
Arjun
  • 3,248
  • 18
  • 35