0

I'm setting up a new HP ALM workflow script to invoke firefox and open two tabs in the same.

The script given works like a charm in command line. However, the same script doesn't work well flow HP-ALM Workflow. I'm certain the script is being invoked though, but the firefox browser is not opening. Placed alerts to debug the script and the alerts from the script are displayed.


Dim wshshell
Set wshshell = WScript.CreateObject("Wscript.Shell")

wshshell.run """firefox.exe"" www.google.com",1,False
wshshell.run """firefox.exe"" www.yahoo.com",2,False

Set wshshell = Nothing
wscript.quit

On a Button click in HP ALM client, firefox should be opened with two tabs. One with google & other with yahoo homepage. However, No page is opening.

  • Why do you use `…,2,False` in the latter `run`? The 2nd parameter is _window style_ and `2` means _Activates the window and displays it as a minimized window_. I'd try omitting both 2nd and 3rd parameters as `wshshell.run """firefox.exe"" www.yahoo.com"`. – JosefZ Jun 21 '19 at 17:20
  • If you find an answer helpful you should consider to [accept the answer](http://stackoverflow.com/help/accepted-answer) and/or [vote up](https://stackoverflow.com/help/why-vote) –  Aug 15 '19 at 13:02

1 Answers1

0

Finally, the following solution helped;

ActionCanExecute()

Function ActionCanExecute()

    On Error Resume Next
    ActionCanExecute = DefaultRes
    browserName = "Mozilla Firefox"
    browserExeName = "Firefox.EXE"
    cmdLineArgPlatform = " -new-window "
    cmdLineArgIdc = " -new-tab "
    sURLPlatform = "www.google.com"
    sURLIdc = "www.yahoo.com"

    Set WSHShell = CreateObject("WScript.Shell")
    exePath = WSHShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\" & _
                     "CurrentVersion\App Paths\" & browserExeName & "\")

    'Open the URL
    sShellCmdPlatform = """" & exePath & """" & "" & cmdLineArgIdc & """" & sURLPlatform & """"
    MsgBox sShellCmdPlatform

    sShellCmdIdc = """" & exePath & """" & "" & cmdLineArgIdc & """" & sURLIdc & """"
    MsgBox sShellCmdIdc

    'MsgBox sFFExe      

    WSHShell.Run sShellCmdPlatform, vbHide
    WSHShell.Run sShellCmdIdc
    On Error Resume Next

    Set WSHShell = Nothing

    ActionCanExecute = DefaultRes

    On Error GoTo 0
End Function