Jump to content

Recommended Posts

Posted

Sorta new to Autoit, so please bare with me.

I have a password change window that will not allow me to tab out of the inactive username text field (username cannot be changed). I can tab manually using the keyboard. I've even tried selecting the password text box by ClassNNname and still no joy. Any help would be appreciated.

Func PasswordChange()
   Sleep(2000)
   _WinWaitActivate("Change Of Password Required","Required Access Cred")
      Local $isControlEnabled = ControlCommand("Change of Password Required", "", "[ClassnameNN:Edit1]")
         If $isControlEnabled = 0 Then
            Send("{TAB}")
            Sleep(1000)
            Send("examplepassword")
            Sleep(1000)
            Send("{TAB}")
            Sleep(1000)
            Send("examplepassword")
            Send("{TAB}")
            Send("{Enter}")
            Sleep(2000)
         Endif
EndFunc

pwbox.jpg

Posted

Is your code running to completion?

I imagine it could hang on your WinWait() and then your sends only take place if $isControlEnabled = 0 so have you check to see that variable is returning 0 as a value? 

I would just dumb it down and do a WinWait() WinActivate() and then Send() without all the extras.

You can also remove the Sleep() if things are moving too fast you can change the default send speed vai options.

 

https://www.autoitscript.com/autoit3/docs/functions/AutoItSetOption.htm

 

Posted

You can get the handle of the editboxs and then use ControlSetText

 

Saludos

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...