How to find the mapped name for the object
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to find the mapped name for the object
Hi everyone,
I tried to find the mapped name for the object with unknown location.
There is a list with a thousand of items in there. I use Find function to find if the item exist or not based on the name of the item.
And if it was exist, I need to click on that item.
However, Find function only returns the variable that show the item exist or not on the list.
It did not return the mapped name for the object.
How can I find the mapped name of the item to use the Click function?
Solved! Go to Solution.
- Labels:
-
Name Mapping
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am not sure I got your problem.
Could you provide a relevant code example or rephrase the use case and the problem?
/Alex [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
#####Find if the item is exist########
p = List.Find("DisplayName","Test_529",15)
if (p.Exists):
Log.Message("The object was found.")
else:
Log.Error("The object was not found.")
########################################
The problem is: How can I find the mapped name for the item "Test_529"
Because the Find method returns a stub object that only contains the Exist property equal to False. So, you can check the Exists property value of the returned object to determine whether the search was successful.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
If .Exists property equals to false this means that the sought for object does not exist and thus is not NameMapped.
Otherwise, if .Exists equals to true, you may check the value of the .MappedName property. If the object is NameMapped this property will contain object's mapped name.
Does this answer your question?
/Alex [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
In your example, p is the object. If Exists is true, then you can use that p object for other things like Click
so something like
p = List.Find("DisplayName","Test_529",15)
if (p.Exists):
p.Click()
Log.Message("The object was found.")
else:
Log.Error("The object was not found.")
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
Oh I can click at item now.
Thank you so much
