unity06 Posted November 2, 2013 Share Posted November 2, 2013 Hi Guys I am still relatively new to autoit. Have been trying to automate IE with limited success. But I have a question, I made a bot which tabs around the page and uses the status bar to identify various links, as it tabs around, it reads from status bar. But when bot runs onto a form entry box, status bar reads nothing. For instance on google page. The main entry box for search. How to get the name of it? Is there some way, to get its name while its highlighted/active? Like Get name of active element/control? I hope it makes sense, because I am getting pretty good at making it work with this tabbing method. Its just I am stuck with this bit, as status bar only shows links, but not names of entry boxes. Thanks Link to comment Share on other sites More sharing options...
michaelslamet Posted November 3, 2013 Share Posted November 3, 2013 Hi, You can use Developer Tools (F12) if you use IE, or use FireBug if you use Firefox. Link to comment Share on other sites More sharing options...
Danp2 Posted November 3, 2013 Share Posted November 3, 2013 What website are you trying to automate? Are you using the _IE functions? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
gruntydatsun Posted November 3, 2013 Share Posted November 3, 2013 (edited) have a look in the the help file for _IEFormElementSetValue (examples at foot of that document) get the firebug addon for firefox go to www.wikihow.com/macrame right click on the search box at the top select Inspect Element with Firebug check out the html for the form you want in the firebug window In this case it's: <form id="cse-search-box" action="/Special:GoogSearch"> <div> <input type="hidden" value="008953293426798287586:mr-gwotjmbs" name="cx"> <input type="hidden" value="FORID:10" name="cof"> <input type="hidden" value="UTF-8" name="ie"> <input type="text" x-webkit-speech="" class="search_box" value="" size="30" name="q" id="cse_q"> <input type="submit" onclick="gatTrack("Search","Search","Custom_search");" onmouseout="button_unswap(this);" onmouseover="button_swap(this);" class="search_button" value="Search" id="cse_sa"> </div> </form> So then this is the code to write something into the search box: #include <IE.au3> $oIE = _IECreate("www.wikihow.com/Macrame") ;open page in IE and get a handle to it Local $oForms = _IEFormGetCollection($oIE,1) ;get handle to form: 1 means get 2nd form on page Local $oQuery = _IEFormElementGetCollection($oForms,3) ;get handle to element: 3 means 4th element of that form _IEFormElementSetValue($oQuery,"Organic Lambswool Mirkin Patterns") ;put what you want into the field Remember the numbering starts at zero so element 4 has index number 3. Edited November 3, 2013 by gruntydatsun MikahS 1 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