naru Posted March 7, 2018 Share Posted March 7, 2018 How can i check the id is exists in IE? i want to check if id = mydocument exists in already opened webpage in IE then msg box("id found"), if the id = mydocument not exists then msgbox(id not found) Link to comment Share on other sites More sharing options...
Danp2 Posted March 7, 2018 Share Posted March 7, 2018 Please clarify your goal because I'm unclear what you are trying to do. Do you want to check for the existence of a specific element? Or something else? What have you tried thus far? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Juvigy Posted March 8, 2018 Share Posted March 8, 2018 Check out _IEGetObjbyID Link to comment Share on other sites More sharing options...
FabioPinheiro Posted March 30, 2018 Share Posted March 30, 2018 I understand. I have: Sleep(30000) $oLink = _IEGetObjById($oIE, 'ctl00_FooterContent_confirmacaoUsuario_BtnSim_LinkButton1') _IEAction($oLink, 'click') Sometimes Sleep(30000) is not suficient time to wait. How I WAINTING a _IEGetObjById EXISTS in the display to click? Example: $oLink = _IEGetObjById($oIE, 'ctl00_FooterContent_confirmacaoUsuario_BtnSim_LinkButton1') if($oLink) exists Then _IEAction($oLink, 'click') Else Sleep(5000) End if OR $oLink = _IEGetObjById($oIE, 'ctl00_FooterContent_confirmacaoUsuario_BtnSim_LinkButton1') While not isObj($olink) Sleep(5000) WEnd HOW I WAIT THE OBJ EXISTS TO CLICK? THANKS!!!!! Link to comment Share on other sites More sharing options...
FabioPinheiro Posted March 30, 2018 Share Posted March 30, 2018 I have: Sleep(30000) $oLink = _IEGetObjById($oIE, 'ctl00_FooterContent_confirmacaoUsuario_BtnSim_LinkButton1') _IEAction($oLink, 'click') Sometimes Sleep(30000) is not suficient time to wait. How I WAINTING a _IEGetObjById EXISTS in the display to click? Example: $oLink = _IEGetObjById($oIE, 'ctl00_FooterContent_confirmacaoUsuario_BtnSim_LinkButton1') if($oLink) exists Then _IEAction($oLink, 'click') Else Sleep(5000) End if OR $oLink = _IEGetObjById($oIE, 'ctl00_FooterContent_confirmacaoUsuario_BtnSim_LinkButton1') While not isObj($olink) Sleep(5000) WEnd HOW I WAIT THE OBJ EXISTS TO CLICK? THANKS!!!!! Link to comment Share on other sites More sharing options...
Developers Jos Posted March 30, 2018 Developers Share Posted March 30, 2018 Please stick this one thread in stead of cross posting and refrain from SHOUTING please. Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Danp2 Posted March 30, 2018 Share Posted March 30, 2018 This has been addressed before on the forum. Here's one example -- Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
FabioPinheiro Posted March 31, 2018 Share Posted March 31, 2018 Danp2. Thanks, but not working. --- begin --- _IEErrorHandlerRegister() Do Sleep(500) $oLink = _IEGetObjById($oIE, 'ctl00_FooterContent_confirmacaoUsuario_BtnSim_LinkButton1') Until IsObj($oLink) _IEAction($oLink, 'click') --- end --- Whats wrong? Link to comment Share on other sites More sharing options...
FabioPinheiro Posted March 31, 2018 Share Posted March 31, 2018 2 minutes ago, FabioPinheiro said: Danp2. Thanks, but not working. --- begin --- _IEErrorHandlerRegister() Do Sleep(500) $oLink = _IEGetObjById($oIE, 'ctl00_FooterContent_confirmacaoUsuario_BtnSim_LinkButton1') Until IsObj($oLink) _IEAction($oLink, 'click') --- end --- ERROR: --> IE.au3 T3.0-2 Warning from function _IEGetObjById, $_IESTATUS_NoMatch (ctl00_FooterContent_confirmacaoUsuario_BtnSim_LinkButton1) Whats wrong? Link to comment Share on other sites More sharing options...
Danp2 Posted March 31, 2018 Share Posted March 31, 2018 10 hours ago, FabioPinheiro said: Whats wrong? No idea because you didn't post a runnable script and you didn't provide any additional details such as the contents of the Scite output window. What version of AutoIT are you using? FWIW, you should see that error repeatedly until the object is found. If the object is never found, then it doesn't exist. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Juvigy Posted April 2, 2018 Share Posted April 2, 2018 So this line: $oLink = _IEGetObjById($oIE, 'ctl00_FooterContent_confirmacaoUsuario_BtnSim_LinkButton1') oLink will not be an object if the ID is missing. So after the call check with "IsObj" and if not object - wait. Link to comment Share on other sites More sharing options...
FabioPinheiro Posted April 2, 2018 Share Posted April 2, 2018 Hi, Juvigy. ctl00_FooterContent_confirmacaoUsuario_BtnSim_LinkButton1 is a HTML ID. Look: <a href="#" id="'ctl00_FooterContent_confirmacaoUsuario_BtnSim_LinkButton1" onclick="confUser()">Confirmar Usuário</a> This link open in a modal popup, after ready a json. When i click i first link, open a modal, but before have a loading. This loading has a delay that depends on the system. it can take 1, 2, 3 ... N minutes. The Sleep command is very useful, but I set 5 minutes, when it takes 2 and I lose time. I need a command that will wait until an HTML ID exists on the page. It cant be WinWait because it is an AJAX. Thanx! Link to comment Share on other sites More sharing options...
Juvigy Posted April 3, 2018 Share Posted April 3, 2018 So you should detect when the modal popup appears. Depending on what kind is that popup you can use WinWaitActive or IE functions. 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