CaptainBeardsEyesBeard Posted January 28, 2020 Share Posted January 28, 2020 Hi So I'm clicking this button which has submit in the inner text and I use this code to do it ;~ Get all Buttons Local $oButtons = _IETagNameGetCollection($oIE, "Button") For $oButton In $oButtons ;~ Check if Button InnerText equals Log In and perform an action. ;~ Uncomment the _IEAction line below to submit the form. If $oButton.InnerText = "Submit" Then if @Error then ConsoleWrite(@CRLF & "Error finding submit button") Endif MsgBox(64, 'Log In Button Found', 'Button found with value: ' & $oButton.InnerText, 2) Sleep(2500) _IEAction($oButton, 'click') Sleep(4000) EndIf Next However when I run my program I get this in the console (41) : ==> The requested action with this object has failed.: If $oButton.InnerText = "Submit" Then If $oButton^ ERROR >Exit code: 1 Time: 39.17 It does click the Submit button so I'm wondering why it fails on the following line: If $oButton.InnerText = "Submit" Then Link to comment Share on other sites More sharing options...
Nine Posted January 28, 2020 Share Posted January 28, 2020 My curiosity would push me to understand why this button is giving trouble. I would first set a counter to know which button is badly reacting. Understanding the DOM of this object would allow to skip it in some way. If you don't have that curiosity, just add a COM error handler. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Danp2 Posted January 28, 2020 Share Posted January 28, 2020 Guessing that the objects in $oButtons go out of scope once the button is clicked, which is easily solved by adding an ExitLoop after the click. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Nine Posted January 28, 2020 Share Posted January 28, 2020 Or what Danp2 just said seadoggie01 and Danp2 2 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
CaptainBeardsEyesBeard Posted January 28, 2020 Author Share Posted January 28, 2020 Thanks I'll try this 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