Retrieve Textvalue from Container

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Bokido
Posts: 4
Joined: Tue Mar 06, 2012 4:21 pm

Retrieve Textvalue from Container

Post by Bokido » Tue Mar 20, 2012 12:57 pm

Hello

I'm trying to retrieve the Textvalue of a Container in the Usercode.
But i'm not able to access the "text" Attribute for the ContainerContentElement.
I think there should be a solution for this , which i've not found out yet.

Greetings Bokido
Attachments
Untitled.jpg
Untitled.jpg (125.21 KiB) Viewed 1170 times
CodeTextbox.rxsnp
(354.24 KiB) Downloaded 151 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Retrieve Textvalue from Container

Post by Support Team » Tue Mar 20, 2012 1:13 pm

Hi,

Do you know the name of the attribute where the text is saved to?
If yes you can try to use the following method:
ContentElement.Element.GetAttributeValue("yourAttribute").ToString();
By the way please update to the actual Ranorex 3.2.2 version, here is the link.

Regards,
Markus
Ranorex Support Team
.
Image

Bokido
Posts: 4
Joined: Tue Mar 06, 2012 4:21 pm

Re: Retrieve Textvalue from Container

Post by Bokido » Tue Mar 20, 2012 1:50 pm

Hi

No i don't.
The recorded item is a Textbox and as usual there should be a attribute which is named "Text" with the text of the Textbox but there isn't. So i guess there must be another Attribute.

Greetings Bokido

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Retrieve Textvalue from Container

Post by Support Team » Tue Mar 20, 2012 2:25 pm

Hi,
No i don't.
Can you ask your developers if they know which attribute/property holds the specific text value?

Maybe the text attribute is not available through your UIAutomation implementation, therefore please check if you can get the text with UISpy, which is a Microsoft tool and should identify all attributes if the UIA implementation is correct.
Is UISpy able to get the right text value?

Regards,
Markus
Ranorex Support Team
.
Image

Bokido
Posts: 4
Joined: Tue Mar 06, 2012 4:21 pm

Re: Retrieve Textvalue from Container

Post by Bokido » Tue Mar 20, 2012 2:53 pm

Hi,

I just found out a method to retrieve the value.
Text textTextBox = "/dom[@caption='Microsoft Silverlight']/body/div/object/form/tabpagelist[@automationid='TabControlContentArea']/tabpage/text[8]";

string textboxvalue = textTextBox.TextValue;

with the following part i was able to get the Value of the right ContainerContentElement.

Greetings Bokido