I need to bring up a MsgBox when the user clicks a button on the Internet Explorer page.
This is the button on the HTML page:
<button id="NOT_READY_BTN-btnEl" type="button" class="x-btn-center" hidefocus="true" disabled="disabled" role="button" autocomplete="off" data-qtip="ENTRA" style="width: 169px; height: 24px;"> <span id="NOT_READY_BTN-btnInnerEl" class="x-btn-inner" style="width: 169px;">ENTRA</span> <span id="NOT_READY_BTN-btnIconEl" class="x-btn-icon " style="background-image:url(img/icons/ENTRA.gif)"></span></button> Thanks
I am not sure on how to grab the innertext I want. Is there a way I can just grab the second line, or is there a better way to do it all together?
#include <IE.au3> $oIE = _IEAttach("Form Details") $oDiv = _IEGetObjById($oIE, "Col3") ;Phone MsgBox (0,"Oops",$oDiv.outertext) When I use this code I get
I received the following error when trying to use _IEGetObjById on a browser object that I had obtained by using _IEAttach.
Shouldn't the code have gotten a 1 or 0 from IsObj and continued by returning with the standard message from _IEGetObjById that there was no match for the requested ID?
I'd appreciate any guidance on next steps to debug.
_IEGetObjById and _IEGetObjByName functions use variable of an InternetExplorer.Application, Window or Frame object as reference to find any dom element.
Is it possible to use a dom element instead of InternetExplorer.Application, Window or Frame to find target dom element instead the dom element. This will help in finding elements using a parent child relationship where duplicate target dom elements exists on the HTML page.
Other automation tools like WebDriver do have this feature. It would be great to have something like this in AutoIt. I love the way AutoIt works!!!!! Especially the IE UDF. Cool stuff from DALE and other developers.
Ex - i would like to do something like this,
$oIE = _IEAttach("Title")
$oParentObject = _IEGetObjById($oIE, "Parent Widget or element Id which contains my target widget in its hierarchy below")
$oTargetObject = _IEGetObjById(oParentObject , "Id of widget i would like to find and do some action")
This will help in situations where there are widgets with duplicate ids on the page....Ex - 2 Add buttons with same id on the same page.....One add button to add a CAR...another Add button to add a Vehicle. In this case i cannot click on the exact Add button i want just with the Add button id. i will need reference of their immediate parent object to uniquely identify them.