13lack13lade 22 Posted July 21, 2014 (edited) Hi Guys, How can i use autoit to interact with this website? Its a website i use at work well, am trying to automate i currently use sendkeys because i could not get FF UDF to work as im not sure how to identify which element im trying to interact with... I've took a screen shot.. and the problem is all the buttons, all the headings etc all have the same name, class, id, or its not shown.. If anyone could enlighten me if this is actually possible or not and if so, how do i get a unique identifier, i have tried myself with Firebug & Mozrepl all show the same thing.. Still learning how to code and havent done much with HTML / Web programming... *EDIT* needs to be done in firefox or chrome.. however havent had any luck with chrome automation and the website doesnt work in IE. Thanks guys!!!!!! Edited July 21, 2014 by 13lack13lade Share this post Link to post Share on other sites
Danp2 878 Posted July 22, 2014 Can you post the page's HTML? Also, I couldn't tell from your description exactly which buttons you are attempting to press. [UDF] WebDriver Latest version Wiki FAQs Share this post Link to post Share on other sites
13lack13lade 22 Posted July 23, 2014 Ultimately, i want to be able to press any of the buttons (as i need to automate a lot of stuff and cant get access directly to the database) as you can see the 'button' i have pressed in the screenshot is location. This is the source code, is that what you mean by HTML? expandcollapse popup<!doctype html> <html> <head> <!-- support chrome frame --> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=IE8" > <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="Expires" content="-1"> <link type="text/css" rel="stylesheet" href="cpl.css"> <link rel="stylesheet" href="leaflet/leaflet.css"> <!--[if lte IE 8]> <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.1/leaflet.ie.css" /> <![endif]--> <link rel="stylesheet" href="leaflet/leaflet.draw.css"> <title>CPL</title> <script type="text/javascript" language="javascript" src="jquery-1.8.2.min.js"></script> <script type="text/javascript" language="javascript" src="jquery-slimScroll.js"></script> <script type="text/javascript" language="javascript" src="jquery-ui-1.9.0.custom.min.js"></script> <script type="text/javascript" language="javascript" src="cpl/cpl.nocache.js"></script> <script type="text/javascript" language="javascript" src="leaflet/leaflet.js"></script> <script type="text/javascript" language="javascript" src="leaflet/leaflet.draw.js"></script> <script type="text/javascript" language="javascript" src="jquery.scrollTo-1.4.3.1-min.js"></script> <script type="text/javascript" language="javascript" src="js/tinymce/tinymce.js"></script> <script type="text/javascript"> $j = jQuery.noConflict(); var _gaq = _gaq || []; _gaq.push(['_setAccount', '']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); function initEditableTinyMCE() { tinyMCE.init({ theme : "modern", skin : "lightgray", mode : "exact", menubar : false, toolbar: "bold italic underline | numlist bullist indent outdent | link unlink", plugins: ["link paste wordcount"], statusbar : false, verify_html : true, paste_strip_class_attributes : true, convert_newlines_to_brs : true, valid_elements : '-strong/b,-em/i,-span[style],-p[style],-ol,-ul,-li,-h1,-h2,-h3,-table,-tr,-td[colspan|rowspan],-th,' + '-thead,-tfoot,-tbody,-a[href|name],sub,sup,strike,br', setup: function(editor) { // Backspace is not detected in keypress, so need to include keyup event as well. editor.on('keypress change keyup focus', function(ed) { $j("#" + editor.id).trigger(ed.type); }); editor.on('blur', function(ed) { editor.save(); $j("#" + editor.id).blur(); }); editor.on('BeforeSetContent', function(ed) { if (ed.content) { ed.content = ed.content.replace(/\t/ig, ' '); } }); editor.on('init', function(ed) { editor.getBody().style.backgroundColor = "#FFFFFF"; }); } }); }; function initEditableTinyMCEBasic() { tinyMCE.init({ theme : "modern", skin : "lightgray", mode : "exact", menubar : false, toolbar: "bold", plugins: ["link paste wordcount"], statusbar : false, verify_html : true, paste_strip_class_attributes : true, convert_newlines_to_brs : true, forced_root_block : false, width: "100%", height: 400, force_p_newlines : false, valid_elements : '-strong/b,-em/i,-span[style],-p[style],-ol,-ul,-li,-h1,-h2,-h3,-table,-tr,-td[colspan|rowspan],-th,' + '-thead,-tfoot,-tbody,-a[href|name],sub,sup,strike,br', setup: function(editor) { // Backspace is not detected in keypress, so need to include keyup event as well. editor.on('keypress change keyup focus', function(ed) { $j("#" + editor.id).trigger(ed.type); }); editor.on('blur', function(ed) { editor.save(); $j("#" + editor.id).blur(); }); editor.on('BeforeSetContent', function(ed) { if (ed.content) { ed.content = ed.content.replace(/\t/ig, ' '); } }); editor.on('init', function(ed) { editor.getBody().style.backgroundColor = "#FFFFFF"; }); } }); }; function initReadonlyTinyMCE() { tinyMCE.init({ theme : "modern", skin : "lightgray", mode : "exact", toolbar: false, menubar : false, statusbar : false, readonly: true, setup: function(editor) { editor.on('init', function(ed) { editor.getBody().style.backgroundColor = "#EBEBE4"; }); } }); }; </script> <!-- <link rel="stylesheet" type="text/css" href="/cpl/css/cpl-static.css"/> --> </head> <body> <iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe> <iframe id="popupShim" src="about:blank" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; width:0px; height: 0px; display:none; background-color:white; z-index:1000;"></iframe> <iframe id="jamGlass" src="about:blank" scrolling="no" frameborder="0" allowTransparency="true" style="position:absolute; top:0px; left:0px; width:0px; height: 0px; display:none; background-color:white; z-index:1000;"></iframe> <noscript> <div style="width: 22em; position: absolute; left: 50%; ; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif"> Your web browser must have JavaScript enabled in order for this application to display correctly. </div> </noscript> <div id="main" ></div> </body> </html> Share this post Link to post Share on other sites
13lack13lade 22 Posted July 23, 2014 Or did you mean this: expandcollapse popup<!DOCTYPE html> <html> <head></head> <body class="dragdrop-dropTarget dragdrop-boundary"> <iframe id="__gwt_historyFrame" style="position:absolute;width:0;height:0;border:0" tabindex="-1" src="javascript:''"></iframe> <iframe id="popupShim" frameborder="0" style="position:absolute; top:0px; left:0px; width:0px; height: 0px; display:none; background-color:white; z-index:1000;" scrolling="no" src="about:blank"></iframe> <iframe id="jamGlass" frameborder="0" style="position:absolute; top:0px; left:0px; width:0px; height: 0px; display:none; background-color:white; z-index:1000;" allowtransparency="true" scrolling="no" src="about:blank"></iframe> <noscript></noscript> <div id="main"> <div style="position: relative; width: 1680px; height: 426px;"> <div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true"></div> <div style="position: absolute; overflow: hidden; left: 0px; top: 0px; right: 0px; bottom: 0px;"> <div class="gwt-SplitLayoutPanel" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;"> <div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true"></div> <div style="position: absolute; overflow: hidden; left: 0px; top: 0px; bottom: 0px; width: 55px;"></div> <div style="position: absolute; overflow: hidden; left: 55px; top: 0px; bottom: 0px; width: 8px;"></div> <div style="position: absolute; overflow: hidden; left: 63px; top: 0px; right: 0px; bottom: 0px;"> <div class="calypso_width" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;"> <div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true"></div> <div style="position: absolute; overflow: hidden; left: 0px; top: 0px; right: 0px; bottom: 0px;"> <div style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;"> <div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true"></div> <div style="position: absolute; overflow: hidden; left: 0px; top: 0px; width: 100%; height: 100%;"> <div class="GCCYTXTCAJ" style="overflow: auto; position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;"> <div style="position: relative;"> <div class="cplEntryPanel" style="position: relative; width: 1617px; height: 426px;"> <div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true"></div> <div style="position: absolute; overflow: hidden; left: 0px; top: 0px; right: 0px; height: 30px;"></div> <div style="position: absolute; overflow: hidden; left: 0px; top: 30px; right: 0px; bottom: 0px;"> <div class="hdcContent" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;"> <div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true"></div> <div style="position: absolute; overflow: hidden; left: 0px; top: 0px; width: 100%; height: 100%;"> <div style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;"> <div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true"></div> <div class="hdcMenuBarArea" style="position: absolute; overflow: hidden; left: 0px; top: 0px; right: 0px; height: 56px;"></div> <div style="position: absolute; overflow: hidden; left: 0px; top: 56px; right: 0px; bottom: 0px;"> <div class="propertyModulePanel" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;"> <div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true"></div> <div style="position: absolute; overflow: hidden; left: 0px; top: 0px; width: 100%; height: 100%;"> <div style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;" aria-hidden="false"> <div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true"></div> <div style="position: absolute; overflow: hidden; top: 0px; right: 0px; bottom: 0px; width: 12px;"></div> <div style="position: absolute; overflow: hidden; left: 0px; top: 0px; bottom: 0px; width: 12px;"></div> <div style="position: absolute; overflow: hidden; left: 12px; top: 0px; right: 12px; height: 75px;"></div> <div style="position: absolute; overflow: hidden; left: 12px; top: 75px; right: 12px; height: 33px;"> <table class="propertyEdit titlePanel" cellspacing="0" cellpadding="0" style="height: 100%; width: 100%; position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;"> <tbody> <tr> <td align="left" style="vertical-align: top;"> <table class="PropertyEditTitleBar" cellspacing="0" cellpadding="0" style="height: 100%;"> <tbody> <tr> <td align="left" style="vertical-align: top;"> <div> <input type="text" tabindex="-1" role="presentation" style="opacity: 0; height: 1px; width: 1px; z-index: -1; overflow: hidden; position: absolute;"></input> <div class="GCCYTXTCPJ clipboardWidget"> <div></div> <div class="GCCYTXTCOJ clipboardIconArea"> <img class="clipboardIcon" border="0" style="width: 15px; height: 23px; background: url("data:image/png;b…uQmCC") no-repeat scroll 0px 0px transparent; display: none;" src="https://www.calypso.net.au/apps/cpl/76.5/fcl/cpl/clear.cache.gif" onload="this.__gwtLastUnhandledEvent="load";" aria-hidden="true"></img> </div> </div> </div> </td> <td align="left" style="vertical-align: top;"> <div> <input type="text" tabindex="-1" role="presentation" style="opacity: 0; height: 1px; width: 1px; z-index: -1; overflow: hidden; position: absolute;"></input> <div class="GCCYTXTCPJ clipboardWidget"> <div> <div class="headerStyle button headerStyle-up" tabindex="0" role="button" aria-pressed="false"> <input type="text" tabindex="-1" role="presentation" style="opacity: 0; height: 1px; width: 1px; z-index: -1; overflow: hidden; position: absolute;"></input> <div class="html-face"></div> </div> </div> <div class="GCCYTXTCOJ clipboardIconArea"></div> </div> </div> </td> <td align="left" style="vertical-align: top;"> <div> <input type="text" tabindex="-1" role="presentation" style="opacity: 0; height: 1px; width: 1px; z-index: -1; overflow: hidden; position: absolute;"></input> <div class="GCCYTXTCPJ clipboardWidget"> <div> <div class="headerStyle button selected headerStyle-up" tabindex="0" role="button" aria-pressed="false"> <input type="text" tabindex="-1" role="presentation" style="opacity: 0; height: 1px; width: 1px; z-index: -1; overflow: hidden; position: absolute;"></input> <div class="html-face"></div> </div> </div> <div class="GCCYTXTCOJ clipboardIconArea"></div> </div> </div> </td> <td align="left" style="vertical-align: top;"></td> <td align="left" style="vertical-align: top;"></td> <td align="left" style="vertical-align: top;"></td> <td align="left" style="vertical-align: top;"></td> <td align="left" style="vertical-align: top;"></td> <td align="left" style="vertical-align: top;"></td> <td align="left" style="vertical-align: top;"></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </div> <div style="position: absolute; overflow: hidden; left: 12px; right: 12px; bottom: 0px; height: 12px;"> <div style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;"></div> </div> <div style="position: absolute; overflow: hidden; left: 12px; right: 12px; bottom: 12px; height: 33px;"> <div class="propertyEdit footerPanel" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;"> <div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true"></div> <div style="position: absolute; overflow: hidden; left: 0px; top: 0px; bottom: 0px; width: 230px;"></div> <div style="position: absolute; overflow: hidden; top: 0px; right: 0px; bottom: 0px; width: 230px;"></div> <div style="position: absolute; overflow: hidden; left: 230px; top: 0px; right: 230px; bottom: 0px;"> <div class="propertyEdit lastEdited" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;"></div> </div> </div> </div> <div style="position: absolute; overflow: hidden; left: 12px; top: 108px; right: 12px; bottom: 45px;"> <div class="propertyEdit workPanel" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;"> <div style="position: absolute; z-index: -32767; top: -20ex; width: 10em; height: 10ex; visibility: hidden;" aria-hidden="true"></div> <div style="position: absolute; overflow: hidden; left: -100%; top: 0%; width: 100%; height: 100%; display: none;"></div> <div style="position: absolute; overflow: hidden; display: none; left: 0px; top: 0px; right: 0px; bottom: 0px;"></div> <div style="position: absolute; overflow: hidden; left: 0%; top: 0%; width: 100%; height: 100%;"> <div class="locationTab tabDetailContent" style="overflow: auto; position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px;" aria-hidden="false"> <div style="position: relative;"> <table class="dataEntryArea" cellspacing="0" cellpadding="0"> <tbody> <tr> <td align="left" style="vertical-align: top;"> <table cellspacing="0" cellpadding="0"> <tbody> <tr> <td align="left" style="vertical-align: top;"> <div> <div id="locationTabContent"> <div class="greyBox"> <table cellspacing="0"> <tbody> <tr> <td></td> <td> <div class="gwt-Label"></div> <table class="cplValueBoxEditorDecoratorPanel" cellspacing="0" cellpadding="0"></table> </td> <td> <div class="gwt-Label"></div> <table class="cplValueBoxEditorDecoratorPanel" cellspacing="0" cellpadding="0"> <tbody> <tr> <td align="left" style="vertical-align: top;"> <div class="valueBoxEditorDecorator contents"> <input class="gwt-TextBox gwt-TextBox-readonly" type="text" maxlength="30" style="width: 214px;" readonly=""></input> </div> </td> </tr> <tr></tr> <tr></tr> </tbody> </table> </td> </tr> </tbody> </table> <table cellspacing="0"></table> <table class="statePostcodeCountry" cellspacing="0"></table> </div> <div class="greyBox voucherArea"></div> <div class="greyBox voucherSpacer"></div> </div> </div> </td> </tr> </tbody> </table> </td> <td align="left" style="vertical-align: top;"> <table cellspacing="0" cellpadding="0" style="height: 475px; width: 400px;"> <tbody> <tr> <td align="left" style="vertical-align: top;"> <div class="leaflet-container leaflet-fade-anim" style="height: 420px; width: 400px; position: relative;" aria-hidden="false" tabindex="0"> <div class="leaflet-map-pane" style="transform: translate(0px, 0px);"> <div class="leaflet-tile-pane"> <div class="leaflet-layer"> <div class="leaflet-tile-container"></div> <div class="leaflet-tile-container leaflet-zoom-animated"> <img class="leaflet-tile leaflet-tile-loaded" style="height: 256px; width: 256px; transform: translate(7px, -16px);" src="http://c.tile.osm.org/15/30313/18988.png"></img> <img class="leaflet-tile leaflet-tile-loaded" style="height: 256px; width: 256px; transform: translate(7px, 240px);" src="http://a.tile.osm.org/15/30313/18989.png"></img> <img class="leaflet-tile leaflet-tile-loaded" style="height: 256px; width: 256px; transform: translate(-249px, -16px);" src="http://b.tile.osm.org/15/30312/18988.png"></img> <img class="leaflet-tile leaflet-tile-loaded" style="height: 256px; width: 256px; transform: translate(263px, -16px);" src="http://a.tile.osm.org/15/30314/18988.png"></img> <img class="leaflet-tile leaflet-tile-loaded" style="height: 256px; width: 256px; transform: translate(-249px, 240px);" src="http://c.tile.osm.org/15/30312/18989.png"></img> <img class="leaflet-tile leaflet-tile-loaded" style="height: 256px; width: 256px; transform: translate(263px, 240px);" src="http://b.tile.osm.org/15/30314/18989.png"></img> </div> </div> </div> <div class="leaflet-objects-pane"></div> </div> <div class="leaflet-control-container"></div> </div> </td> </tr> <tr></tr> </tbody> </table> </td> </tr> </tbody> </table> </div> </div> </div> <div style="position: absolute; overflow: hidden; display: none; left: 0px; top: 0px; right: 0px; bottom: 0px;"></div> <div style="position: absolute; overflow: hidden; display: none; left: 0px; top: 0px; right: 0px; bottom: 0px;"></div> <div style="position: absolute; overflow: hidden; display: none; left: 0px; top: 0px; right: 0px; bottom: 0px;"></div> <div style="position: absolute; overflow: hidden; display: none; left: 0px; top: 0px; right: 0px; bottom: 0px;"></div> <div style="position: absolute; overflow: hidden; display: none; left: 0px; top: 0px; right: 0px; bottom: 0px;"></div> <div style="position: absolute; overflow: hidden; display: none; left: 0px; top: 0px; right: 0px; bottom: 0px;"></div> <div style="position: absolute; overflow: hidden; display: none; left: 0px; top: 0px; right: 0px; bottom: 0px;"></div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <iframe id="cpl" src="javascript:''" style="position: absolute; width: 0px; height: 0px; border: medium none;" tabindex="-1"></iframe> <div style="display: none;" aria-hidden="true"></div> <div style="position: absolute; z-index: -32767; top: -20cm; width: 10cm; height: 10cm; visibility: hidden;" aria-hidden="true"></div> </body> </html> Share this post Link to post Share on other sites
Danp2 878 Posted July 23, 2014 Neither of those is exactly what I want, although the 2nd is closer than the first. I'm trying to get you to provide that html source so that we can load the page and see exactly what you are seeing. In FireFox, you can try pressing Ctrl+S and select Web Page, HTML only. Once you have the file saved, double click on it to open it in the browser and check if the equivalent of the original page is displayed. From the code you posted above, I see that there are some iframes involved. That could complicate things... Dan [UDF] WebDriver Latest version Wiki FAQs Share this post Link to post Share on other sites
13lack13lade 22 Posted July 23, 2014 (edited) Saved it, opened it, just appeared to be a blank screen... ? Yeah i have a feeling that this is way over my head.. might have to stick to controlsend, however having lots of issues with creating a robust script this way.. Edited July 23, 2014 by 13lack13lade Share this post Link to post Share on other sites