Ebola57 Posted May 10, 2019 Share Posted May 10, 2019 Hi community Is there a way more 'academic' to achieve this : I intend to click on a button from an IE webpage that has neither id nor name, so selecting it by this way sounds for me impossible I used a dirty way to achieve this, but would like to be sur that my method is the best one HTML code <button title="Ajouter une pièce jointe" class="panel-button sp-attachment-add btn btn-link" role="button" aria-label="Ajouter une pièce jointe" ng-click="attachmentHandler.openSelector($event)"><span class="glyphicon glyphicon-paperclip"></span></button> My Au3 code Local $oTags = _IETagNameGetCollection($oIE, "button") For $oTag In $oTags If $oTag.Title == "Ajouter une pièce jointe" Then _IEAction($oTag, "click") ExitLoop EndIf Next Best regards Link to comment Share on other sites More sharing options...
Nine Posted May 10, 2019 Share Posted May 10, 2019 If the number of buttons is always the same, you could use the index to access directly to the object : Local $nButton = 2 ; 0 based number = 3rd button _IEAction(_IETagNameGetCollection($oIE, "button", $nButton), "click") Ebola57 1 “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...
Ebola57 Posted May 10, 2019 Author Share Posted May 10, 2019 That's a nice idea as indeed the number of button is static at this run point Link to comment Share on other sites More sharing options...
Ebola57 Posted May 10, 2019 Author Share Posted May 10, 2019 A strange thing happens when I click on the button This button opens a "Select file" window. But as soon as the "Select File" window opens , the script freeze as if it can't get out of _IEAction ( $oTag, "click") The script only follow its way if I set a file or cancel the window Is there a way to say "click" and "forget" ?? Link to comment Share on other sites More sharing options...
Danp2 Posted May 10, 2019 Share Posted May 10, 2019 @Ebola57 This has been discussed lot of times on the forum. Here's one recent example -- Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Ebola57 Posted June 11, 2019 Author Share Posted June 11, 2019 Indeed, I spent a lot of time anyway to find the tiny part that solves so quickly the problem (at least in my case) I set the used code in case someone read this and want to save hours of reading Code that freezes _IEAction($oTag, "click") Code that runs flawlessly $hIE = _IEPropertyGet($oIE, "hwnd") _IEAction($oTag, "focus") ControlSend($hIE, "", "", "{ENTER}") Regards 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