What I meant was that when you use Run application it already opens Firefox. Then you should use Launch new Firefox, but instead of making it launch a new instance, make it Attach to an existing instance (the one you launched via Run application). Make sure you add a Wait for window action in there to wait for Firefox to actually open and load the page, before you try to attach to it.
Here's a snippet I commonly use when launching a browser:
SET URL TO $'''{SomeURL}'''
System.RunApplication.RunApplication ApplicationPath: $'''chrome''' CommandLineArguments: $'''www.google.com''' WorkingDirectory: '' WindowStyle: System.ProcessWindowStyle.Maximized ProcessId=> AppProcessId
WAIT (UIAutomation.WaitForWindow.ToOpenByTitleClass Title: $'''Google*''' Class: $'''Chrome_WidgetWin_1''' FocusWindow: True) FOR 30
WebAutomation.LaunchChrome.AttachToChromeByTitle TabTitle: $'''Google''' AttachTimeout: 5 BrowserInstance=> BrowserMain
ON ERROR REPEAT 5 TIMES WAIT 3
END
WebAutomation.GoToWebPage.GoToWebPageCloseDialog BrowserInstance: BrowserMain Url: URL
You can copy and paste this into your PAD designer to have the actions created for you.
If you do, note the following things:
- This is designed to work with Google Chrome. If you want to use Firefox, you will need to modify those actions to:
- Run a different application
- Wait for a window with a different title
- Use a different Launch browser action
- You need to replace the {SomeURL} placeholder with an actual URL that you want to navigate to.
This has worked for me without fail for several years now, when sometimes simply using Launch new Chrome fails due to the extension not loading properly.
-------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.