Forum Discussion
I was able to duplicate your simple example but I noticed the following:
If you use from tc import Log it only works the first time, as you desribed.
But, I also tried the following two options and they work fine:
import tc # must reference items as tc.Log.Message("test")
from tc import *
Lastly, I also noticed that leaving out the import tc and just using Log.Message("test") works and I did not think that would be true in this new version of TestComplete/Python.
I am a little confused as to what is "proper" with this new version.
I need to modify my answer.
I noticed leaving out the import and just calling Log.Message("test") works some of the time. If you call one Script from another Script, it will not. I always noticed some oddities when using subfolders to organize my scripts (real folder not just TestComplete fake folders)
- mcpm23 days agoOccasional Contributor
I also noticed that in this simple case leaving out the import works correctly, but I didn’t want to make things too complicated, since adding this import is one of the suggested ways to handle it according to SmartBear documentation. Moreover, I’ve noticed that the necessity of adding these imports seems somewhat random — sometimes you need them, sometimes you don’t — but I add them in every script where keywords like Log occur.
I was informed on Friday that the ticket I created was passed to the development team, so I assume it’s being treated as a bug.