TestProject Forum

Input parameter inside a XPATH or CSSselector

Can I use the input parameter inside a XPATH or CSSselector to locate an element where I will give input from CSV files…?? If yes please suggest me how to achieve this…??

Hello @gaurav
Yes, you can do that.
You can put a parameter anywhere, including to a locator:
image

image

image

image

image

If I want to inject a different value each time, I can use a CSV file, where I can put all the values and use them in my test.
Using data drive testing with multiple different parameters is a simple way to change values.
Once you create the test you can download the data source template:


Add the values:
image

Then upload the file to Data Sources:

You can use it both in the tests and in jobs as well.

You can see here video how to do that as well: