How can I set the value of a selector at runtime?
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How can I set the value of a selector at runtime?
Hello,
I have a scenario that needs to iterate select a value from a dropdown every time it runs. Typically, I use the FindElement action in combination with an xpath expression to click on the required value. My problem is that element that identifies the dropdown changes depending on action on previous steps.
Is it possible to nest FindElement actions?
Is it possible to set NameMapping objects properties from a test run?
Thanks.
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You could save the needed value in a variable and then use the variable in the Find Element when you need it in the later steps.
Give us an example of what you are trying to accomplish by editing the name mapping on the fly.
Marsha_R
[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.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you have a look at step 26 on this blog post...
It shows you how to use a Project Variable in the name map. So you can set the value of the Project variable at run time, then use that variable in the namemap / selector when you need it. The key bit is making sure you 'refresh' the namemap if you update the variable. All detailed in the post and in the video.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just what I was trying to accomplish! Thanks!!!
