My work is requiring me to do a Parameterize search in a web app using different sets of data(names, addresses, etc). I have not been able to find any resources that can help me with this. Does anyone happen to have a resource or knows how it can be done?
Asked
Active
Viewed 70 times
0

Oleg Valter is with Ukraine
- 9,619
- 8
- 37
- 59

Birenp89
- 1
- 1
-
why dont you have your test data in a spreadsheet. Read all the test data into a collection and iterate through it for each row – itronic1990 May 28 '21 at 16:18
-
There are many ways to do this. I am not sure how Selenium in Powershell works but the idea is probably the same. With my C# projects I either use CSV or JSON files for the test data, and then iterate of them as needed. There are special libraries and methods needed to read and parse the data but then it becomes easy just to pick which dataset you want for whatever test you want. – JD2775 May 28 '21 at 16:33
-
How would I implement the Json file into my selenium script is kind of where i am lost. – Birenp89 May 28 '21 at 16:42
-
The problem is I don't know Powershell so its hard to give you specifics. The high level idea though (at least in C#/Java etc...) is to create a Class object with the fields that match the JSON file fileds. Read in the JSON file into that class object and then parse it as needed. Again though I dont know how Powershell works, you may need to have a completely different approach. I would start by googling "reading and parsing json files in powershell" and see what you come up with. The selenium part in that context is not important. – JD2775 May 28 '21 at 16:46
-
1haha google is just as confused as yall on why i am using powershell instead of java, but you have been alot of help though thank you – Birenp89 May 28 '21 at 17:01