# Test error after rerun tests

**URL:** <https://community.smartbear.com/t/test-error-after-rerun-tests/363>\
**Category:** TestComplete\
**Tags:** test, testcomplete, migrated\
**Created:** [February 19, 2025, 12:33pm UTC](https://community.smartbear.com/t/test-error-after-rerun-tests/363 "2025-02-19T12:33:04Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [February 19, 2025, 12:33pm UTC](https://community.smartbear.com/t/test-error-after-rerun-tests/363/1 "2025-02-19T12:33:04Z")

</div>

> Originally posted by **MichalinaK** on February 19, 2025

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?

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [February 19, 2025, 12:54pm UTC](https://community.smartbear.com/t/test-error-after-rerun-tests/363/2 "2025-02-19T12:54:47Z")

</div>

> Originally posted by **rraghvani** on February 19, 2025

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?

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [February 19, 2025, 2:30pm UTC](https://community.smartbear.com/t/test-error-after-rerun-tests/363/3 "2025-02-19T14:30:22Z")

</div>

> Originally posted by **Hassan\_Ballan** on February 19, 2025

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

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [February 19, 2025, 5:48pm UTC](https://community.smartbear.com/t/test-error-after-rerun-tests/363/4 "2025-02-19T17:48:01Z")

</div>

> Originally posted by **scot1967** on February 19, 2025

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](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.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [February 20, 2025, 8:59am UTC](https://community.smartbear.com/t/test-error-after-rerun-tests/363/5 "2025-02-20T08:59:41Z")

</div>

> Originally posted by **MichalinaK** on February 20, 2025

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

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [February 20, 2025, 10:14am UTC](https://community.smartbear.com/t/test-error-after-rerun-tests/363/6 "2025-02-20T10:14:17Z")

</div>

> Originally posted by **rraghvani** on February 20, 2025

What value are you passing in for “name”?

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [February 20, 2025, 1:44pm UTC](https://community.smartbear.com/t/test-error-after-rerun-tests/363/7 "2025-02-20T13:44:45Z")

</div>

> Originally posted by **scot1967** on February 20, 2025

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

Here _name_is a variable. This should be a string like “Some Folder Name” or a string variable. Log.Message(name); or set a watch on the variable and let us know what you see. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [February 20, 2025, 4:55pm UTC](https://community.smartbear.com/t/test-error-after-rerun-tests/363/8 "2025-02-20T16:55:06Z")

</div>

> Originally posted by **Hassan\_Ballan** on February 20, 2025

You will need to debug your code to find out the value of “name” on first time and second time run. From your description it would seem that on first time run the value is set to something valid, and later on value is changed to become invalid for second run.

Maybe also you can provide the code in question to look at.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [March 4, 2025, 10:58pm UTC](https://community.smartbear.com/t/test-error-after-rerun-tests/363/9 "2025-03-04T22:58:20Z")

</div>

> Originally posted by **MiguelAlvarez** on March 04, 2025

Hi, I get the same error but when calling.

```auto
Log.Message("The running state is the one expected!")

```

It throws the runtimeeerror “The object does not exist” instead of returning None.

 ![](https://canada1.discourse-cdn.com/flex049/uploads/smartbear_prod/original/1X/b8189f9a0266947b682db7bc8372ebb36407f505.png)

from a function inside a BDD @given bining.

This is my BDD Given binding

```auto
@given("that the Deidentification tool is not running")
def check_deidentification_tool_is_not_running():
  if application_manager.check_application_isrunning("DeId.GUI", False):
    Log.Message("Application is not running")
  else: 
    if Sys.WaitProcess("DeId.GUI",1000).Exists:
      Sys.Process("DeId.GUI").Close()
      while Sys.WaitProcess("DeId.GUI",1000).Exists:
        aqUtils.Delay(1000)
      if application_manager.check_application_isrunning("DeId.GUI", False):
        Log.Message("Application is not running")
      else:
        Log.Message("Expected result is not met")

```

Inside of check\_application\_isrunning is where I get the error, this my check\_application\_isrunning function

```auto
def check_application_isrunning(app_name, expected_state):
  cmd_command = 'powershell "gps | where {$_.MainWindowTitle } | select Description'
  processes = subprocess.Popen(cmd_command, shell=True, stdout=subprocess.PIPE)
  running_processes = []
  for line in processes.stdout:
      if line.rstrip():
          running_processes.append(line.decode().rstrip())
                    
  app_currently_running = app_name in running_processes
  
  if app_currently_running == expected_state:
    Log.Message("The running state is the one expected!") ##### This is where the runtimeerror happens
    return True
  else:
    Log.Message("The running state is the NOT one expected!")       
    return False

```

I’m using Testcomplete Version 15.72.60.7 x64 and my project is in python.

I believe this is a bug in testcomplete and here is my reasoning why: I’ve gotten this error before when trying to use the testcomplete property Project.Path. I have to restart my test three times for it to work on the fourth time. I should be able to call Project.Path from anywhere no? Well when I hit this issue and evaluate only “Project.Path” with the debugger I get the runtime error **the object does not exist**.

Here’s something interesting: When I call Project.Path (or Log.Message) before I get inside the function that uses it, there is no issue, but when it gets called from inside the function that uses it there is an issue. Samething with Log.Message:

 ![](https://canada1.discourse-cdn.com/flex049/uploads/smartbear_prod/original/1X/af90d201c4d0770f36f07bfe1bca88c68b931e03.png)

_Picture Caption: Debug evaluation of Log.Message(somestring) before going into function(works)_

 ![](https://canada1.discourse-cdn.com/flex049/uploads/smartbear_prod/original/1X/4b618b9b351847549db29c5721aa65c067ea0d58.png)

_Picture Caption: Debug evaluation of Log.Message(somestring) after going into function(doesn’t work)_

I managed to work around it by passing Project.Path as a parameter to the function that uses its value, but now I’m having the same issue with Log.Message, so definitely a testcomplete bug unless there are rules about where you can and can’t use it, but like I said if I just retry (restart a run in my BDD feature file) 3 times is works on the fourth time.

 ![](https://canada1.discourse-cdn.com/flex049/uploads/smartbear_prod/original/1X/ce14b81023741a8bff6063e9e66f213c45bc2b26.png)

_Picture Caption: Debug evaluation of Log.Message(somestring) after going into function(works after restarting feature file run a couple times)_

Are testcomplete properties e.g. Project.Path and functions e.g. Log.Message always available or could there be some issue with the order the python interpreter loads the class into memory, maybe sometimes these TestComplete properties and methods are not ready for the interpreter at load time?

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [March 5, 2025, 9:47am UTC](https://community.smartbear.com/t/test-error-after-rerun-tests/363/10 "2025-03-05T09:47:22Z")

</div>

> Originally posted by **rraghvani** on March 05, 2025

When using Python, there are specific requirements you need to follow, see [https://support.smartbear.com/testcomplete/docs/scripting/specifics/python.html](https://support.smartbear.com/testcomplete/docs/scripting/specifics/python.html)

I also suggest you run your PowerShell command using [https://support.smartbear.com/testcomplete/docs/testing-with/advanced/using-external-functions/running-powershell-scripts.html](https://support.smartbear.com/testcomplete/docs/testing-with/advanced/using-external-functions/running-powershell-scripts.html) - as the subprocess command spawns a new process, and TC doesn’t support multithreading.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [March 5, 2025, 5:30pm UTC](https://community.smartbear.com/t/test-error-after-rerun-tests/363/11 "2025-03-05T17:30:34Z")

</div>

> Originally posted by **MiguelAlvarez** on March 05, 2025

All my pyton tests are part of the “Scripts” folder. Is there a way to include the python package from testcomplete that has Log and Project into my scripts? That could be a workaround for this testcomplete bug.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [March 5, 2025, 6:14pm UTC](https://community.smartbear.com/t/test-error-after-rerun-tests/363/12 "2025-03-05T18:14:10Z")

</div>

> Originally posted by **MiguelAlvarez** on March 05, 2025

Same situation as this person [RuntimeErrors after upgrading to 15.68.8.7 | SmartBear Community](https://community.smartbear.com/t/runtimeerrors-after-upgrading-to-15-68-8-7/338) It’s also happening to me, hopefully they fix it soon

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [March 19, 2025, 11:55am UTC](https://community.smartbear.com/t/test-error-after-rerun-tests/363/13 "2025-03-19T11:55:14Z")

</div>

> Originally posted by **jrussell** on March 19, 2025

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

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [March 19, 2025, 2:32pm UTC](https://community.smartbear.com/t/test-error-after-rerun-tests/363/14 "2025-03-19T14:32:29Z")

</div>

> Originally posted by **caitlinrich** on March 19, 2025

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.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [October 7, 2026, 5:16pm UTC](https://community.smartbear.com/t/test-error-after-rerun-tests/363/15 "2026-10-07T17:16:48Z")

</div>

Closed on October 7, 2026, 5:16pm UTC

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
