Can KeywordTests Parameters be used as selector value?
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can KeywordTests Parameters be used as selector value?
Hi,
I need to click on a table cell. Currently, the selector is displayed as:
//div[.='John Smith']
If I want to click another cell in the table with a different name is it valid to replace the value in the selector with a parameter?
//div[.=KeywordTests.MyTest.Parameters.Name]
I tried it but it didn't work. Do I have to create a selector for each cell that might be under test?
Regards
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @enriquebravo!
You can absolutely use Variables in the mapping!
For instance, you can create a Variable called 'tableIDVar' with 'John Smith' as the value. Then in the mapping for that object, you can replace the value with '%tableIDVar%, i.e. = '//div[.='%tableIDVar%']
Here is the overview docs for Variables within TC;
https://support.smartbear.com/testcomplete/docs/testing-with/variables/index.html
I hope this helps!
Regards,
Nick
Solutions Engineer @ SmartBear
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the help. I had to use project variables, not test variables/parameters, but it worked.
Cheers,
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @enriquebravo!
Absolutely, we're always happy to help. Thanks for letting us know that worked!
Happy Testing!
Regards,
Nick
Solutions Engineer @ SmartBear
