Jump to content

Web Form on Mozilla Firefox, passing credentials


Faraz
 Share

Recommended Posts

I have to open a URL on Mozilla Firefox , cursor is by default userid textbox, had to send userid, send tab, send pwd with flag 1 , send tab, send Enter.

But Script is Failing to take Password.

Any Help

 

#include <Constants.au3>
#include <IE.au3>
#include <PassMask.au3>

If $CmdLine[0] <> 3 Then
    MsgBox($MB_OK, "Usage", "ps_weblogin_FireFox <Url> <Browser Title> <Text to Send>")
Else
   web_login($CmdLine[1], $CmdLine[2], $CmdLine[3])
EndIf

Func web_login($bt_url, $bt_Title, $bt_SendText)

    Local $ff = Run("C:\Program Files (x86)\Mozilla Firefox\firefox.exe " & $bt_url)
        WinWaitActive($bt_Title)
    Sleep(2000)
    ControlSend("","","",$bt_SendText)

EndFunc

_______________________________________________
_______________________________________________

Func Mask_Password($Password)
    $MaskPassword = $Password
    $MaskPassword = StringReplace($MaskPassword, "#", "||||||#@@@@@@")
    $MaskPassword = StringReplace($MaskPassword, "!", "||||||!@@@@@@")
    $MaskPassword = StringReplace($MaskPassword, "+", "||||||+@@@@@@")
    $MaskPassword = StringReplace($MaskPassword, "^", "||||||^@@@@@@")
    $MaskPassword = StringReplace($MaskPassword, "{", "||||||{@@@@@@")
    $MaskPassword = StringReplace($MaskPassword, "}", "||||||}@@@@@@")
    $MaskPassword = StringReplace($MaskPassword, "||||||", "{")
    $MaskPassword = StringReplace($MaskPassword, "@@@@@@", "}")
    Return $MaskPassword
EndFunc

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

×
×
  • Create New...