tommytx Posted May 4, 2013 Posted May 4, 2013 Can someone help me get back on track? I know the first line in the autoit file should be using the form element, but there is no form name or ID. so I would like to address it direct knowing the name of the selector.... Local $oSelect = _IEFormElementGetObjByName($oIE, "tomselector") Is this possible.. Html stuff... <select name=tomselector> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select> Autoit stuff Local $oSelect = _IE GetObjByName($oIE, "tomselector") _IEFormElementOptionselect($oSelect, "Mercedes", 1, "byText") Sleep(1000) _IEFormElementOptionselect($oSelect, "mercedes", 1, "byValue") Sleep(1000) _IEFormElementOptionselect($oSelect, 0, 1, "byIndex") Sleep(1000) I only need one method above to set the options, but I was trying all 3 to see if I could get anyone to work. Thanks
tommytx Posted May 4, 2013 Author Posted May 4, 2013 This is what my selector is wrapped in..and it might help some one help me figure out how to address the selector remotely by autoit. As you can see I don't have the normal form to reference and it has no name.. So is it possible to address the selector using the table which has no name but does have a class. <div class="form"> <table class="inner"> <select name=tomselector> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select> </table> </div>
Danp2 Posted May 4, 2013 Posted May 4, 2013 Run your code in SciTE and post the results from the Output window. Latest Webdriver UDF Release Webdriver Wiki FAQs
mikell Posted May 4, 2013 Posted May 4, 2013 (edited) There was a space left in the func '_IE GetObjByName ' Using a local htm file with your html stuff inside, this works for me #include <IE.au3> $oIE = _IECreate("file:///C:/Documents%20and%20Settings/user/desktop/1.htm") Sleep(1000) $oSelect = _IEGetObjByName($oIE, "tomselector") _IEFormElementOptionselect($oSelect, "Saab", 1, "byText") Sleep(1000) _IEFormElementOptionselect($oSelect, "mercedes", 1, "byValue") Sleep(1000) _IEFormElementOptionselect($oSelect, 3, 1, "byIndex") Edited May 4, 2013 by mikell
tommytx Posted May 5, 2013 Author Posted May 5, 2013 Thanks i guess I am over tired... I did not notice the space either.... works for me also now... Thanks again...
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