WPF Application und RanoreXPath

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
andreas.tastler
Posts: 36
Joined: Mon Sep 20, 2010 10:59 am

WPF Application und RanoreXPath

Post by andreas.tastler » Mon Sep 20, 2010 1:00 pm

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
Attachments
Textbox.rxsnp
(920 Bytes) Downloaded 228 times

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

Re: WPF Application und RanoreXPath

Post by Support Team » Mon Sep 20, 2010 1:40 pm

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
.
Image