Jump to content

Issue with _IEGetObjById


Recommended Posts

Hello,

I'm trying to write a simple macro for IE browser, but it seems that  _IEGetObjById () working not properly.  My code:

#include <IE.au3>
$oIE = _IECreate("http://aldas123.hostingas.in/phpBB3/")
_IELinkClickByText($oIE, "Register")
_IELoadWait($oIE)
Sleep (1000)
_IEAction ( _IEGetObjById($oIE, "agreed"), "click" )

 

The problem is, that it works on 4/6 computers. But it fails on two laptops with errors:

--> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (agreed)
--> IE.au3 T3.0-2 Error from function _IEAction(click), $_IESTATUS_InvalidDataType

I can't understand where is the problem, because all IE versions the same for all PCs

Link to comment
Share on other sites

The code ran fine for me once I separated out this line:

_IEAction ( _IEGetObjById($oIE, "agreed"), "click" )

into two separate lines:

$oButton = _IEGetObjById($oIE, "agreed")
_IEAction ( $oButton, "click" )

P.S. Your call to _IELoadWait($oIE) is redundant since there is one by default with _IELinkClickByText.

Link to comment
Share on other sites

I tried separated too. Doesn't work. Strange, because it works on four different computers, but it fails on another two... 

I can't find other ways to do it.

P.S. thanks about _IELoadWait

Maybe I will try to use keyboard - press enter or something like that

Link to comment
Share on other sites

Strange.

#include <IE.au3>
$oIE = _IECreate("http://aldas123.hostingas.in/phpBB3/ucp.php?mode=register")
_IEAction ( _IEGetObjById($oIE, "agreed"), "click" )

 

This works fine and button clicked successfully.

Seems something wrong with _IELinkClickByText($oIE, "Register") this one.

Link to comment
Share on other sites

I've just Restored all Internet Options and now it works.

Im not sure where was the problem, but :

#include <IE.au3>
$oIE = _IECreate("http://aldas123.hostingas.in/phpBB3/")
_IELinkClickByText($oIE, "Register")
ConsoleWrite(_IEPropertyGet($oIE,"locationurl"))

One PC returned - http://aldas123.hostingas.in/phpBB3/ (NOT CORRECT)

And another one returned - http://aldas123.hostingas.in/phpBB3/ucp.php?mode=register (CORRECT)

 

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...