SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    May 2003
    Location
    Austria
    Posts
    1,480
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Retrieving items from DevExpress XtraTreeList-object

    I am testing a .NET application that contains a custom Treelist object (package from DevExpress XtraTreeList).
    The tree looks like that (each item is a row in the TreeTable with 5 columns):
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">+ Item 0
    | +- Item 0;0
    | +- Item 0;1
    | +- Item 0;2
    |
    +-Item 1
    +- Item 0;0
    +- Item 0;1
    +- Item 0;2</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Reading child objects (e.g. Item 0;1) in the tree is impossible, TestComplete returns this error:
    "Runtime Error in MS VBScript. The object doesn't support this property or method: 'field__items.Items(...).NodeItems'"

    Here's the code I tried to use and the values returned:
    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">m.mParameterTree.Selection.field_treeL ist.FocusedNode.NodeItems.field__items.Items(0)
    ==&gt; returns the string value of the first column of the selected Item
    m.mParameterTree.Nodes.FirstNode.ToString()
    ==&gt; returns the ClassName of Item 0 (ClassName = &quot;ParameterTreeNode&quot
    m.mParameterTree.Nodes.FirstNode.Nodes.FirstNode.N odeItems.field__items.Items(0)
    ==&gt; returns the string value of the first column of Item 0;0 (2 times &quot;FirstNode&quot
    m.mParameterTree.Nodes.FirstNode.Nodes.FirstNode.T oString()
    ==&gt; returns the ClassName of Item 0;0 (2 times &quot;FirstNode&quot;, ClassName = &quot;ParameterTreeNode&quot
    m.mParameterTree.Nodes.FirstNode.Nodes.field_nodes .field__items.Items(0).ToString()
    ==&gt; returns the ClassName of Item 0;0 (&quot;FirstNode&quot; + Item(0), ClassName = &quot;ParameterTreeNode&quot
    m.mParameterTree.Nodes.FirstNode.Nodes.field_nodes .field__items.Items(0).NodeItems.field__items.Item s(0)
    ==&gt; This causes the Runtime Error... :-(</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Our developers told me that it must be the same object (and TestComplete shows the same Class Name), so the property "NodeItems" must be available... [img]images/icons/frown.gif[/img]

    When I use the Object Browser to step into this property, it's the same:
    Sys.proc_KemroMgr.frm_KemroMgr_main.tab_properties .mParameterTree.Nodes.FirstNode.Nodes.field_nodes. field__items
    contains one property "Items", if I view the value of "Items(0)" it shows "IDispatch".
    When I step into it, there are no properties, fields, methods, ... displayed.

    Can anyone give me a hint how to solve this problem?
    Thanks!
    Juergen

  2. #2
    Member
    Join Date
    Feb 2003
    Location
    Frisco, TX, USA
    Posts
    68
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Retrieving items from DevExpress XtraTreeList-object

    Hello Juergen,

    Please accept my apologies for the delayed response.

    Unfortunately, we were unable to reproduce the problem. We used the TreeListMultiEditors sample application that is shipped with DevExpress XtraTreeList. Here is the script that worked fine with the application:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">' Please launch the TreeListMultiEditors application before executing this script
    Sub Test
    Set TreeList = Sys.Process(&quot;TreeListMultiEditors&quot.frmMain.treeList1

    ' m.mParameterTree.Selection.field_treeList.FocusedN ode.NodeItems.field__items.Items(0)
    Call Log.Message(TreeList.Selection.get_Item(0).GetDisp layText(TreeList.Columns.get_Item2(0)))

    ' m.mParameterTree.Nodes.FirstNode.ToString()
    Call Log.Message(TreeList.Nodes.FirstNode.ToString())

    ' m.mParameterTree.Nodes.FirstNode.Nodes.FirstNode.N odeItems.field__items.Items(0)
    Call Log.Message(TreeList.Nodes.FirstNode.Nodes.FirstNo de.get_Item(TreeList.Columns.get_Item2(0)).ToStrin g2())
    Call Log.Message(TreeList.Nodes.FirstNode.Nodes.FirstNo de.GetDisplayText(TreeList.Columns.get_Item2(0)))

    ' m.mParameterTree.Nodes.FirstNode.Nodes.FirstNode.T oString()
    Call Log.Message(TreeList.Nodes.FirstNode.Nodes.FirstNo de.ToString())

    ' m.mParameterTree.Nodes.FirstNode.Nodes.field_nodes .field__items.Items(0).ToString()
    Call Log.Message(TreeList.Nodes.FirstNode.Nodes.get_Ite m(0).ToString())

    ' m.mParameterTree.Nodes.FirstNode.Nodes.field_nodes .field__items.Items(0).NodeItems.field__items.Item s(0)
    Call Log.Message(TreeList.Nodes.FirstNode.Nodes.get_Ite m(1).get_Item(TreeList.Columns.get_Item2(0)).ToStr ing2())
    Call Log.Message(TreeList.Nodes.FirstNode.Nodes.get_Ite m(1).GetDisplayText(TreeList.Columns.get_Item2(0)) )
    End Sub</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">I was unable to use your code lines as they are, and I replaced them with analogous ones. I would also like to note that TestComplete has a restriction mentioned in the "Testing .NET Applications" Help topic:

    >>>>>
    To get or set an indexed property, use methods that provide access to this property, but not the property itself. For instance, to get access to datagrid cells, use the get_Item method of the DataGrid class rather than the DataGrid.Items property.
    <<<<<
    Robert Leahey - TeamAQA
    Thoughtsmithy Software
    Note: I am not an employee of AutomatedQA - my support here is on a volunteer basis.

  3. #3
    Senior Member
    Join Date
    May 2003
    Location
    Austria
    Posts
    1,480
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Retrieving items from DevExpress XtraTreeList-object

    Robert, many thanks for your answer.
    I didn't see this restriction in the help - by using get_Item() instead of Items() I also could make it work.

    Thank you for your help!
    Regards,
    Juergen

  4. #4
    Junior Member
    Join Date
    Nov 2004
    Location
    Bristol
    Posts
    1
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Retrieving items from DevExpress XtraTreeList-object

    I am having terrible trouble with this control also.
    Does anyone have a C# script example of this solution?

    Regards
    Marc

  5. #5
    Senior Member
    Join Date
    Oct 2003
    Posts
    928
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: Retrieving items from DevExpress XtraTreeList-object

    Hi Marc,

    Please see the following thread in the TestComplete newsgroup:
    http://automatedqa.com/forums/d.cgi?cmd=...19520&amp;utag=

    The sample script posted in this thread is written in JScript, but it will work in a C#Script project as well.
    Regards,
    Alex - SmartBear Support

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.00%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 08:31 AM.

Copyright BetaSoft Inc.