Hi,
There is a control of type container and it has sub elements of type text. i want to read the text value of each text in the container. How can i do this.
i tried using the following code but dose not work for me
Ranorex.Container IV_Add = <XPath of Container>
Element[] invadd=IV_Add.FindChildren(Role.Text);
for(int i=0; i<=invadd.Length; i=i+1)
{
Console.WriteLine(invadd.GetAttributeValue("Text"));
}
Thanks
Kiran pol
How to get all the text elements from container
-
- Posts: 12
- Joined: Tue Oct 06, 2009 6:40 am
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 3:30 pm
- Location: Graz, Austria
Re: How to get all the text elements from container
Hi,
I would use following code to get all elements of type Ranorex.Text
http://www.ranorex.com/Documentation/Ra ... torial.pdf
Regards,
Peter
Ranorex Support Team
I would use following code to get all elements of type Ranorex.Text
Ranorex.Container cont = "yourPath"; foreach(Ranorex.Text txt in cont.FindChildren<Ranorex.Text>()) { Console.WriteLine(txt.TextValue); }Please also take a look to our tutorial
http://www.ranorex.com/Documentation/Ra ... torial.pdf
Regards,
Peter
Ranorex Support Team
-
- Posts: 12
- Joined: Tue Oct 06, 2009 6:40 am
Re: How to get all the text elements from container
Hi ,,
Thanks the code works fine but i have on more porblem .. I actually want to get the AccessiableName or AccessiableDescription property of the text element because the text associated with the child elements is empty .. i tried using
Console.WriteLine(txt.AccessiableDescription); but i suppose that is not the way it would work
Regards
Kiran Pol
Thanks the code works fine but i have on more porblem .. I actually want to get the AccessiableName or AccessiableDescription property of the text element because the text associated with the child elements is empty .. i tried using
Console.WriteLine(txt.AccessiableDescription); but i suppose that is not the way it would work

Regards
Kiran Pol
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 3:30 pm
- Location: Graz, Austria
Re: How to get all the text elements from container
Hi,
Please take a look to the API documentation of Ranorex.
http://www.ranorex.com/Documentation/Ra ... eValue.htm
Example Code:
Peter
Ranorex Support Team
Please take a look to the API documentation of Ranorex.
http://www.ranorex.com/Documentation/Ra ... eValue.htm
Example Code:
Text.Element.GetAttributeValue("accessibledescription");Regards,
Peter
Ranorex Support Team
-
- Posts: 12
- Joined: Tue Oct 06, 2009 6:40 am
Re: How to get all the text elements from container
Thanks a lot ... it works perfect..
I will go through the links you have provided to get better insight of things to use..
Thanks
Thanks
Kiran Pol
I will go through the links you have provided to get better insight of things to use..
Thanks
Thanks
Kiran Pol
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 3:30 pm
- Location: Graz, Austria
Re: How to get all the text elements from container
Hi,
Also take a look to our screen casts
http://www.ranorex.com/support/screencasts.html
The two about RxPath are really helpful and explain you the RxPath in more detail.
Regards,
Peter
Ranorex Support Team
Also take a look to our screen casts
http://www.ranorex.com/support/screencasts.html
The two about RxPath are really helpful and explain you the RxPath in more detail.
Regards,
Peter
Ranorex Support Team