Forum Discussion

geoffrey_loh's avatar
geoffrey_loh
Occasional Contributor
12 years ago

Invoking the Run method on a browser always launches another instance

Hi, I'm trying to make it so that a browser instance is only launched if one does not already exist and am for example using something like



TestedApps.chrome.Run(1,false)



Going by the documentation at Run Method, this should launch a maximum of 1 instance of the browser and only if there isn't already 1 existing. The problem I'm having is that it keeps launching the instance of the browser regardless of whether there is an existing instance or not.

1 Reply

  • ArtemS's avatar
    ArtemS
    SmartBear Alumni (Retired)
    Hi Geoff,

    I'd recommend using the Browsers and BrowserInfo objects instead of the TestedApps object. These objects are designed especially for managing web-browsers.

    For example, the Browsers.Item().Run() method would launch a new browser, or would use an already running instance:

    Browsers.Item(btChrome).Run("http://smartbear.com/")




    Regards,

    Artem.