mfoster711
3 months agoRegular Contributor
TestComplete Freeze up after Stop Button
TestComplete will freeze up if I press the stop button in the following example.
- Add a breakpoint in the DummyFunction on the line marked "Use breakpoint on this line.....".
- Run the Main function
- When the script pauses on the breakpoint, click the TestComplete Stop button.
- TestComplete will freeze and only option is to force close in Task Manager
Any clue why this is happening?
class dummyClass:
@staticmethod
def DummyFunction():
try:
pass # Do some work. Use breakpoint on this line and then click Stop Button
return "some value"
except Exception as err:
Log.Error("DummyFunction Exception: "+str(err.args))
return ""
# This main function is designed to run endlessly until user presses Stop Button
def main():
try:
while True:
return_value = dummyClass.DummyFunction()
if return_value != "":
pass # Do some tasks if return_value is not blank
aqUtils.Delay(60000, "Wait for a minute after performing work")
else:
aqUtils.Delay(60000, "Wait for a minute")
except Exception as err:
Log.Error("Main Exception: "+str(err.args))The behaviour you're experiencing is due to the difference between debugging mode and normal execution. Using Python, similar Ctrl + C doesn't work immediately when debugging as the debugger has control over the execution, not the Python interpreter's normal signal handling.
Also, there are known issues with the latest version of TC and Python.