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
0 answers

Datadriven not working using Testng data provider

I am trying to read data from excel using apache poi with testng data provider but testng is skipping my test method. Below is the error am getting SKIPPED: VerifyLoanDetails java.lang.RuntimeException: java.lang.NullPointerException Caused by:…
jino
  • 69
  • 1
  • 12
0
votes
1 answer

How to resolve org.testng.internal.reflect.MethodMatcherException in TestNG?

ContactsPage Class:- public class ContactsPage extends TestBase { public ContactsPage() { PageFactory.initElements(driver, this); } public boolean contactsLabel() { return contactsLabel.isDisplayed(); } public void…
Elegant Student
  • 305
  • 2
  • 8
  • 16
0
votes
1 answer

Customization of Extent Reports using TestNG (Java)

Need help to display parameters (against each test) in extent report. Parameters like the values picked from @dataprovider (URL, other details to fill the form) in Testng framework and also not getting failed stack trace against failed…
0
votes
1 answer

parameterization with multiple @dataprovider to Test the "login and homepage" Test case as together

Hi I am new to Automation and I am trying to do a data parameterization of 'Login.java and HomePage.java' as together. And post the result in respective column in excel sheet. Please find the Structure of excel as below. Testcase for…
Rama
  • 815
  • 2
  • 17
  • 37
0
votes
1 answer

How to print text below and above Passed: in the console area in selenium

I have three @test methods to add, update and delete records in a webpage, once my execution completes I am looking for an output something like below, where can I use the sisout to print the highlighted messages, I am running my code in TestNG. …
Jagadeesh
  • 143
  • 2
  • 3
  • 14
0
votes
1 answer

How to read data from excel sheet using data provider in POM maven project

I am unable to read data from excel using data provider.. I am creating one class to read data from excel but getting error. [screenshot attached] now how to use same in the Test class to call them. public class DataProvider extends Base { //…
0
votes
1 answer

TestNG Dataprovider - Filtering test data

I have a TestNG Dataprovider with full of test data. I'm parsing an Excel sheet, so dataprovider has eg. 15 test data list. I do not want to run my tests with all the 15 test data set, only one. Is it possible to filter the dataset and run the tests…
arena
  • 233
  • 3
  • 15
0
votes
2 answers

data providers in testng using selenium webdriver and java

@DataProvider public Iterator getTestData() throws IOException { ReadTestData readtestData=new ReadTestData(); ArrayList testData=readtestData.readExcel(); return testData.iterator(); …
aron
  • 17
  • 1
  • 4
0
votes
1 answer

Am facing the return type error in the data provider class

Can someone please find the issue in the following code? Am facing the return type error in the data provider class. This is the issue am facing when executing this code, "Data Provider public java.lang.Object[][] testCases.TestCases.loginData()…
Raj91
  • 1
  • 2
0
votes
1 answer

Creating TestNG dataProvider from two arrays

I am dealing with creating correct TestNG data provider Object. My goal is to create structure {customerCode, countryCode} e.g. "345","US". I was able to load data from testNG.xml file into two separate arrays, but finally how to put the code so it…
Michal
  • 610
  • 10
  • 24
0
votes
1 answer

DataProvider parallel text input - multithreading issue

I want to realize parallel test run with DataProvider for testing an input field. Expected Result: Parallel tests for each text in DataProvider Open page Write "Text1" (or "Text2" or "Text3") Press "Search" button Actual Result: One test with…
0
votes
2 answers

How to restrict the particular method to be executed once only, When factory and dataprovider annotation method is used?

I am automating database automation. I am using @factory and @Dataprovider annotation in feed the inputs. I want to restrict this method related alone runs once getCountOfPt1(poiLocId) I tried setting boolean value also, but it fails, because I am…
selvi
  • 1,271
  • 2
  • 21
  • 41
0
votes
1 answer

How to give Custom Method name in TestNG emailable report, in case when DataProvider is Used

I am using Data Provider in and report is displaying the same method name in all the tests in TestNG report. static String TC_Name; @DataProvider(name="SampleTestData") public Object[][] testData() { return new Object[][]{ …
Aneesh Goel
  • 47
  • 2
  • 6
0
votes
1 answer

TestNG and DataProvider - how to handle good failed tests

My queston is: When you do a test for logging page and you use different parameters and some of them causes our tests failing then what you do with them? I mean you have test with let say 5 parameters - 3 of them are positive and test passes, and 2…
EdXX
  • 872
  • 1
  • 14
  • 32
0
votes
1 answer

Is it possible to stop execution of a test method after one iteration of DataProvider and not run all the iterations? If yes , How?

Basically i want to run a test which will set certain value for a variable which i am going to use in another test(dependent). But the first method has DataProvider for over 30 iterations. I do not want to run it 30 times but only very first…
Hanendra
  • 31
  • 2