Jump to content

Recommended Posts

Posted

hello, I'm new to autoit and I need help to automate a login to a page of my work,
the problem is that it is for many people and I dont know how to do it so that the text box can be edited, 
and then with a button it is sent to the user/password box. Thanks

 

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Users\Santiago\Desktop\Form1.kxf
Global $Form1 = GUICreate("Login user", 306, 233, -1, -1)
Global $Input1 = GUICtrlCreateInput("Input1", 119, 43, 138, 21)
Global $Input2 = GUICtrlCreateInput("Input2", 119, 90, 138, 21)
Global $Label1 = GUICtrlCreateLabel("Username", 48, 47, 52, 17)
Global $Label2 = GUICtrlCreateLabel("Password", 49, 92, 50, 17)
Global $Login = GUICtrlCreateButton("Login", 174, 147, 107, 26)
Global $Clear = GUICtrlCreateButton("Clear", 30, 147, 107, 26)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

         Case $Login
            Login()
    EndSwitch
WEnd

Func Login()

Global $username = "1234"
Global $password = "5678"

WinActivate("Untitled: Notepad", "")
;
Send($username)
Sleep(10)
Send("{TAB}")
Sleep(10)
Send($password)
Sleep(10)
Send("{ENTER}")
endfunc

 

Posted
Posted
  On 3/1/2019 at 4:26 PM, Nine said:

If I understand you correctly, you want to send the content of Input1 and Input2 to some windows ?  (in your example it is notepad) Right ?  But you don't know how to read those 2 fields ?

Expand  

Yes, exactly

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
  • Recently Browsing   0 members

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