Parameterized test step
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Marsha_R I've looked at this and I run into issues at this step:
https://support.smartbear.com.../modifying-mastercard-clickbutton-operation.html
I'm using CSS selectors for name mapping, and I do not see how I can do this step.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@ebarbera Thanks! That is what I was looking for. I'll give this a go and let you know if it works.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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: https://support.smartbear.com/testcomplete/docs/testing-with/data-driven/tutorials/keyword/modifying...
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@ryanterronez I should have mentioned the persistent part - but I'm glad you got it working!
Happy to help anytime.
Emma
