I'm just getting started with TestComplete so I was playing around with it and the Windows Calculator. I've created a basic python script to confirm that 1+1=2.
Calculator = Sys.Process("Microsoft.WindowsCalculator")
LandmarkTarget = Calculator.UIAObject("Calculator").UIAObject("LandmarkTarget")
if not Calculator.Exists:
# Confirm one plus one equals two
"Text", cmpEqual, "2", False
The only problem is the CheckProperty fails and when I check the details... apparently it's got "2", but was expecting "2".
if aqString.Trim(Aliases.LandmarkTarget.Display_is_2.TextContainer.NormalOutput.Text) != 2:
if aqString.Trim(Aliases.LandmarkTarget.Display_is_2.TextContainer.NormalOutput.Text) != "2":
and they're both returning the same error.
By adding a function to convert the output to ascii, I can see that the return from the calculator is '8237508236' which translates an 'R%2R$', which is weird, but attempting to match that string also fails.