Page 1 of 1

Drag and Drop

Posted: Fri Dec 20, 2013 1:39 am
by Mayra
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,

Re: Drag and Drop

Posted: Mon Dec 23, 2013 1:41 pm
by mebner
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

Re: Drag and Drop

Posted: Sat Jan 04, 2014 9:42 pm
by Mayra
Thanks. It worked, but let me try it a few more times because unfortunately it works intermittently.