Unable to access child elements in Treeview control
Posted: Tue Dec 27, 2016 6:59 am
Hi,
I am trying to access the child elements of a treeview control in a silverlight based application. The Ranorex application version is 4.1.
As long as the Parent elements in treeview control are inside the visiable/viewable area, I am able to identify the child elements individually, however, the problem starts as soon as the parent control goes out of the visible/viewable of the screen, I am not able to identify the individual child elements.
I am using following code to identify the element/s.
Ranorex snapshots are also attached for the reference. TreeView1.rxsnp file contains the child element snapshot when parent nodes are visible on the screen. Whereas TreeView2.rxsnp file contains snapshot of treeview control when the parent nodes are not visible.
Any help will be appreciated.
I am trying to access the child elements of a treeview control in a silverlight based application. The Ranorex application version is 4.1.
As long as the Parent elements in treeview control are inside the visiable/viewable area, I am able to identify the child elements individually, however, the problem starts as soon as the parent control goes out of the visible/viewable of the screen, I am not able to identify the individual child elements.
I am using following code to identify the element/s.
Code: Select all
Tree DimensionTree=".//object[#'AppSilverlightControl']/form[@name='Silverlight Control']/form[@classname='Popup']/?/?/tree[@automationid='DimensionsTree']";
TreeItem Measures=DimensionTree.Element.Children[0].Children[4];
foreach(Element eleChild in Measures.Element.Children)
{
try
{
Text txtMeasure=(Text)eleChild.Children[3];
txtMeasure.Focus();
if(txtMeasure.Caption.ToString().Equals(RetroMeasure))
{
Element MeasuresDropArea=".//object[#'AppSilverlightControl']/form[@name='Silverlight Control']/form[@classname='Popup']/?/?/element[@name='MeasuresDropArea' and @classname='FieldsDropAreaControl']";
txtMeasure.Click();
Mouse.ButtonDown(WinForms.MouseButtons.Left);
Mouse.MoveTo(MeasuresDropArea);
Mouse.ButtonUp(WinForms.MouseButtons.Left);
found=true;
break;
}
}
catch(Exception e)
{
DimensionTree.Focus();
Mouse.MoveTo(DimensionTree);
Keyboard.Press("{Down}");
}
}
Any help will be appreciated.