Page 1 of 1

Problem in identifying an object with in a WPF table.

Posted: Mon Jun 25, 2012 5:06 pm
by ram.telu
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

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

Posted: Tue Jun 26, 2012 9:24 am
by Support Team
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

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

Posted: Tue Jun 26, 2012 1:44 pm
by ram.telu
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

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

Posted: Tue Jun 26, 2012 2:28 pm
by Support Team
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