Hakuin Posted January 17, 2018 Share Posted January 17, 2018 Hello, I would like to press a button on a Internet Explorer popup window but I cannot find it. The popup looks like the attached image "OffeneAnträge.jpg" The HTML of this popup is like this: (Retrieved from Firefox) expandcollapse popup<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head> <meta http-equiv="content-type" content="text/html; charset=windows-1252"> <meta http-equiv="content-language" content="de"> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="Content-Script-Type" content="text/javascript"> <meta http-equiv="Content-Style-Type" content="text/css"> <link rel="stylesheet" type="text/css" href="Offene%20Antr%C3%A4ge-Dateien/iflx.css"> <!-- jQIncludes --> <link type="text/css" href="Offene%20Antr%C3%A4ge-Dateien/jquery-ui.css" rel="Stylesheet"><script type="text/javascript" src="Offene%20Antr%C3%A4ge-Dateien/jquery.js"></script><script type="text/javascript" src="Offene%20Antr%C3%A4ge-Dateien/jquery-ui.js"></script><script type="text/javascript" src="Offene%20Antr%C3%A4ge-Dateien/jquery_002.js"></script> <!-- other common files --> <script type="text/javascript" src="Offene%20Antr%C3%A4ge-Dateien/iflxconsole.js"></script> <script type="text/javascript" src="Offene%20Antr%C3%A4ge-Dateien/iflxtools.js" language="JavaScript"></script> <script type="text/javascript" src="Offene%20Antr%C3%A4ge-Dateien/iflxUtil.js"></script> <script type="text/javascript" src="Offene%20Antr%C3%A4ge-Dateien/iflxCommonSettings.js"></script> <script type="text/javascript" src="Offene%20Antr%C3%A4ge-Dateien/iflxBrowserDialog.js"></script> <script type="text/javascript" src="Offene%20Antr%C3%A4ge-Dateien/iflxJapiTextInner.js"></script> <script type="text/javascript" src="Offene%20Antr%C3%A4ge-Dateien/iflxJapiText.js"></script> <script type="text/javascript" src="Offene%20Antr%C3%A4ge-Dateien/date.js"></script> <script type="text/javascript" src="Offene%20Antr%C3%A4ge-Dateien/iflxJQCalendar.js"></script> <title>Offene Anträge</title> <script language="JavaScript" type="text/javascript" src="Offene%20Antr%C3%A4ge-Dateien/iflxcookies.js"></script> <script language="JavaScript"> function yesAction() { parent.opener.location.href='setsuccessmain.jsp?SuccessMain=wflistmain.jsp'; window.close(); } function noAction() { parent.opener.location.href='/WebClient/iflx/genehmiger/main.jsp'; window.close(); } </script> </head> <body class="mainframe"> <center> Sie haben offene Anträge. Wollen Sie direkt in die Antragsliste gelangen? <br><br> <span class="iflxButtonFinder"><script type="text/javascript" src="Offene%20Antr%C3%A4ge-Dateien/ButtonHandler.js" language="JavaScript"></script><script language="JavaScript"> <!-- buttonHandler0 = new ButtonHandler("buttonHandler0"); buttonImageArray1 = new Array( new Array("images/buttonNormalLeft.gif","images/buttonNormalCenter.gif","images/buttonNormalRight.gif"), new Array("images/buttonHoverLeft.gif","images/buttonHoverCenter.gif","images/buttonHoverRight.gif"), new Array("images/buttonClickedLeft.gif","images/buttonClickedCenter.gif","images/buttonClickedRight.gif"), new Array("images/buttonDisabledLeft.gif","images/buttonDisabledCenter.gif","images/buttonDisabledRight.gif"), new Array("images/buttonClickedHoverLeft.gif","images/buttonClickedHoverCenter.gif","images/buttonClickedHoverRight.gif") ); buttonStyleArray1 = new Array("iflxButtonFactoryTextContainerNormal","iflxButtonFactoryTextContainerHover","iflxButtonFactoryTextContainerClicked","iflxButtonFactoryTextContainerDisabled"); // --> </script><nobr><img onclick="yesAction()" src="Offene%20Antr%C3%A4ge-Dateien/buttonNormalLeft.gif" class="iflxButtonFactoryImageLeft"><img onclick="yesAction()" src="Offene%20Antr%C3%A4ge-Dateien/buttonNormalCenter.gif" class="iflxButtonFactoryImageCenter" style="width: 113px;"><img onclick="yesAction()" src="Offene%20Antr%C3%A4ge-Dateien/buttonNormalRight.gif" class="iflxButtonFactoryImageRight"><span style="position:relative;width:1" class="iflxButtonFactoryTextContainerAnchor iflxButtonFactoryTextContainerAnchorFF"><button stylesarray="buttonStyleArray1" onmouseover="buttonHandler0.displayHover(this);" style="position: absolute; width: 121px; left: -121px; height: 20px; top: -20px;" onmouseout="buttonHandler0.displayNormal(this);" onclick="yesAction()" class="iflxButtonFactoryTextContainerOuter" buttonhandler="buttonHandler0" onmousedown="buttonHandler0.displayClick(this);" tabindex="0" imagesarray="buttonImageArray1" onmouseup="buttonHandler0.displayHover(this);" type="button"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="iflxButtonFactoryTextContainerNormal" style="white-space: nowrap" width="121" height="20">Ja</td></tr></tbody></table></button></span></nobr><script id="buttonOnloadId0" language="JavaScript"> <!-- if(document.getElementById('buttonOnloadId0')!= null){ buttonContainer = document.getElementById('buttonOnloadId0').previousSibling; buttonHandler0.adaptWidth(buttonContainer); buttonHandler0.adaptHeight(buttonContainer); } // --> </script></span> <span class="iflxButtonFinder"><nobr><img onclick="noAction()" src="Offene%20Antr%C3%A4ge-Dateien/buttonNormalLeft.gif" class="iflxButtonFactoryImageLeft"><img onclick="noAction()" src="Offene%20Antr%C3%A4ge-Dateien/buttonNormalCenter.gif" class="iflxButtonFactoryImageCenter" style="width: 113px;"><img onclick="noAction()" src="Offene%20Antr%C3%A4ge-Dateien/buttonNormalRight.gif" class="iflxButtonFactoryImageRight"><span style="position:relative;width:1" class="iflxButtonFactoryTextContainerAnchor iflxButtonFactoryTextContainerAnchorFF"><button stylesarray="buttonStyleArray1" onmouseover="buttonHandler0.displayHover(this);" style="position: absolute; width: 121px; left: -121px; height: 20px; top: -20px;" onmouseout="buttonHandler0.displayNormal(this);" onclick="noAction()" class="iflxButtonFactoryTextContainerOuter" buttonhandler="buttonHandler0" onmousedown="buttonHandler0.displayClick(this);" tabindex="0" imagesarray="buttonImageArray1" onmouseup="buttonHandler0.displayHover(this);" type="button"><table cellspacing="0" cellpadding="0"><tbody><tr><td class="iflxButtonFactoryTextContainerNormal" style="white-space: nowrap" width="121" height="20">Nein</td></tr></tbody></table></button></span></nobr><script id="buttonOnloadId1" language="JavaScript"> <!-- if(document.getElementById('buttonOnloadId1')!= null){ buttonContainer = document.getElementById('buttonOnloadId1').previousSibling; buttonHandler0.adaptWidth(buttonContainer); buttonHandler0.adaptHeight(buttonContainer); } // --> </script></span> </center> </body></html> But when I use Autoit to access this popup using $sTexts = _IEBodyReadHTML($oIE) the retrieved HTML is this: <SCRIPT language=JavaScript> window.open("askyesno.jsp?TitleText=requestcheck_title&QuestionText=requestcheck_question&YesText=requestcheck_yesText&NoText=requestcheck_noText&YesPage=setsuccessmain.jsp%3FSuccessMain%3Dwflistmain.jsp&NoPage=%2FWebClient%2Fiflx%2Fgenehmiger%2Fmain.jsp&YesAction=null&NoAction=null", "questionWindow", "dependent=yes,height=130,width=350,left=300,top=300"); </SCRIPT> I would like to click the "Nein" Button; so far I would use this code but _IETagNameGetCollection fails. Maybe because there is no button in the HTML seen by AutoIt. Local $buttons = _IETagNameGetCollection($oIE, "button") If @error Then $oIE.Quit() $IsSyncing = False Return EndIf For $button In $buttons If $button.className = "iflxButtonFactoryTextContainerOuter" & $button.innerHTML = "Nein" Then _IEAction($button, "click") EndIf Next Is there a way to ensure the SCRIPT part is executed and to access the button ? (It would also be good to call the JavaScript noAction() seen in the HTML directly) Thank you very much! Link to comment Share on other sites More sharing options...
Earthshine Posted January 17, 2018 Share Posted January 17, 2018 (edited) I would try IUIAutomation found in FAQ 31 FAQ Edited January 17, 2018 by Earthshine My resources are limited. You must ask the right questions 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