Forum Discussion
ElizabethO
4 days agoOccasional Contributor
def convertQueryToListOfDictionaries(query) :
query.First();
listOfDictionaries = [];
while not query.EOF :
record = [];
for number in range(0, query.FieldCount) :
record.append((query.Field[number].FieldName,query.Field[number].Value));
listOfDictionaries.append(dict(record));
query.Next();
return listOfDictionaries;Its just returning a list, When I added from tc import * it fixed it for a bit but now its started again, might go with the option of downgrading my TC version
rraghvani
Champion Level 3
1 day agoThere is something weird going on when using Python. If I run my function test() in Unit2 which purposely errors -
def test():
result = Unit2.executeQuery("", [])
Log.Message(f"{result}")
Then when I run function test() in Unit1, which should pass, it errors with the following message -
However, if I restart TestComplete or rerun test() in Unit1, then it passes
It's definitely a bug, and I suggest you open a Support Ticket for this.