Drag and drop between distinct forms/applications

Ask general questions here.
bkruse
Posts: 39
Joined: Tue Jul 20, 2010 12:19 pm

Drag and drop between distinct forms/applications

Post by bkruse » Tue Jun 18, 2013 12:37 pm

Hi,

I want to achieve the following:
Drag an item (file) from one windows explorer window to another windows explorer window.
Windows 7 Pro 32bit, Ranorex 4.0.3, no Turbo Mode active.

The recorded code is:

Code: Select all

        [System.CodeDom.Compiler.GeneratedCode("Ranorex", "4.0.3")]
        void ITestModule.Run()
        {
            Mouse.DefaultMoveTime = 300;
            Keyboard.DefaultKeyPressTime = 100;
            Delay.SpeedFactor = 1.0;

            Init();

            Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Down item 'Form64Driver.Name1' at 42;11.", repo.Form64Driver.Name1Info, new RecordItemIndex(0));
            repo.Form64Driver.Name1.MoveTo("42;11");
            Mouse.ButtonDown(System.Windows.Forms.MouseButtons.Left);
            Delay.Milliseconds(940);
            
            Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Up item 'ProgrammerV61.Elementansicht' at 135;466.", repo.ProgrammerV61.ElementansichtInfo, new RecordItemIndex(1));
            repo.ProgrammerV61.Elementansicht.MoveTo("135;466");
            Mouse.ButtonUp(System.Windows.Forms.MouseButtons.Left);
            Delay.Milliseconds(700);
            
        }
Interesting:
If I convert it to UserCode and change the repo.Form64Driver.Name1.MoveTo("42;11"); to Mouse.MoveTo(repo.Form64Driver.Name1, "42;11"); then it works fine!

Modified UserCode:

Code: Select all

        public void test()
        {
        	Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Down item 'Form64Driver.Name1' at 42;11.", repo.Form64Driver.Name1Info, new RecordItemIndex(0));
//            repo.Form64Driver.Name1.MoveTo("42;11");
			Mouse.MoveTo(repo.Form64Driver.Name1, "42;11");
            Mouse.ButtonDown(System.Windows.Forms.MouseButtons.Left);
            Delay.Milliseconds(940);
            
            Report.Log(ReportLevel.Info, "Mouse", "Mouse Left Up item 'ProgrammerV61.Elementansicht' at 135;466.", repo.ProgrammerV61.ElementansichtInfo, new RecordItemIndex(1));
//            repo.ProgrammerV61.Elementansicht.MoveTo("135;466");
			Mouse.MoveTo(repo.ProgrammerV61.Elementansicht, "135;466");
            Mouse.ButtonUp(System.Windows.Forms.MouseButtons.Left);
            Delay.Milliseconds(700);
        }
Also, the record/playback without modification works fine if I drag and then drop it in/to the same windows explorer window.

In fact, I tried to move a file from windows explorer to our application, which has the same problem.
Seems to me as if the Ranorex record functionality has a little issue with dragging between different forms/applications?

regards, Björn

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Drag and drop between distinct forms/applications

Post by Support Team » Wed Jun 19, 2013 4:26 pm

Hello,

Thank you for reporting this issue.
I added it into our internal bugtracking system in order to analyze it.

Please use the workaround with 'Mouse.MoveTo()' until this issue is fixed.
Thank you.

Regards,
Markus (T)

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Drag and drop between distinct forms/applications

Post by Support Team » Wed Jun 19, 2013 4:26 pm

Hello,

Thank you for reporting this issue.
I added it into our internal bugtracking system in order to analyze it.

Please use the workaround with 'Mouse.MoveTo()' until this issue is fixed.
Thank you.

Regards,
Markus (T)