Forum Discussion
Thanks for your rapid reply. Here is a step-by-step of what is happening. This is the keyword test Sandbox:
This is the Keyword test variables:
Here are the project level variables:
Here is the code for the script CheckForEnvVariables in the file LoginScripts:
def CheckForEnvVariables():
for i in range(KeywordTests.Sandbox.Variables.VariableCount):
name = KeywordTests.Sandbox.Variables.GetVariableName(i)
Log.Message("Name: " + str(name))
Log.Message("Value: " + str(KeywordTests.Sandbox.Variables.VariableByName[name]))
for i in range(Project.Variables.VariableCount):
name = Project.Variables.GetVariableName(i)
Log.Message("Name: " + str(name))
Log.Message("Value: " + str(Project.Variables.VariableByName[name]))
After bringing up TestComplete cold, the first thing I do is run the keyword test Sandbox. This is the resulting log file, which looks like what we want:
I immediately run Sandbox a second time and this is the error I get:
And this is the resulting log file:
And further attempts to run Sandbox have the same error
From TC v15.68.8.7 and onwards, there's been a number of reported issues, when using Log.Message method in Python, as well as other issues!
I suggest you open a support ticket via https://support.smartbear.com/testcomplete/message/
Note, use the Formatted string literals to simplify string formatting and interpolation e.g.
def CheckForEnvVariables():
for i in range(0, Project.Variables.VariableCount):
name = Project.Variables.GetVariableName(i)
Log.Message(f"Name: {name}")
Log.Message(f"Value: {Project.Variables.VariableByName[name]}")
- TikiHardBop13 months agoNew Contributor
I have opened a support ticket for the Log.Message() stuff (#759774). I have not heard back. I was just wondering if this problem with variables is related or a separate issue. I will ask them when I hear back about the Log.Message() support ticket.
I'm curious how a bug with something as basic as a Log.Message() would even make it into a final released product, though?
- rraghvani3 months ago
Champion Level 3
If you search the forum, you will come across similar issues.
I'm not sure if the Python libraries that's packaged with TestComplete have been updated, and is now causing these issues.
- TikiHardBop13 months agoNew Contributor
It seems to be related to import statements.