Jump to content

automate log-in on chrome


rio
 Share

Recommended Posts

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

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...