DrRobert Posted June 7, 2014 Share Posted June 7, 2014 (edited) I've written a script in vbs and now have been told it needs to be in autoit. I have never used autoit untill today.i have managed to get my web pages username and password in. but cant get it to click.bellow is my vbscriptDim IE Set IE = CreateObject("InternetExplorer.Application") Set WshShell = Wscript.CreateObject("Wscript.Shell") IE.Visible = 3 IE.FullScreen = True IE.navigate "[url=https://xxxxxxxxxxxxx]https://xxxxxxxxxxxxx"[/url] Do While (IE.Busy) WScript.Sleep 10 Loop Set Helem = IE.document.getElementByID("UserName") Helem.Value = "" Set Helem = IE.document.getElementByID("Password") Helem.Value = "" 'set Helem = IE.document.getElementByID("LogIn") set objForms = IE.document.getElementsByTagName("form") set objForm = objForms(0) for each objField in objForm if (objField.type = "submit") then objField.Click end if nextmy autoit script looks like this#include <IE.au3> $oIE = _IECreate("url") $oForm = _IEFormGetObjByName($oIE, 0) Local $oQuery = _IEFormElementGetObjByName($oForm, "UserName") _IEFormElementSetValue($oQuery, "username") Local $oQuery1 = _IEFormElementGetObjByName($oForm, "Password") _IEFormElementSetValue($oQuery1, "password") so i am missing the set objForms = IE.document.getElementsByTagName("form") set objForm = objForms(0) for each objField in objForm if (objField.type = "submit") then objField.Click end if nextany help will deserve a n internet beer Edited June 7, 2014 by Melba23 Addedcode tags Link to comment Share on other sites More sharing options...
butterfly Posted June 7, 2014 Share Posted June 7, 2014 Hello and welcome to the forums, please edit your post and click the blue icon and paste your code in between, it helps us read your code better Link to comment Share on other sites More sharing options...
lorenkinzel Posted June 7, 2014 Share Posted June 7, 2014 For some time, web browsers were quite the fad in the forums. A search for them should get you a fully functional browser script. Go for it!! (& return with any questions). Link to comment Share on other sites More sharing options...
Danp2 Posted June 7, 2014 Share Posted June 7, 2014 Did you try this? _IEFormSubmit($oForm) Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
DrRobert Posted June 10, 2014 Author Share Posted June 10, 2014 (edited) just let follow up this, i fixed it. i realised how close to vbscript autoit commands can be. so imanaged to get my click/submit command sorted $oFormElements = _IEFormElementGetCollection ( $oForm ) For $oFormElement In $oFormElements If $oFormElement.type = 'submit' Then _IEAction ($oFormElement, "click") EndIf Next Edited June 10, 2014 by DrRobert 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