Sign in to follow this  
Followers 0
mrrlg

Mouse Click and Oracle

9 posts in this topic

I am attempting to automate a patch application using Oracle's Universial Installer. When I use the Active Window info to "spy" on the test installation I was able to successfully install the patch on my test machine using the x and y coordinates for the Mouse Position. However, when I attempt to run the script on another machne that has a different screen resolution, the script dies. The pixel color under the mouse is the same for every active button. No information is returned for Last Control Under Mouse, Staus Bar Text, Visable Window Text or Hidden Window Text. Is there any way short of constructing a script for each screen resolution to tell the mouse where to go?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You probably are using Absolute coordinates. This kind of problems should be avoided with coodinates relative to the window. So where ever the window is (so what ever resolution) until the window don't change size you'll click your button.

Check Opt() for:

MouseCoordMode

PixelCoordMode

If the window also change size you should also check

WinMove()

to resize it to a know size.

Edited by ezzetabi

Share this post


Link to post
Share on other sites

add a calculation for screen higth and width. Also, is the installer running full screen? if not, make sure Opt("MouseCoordMode", 0) ;1=absolute, 0=relative.

As far as colors, gamma adjustments are not all the same on different computers/video cards.

Just a little info to help.


AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

Or just

WinMove ( "title", "text", 0, 0 ,640 ,480)

and regulate the script on this size that will work in every Windows system.

Share this post


Link to post
Share on other sites

I added the opt("MouseCoordMode",0) to my script, that did not seem to help. When I changed the resolution of the Active desktop to 1024x768, then the first mouse command worked. Is there a way to script a screen resolution change?

Share this post


Link to post
Share on other sites

You will also need to change your script accordingly if the window was not at the top left of the screen when you created the script.

As for changing resolution, you can't do it with autoit. You can try a command line tool.


Who else would I be?

Share this post


Link to post
Share on other sites

On the original machine that I wrote the script, the window did not open in the upper left hand corner so that would skew my x and y coordinates. Is there a way to force that?

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

since you wrote the script in absolute mode, you will have to adjust every movement, or adjust the window.

If you can find the size and location of the window on your original machine, you can set that in the script.

WinMove ( "title", "text", 100, 200 ,640 ,480)

WinMove ( "title", "text", x, y [, width [, height]] )

set this and then you can use your mouse in any resolution as long as the full window fits in it. It will be closer to upper left on higher resolution machines.

basically your absolute should match since we are moving the window to match where it was on the first machine. Also you should use the same Opt("MouseCoordMode", 1) ;1=absolute(default), 0=relative.

#note to remember, try to use relative x,y coords when doing installs.

Edited by scriptkitty

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

Not quite sure I did this right. I got the windows coordinates from the original machine and added this portion to my script. The mouse still skitters off to one side and the script stops after the first window opens.

AutoitSetOption("WinTitleMatchMode",4)

Run("\\aoofs\oracle\2376472\Disk1\setup.exe")

WinMove("Oracle Universal Installer", 192, 144, 646, 512)

WinWaitActive("Oracle Universal Installer")

MouseClick ("Left", 752,627)

WinMove("Oracle Universal Installer", 192, 144, 646, 512)

WinWaitActive("Oracle Universal Installer")

MouseClick ("Left", 752,627)

WinMove("Oracle Universal Installer", 192, 144, 646, 512)

WinWaitActive("Oracle Universal Installer")

MouseClick ("Left", 752,627)

WinMove("Oracle Universal Installer", 192, 144, 646, 512)

WinWaitActive("Oracle Universal Installer")

MouseClick ("Left", 77,483)

WinMove("Exit", 385, 258, 260, 168)

WinWaitActive("Exit")

MouseClick ("Left", 170,144)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0