Forum Discussion

MichalinaK's avatar
MichalinaK
New Contributor
7 months ago
Solved

Test error after rerun tests

Hi,

I am testing desktop application in TestComplete. When I open TestComplete and run my test suite all tests are pass. But when I rerun this suite there is some inexpected error. When I colse TestComplete and open this again everyhing is OK, tests pass.  What could be the causes?

  • When identifying desktop applications and objects, TestComplete uses the properties of the object and Windows processes to identify and recognize objects. If your test runs the application executable each time it runs a test, you may have issues if the application is already open on your system. If the application is already open, TestComplete will open a second instance, which will make it difficult to recognize and access objects. 

    The best practice is to make sure, when recording tests, that your application starts and ends in the same state for a given test. If TestComplete is having trouble recognizing objects, the first thing I'd check is making sure it's not opening a new instance of the application when you rerun your test. 

13 Replies

  • rraghvani's avatar
    rraghvani
    Icon for Champion Level 3 rankChampion Level 3

    Can you provide more details, as "unexpected error" does not really give us much information to work from!

    What version of TC are you using? What scripting language are you using? How are you opening your application? What's the actual error message?

  • You need to provide more details, for starter what does the error message state? Screen shot or log complete entry.

    • MichalinaK's avatar
      MichalinaK
      New Contributor

      For example:  "RuntimeError: The object does not exist"  in Log.CreateFolder(name) function. This is first step of test.

      • rraghvani's avatar
        rraghvani
        Icon for Champion Level 3 rankChampion Level 3

        What value are you passing in for "name"?

         

  • scot1967's avatar
    scot1967
    Icon for Champion Level 2 rankChampion Level 2

    A complete guess as we don't have anything to go on.  Are you using project or suite variables?

    https://support.smartbear.com/testcomplete/docs/testing-with/variables/collections/project-and-project-suite/about.html

    Project and project suite variables can be temporary and persistent. You create them in the appropriate sections of the Variables page of the project or project suite editor. Persistent variables store their values between test runs. This way, you can share data between test sessions. Variables of the Object, Table, and DBTable types cannot be persistent.

    Note: Use persistent variables carefully. When a test run starts, the variable will have the value stored during the preceding test run rather than its initial value and this may cause your test to fail.

  • jrussell's avatar
    jrussell
    Occasional Contributor

    I am having similar problems.  I put a single test in an execution plan group, set the count to 5 so it will run the same test 5 times.  after 4 times, it stops with a "RuntimeError: The object does not exist."  I have seen this many times in different parts of our tests and have not been able to figure out the cause.  I have been leaning towards a problem with Event Controllers, but it does not happen consistently enough for me to pinpoint anything in particular.  I am using version 15.71

  • When identifying desktop applications and objects, TestComplete uses the properties of the object and Windows processes to identify and recognize objects. If your test runs the application executable each time it runs a test, you may have issues if the application is already open on your system. If the application is already open, TestComplete will open a second instance, which will make it difficult to recognize and access objects. 

    The best practice is to make sure, when recording tests, that your application starts and ends in the same state for a given test. If TestComplete is having trouble recognizing objects, the first thing I'd check is making sure it's not opening a new instance of the application when you rerun your test.