Forum Discussion
I am entering one set of data only once and entering the various fields within the environment. Then I select Create and the system automatically generates the data within the environment. What I want do is be able to have the same data 10 or 20 times.
I don't need to change the data each time I create new information. I will be looking at creating a script to do that later but all I want right now is to be able to enter one set of data multiple times.
You can use a csv or Excel file and only have one data line in it for now and use the data driven test with a For loop inside it to count the new records. This has the advantages of 1) letting you edit the data outside the test so you don't have touch the code 2) being scalable, so later on you could have different versions of the data easily, again without changing the code. In your example, it would create 10 (or 20) records for each line in the file.
You can create variables to hold that data and use a For loop to go through the data entry using the variables. If you ever want to change the data, you will have to edit the variables. If you ever want to have multiple sets of data, you will have to add more variables and change your code.
Related Content
- 4 years ago
- 8 years ago
- 4 years ago
Recent Discussions
- 6 days ago
- 6 days ago
- 9 days ago