This is a migrated thread and some comments may be shown as answers.

RadTreeListView Issues - and questions

6 Answers 73 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Shashi
Top achievements
Rank 1
Shashi asked on 16 Dec 2013, 11:45 PM
Hi,

Our application team recently updated one of the screens in our application to replace RadTreeView with RadTreeListView to display a hierarchical set of data.  While updating our automated tests to react to this change, I ran into several issues in the translator for the TreeListView control:

a) Attached error message showed up when I tried to record a step to verify root node count on the TreeListView control.  Step was recorded using the Build Validation dialog - error occurred when I clicked OK after changing expected value (originally "value?") to the expected value.

b) When I ran the test, that same step failed with the following exception (note:  same exception also occurs if the type of comparison is anything other than Equals such as GreaterThan):
'12/16/2013 5:47:43 PM' - 'Fail' : 41. radtreelistview(EncounterDiagProcNaviagationTreeRadtreelistview): root item count 'Equal' '0'.
------------------------------------------------------------
Failure Information:
~~~~~~~~~~~~~~~
Element Not found!
FindExpression used:
[name 'Exact' ColumnViewElement]

InnerException:
ArtOfTest.Common.Exceptions.FindElementException: Element Not found!
FindExpression used:
[name 'Exact' ColumnViewElement]

   at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo, Object target)
   at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout, WaitResultType errorResultType)
   at ArtOfTest.WebAii.Silverlight.VisualWait.ForExistsInternal(Int32 timeout, Boolean invertCondition)
   at ArtOfTest.WebAii.Silverlight.VisualWait.ForVisible(Int32 timeout)
   at ArtOfTest.WebAii.Silverlight.VisualFind.ReturnOrThrow(FrameworkElement e, String throwMessage)
   at ArtOfTest.WebAii.Silverlight.VisualFind.ByName(String name)
   at Telerik.WebAii.Controls.Xaml.RadTreeListView.get_ColumnView()
   at Telerik.WebAii.Controls.Xaml.RadTreeListView.get_TreeViewPanel()
   at Telerik.WebAii.Controls.Xaml.RadTreeListView.get_TreeListItems()
   at Telerik.WebAii.Design.Translators.Xaml.TreeListView.TreeListViewIntegerPropertyVerification.GetValueByProperty(String name)
   at Telerik.WebAii.Design.Translators.Xaml.Common.RadControlPropertyVerificationDescriptor.ExtractData(IApplication hostApp, DescriptorValueStore dataStore)
   at ArtOfTest.WebAii.Design.Extensibility.XamlVerificationDescriptor.ExtractData(IAutomationHost targetHost, DescriptorValueStore dataStore)
   at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)


c) Same exception occurred when I attempted to get the root node count in a coded step (using the API RadTreeListView.TreeListItems.Count)
d) Same exception occurred when I attempted to get all the root nodes in the tree (using RadTreeListView.TreeListItems).

Upon reviewing past posts in the forum, I came across the following threads that (I believe) are reporting the same or similar issues:
http://www.telerik.com/automated-testing-tools/community/forums/test-studio-express/automation-framework/bug-with-radtreelistview.aspx
http://www.telerik.com/automated-testing-tools/community/forums/test-studio-express/automation-framework/time-outs-when-evaluating-properties-in-radtreelistview.aspx
http://www.telerik.com/automated-testing-tools/community/forums/test-studio-express/automation-framework/treelistviewtests-bugs.aspx

The bug referenced in the above threads (PITS 10006) remains unscheduled - and there is no corresponding issue (that I could find) in the new Issues and Feature Requests site.

Telerik:  Could you update the status of the above issue?   If it is fixed, which version of Test Studio has the fix? (Note, we are on 2012.2.1420 - upgrade is currently not an option for us).  If it is not fixed, could you raise priority on it (there are already 5 votes on the PITS issue - I will add my vote as well).

I have worked around the above issues using the workarounds suggested in the above threads as well as some I developed on my own - but I do have a couple of questions/unresolved issues:

a) What is the real object type of the FrameworkElement objects in the list returned by the following code?  it would be nice if I could get a list of higher-order objects (such as RadTreeListItem).
IList<FrameworkElement> TreeListItems = tree.Find.AllByType("TreeListViewRow");

b)  Due to the issues with TreeListItems API, I am unable to perform tree traversal and validation functions (for example, verify row B is a child of row A, or get all child rows of a given root node row).  I believe that the TreeListView is still a tree view.  I welcome any ideas/code for doing that in my version of Test Studio (in my signature block below).

Thanks for any help you can provide.

Shashi
Telerik Test Studio 2012.2.1420.0 (VS plugin).

6 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 19 Dec 2013, 11:18 PM
Hi Shashi,

We need some additional time to fully investigate the problems you are running into. We'll finish this and report back to you tomorrow.

Regards,
Cody
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Cody
Telerik team
answered on 20 Dec 2013, 07:33 PM
Hi Shashi,

