Aldas0729 Posted January 9, 2017 Share Posted January 9, 2017 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 More sharing options...
Danp2 Posted January 9, 2017 Share Posted January 9, 2017 Please explain why you need to automate registration on a phpBB forum. Also, what version of Autoit are you using? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Aldas0729 Posted January 9, 2017 Author Share Posted January 9, 2017 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 Link to comment Share on other sites More sharing options...
Danp2 Posted January 9, 2017 Share Posted January 9, 2017 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. Aldas0729 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Aldas0729 Posted January 9, 2017 Author Share Posted January 9, 2017 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 More sharing options...
Aldas0729 Posted January 9, 2017 Author Share Posted January 9, 2017 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 More sharing options...
Aldas0729 Posted January 9, 2017 Author Share Posted January 9, 2017 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now