Problem in identifying an object with in a WPF table.

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
ram.telu
Posts: 2
Joined: Mon Jun 25, 2012 4:32 pm

Problem in identifying an object with in a WPF table.

Post by ram.telu » Mon Jun 25, 2012 5:06 pm

We have an application with WPF GUI and we have textbox objects within WPF table.

When I open the application and spy I could see the textbox under WPF table and I am able to set text to it (Screen shot 1). But after doing some other operations on the application (navigating to a different tab) come back to the same WPF table. I have noticed that textbox under WPF table is not shown (Screen shoot 2). But if I close the application and restart, noticed that Ranorex spy is identifying the object correctly (Screen shot 3).

I could not get why it is unable to identify same object able after doing some other actions (Navigate to other tabs or Save an action, etc.). Can you please help me in solving this issue?

Below is the code I am trying to run (This is successful only when I restart the application) and please find the screen shots for more details

var path = "/form[@automationid='ColumbusMainWindow']/element[@automationid='dockingManager']/tabpagelist//element/element/tabpagelist/tabpage/element/table/container/element/element/element[3]/element/text[@name='"+ strRiskObject + "']/../../parent::element";
Validate.Exists(path);

// Setting Certificate Member
var pathCertMemPath = path + "/element[10]/element/text[@classname='TextBlock']";
Validate.Exists(pathCertMemPath);

Ranorex.Text txtCertMem = Host.Local.FindSingle<Ranorex.Text>(pathCertMemPath);
txtCertMem.Click();
Keyboard.Press("forship");
Keyboard.Press("{Enter}");





Please let me know if you need any additional details to understand the issue.



Ramchander Telu
Attachments
Ranorex3.png
Ranorex3.png (471.56 KiB) Viewed 1298 times
Ranorex2.png
Ranorex2.png (427.1 KiB) Viewed 1298 times
Ranorex1.png
Ranorex1.png (451.89 KiB) Viewed 1298 times

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

Re: Problem in identifying an object with in a WPF table.

Post by Support Team » Tue Jun 26, 2012 9:24 am

Hi,
ram.telu wrote:When I open the application and spy I could see the textbox under WPF table and I am able to set text to it (Screen shot 1). But after doing some other operations on the application (navigating to a different tab) come back to the same WPF table. I have noticed that textbox under WPF table is not shown (Screen shoot 2). But if I close the application and restart, noticed that Ranorex spy is identifying the object correctly (Screen shot 3).

I could not get why it is unable to identify same object able after doing some other actions (Navigate to other tabs or Save an action, etc.). Can you please help me in solving this issue?
Sounds like UIAutomation for the mentioned WPF control is not implemented correctly.
More precisely the updated or refresh implementation is not working correctly.
Ranorex can only recognize what the control provides.

If the control is implemented by yourself please try to fix your implementation.
If the control is implemented by a 3rd party vendor, come in contact with them and inform them about the bug within their implementation.

Regards,
Tobias
Ranorex Team
.
Image

ram.telu
Posts: 2
Joined: Mon Jun 25, 2012 4:32 pm

Re: Problem in identifying an object with in a WPF table.

Post by ram.telu » Tue Jun 26, 2012 1:44 pm

Thank you for the quick response. WPF Control was implemented inhouse by our dev team, But we not not sure how to fix that, because they have not written anything to around UIAutomation.

It would be great if you can specifiy what need to done from our develpers to fix this, more specificaly if you can provide a sample code on a simple control with correct implemention UIAutomation.

Thank you
Ram

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

Re: Problem in identifying an object with in a WPF table.

Post by Support Team » Tue Jun 26, 2012 2:28 pm

Hi,

please have a look at following link, which might help you solving your problem (see the code in the workaround section):
https://connect.microsoft.com/VisualStu ... temssource

Regards,
Tobias
Ranorex Team
.
Image