Jump to content

Authentication Required in Firefox & IE


prorated
 Share

Recommended Posts

Hello,

I have a simple problem when running into firefox, IE, chrome and other browser sites asking for authentication. The problem I'm having is when a user puts in the wrong information for the proxy authentication, if proxy info. is wrong than it doesn't successfully continues the script. I can't seem to find the right statement (while, Elseif.....) to re prompt the user for authentication information than continue the script or if they don't need to put in the proxy information to continue the script.

*I Have tried many things but don't know the right syntax for the script*

$password=InputBox("Enter password","Please Enter Your Password", "", "*")
$proxy=InputBox("Enter Proxy Pin Number", "Please Enter Your Proxy Pin Number", "", "*")
shellExecute("@ProgramFilesDir&"\Mozilla Firefox\firefox.exe", "http://www.google.com")
WinWaitActive("Authentication Required")
Send(@username)
Send("{Tab}")
Send($proxy)
Sleep(500)
Send("{Enter}")
;--PROBLEM ZONE ---     So if they put in the wrong info when prompt at first than i wanted it to go to go back and re-prompt and continue the rest of the script
While WinWaitActive("Authentication Required")
    Send(@username)
    Send("{Tab}")
    $proxy=InputBox("Proxy Pin #", "Your PIN was incorrect, please re-enter", "", "*")
    Send($proxy)
    Send("{Enter}")
    WEnd
WinWaitActive("Google - Mozilla Firefox") 
Send("!d")
Send("SITE:URL{Enter}")
Sleep(1000)

Please help with the correct statment i should use or how i should go about it

Link to comment
Share on other sites

Hello,

I have a simple problem when running into firefox, IE, chrome and other browser sites asking for authentication. The problem I'm having is when a user puts in the wrong information for the proxy authentication, if proxy info. is wrong than it doesn't successfully continues the script. I can't seem to find the right statement (while, Elseif.....) to re prompt the user for authentication information than continue the script or if they don't need to put in the proxy information to continue the script.

*I Have tried many things but don't know the right syntax for the script*

$password=InputBox("Enter password","Please Enter Your Password", "", "*")
$proxy=InputBox("Enter Proxy Pin Number", "Please Enter Your Proxy Pin Number", "", "*")
shellExecute("@ProgramFilesDir&"\Mozilla Firefox\firefox.exe", "http://www.google.com")
WinWaitActive("Authentication Required")
Send(@username)
Send("{Tab}")
Send($proxy)
Sleep(500)
Send("{Enter}")
;--PROBLEM ZONE ---     So if they put in the wrong info when prompt at first than i wanted it to go to go back and re-prompt and continue the rest of the script
While WinWaitActive("Authentication Required")
    Send(@username)
    Send("{Tab}")
    $proxy=InputBox("Proxy Pin #", "Your PIN was incorrect, please re-enter", "", "*")
    Send($proxy)
    Send("{Enter}")
    WEnd
WinWaitActive("Google - Mozilla Firefox") 
Send("!d")
Send("SITE:URL{Enter}")
Sleep(1000)

Please help with the correct statment i should use or how i should go about it

You just put it in a While loop so it does it over and over, and when you detect success do ExitLoop to get out of the loop and continue the script.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

You just put it in a While loop so it does it over and over, and when you detect success do ExitLoop to get out of the loop and continue the script.

:)

Yes very true, should have put a some better code into the field but im just getting :) over the hole thing. I have put ExitLoop into my script but still it hasn't work exactly like i need it to. The page comes up than it ask for your proxy information, if proxy info was put in wrong it will re-prompt the user than exit the loop but if some one has already put there proxy information into the window i can't get to continue the script. So i guess what i need to know is if one window or another pops up do the proxy and one to say continue the script __what would be the code for that be o:) -me __

Link to comment
Share on other sites

Yes very true, should have put a some better code into the field but im just getting :) over the hole thing. I have put ExitLoop into my script but still it hasn't work exactly like i need it to. The page comes up than it ask for your proxy information, if proxy info was put in wrong it will re-prompt the user than exit the loop but if some one has already put there proxy information into the window i can't get to continue the script. So i guess what i need to know is if one window or another pops up do the proxy and one to say continue the script __what would be the code for that be o:) -me __

If the dialog is conditional (may or may not occur, or re-occur) then set up an AdLibEnable() function to watch for it and handle it if the need arises.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

:)

While i got my Authentication problem resolved, seems to be simpler than I made it. I ended up just using the While WinExists() to get it going and skipped asking for the proxy password from the start even though that would be cool.

$password=InputBox("Enter password","Please Enter Your Password", "", "*")
shellExecute("C:\Documents and Settings\"&@UserName&"\Desktop\Computer Software\FirefoxPortableTest\FirefoxPortable.exe", "http://www.google.com")
Sleep(1000)
While WinExists("Authentication Required") = 1
        $proxy=InputBox("Proxy Pin #", "Please put your own ", "", "*") 
        Send(@username)
    Send("{Tab}")
    Send($proxy)
    Send("{Enter}")
    Sleep(1000)
    WEnd
WinWaitActive("Google - Mozilla Firefox") 
Send("!d")
Send("https://siteaddress{Enter}")

Thanks for the help!

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