How can we create data driven framework using TestNG

0 votes
Jun 12, 2019 in Selenium by Yuvraj
2,444 views

1 answer to this question.

0 votes

Hey Yuvraj, we can create a Data Driven Framework by using @DataProvider annotation in TestNG.

@DataProvider(name="getData")
 public Object[][] getData(){
  //Object [][] data = new Object [rowCount][colCount];
  Object [][] data = new Object [2][2];
  
  data [0][0] = "FirstId";
  data [0][1] = "FirstPswd";
  
  data[1][0] = "SecondId";
  data[1][1] = "SecondPswd";
  
  return data;
  
 }
answered Jun 12, 2019 by Anvi
• 14,150 points

Related Questions In Selenium

0 votes
1 answer

How Parametermizing tests can be done in TestNG using Data Provider?

Hi Devashish, you can parameterize tests with ...READ MORE

answered Jul 8, 2019 in Selenium by Abha
• 28,140 points
2,552 views
0 votes
0 answers

How to implement Data-Driven framework using Apache POI?

How to implement Data-Driven framework using Apache ...READ MORE

Jul 15, 2019 in Selenium by Deeksha
681 views
0 votes
1 answer

How can I run test cases in parallel using Keyword Driven Framework?

One solution to try for executing test ...READ MORE

answered Jun 29, 2020 in Selenium by Alexander
2,861 views
0 votes
2 answers

How can we take screenshots of tests in Selenium 2 using C#

Hey, try using following code command to ...READ MORE

answered Aug 23, 2019 in Selenium by Abha
• 28,140 points
1,434 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
13,674 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,143 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
7,221 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,875 views
0 votes
1 answer

How can I store data into a cookie using Selenium Webdriver?

Hey Abhilasha, we can load a website ...READ MORE

answered Jun 19, 2019 in Selenium by Anvi
• 14,150 points
3,188 views
0 votes
1 answer

How can I create a POM test case in Selenium Webdriver?

Hey Akshay, follow these steps to create ...READ MORE

answered May 13, 2019 in Selenium by Anvi
• 14,150 points
1,472 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP