Jump to content
Sign in to follow this  
Aldas0729

Issue with _IEGetObjById

Recommended Posts

Aldas0729

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

Share this post


Link to post
Share on other sites
Aldas0729

Im a student and I need to compare several technologies for automated testing like iMacros, Selenium IDE and etc. Also I wanna try AutoIT, but sometimes it fails on other PCs.

Im using AutoIT v.3.3.14.2

Share this post


Link to post
Share on other sites
Danp2

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.

  • Like 1

Share this post


Link to post
Share on other sites
Aldas0729

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

Share this post


Link to post
Share on other sites
Aldas0729

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.

Share this post


Link to post
Share on other sites
Aldas0729

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)

 

 

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  

×