Need Help With Mouse Clicks
WayCoolJr
![]()
- Joined: Nov 14, 2009
- Posts: 7
I'm having a difficult time getting my mouse clicks generated with macro recorder to repeat at the same location during playback.
The mouse is usually a few pixels off, just enough to break the job. This problem is ocurring mostly when trying to click a link on a website.
I have even edited the Action to reset the mouse location (using CTRL), but still am having no luck.
It works sometimes, but usually not.
Is there a better way to click on a link other than using a Send Mouse Click?
Marios
![]()
- Joined: May 26, 2009
- Posts: 27
WayCoolJr
![]()
- Joined: Nov 14, 2009
- Posts: 7
Hi Marios and thanks for the quick reply.
Yes I am using Active Window. I just double-checked to make sure and all the mouse clicks are set for Active Window and they are. I also made sure that was set before I started the recording.
I have a 21" monitor with my resolution set at 1680 X 1050 and run my browser window at maximum. I thought maybe this was causing a problem because I sometimes got an error stating that the mouse location was outside the available area (or something like that). So I tried a smaller window before recording and experienced the same problem even using Active Window.
Marios
![]()
- Joined: May 26, 2009
- Posts: 27
WayCoolJr
![]()
- Joined: Nov 14, 2009
- Posts: 7
OK - will do - thanks again.
codex
![]()
- Joined: Nov 12, 2009
- Posts: 161
Are you sure that this is not a timing issue? You mentioned that the issue usually occurs in websites. What may be happening is the following:
1) You recorded the mouse clicks with the "Macro Recorder" (you probably recorded the mouse moves too)
2) Sometimes when you execute the job, a website takes a bit more to load completely than it did when you recorded it.
3) The result is that one mouse click is being sent too early thus messing with your whole job's execution.
There is a very safe solution to deal with this issue (if this is actually what is making your job fail):
Whenever a new page is being loaded in the browser, WinAutomation's Macro Recorder automatically places a "Wait for Window" action (since you are recording your job relative to the active window).
A very neat trick that you can do in order to make sure that the page is actually fully loaded before sending your mouse clicks, is to place a "Wait for Image" action exactly after every new page load (i.e. after every "Wait for Window" action). You will of course have to capture as an image a part of the webpage that appears only when the page is fully loaded (e.g. a specific button, a logo etc).
This way WinAutomation will pause the job execution till this image appears on the screen and the next mouse click will be sent only when the page is actually loaded.
I'm not sure whether this is the problem but I think that it worths checking it out.
WayCoolJr
![]()
- Joined: Nov 14, 2009
- Posts: 7
Thanks Codex. Actually, I was having that problem as well. What I did was place a simple Wait for 6 seconds to make sure the page loaded. After I did that, accurracy increased significantly, especially for that particular website I was working with.
But, now, I am trying to make some WordPress configuration for example - Activate Pugins - whereby it will just miss the links or the checkboxes on playback.
I used an automation tool in the past that saw things like hyperlinks and form fields on webpages as objects and actions were performed on the objects as opposed to mouse coordinates on a window...maybe I should request this in the Feature Request section of this forum
On the other hand, I know others are having success doing similar things so I want to get this going.
I think Jack Duncan's videos may help me...I plan to watch those today. If I get anywhere I will come back here and report.
codex
![]()
- Joined: Nov 12, 2009
- Posts: 161
Just one small addition:
A method that will allow you to have absolutely stunning results and that worked for me in EVERY occasion, is the image recognition. When I want to be 100% sure that nothing is going to mess with my job, I use the following combination of actions:
"Wait for Image"
"Move Mouse to Image"
"Send (left) Mouse Click"
WinAutomation does an outstanding job in identifying text, links, buttons and in general any part of the screen that can be captured as an image and clicking on it (or relative to it with the offset option). You may need to capture the images manually (it's not as easy as the Macro Recorder is) but it guarantees flawless results in your form submissions.
WayCoolJr
![]()
- Joined: Nov 14, 2009
- Posts: 7
Great idea Codex. Can I use a link as an image, in other words, capture that part of the screen as an image and have WA look for that part of the page that "looks" like the captured image, or does it actually have to be an image (jpg, png, etc)?
Thank you for all your help!
codex
![]()
- Joined: Nov 12, 2009
- Posts: 161
Of course you can! That's the beauty of the image recognition! You can capture any part of the screen as image!
Especially when capturing links, notice that they may have the default (for most browsers) blue color when you capture them and the purple (visited) color later on leading many times to problems. I personally use Firefox 3.5 and this addon helped me disable the special styling so that every time the link looks like it's pressed for the first time.
Hf exploring all the possibilities with image recognition! Cheers! :)