Forum Discussion

jjackson150's avatar
jjackson150
Occasional Contributor
3 months ago

"Unable to find the object Sys.Browser("chrome")" When Running Several Back to Back Tests

Hi SmartBear,

When my team runs several tests back to back, we will occasionally receive the following error "Unable to find the object Sys.Browser("chrome")". This falsely fails the current test and prevents any subsequent tests in the execution plan from successfully running.

TestComplete has to be restarted to fix this issue. We want to use the execution plan to run a series of tests, but to reliably run back to back tests, we have to reset TestComplete in-between tests. I've attached a screenshot of a test log showing where "Unable to find the object Sys.Browser("chrome")" starts failing our tests and how a new test (LoginTMS7_ChomeBeta) outside of the "Manual Transaction - Bulk" execution plan resolves the error.

8 Replies

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I can reproduce the error using your code,

    I suggest you keep your coding simple,

    Ideally, it's best to close all browsers first, then launch your desired browser to perform the necessary web app testing.

    The code that's within a function, should be indented and no need for the extra line after the opening bracket - it makes the code easier to read.

    Also, ensure you are using a "working" version of TC. I find that v15.55.53.7 is stable.

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    Two things to do - 

    First, make sure that you are closing browser(s) at the end of each test run so that next time you start a browser, there's no confusion about which one is being used.

    Second, use Wait Browser to make sure the browser is actually available before you begin a test.

    https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/sys/waitbrowser-method-sys-object.html

  • Humashankar's avatar
    Humashankar
    Champion Level 0

    Hi - I hope that you are Doing good !!


    Kindly Add appropriate synchronization points in your test scripts to ensure that TestComplete waits for the Chrome browser to fully load before attempting to interact with it

    Hope this helps

    Thank you very much and have a fantastic day!
    Warm regards

  • jjackson150's avatar
    jjackson150
    Occasional Contributor

    Hi Marsha, we are following both of those practices. If you look at my screenshot, you can see that Chrome is in fact open and the TC dialog pop-up shows that TC is still waiting for the browser. Thanks

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    It's hard to tell what you are doing if we can't see the code. Please post the bit with the Chrome launch and the WaitBrowser so we can see the details.

  • jjackson150's avatar
    jjackson150
    Occasional Contributor

    Here's what we currently have:

    Here's what we could add to prevent the issue?

     

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    Yes, use the WaitBrowser instead of what you had previously. That's what is recommended.

    https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/sys/browser-method-sys-object.html

  • jjackson150's avatar
    jjackson150
    Occasional Contributor

    I'll add the additional WaitBrowser property, but it may take some time to confirm whether this fixed the issue or not. Personally, I don't believe it's a coincidence that the following test in the execution plan failed for the same reason, and the last test (where TC is closed/reopened) suddenly starts working again. We've seen this issue several times. Even while developing new tests. 

    Thank you for the help.