mdcastle Posted April 26, 2012 Share Posted April 26, 2012 (edited) I'm trying to automate the selection of an <option value> in an IE form. The form I am automating does not have a "name" or "id" value so i can't use _IEFormGetObjByName and then _IEFormElementGetObjByName. So I have the following code: $oForm = _IEFormGetCollection($OpenIE, 0) $oSelect = _IEFormElementGetCollection($oForm) _IEFormElementOptionSelect($oSelect, "5449", 1, "byValue") I'd prefer to use _IEFormElementGetObjByName but $s_name is not static i.e. it could be "add_role_12345" or "add_role_54321", etc. Can anyone give me an example of how I can make this work? NB There is only one select box on the form. Many thanks in advance. Edited April 26, 2012 by mdcastle Link to comment Share on other sites More sharing options...
mdcastle Posted April 26, 2012 Author Share Posted April 26, 2012 solved by finding indexed instance using $iElemCnt = @extended $sMsg = "Element values:" & @CRLF $i = 0 For $oElem In $oSelect $sMsg &= $i & ": " & _IEFormElementGetValue($oElem) & @CRLF $i += 1 Next MsgBox(64, $iElemCnt & " Results", $sMsg) then amending $oSelect = _IEFormElementGetCollection($oForm) to $oSelect = _IEFormElementGetCollection($oForm, 10) 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