Jump to content

Help with FireFox Certificate import


Recommended Posts

I have a script that I want to run that selects the importing of a cert into Firefox, but also want to check the pop-up if the cert is already installed.

This works but as soon as I Add the IF, THEN statements it does nothing.

Please Help.

Dim $PID1

Opt("WinWaitDelay",100)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

$URL="http://SomeURL/mcafee_webgateway.der"

Run(@COMSPEC & " /c start /min firefox.exe "& $URL)

If _WinWaitActivate("Downloading Certificate","")Then

MouseMove(27,96)

MouseDown("left")

MouseMove(27,97)

MouseUp("left")

MouseClick("left",26,114,1)

MouseClick("left",26,138,1)

MouseMove(380,257)

MouseDown("left")

MouseMove(381,257)

MouseUp("left")

Else

Exit

_WinWaitActivate("Alert","")

MouseClick("left",181,81,1)

EndIF

Func _WinWaitActivate($title,$text,$timeout=0)

WinWait($title,$text,$timeout)

If Not WinActive($title,$text) Then WinActivate($title,$text)

WinWaitActive($title,$text,$timeout)

EndFunc

sleep (1000)

$PID1 = ProcessExists("firefox.exe") ; Will return the PID or 0 if the process isn't found.

ProcessClose($PID1)

Link to post
Share on other sites
  • 2 weeks later...

Hi.

Welcome to the forum :graduated:

Where is the issue with your script?

use SciTE Editor to "tidy" your script for better readability:

Dim $PID1
Opt("WinWaitDelay", 100)
Opt("WinDetectHiddenText", 1)
Opt("MouseCoordMode", 0)
$URL = "http://SomeURL/mcafee_webgateway.der"
Run(@ComSpec & " /c start /min firefox.exe " & $URL)

While 1
    If _WinWaitActivate("Downloading Certificate", "") Then
        MouseMove(27, 96)
        MouseDown("left")
        MouseMove(27, 97)
        MouseUp("left")
        MouseClick("left", 26, 114, 1)
        MouseClick("left", 26, 138, 1)
        MouseMove(380, 257)
        MouseDown("left")
        MouseMove(381, 257)
        MouseUp("left")
    Else
        Exit
        _WinWaitActivate("Alert", "")
        MouseClick("left", 181, 81, 1)
    EndIf
WEnd

Func _WinWaitActivate($title, $text, $timeout = 0)
    WinWait($title, $text, $timeout)
    If Not WinActive($title, $text) Then WinActivate($title, $text)
    WinWaitActive($title, $text, $timeout)
EndFunc   ;==>_WinWaitActivate


Sleep(1000)
$PID1 = ProcessExists("firefox.exe") ; Will return the PID or 0 if the process isn't found.
ProcessClose($PID1)

Regards, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

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

    No registered users viewing this page.

×
×
  • Create New...