Jump to content
Sign in to follow this  
Peace

Click OK on Firefox Certificate popup prompt

Recommended Posts

Peace

Hello all,

I just found out about AutoIt yesterday and tried to write a simple script to click on the "OK" button whenever starting a Firefox web browser generates a Certificate pop-up prompt. I'm trying out Selenium RC in Java testing a HTTPS web apps and called an AutoIt compiled .exe file. However, it doesn't seem it recognize the pop-up box.

--- My Java code to call AutoIt script ---

Runtime rt = Runtime.getRuntime();

rt.exec("C:\\AutoIt\\clickOK.exe");

--- My AutoIt script -----

; Wait for the window to become active

If WinExists("Security Error: Domain Name Mismatch") Then

; Click the "OK" button

;MsgBox(0, "Pop up Box Found!", "Pop Up Box Body Text", 5)

;ControlClick("Security Error:Domain Name Mismatch", "OK", "")

WinWaitActive("Security Error: Domain Name Mismatch", "&OK")

Send("!s")

EndIf

Any ideas and suggestions are greatly appreciated.

Thanks!

Share this post


Link to post
Share on other sites
PsaltyDS

Hello all,

I just found out about AutoIt yesterday and tried to write a simple script to click on the "OK" button whenever starting a Firefox web browser generates a Certificate pop-up prompt. I'm trying out Selenium RC in Java testing a HTTPS web apps and called an AutoIt compiled .exe file. However, it doesn't seem it recognize the pop-up box.

--- My Java code to call AutoIt script ---

Runtime rt = Runtime.getRuntime();

rt.exec("C:\\AutoIt\\clickOK.exe");

--- My AutoIt script -----

; Wait for the window to become active

If WinExists("Security Error: Domain Name Mismatch") Then

; Click the "OK" button

;MsgBox(0, "Pop up Box Found!", "Pop Up Box Body Text", 5)

;ControlClick("Security Error:Domain Name Mismatch", "OK", "")

WinWaitActive("Security Error: Domain Name Mismatch", "&OK")

Send("!s")

EndIf

Any ideas and suggestions are greatly appreciated.

Thanks!

Are you sure the popup exists yet when you're looking for it? Where you comment: "Wait for the window to become active"

There is no actual "Wait". If the popup doesn't exist that milisecond, it will move on by returning false. Perhaps you meant to use WinWait(), perhaps with a timeout to keep it from hanging?

;)


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

Share this post


Link to post
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
Sign in to follow this  

×