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
-1
votes
2 answers

Why am i getting Array out of bounds exception for this code?

<@DataProvider> public Object[][] getdata() { Object [][] data =new Object [0][1]; data[0][0]="restricteduser"; data[0][1]="123412"; return data; } We are talking about dataprovider annotation in selenium here.
-1
votes
1 answer

Invoke different classed based on the parameter provided in testng.XML

I have a query regarding testng module. My requirement is to invoke different classes based on the parameter provided in the testng.xml Testng.XML
Priya
  • 69
  • 4
  • 15
-1
votes
1 answer

org.openqa.selenium.WebDriverException: unknown error:

Automating test scenario with multiple data sets using @dataprovider, for e.g if I have three rows of data in my excel sheet the then my test method should run for three times, it's running fine when I automate till a certain point. As shown in code…
-1
votes
1 answer

Method which gets data from dataprovider has to be used in another class: Selenium, Java, TestNG

Step1: Created a class A with two methods: @Test(dataProvider="testdata") InputToForm() @DataProvider(name="testdata") readDataFromExcel() Step2: Created a class B, where I need to call the method InputToForm() with the data.
rht 73
  • 1
  • 2
-1
votes
1 answer

Pulling data from multiple Excel sheets with @Dataprovider and passing it to @test

I am facing an issue related to @Dataprovider and @Test Scenario : I need to get data from multiple sheets(sheet1, sheet2, sheet3, .....) with help of @dataprovider annotation, I have web application in which there are multiple webpages in which I…
-1
votes
1 answer

Does dependency in testNg cause rerun?

For example, I have the following methods and I run the whole test class. public void previous() { ....... } @Test(dependsOnMethods={"previous"}) public void current() { ....... } If that is the case, how many times will the previous methods…
Khalil
  • 21
  • 1
  • 6
-2
votes
1 answer

How to pass an input parameter as test classname in selenium?

I have to run a specific test through the command prompt. Could you please clarify how to pass an input parameter as test class name in testing?
-2
votes
1 answer

Can we provide priority, description of testng class fromm excel?

I want to pass test-ng priority through excel file . Is there any way to do that ?
-2
votes
1 answer

Override properties file using testng xml file

How can I override properties file values from the values in testng.xml file. Eg: Have 3 properties file a.properties #This property file contains host url and userid and env hosturl=abcd.com uid=xyz similarly other b.properties Now when I run as…
-2
votes
4 answers

DataProvider in TestNG to pass data from excel

I started learning Selenium2 (WebDriver) with Eclipse and TestNG. I have a question about DataProvider. I have a login page having user, password and login button for example. I have written a test in TestNG. I have used pageobject for UI objects…
Anji R
  • 843
  • 3
  • 16
  • 23
-3
votes
1 answer

Selecting Angular material drop down option by reading data using excel sheet with Apache POI in Selenium webdriver and Data driven testing

how to select Angular material drop down list option from excel sheet data/value/parameter with selenium webdriver Data driven concept and Using APACHE POI
-3
votes
1 answer

how to make @Test run only once

I am working on data driven testing, currently i am stuck on @Test. I want to pass the data to two different data providers and want to run one of the @test only once. How can i achieve this. Below is the same code describing my situation …
ddb
  • 1
  • 1
  • 4
-4
votes
2 answers

Can someone please explain technically the functionality of the below code

File src = new File(filePath); FileInputStream fis = new FileInputStream(src); XSSFWorkbook wb = new XSSFWorkbook(fis); XSSFSheet sheet1 = wb.getSheetAt(0); Why did they pass the src object to FileInputStream? Why did they pass FileInputStream…
Manoj Kumar
  • 93
  • 1
  • 3
  • 11
-5
votes
1 answer

Getting java.lang.NoSuchMethodError: while trying to execute from command prompt but working fine while executing from eclipse

using Testing Version 6.8 StackTrace: java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V at…
1 2 3
29
30