HI,
I am trying to record a function that drags and drops dates into a calendar. Upon playback Ranorex replays the first click on the item and moves to the location that it should but without dragging the item accross?
Can anyone tell me why this might be?
Thanks
Chris
not recording drag and drop
Re: not recording drag and drop
Is the item itself moving or just the mouse?Chris Wright wrote:moves to the location that it should but without dragging the item accross?
Did you issue a click on the object (which is actually a click and release or did you issue a mouse down, then move, then a mouse up?
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!
Ciege...
Ciege...
-
- Posts: 25
- Joined: Tue Mar 08, 2011 11:07 am
Re: not recording drag and drop
The item is not moving its just the mouse. The action is recorded as a click down in this instance.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: not recording drag and drop
Do you run the automation in Turbo Mode, i.e. without delays at full speed? Some controls want to be clicked for half a second or so before the enter drag & drop mode.
Another possible cause could be a focus problem. Try clicking the item first, then delay execution for a second, then start the drap & drop operation (mouse down -> move -> mouse up).
Regards,
Alex
Ranorex Team
Another possible cause could be a focus problem. Try clicking the item first, then delay execution for a second, then start the drap & drop operation (mouse down -> move -> mouse up).
Regards,
Alex
Ranorex Team
Re: not recording drag and drop
hello,
have the same issue.
there is the code
Basically, what it suppose to do is to find the image and select it with a selection rectangle
it worked before with ranorex 3.2, updated it to 3.3 today and it doesn't seem to work.
regards,
Wyll
have the same issue.
there is the code
Code: Select all
repo.myApp.MoveTo
(new Location(bmp, "120;100"),1000);
Delay.Milliseconds(1000);
Mouse.ButtonDown(Windows.Forms.MouseButtons.Left);
Delay.Milliseconds(1000);
repo.myApp.MoveTo
(new Location(bmp,"-30;30"),1000);
Delay.Milliseconds(1000);
Mouse.ButtonUp(System.Windows.Forms.MouseButtons.Left);
it worked before with ranorex 3.2, updated it to 3.3 today and it doesn't seem to work.
regards,
Wyll
Re: not recording drag and drop
You should probably be using the Mouse.MoveTo method, which actually moves the mouse pointer, instead of trying to move the object in your application under test.
If you are trying to manipulate the mouse, try using the mouse methods directly.
See the Ranorex API -> Ranorex Namespace -> Mouse.MoveTo(Point), etc.
You will, of course, need to verify the correct references.
If you are trying to manipulate the mouse, try using the mouse methods directly.
See the Ranorex API -> Ranorex Namespace -> Mouse.MoveTo(Point), etc.
Code: Select all
Mouse.ButtonDown(Windows.Forms.MouseButtons.Left);
Delay.Milliseconds(1000);
--->>> Mouse.MoveTo(repo.MyApp, new Location(bmp,"-30;30"));
Delay.Milliseconds(1000);
Mouse.ButtonUp(System.Windows.Forms.MouseButtons.Left);
Shortcuts usually aren't...
- artur_gadomski
- Posts: 207
- Joined: Mon Jul 19, 2010 6:55 am
- Location: Copenhagen, Denmark
- Contact:
Re: not recording drag and drop
http://www.ranorex.com/Documentation/Ra ... MoveTo.htm
MoveTo method actually moves the mouse to location within the control, so I'd say the usage is correct.
Looks like Move method tries to move the control.
MoveTo method actually moves the mouse to location within the control, so I'd say the usage is correct.
Looks like Move method tries to move the control.
Re: not recording drag and drop
hello again,krstcs wrote:You should probably be using the Mouse.MoveTo method, which actually moves the mouse pointer, instead of trying to move the object in your application under test.
If you are trying to manipulate the mouse, try using the mouse methods directly.
See the Ranorex API -> Ranorex Namespace -> Mouse.MoveTo(Point), etc.
You will, of course, need to verify the correct references.Code: Select all
well, you can see the mouse moves to the right spot with my code, but it doesnt seem to press the left mousebutton down. Also tried to change to mouse.moveto() but it doesn't seem to work also.
And again it worked with the 3.2 version of ranorex
regards,
wyll
EDIT: hardcoded mouseposition without using the image references seems to work fine, but this can't be the solution to it.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: not recording drag and drop
Hi Wyll,
The problem in your code is not in using "Mouse.MoveTo(elem)" or "elem.MoveTo()". This is working fine in both ways (also in 3.3.1). I think problem is "new Location(...)". Do you have checked if the search for the bitmap works well? Is the Location in the bitmap the right one (-30)?
Regards,
Larissa
Ranorex Support Team
The problem in your code is not in using "Mouse.MoveTo(elem)" or "elem.MoveTo()". This is working fine in both ways (also in 3.3.1). I think problem is "new Location(...)". Do you have checked if the search for the bitmap works well? Is the Location in the bitmap the right one (-30)?
Regards,
Larissa
Ranorex Support Team
Re: not recording drag and drop
hello,
i attached a picture of how it used to work, but now doesn't.
the mouse position starts at the red dot and holds down the button until the blue dot.
yes image find should also be sucessful since the mouse is moving to there.
(and shouldnt there be an Error in the log "for not finding the image"?)
my code had a minor mistake it should be (-30,-30) so to prevent clicking on the icon it is negative.
i attached a picture of how it used to work, but now doesn't.
the mouse position starts at the red dot and holds down the button until the blue dot.
yes image find should also be sucessful since the mouse is moving to there.
(and shouldnt there be an Error in the log "for not finding the image"?)
my code had a minor mistake it should be (-30,-30) so to prevent clicking on the icon it is negative.
You do not have the required permissions to view the files attached to this post.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: not recording drag and drop
Hi,
I reproduced your desired activity and had no problems with clicking. Nevertheless it took a while finding the "folder-image". My code looks exactly like yours except the timing of the 1000 ms in MoveTo - I skipped the timing. Is your AUT always in the foreground during your test?
I just recognized that you have one time "Windows.Forms.MouseButtons.Left" and the other time "System.Windows.Forms.MouseButtons.Left". You can include
Regards,
Larissa
Ranorex Support Team
I reproduced your desired activity and had no problems with clicking. Nevertheless it took a while finding the "folder-image". My code looks exactly like yours except the timing of the 1000 ms in MoveTo - I skipped the timing. Is your AUT always in the foreground during your test?
I just recognized that you have one time "Windows.Forms.MouseButtons.Left" and the other time "System.Windows.Forms.MouseButtons.Left". You can include
using WinForms = System.Windows.Forms;and call WinForms.MouseButtons.Left to be conform.
Regards,
Larissa
Ranorex Support Team
Re: not recording drag and drop
Hello Larissa,
thank you for your help. yes my AUT is in the foreground during the test. is there a way not to do it in the foreground?
just in case, I will just hardcode the mouse coordinates and hope the object never gets moved.
oh well,
regards,
wyll
thank you for your help. yes my AUT is in the foreground during the test. is there a way not to do it in the foreground?
just in case, I will just hardcode the mouse coordinates and hope the object never gets moved.

oh well,
regards,
wyll
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: not recording drag and drop
Hi,
Your AUT should always be in the foreground. If it is not there will occur problems with finding the objects, of course. I just want to be sure that in your case this was not the reason for your problem.
Regards,
Larissa
Ranorex Support Team
Your AUT should always be in the foreground. If it is not there will occur problems with finding the objects, of course. I just want to be sure that in your case this was not the reason for your problem.
Regards,
Larissa
Ranorex Support Team