3mustgetbeers Posted December 1, 2013 Share Posted December 1, 2013 Hi all, Just trying to get to grips with the IE UDF but struggling a little All I want to do is populate an input box, for example google. I am looking at the examples and came across "_IEFormSubmit" in the help file; and specifically the example "_IEFormElementGetObjByName". When I run this example script Google opens but nothing is searched for. The code is: #include <IE.au3> Local $oIE = _IECreate("http://www.google.com") Local $oForm = _IEFormGetObjByName($oIE, "f") Local $oQuery = _IEFormElementGetObjByName($oForm, "q") _IEFormElementSetValue($oQuery, "AutoIt IE.au3") _IEFormSubmit($oForm) And the console errors are: --> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop --> IE.au3 V2.4-0 Warning from function _IEFormGetObjByName, $_IEStatus_NoMatch --> IE.au3 V2.4-0 Error from function _IEFormElementGetObjByName, $_IEStatus_InvalidDataType --> IE.au3 V2.4-0 Error from function _IEFormElementSetValue, $_IEStatus_InvalidDataType --> IE.au3 V2.4-0 Error from function _IEFormSubmit, $_IEStatus_InvalidDataType As I say, I am just really getting started with the IE UDF so I'm at a bit of a loss to this, can anyone advise why the example isn't working for me - I haven't changed anything. And also, does anybody have a simple script that will perform a Google search just to get me started? Thanks! 3mgb Link to comment Share on other sites More sharing options...
Solution karlkar Posted December 1, 2013 Solution Share Posted December 1, 2013 The name of the form and of input. They are different. Check them in (developer tool F12 in IE) or firebug in FF. Link to comment Share on other sites More sharing options...
3mustgetbeers Posted December 2, 2013 Author Share Posted December 2, 2013 Hi Karlkar, Thanks for that, you're quite right, amending the form name to "gbqf" makes this work. Out of interest, is it possible to do a partial match on the form name - in this case, for example "gbq*" ?? Thanks again Link to comment Share on other sites More sharing options...
karlkar Posted December 2, 2013 Share Posted December 2, 2013 No, I'm afraid it is not possible Link to comment Share on other sites More sharing options...
Danp2 Posted December 2, 2013 Share Posted December 2, 2013 Actually, you could do it by calling _IEFormGetCollection and then looping through the collection for forms with matching names. karlkar 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
3mustgetbeers Posted December 4, 2013 Author Share Posted December 4, 2013 Thanks both, further reading for me 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