Problem in identifying an object with in a WPF table.
Posted: 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
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