Drag and Drop

Ask general questions here.
Mayra
Posts: 68
Joined: Mon Dec 16, 2013 5:27 am

Drag and Drop

Post by Mayra » Fri Dec 20, 2013 1:39 am

Hello,'
I have the following code:
Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Down item 'NtoUI.WebElementSvg' at 241;40.", repo.NtoUI.WebElementSvgInfo, new RecordItemIndex(0));
repo.NtoUI.WebElementSvg.MoveTo(new Location(WebElementSvg_Screenshot1, "241;40", WebElementSvg_Screenshot1_Options));
Mouse.ButtonDown(System.Windows.Forms.MouseButtons.Left);
Delay.Milliseconds(2470);

Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Up item 'NtoUI.WebElementSvg' at .058;.492.", repo.NtoUI.WebElementSvgInfo, new RecordItemIndex(1));
repo.NtoUI.WebElementSvg.MoveTo(new Location(WebElementSvg_Screenshot2, ".058;.492", WebElementSvg_Screenshot2_Options));
Mouse.ButtonUp(System.Windows.Forms.MouseButtons.Left);
Delay.Milliseconds(2470);

When executing the steps individually I can see that a click on the correct section of the image is happening, but there is really no dragging which is what connects the two images with a line.

Can you tell me what is wrong?
Thanks,

mebner

Re: Drag and Drop

Post by mebner » Mon Dec 23, 2013 1:41 pm

Hello,

The code looks quite okay.

What you can also try is to click on the specific start point, then perform a Mouse.Down on the same position and a Mouse.Up on the target position.

Regards,
Markus

Mayra
Posts: 68
Joined: Mon Dec 16, 2013 5:27 am

Re: Drag and Drop

Post by Mayra » Sat Jan 04, 2014 9:42 pm

Thanks. It worked, but let me try it a few more times because unfortunately it works intermittently.