dar100111 Posted August 15, 2013 Share Posted August 15, 2013 Hey All, Have a website that when I navigate to a page, the information isn't complete and has a little loading animation on the website so I need to figure out a better solution than _ieloadwait. Anyone ever try doing something like telling the script to wait until a form, element or table is available before continuing their script. Was curious how someone utilizes that or if a different method was easier. Thank you very much! Link to comment Share on other sites More sharing options...
JohnOne Posted August 15, 2013 Share Posted August 15, 2013 Use error handler. Try to get last loaded object until it has value you expect. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
dar100111 Posted August 15, 2013 Author Share Posted August 15, 2013 Hey John! thanks for the quick response. So If I'm looking for a certain form and I set it to a variable like $oForm, how to you incorporate the code? @error ? Thank you very much for the help! Link to comment Share on other sites More sharing options...
JohnOne Posted August 15, 2013 Share Posted August 15, 2013 Show minimal code you have already to get the form object. And we'll go from there. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Edano Posted August 15, 2013 Share Posted August 15, 2013 probably you have to find an individual solution, since some websites are built in this way to prevent automation. [color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font] Link to comment Share on other sites More sharing options...
dar100111 Posted August 15, 2013 Author Share Posted August 15, 2013 Hey Edano, So instead of a sleep function I want to have it wait until it can find the $oForm listed below, if that's possible. $_IEAction($railtrace, "click") _IELoadWait($oIE) Sleep(5000) $oFrame = _IEFrameGetObjByName($oIE, 'module') $oForm = _IEFormGetObjByName($oFrame, 'ClEquipmentTraceProfileForm') $entry = _IEFormElementGetObjByName($oForm, 'equipment') $method = _IEFormElementGetObjByName($oForm, 'delivery') $output = _IEFormElementGetObjByName($oForm, 'outputType') _IEFormElementSetValue($entry, "HJCU137135") _IEFormElementOptionSelect($output, "csv", 1, "byValue") _IEFormElementOptionSelect($method, "D", 1, "byValue") _IEAction($entry, "focus") _IELoadWait($oIE) Link to comment Share on other sites More sharing options...
Solution JohnOne Posted August 15, 2013 Solution Share Posted August 15, 2013 (edited) _IEErrorHandlerRegister("MyErrFunc") Do Sleep(100) $oForm = _IEFormGetObjByName($oFrame, 'ClEquipmentTraceProfileForm') Until IsObJ($oForm) Func MyErrFunc() Return EndFunc ;==>MyErrFunc Edited August 15, 2013 by JohnOne Gianni and Edano 2 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
dar100111 Posted August 15, 2013 Author Share Posted August 15, 2013 Sweet. Thanks John! Link to comment Share on other sites More sharing options...
Edano Posted August 15, 2013 Share Posted August 15, 2013 yes. that is a nice solution [color=rgb(255,0,0);][font="'comic sans ms', cursive;"]FukuLeaks[/color][/font] 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