ChapoX Posted July 16, 2012 Share Posted July 16, 2012 Hi Guys, 1st time poster here.So I am trying to "click" a button in IE and was going to use _IEGetObjById and _IEAction($ , "Click")But the button I want to click on does not have a name when I view the source of the page.It does appear that the button is attatched to a function on the page, so it would be great if I could "click" the button, or run the function on the page.Below is extracts of the source. The details of the button, and the function the button is assigned to, is in bold and underlined.Any help would be awesome.<td><input class="button" type="button" value="Scheduler" onclick="doSchedule()"> <input class="button" type="button" value="Write To CSV" onclick="getCSV()"></td><script language="Javascript"><!--function submitaction (action){document.form1.submit();}function getCSV (){document.form1.action="RptCSV.jsp";submitaction ("");}function doSchedule (){document.form1.action="TaskAdd.jsp";submitaction ("");}--></script> Link to comment Share on other sites More sharing options...
Juvigy Posted July 16, 2012 Share Posted July 16, 2012 Get all 'input' elements with _IETagNameGetCollection , loop trough them and compare its value to "Write To CSV" and then _IEAction($ , "Click")The other option you can try is to call the "getCSV()" function. Link to comment Share on other sites More sharing options...
ChapoX Posted July 17, 2012 Author Share Posted July 17, 2012 Thanks for that. Ended up getting it working with _IETagNameGetCollection $Tag = _IETagNameGetCollection($IE_Page, "input") For $oInput In $Tag If $oInput.value = "Write To CSV" Then $Button = $oInput ExitLoop EndIf Next _IEAction (Button, "click") Link to comment Share on other sites More sharing options...
TJ123 Posted July 17, 2012 Share Posted July 17, 2012 I have had an issue with some controls that do not show a Name or ID when I use AutoIt Window Info Tool on them. I am wondering if I could use similar code to find the Name/ID, or otherwise reference these controls. Any ideas are appreciated. TJ. Link to comment Share on other sites More sharing options...
Juvigy Posted July 17, 2012 Share Posted July 17, 2012 Sometimes elements dont have NAME or ID. Then you have to get creative using .InnerText or .InnerHTML or.Value in the above example. It all depends on the HTML code. 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