I can confirm that the bug reported in PITS 10006 was included in our latest release, build 2013.2.1210, released on December 10th this year. Since you are currently using 2012.2.1420 you will need to upgrade to get this fix.

a) What is the real object type of the FrameworkElement objects in the list returned by the following code?  it would be nice if I could get a list of higher-order objects (such as RadTreeListItem).

That code will return a list of "Telerik.WebAii.Controls.Xaml.RadTreeListView" objects.

I welcome any ideas/code for doing that in my version of Test Studio

It will take me about 2 days to be able to work up some code examples for accomplishing the tasks you have requested.

Regards,
Cody
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Cody
Telerik team
answered on 26 Dec 2013, 10:39 PM
Hello Shashi,

A RadTreeView turns out to be a series of UL's in a hierarchical structure. Using our demo page, you can see what it looks like in our DOM explorer - see attached screen shot.

Knowing this we can create code to traverse the tree and log some information about it:
[CodedStep(@"New Coded Step")]
public void WebTest1_CodedStep()
{
    IList<RadTreeNode> rootnodes = Pages.ASPNETTreeViewDemo.MainTreeView.RootNodes;
    Log.WriteLine("Count of root nodes: " + rootnodes.Count);
    foreach (RadTreeNode rootnode in rootnodes)
    {
        iteratenodes(rootnode);
    }
}
 
private void iteratenodes(RadTreeNode radTreeNode)
{
    Log.WriteLine("Begin iteration node: " + radTreeNode.Text);
    if (radTreeNode.ChildNodes.Count > 1)
    {
        Log.WriteLine("Level of this node: " + radTreeNode.Level + ", Number of children: " + radTreeNode.ChildNodes[1].ChildNodes.Count);
        IList<Element> childnodes = radTreeNode.ChildNodes[1].ChildNodes;
        foreach (Element child in childnodes)
        {
            iteratenodes(child.As<RadTreeNode>());
        }
    }
    Log.WriteLine("End iterating node: " + radTreeNode.Text);
}

From here we can expand on the idea of verifying a child node has a certain parent and so on. I leave that exercise up to you. This should get you pointed in the right direction. If you need further assistance let me know where you're stuck and I'll jump in to help.

Regards,
Cody
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Shashi
Top achievements
Rank 1
answered on 30 Dec 2013, 02:25 PM
Hi Cody,

Thanks for the information.  Unfortunately, it may not be helpful for a couple of reasons:

a) The information you have provided is for an HTML application (I believe) - ours is a Silverlight application.
b) More important, the information is for a RadTreeView - but I need it for a RadTreeListView.  As I mentioned in my original post, I am reacting to a change of control from RadTreeView to RadTreeListView.  As you know, the two are very different in their APIs even though they are visually similar. 

Let me know if you have equivalent code for Telerik's Silverlight RadTreeListView elements.  Again, I am looking for code that will work *without* the fixes in the latest version of Test Studio (due to development schedule constraints, it may be a while before we upgrade).

Thanks,
Shashi

0
Cody
Telerik team
answered on 30 Dec 2013, 03:06 PM
Hello,

Opps, my apologies for overlooking the fact you're trying to test a Silverlight application. Please allow me a couple more days to work up an equivalent Silverlight sample.

Regards,
Cody
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Cody
Telerik team
answered on 31 Dec 2013, 04:19 PM
Hi Shashi,

Silverlight controls are much more difficult to work with simply due to the nature of how Silverlight works. Silverlight likes to "virtualize" data. This means the Visual Tree (which is what we use to automate against) will only contain the UI elements needed to paint the UI in its current state. If nodes are not expanded in the UI, they won't exist in the Visual Tree.

I worked up an equivalent sample for this Silverlight sample page. I hope this is enough to get you started. Let me know if you need further assistance.

[CodedStep(@"New Coded Step")]
public void SilverlightScratchTest_CodedStep()
{
    IList<IRadTreeViewItem> rootNodes = Pages.Silverlight4Controls.SilverlightApp.MainRadtreeview.RootNodeElements;
    Log.WriteLine("Number of root nodes: " + rootNodes.Count + "\n");
    foreach (IRadTreeViewItem node in rootNodes)
    {
        IterateNode(node);
    }
}
 
private void IterateNode(IRadTreeViewItem node)
{
    Log.WriteLine("Start iterating node: " + node.Text);
    if (!node.IsExpanded)
    {
        node.ItemExpander.ScrollToVisible();
        node.ItemExpander.User.Click();
        node.Refresh();
    }
    IList<IRadTreeViewItem> childNodes = node.NodeElements;
    Log.WriteLine("Children count: " + childNodes.Count);
    foreach (IRadTreeViewItem childNode in childNodes)
    {
        IterateNode(childNode);
    }
    Log.WriteLine("End iterating node: " + node.Text + "\n");
}


Regards,
Cody
Telerik
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Shashi
Top achievements
Rank 1
Answers by
Cody
Telerik team
Shashi
Top achievements
Rank 1
Share this question
or