0

I need to feed my test with testdata from a .csv file and therefore I need to parameterize my test. How is that done in Selenium?

Here is the code:

element.sendKeys("30097429029");

I want the numbers to be parameterized.

Magnus Jensen
  • 905
  • 6
  • 36
  • 73

2 Answers2

0

This is not Selenium related, you could use some lib for .csv handling (or something like this https://www.mkyong.com/java/how-to-read-and-parse-csv-file-in-java/) and than pass this data to your methods. Not sure what is exactly a problem, what are you trying to accomplish?

acikojevic
  • 915
  • 1
  • 7
  • 16
0

Data from csv can be passed using Dataproviders. A Data Provider is a method annotated with @DataProvider. A Data Provider returns an array of objects. More detailed answer you can find How to pass parameter to data provider in testng from csv file

Community
  • 1
  • 1