Sign in to follow this  
Followers 0
rio

automate log-in on chrome

5 posts in this topic

hi every one, i'm new to autoit :( and i want to automate login to a router interface via Chrome.

can anyone help

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by Apples292

Share this post


Link to post
Share on other sites
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}")

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Apples292

thank you for your replay but its doesn't help

Edited by rio

Share this post


Link to post
Share on other sites

#5 ·  Posted (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 by Apples292

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0