Page 1 of 1

WPF Application und RanoreXPath

Posted: Mon Sep 20, 2010 1:00 pm
by andreas.tastler
Hi all

I am building an element repository for our new WPF client application an noticed, that the detection of RanoreXPath sometimes returns unwanted results.

For example, a standard Textbox in WPF returns something like that:
/form[@name='Window1']/text/container[@automationid='PART_ContentHost']
but I exptected this
/form[@name='Window1']/text[@automationid='textBox1']

Is there any way to set configuration, so that Textbox controls will be evaluated to the Textbox and not to the Container inside? In the Repository I can change this, but if I make another recording, a new element which points to the container will be created in the repository again.

Thank you in advance

Andreas

Re: WPF Application und RanoreXPath

Posted: Mon Sep 20, 2010 1:40 pm
by Support Team
Hi,

that's a technology based problem of WPF.
But of course you can access the attributes of the textbox directly via the textbox (not the container).
So you can use the path:

Code: Select all

/form[@name='Window1']/text[@automationid='textBox1']
to access e.g. the text of the text box.

Tracking the path of a textbox in a WPF application is a bit tricky.
If you move over the textbox the underlying container will be tracked.
But if you move to the border of the textbox, the path of the textbox itself will be tracked.

By the way, there went something wrong with your snapshot file.

Regards,
Tobias
Ranorex Team