Verifying an item in Tree
Posted: Sun Jul 10, 2011 3:59 pm
Hi frnds,
I am trying to verify an item is displayed correctly in the Tree object using the following code..
IList<Ranorex.TreeItem> treeitem=Form_Name.TreeOutLine_Name.FindChildren<Ranorex.TreeItem>();
foreach(TreeItem item in treeitem)
{
if(treeitem.text.Contains(item)
{
Report.Success("Item displayed in Tree");
}
else
{
Report.Failure("Item not found");
}
}
But this code is not working.
Below is the way the items are displayed..
-Item1
--Item2
I am trying to verify Item2 in the tree.Pls find the solution ASAP.
Thanks,
Rakesh
I am trying to verify an item is displayed correctly in the Tree object using the following code..
IList<Ranorex.TreeItem> treeitem=Form_Name.TreeOutLine_Name.FindChildren<Ranorex.TreeItem>();
foreach(TreeItem item in treeitem)
{
if(treeitem.text.Contains(item)
{
Report.Success("Item displayed in Tree");
}
else
{
Report.Failure("Item not found");
}
}
But this code is not working.
Below is the way the items are displayed..
-Item1
--Item2
I am trying to verify Item2 in the tree.Pls find the solution ASAP.
Thanks,
Rakesh