Ask a Question

Parameterized test step

Occasional Contributor

Parameterized test step

I have a page that displays links for different charts:


I would like to have a parameterized keyword test step that will take each of these links as a parameter.  That way I can write one test and have it run however many times as needed.  I'm not sure how to do this and I'm looking for suggestions.  If possible, I would like to avoid scripting for this.  I'm sure I could come up with some JS that could accomplish this, but I would like a way to do it using a keyword test.

Community Hero

This should be helpful:

[Community Hero]
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
Occasional Contributor

@Marsha_R I've looked at this and I run into issues at this step:



I'm using CSS selectors for name mapping, and I do not see how I can do this step.

Hi @ryanterronez,


See if this article helps - section "To use variables in selectors"


You can use a variable to drive the selector - this could even work in a datadriven loop if thats something you are looking to do.





Occasional Contributor

@ebarbera Thanks!  That is what I was looking for.  I'll give this a go and let you know if it works.

Occasional Contributor



I have created a project level table variable named chartCategory:



I have referenced the variable in name mapping as described here:



I have tried with and without single quotes, I have tried with and without a column name and I keep getting this error:


Not sure what I am doing wrong, but I can't seem to get it to work.



I believe the issue here is the variable type - for this you will have to use a string type variable. 


You can use a set variable value step to iterate through a table - here is a somewhat similar tutorial that applies a similar concept:



Occasional Contributor



Alright, I got it working.  Had to change the variable type to string and also had to make it a persistent variable, wasn't working when I had it as a temporary variable.  Thank you so much for you assistance!

@ryanterronez I should have mentioned the persistent part - but I'm glad you got it working! 


Happy to help anytime.



Showing results for 
Search instead for 
Did you mean: