Forum Discussion

kaiiii's avatar
kaiiii
Regular Contributor
5 years ago
Solved

check extension is installed on browser.

How can Check extension is installed on browsers or not by using script.

  • kaiiii's avatar
    kaiiii
    5 years ago

    Hi tristaanogre 

    Yes... I raised query for same and below is the reply.

    "The test failures I found are related to a SetUpBrowser function in your tests that closes an existing browser window before opening a new browser with OpenBrowserWithURL.
    When the new browser window is launched this way, it does not always contain the user profile information needed and causes the test to fail. I would recommend posting the URL to the existing browser window instead of opening a new browser to see if that produces more consistent results for your tests."

     

    And below is the function I am using.

     

    Sub SetUpBrowser
     While Sys.WaitBrowser().Exists
     Call Sys.WaitBrowser().Close()
     Wend
    End Sub

     

     

    Sub OpenBrowserWithURL (BrowserName,URL)
    Dim firefox,InternetExplorer,Chrome,Edge, Browser

    If (BrowserName="Firefox")Then
    Browsers.Item(firefox).Navigate(URL)
    Sys.Browser.BrowserWindow(0).Maximize
    ElseIf (BrowserName="InternetExplorer")Then
    Browsers.Item("iexplore", "11", Browsers.pX64).Run URL
    Sys.Browser.BrowserWindow(0).Maximize
    ElseIf (BrowserName="Edge")Then
    Browsers.Item(btEdge).Navigate(URL)
    Sys.Browser.BrowserWindow(0).Maximize
    ElseIf (BrowserName="Chrome")Then
    Browsers.Item(btChrome).Navigate(URL)
    Sys.Browser("chrome").BrowserWindow(0).Maximize
    End If

    Browser = Browsers.CurrentBrowser.Description
    Log.Checkpoint("Browser Details: " + Browser)
    Log.Checkpoint("URL: "&URL)

    Browsers.Refresh
    End Sub

     

    vinniew 

    Thanks for reply.

    Yes.. I am working on multiple instances(CBT).

    I have already gone through thelink provided by you but now I am looking to check extension status on browser.

4 Replies

  • Hey Kaii, 

     

    The extension is used only in chrome so its only chrome you need to check 

     

    https://support.smartbear.com/testcomplete/docs/app-testing/web/general/preparing-browsers/chrome-extension.html

     

    Have you multiple instances of chrome? 

     

    For other browser prepparation the steps are different so see the below link for reference

     

    https://support.smartbear.com/testcomplete/docs/app-testing/web/general/preparing-browsers/index.html

     

    Hope this helps 

     

    Vinnie

     

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Based upon your previous messages and conversations, I understand that you're doing most of your work in CBT environments.  If you are having a problem with running a chrome test on a CBT environment where it's stating that the extension is not installed, that is a support question for the CBT team...and I believe you've been given the advice to open a support ticket with that team.  Have you done so?  If so, what was the response?

      • kaiiii's avatar
        kaiiii
        Regular Contributor

        Hi tristaanogre 

        Yes... I raised query for same and below is the reply.

        "The test failures I found are related to a SetUpBrowser function in your tests that closes an existing browser window before opening a new browser with OpenBrowserWithURL.
        When the new browser window is launched this way, it does not always contain the user profile information needed and causes the test to fail. I would recommend posting the URL to the existing browser window instead of opening a new browser to see if that produces more consistent results for your tests."

         

        And below is the function I am using.

         

        Sub SetUpBrowser
         While Sys.WaitBrowser().Exists
         Call Sys.WaitBrowser().Close()
         Wend
        End Sub

         

         

        Sub OpenBrowserWithURL (BrowserName,URL)
        Dim firefox,InternetExplorer,Chrome,Edge, Browser

        If (BrowserName="Firefox")Then
        Browsers.Item(firefox).Navigate(URL)
        Sys.Browser.BrowserWindow(0).Maximize
        ElseIf (BrowserName="InternetExplorer")Then
        Browsers.Item("iexplore", "11", Browsers.pX64).Run URL
        Sys.Browser.BrowserWindow(0).Maximize
        ElseIf (BrowserName="Edge")Then
        Browsers.Item(btEdge).Navigate(URL)
        Sys.Browser.BrowserWindow(0).Maximize
        ElseIf (BrowserName="Chrome")Then
        Browsers.Item(btChrome).Navigate(URL)
        Sys.Browser("chrome").BrowserWindow(0).Maximize
        End If

        Browser = Browsers.CurrentBrowser.Description
        Log.Checkpoint("Browser Details: " + Browser)
        Log.Checkpoint("URL: "&URL)

        Browsers.Refresh
        End Sub

         

        vinniew 

        Thanks for reply.

        Yes.. I am working on multiple instances(CBT).

        I have already gone through thelink provided by you but now I am looking to check extension status on browser.