Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Firstly,please view this question from a tester's perspective.i will put down the question below:
1.I need to drag and drop a WPF FrameworkElement (a Thumbnail to be precise) to another WPF FrameworkElement (a ListView).
2.I don't want to use the X,Y co-ordinates for the target , as because if the resolution changes my test script will fail.
3.The source element is placed on A grid and target element on B grid and both A&B are placed on the same ContentPresenter.

The issue is, when I am trying to do a DragTo on the source element to the target element, I get a Null reference exception, probably the same reference doesn't work on the other grid.

What I have tried:

This is what I have tried to do:
sourceElement.User.DragTo((FrameworkElement)targetElement);

I am trying to use the InputSimulator for the MouseEvents but nothing much helping as they want UITesTControl as the elements. i was not able to cast a WPF element to a UItestControl element.
Please help me here.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900