Hi
Ranorex gets all the text (Static and Edit). Is there a function to get the text by the class name it belongs to?
I can get the class name for a particular text, but is there a function like FindDescendants but by the class name say Edit. The idea is to find all the Editboxes in a form.
Thanks
Is there a way of getting the text based on a class type
-
- Posts: 6
- Joined: Fri Feb 20, 2009 11:26 am
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
You can use the Find method with a relative path that searches for a classname, e.g.:
Using RanoreXPaths you can search for elements matching any of the attributes listed in RanorexSpy. E.g. you could search for all elements that have a 'Text' attribute with value "Hello World":
The '*' means "match all roles/capabilites" (e.g. Form, Button, Text, or ...).
Regards,
Alex
Ranorex Support Team
Code: Select all
Form form = ...;
IList<Text> descendantEdits = form.Find<Text>(".//text[@class='Edit']");
Code: Select all
IList<Unknown> elements = Host.Local.Find<Unknown>("//*[@text='Hello World']");
Regards,
Alex
Ranorex Support Team