Ask a Question

TestComplete lock library files after first run

Senior Member

TestComplete lock library files after first run


I faced with problem when importing several librarys. On first test run everythins works as expected, but if I try to run agait the same routine without re-run testcomplete I get an error.

The problem is that library files was locked by testcomplete process on first run, and they was not released after test is finished.

Here my code:


sys.path.insert(0, Project.Path + '..\\Lib')
sys.path.insert(0, Project.Path + '..\\..\\')
from APItests import LogGenerator
import io
nism_ip = ProjectSuite.Variables.NismIP
falcon_ip = Project.Variables.MARipageURL.split('/')[2]

f = io.StringIO()
sys.stdout = f
sys.stderr = f

def clear_logs():
    Clear all log events on falcon
    LogGenerator.clear_logs(falcon_ip, nism_ip)

def print_stdout():
    Function to print in Log.Message the 'print()' statement
    output = f.getvalue().split('\n')
    for o in output:


On first run of 'clear_logs()' routine it's passed, but  on second run there has error:

SystemError: initialization of _psycopg raised unreported exception	9:52:03	Normal			0.00
The script execution was interrupted.	9:52:03	Normal			0.18

TestComplete locks files for psycopg2 and for lxml librarys.

As workaround I found only one solution - rerun testcomplete

Anyone have sugestions how to fix these issue?

Community Hero

I suggest that you contact Support with this question.  Here's the link:

[Community Hero]
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
Showing results for 
Search instead for 
Did you mean: