Is there a way to recognize in testadvantage/ quick test pro that the user is dragging a ultratreenode from an ultratree and the trying to drop that node on some separate panel? I have tried several things, but the only type of drag operation I can seem to get qtp recording to recognize is draging one node to another node on the same tree.
thanks
Hello Alan,
Thanks for your quick reply. It's good to know that this case is logged as feature request. It will be nice if Infragistics implements this in the next version of TestAdvantage so that I can develop my scripts with ease.
Vidya
Vidya,
The DragItem method is provided for the Microsoft TreeView. There isn't any implementation for this method in TestAdvantage and as such, it is expected that it doesn't work. Currently the only two methods that can be used for drag and drop operations are the Drag and the DragNode methods. The Drag method is provided for all .NET objects and uses mouse coordinates. The DragNode method is provided by TestAdvantage and is limited to dragging nodes within a single tree.
To add functionality to start a drag from a tree node rather than coordinates would need to be implemented as a new feature. I will go ahead and log this feature request for you and follow up through the support case that you have logged.
Alan
Thanks for the information. I have the same problem with Drag operation from a tree control. I can drag specifying mouse x and y coordinates but my requirement is to drag a specific item from a tree and drop it onto another control. for this I used DragItem method to drag an item from the tree. I passed item's complete path but it didn't worked. It is saying "cannot identify object in tree. make sure specified item present in the tree". I thought probably I am passing wrong path. Then I retrieved active node's full path by saying tree.ActiveNode.FullPath and then passed the same to DragItem method. still it is giving the same message. Then I tried passing item index. still the same error message. I am suspicious that DragItem method is actually working or not. Please try this DragItem method and and let me know if you are facing the same situation. This is very much important for developing my scripts.
Thanks,
Hello,
For dragging from the tree to another control, you can use the generic Drag and Drop methods that are available on all .NET objects in QTP. These method are based on mouse coordinates. If you would like to record the drag operation, you can do so by disabling TestAdvantage while recording the drag operation.
When you record without TestAdvantage the tree will be recognized as SwfObject rather than SwfTreeView. I have tested recording in a single test with TestAdvantage disabled and then TestAdvantage enabled and this worked and I could play back the script.
This approach will cause the tree to be added to the object repository twice so I would recommend that you record the drag operations in a new script and then manually edit the recorded script replacing SwfObject with SwfTreeView and then adding these lines to your existing script that already works with the tree.
To enable or disable TestAdvantage, you can use the version utility which can be found in the start menu under Infragistics -> TestAdvantage for Windows Forms [version] -> TestAdvantage for Windows Forms Tools
Let me know if you have any questions with this matter.
Sincerely,AlanSenior Developer Support Engineer