Sign in to follow this  
Followers 0
Val78

Need help with _IEPropertyGet

4 posts in this topic

Hi,

I've been trying to get a mouse to move to a certain control on the web page using screenx and screeny properties of _IEPropertyGet function.

I've been able to get the script to work when the page domain is "localhost" but if I try the same script on our training or live domain the script simply doesn't work and I have no idea why. I get no error messages and it seems like AutoIt simply stops executing at the point when I try to extract coordinates of the control. Here is the code sample I'm talking about.

$oIE = _IECreate("http://training.mysite.com/App/Modules/GP/Order.aspx?company=X&id=Y")
$HWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($HWND, "", @SW_MAXIMIZE)
_IEAction($oIE, "visible")

$button = _IEGetObjById($oIE, "UcxOrderEntry3xOrdersGridxxctl2xxctl0_Item_0")
$iScreenX =  _IEPropertyGet($button,"screenX")
$iScreenY =  _IEPropertyGet($button,"screenY")
$height = _IEPropertyGet($button,"height")
$width = _IEPropertyGet($button,"width")
MouseMove($iScreenX + $width/2, $iScreenY + $height/2)

If I set $oIE = _IECreate("http://localhost/App/Modules/GP/Order.aspx?company=X&id=Y"), code seems to work. I even did a Diff on source of the page between my local and other domain and I could not see any differences that would affect this script. Is there anything that I'm missing?

Thanks for your help.

Share this post


Link to post
Share on other sites



Suggest you run from the SciTe console and use SciTe Debug Mode (see my sig) to insure you know what lines of code are executing.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Suggest you run from the SciTe console and use SciTe Debug Mode (see my sig) to insure you know what lines of code are executing.

Dale

Thanks Dale, I just ran it with debug in SciTe and it executed fine until I try to get x screen position of the button:

0042: 0-0: $iScreenX = _IEPropertyGet($button,"screenX")

C:\Program Files\AutoIt3\Include\IE.au3 (3036) : ==> The requested action with this object has failed.:

Return $iTemp + $o_object.document.parentwindow.screenLeft

I'm not sure why this script has issues pulling up coordinates on remote domains.

Share this post


Link to post
Share on other sites

Please post all of the output to the SciTe console.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

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