rio Posted April 19, 2014 Posted April 19, 2014 hi every one, i'm new to autoit and i want to automate login to a router interface via Chrome. can anyone help
Apples292 Posted April 19, 2014 Posted April 19, 2014 (edited) Would you be satisfied with something that simply entered the details when you pressed a required key? #Include <Misc.au3> While 1 If _IsPressed(70) Then ; Code 70 is the F1 key however you can use a different key by checking the helpfile for _IsPressed() Send("Username") Send({TAB}) Send("Password") EndIf sleep(10) WEnd Thanks Apples292 Edited April 19, 2014 by Apples292
rio Posted April 19, 2014 Author Posted April 19, 2014 this is what i came up with it works, but not really what i want cause the send function can write else where if I click with mouse #include <Constants.au3> Run("C:Program FilesGoogleChromeApplicationchrome.exe http://192.168.1.1") WinWait("[CLASS:Chrome_WidgetWin_1]", "",10) Sleep(2000) AutoItSetOption("SendKeyDelay",400) ;this is the user id send(" Menara") send ("{TAB}") ;this is the password send("Menara") send ("{ENTER}")
rio Posted April 19, 2014 Author Posted April 19, 2014 (edited) Apples292 thank you for your replay but its doesn't help Edited April 19, 2014 by rio
Apples292 Posted April 19, 2014 Posted April 19, 2014 (edited) No problem, I don't use Chrome so I don't have experience with the controls and handles of windows it uses but you could use the AutoIt Window Info tool to find the window class/name (looks like you've found it with this [CLASS:Chrome_WidgetWin_1]) and the handles of the two inputs on that window. Once you've done that you can either use ControlSetText ( "[CLASS:Chrome_WidgetWin_1]", "", $hUserIDControlHandle, "Menara") ControlSetText ( "[CLASS:Chrome_WidgetWin_1]", "", $hPasswordControlHandle, "Menara") Or ControlSend() Which uses a similar syntax Thanks Apples292 Edited April 19, 2014 by Apples292
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