Forum Discussion
6 Replies
Sort By
Hi Nan,
Try calling the Refresh method (if you are using full object names) or the RefreshMappingInfo method (if you are using mapped/aliased objects) right before retrieving the property value in your test.
- liangnOccasional ContributorHi Allen,
thank you. It works.
Best wishes
Nan - -Pv-Occasional ContributorTC Enterprise 8.2 on Win7x64.
ChildCount is not always successful for me even after refresh on QWidget controls:
Object Browser:
Sys.Process("NAME").Form("License Wizard"):
ChildCount = 6
Children displayed:
Window("QWidget", "", 1)
Window("QWidget", "", 2)
MenuBar("System")
TitleBar(0)
Client("LicenceWizard")
Client(0)
In script
Sys.Process("NAME").Form("License Wizard").Refresh();
Log.Message("Searching " + Sys.Process("NAME").Form("License Wizard").ChildCount + " children...");
for (var i = 0; i < Sys.Process("NAME").Form("License Wizard").ChildCount; i++)
{
var MyItem = Sys.Process("NAME").Form("License Wizard").Child(i);
Log.Message("Searching Item: '" + MyItem.Name + "'");
}
Result:
Searching 4 children...
Searching Item: 'Client(0)'
Searching Item: 'Client("License Wizard")'
Searching Item: 'TitleBar(0)'
Searching Item: 'MenuBar("System")'
The control I want to click is in "Window("QWidget", "", 2)"
Note: the index may change to protect the innocent...
If I run this code multiple times, there is a random chance the window with the control I want will show up as one of the 4 detected children.
Very occasionally, 6 children will be reported and the control will be found.
-Pv-
Hi Paul,
As I understand, you launch the script right after observing the 6 objects in the Object Browser's tree. Will the behavior persist if you comment out the Refresh method call in your code?- -Pv-Occasional ContributorThe Object Browser always reports 6 children on Sys.Process("NAME").Form("License Wizard") in the property display.
The object browser will display the 6 children only after many refreshes.
Using refresh in script, I get 6 rarely, but only after many refreshes.
TC cannot click on the required object because is is not always available even though it's clickable on the screen.
-Pv- - Hi Paul,
We need to reproduce the problem on our side in order to investigate it. So, we need to have your tested application here. Please contact us via our Contact Support form regarding possible options.
Related Content
- 12 months agomtsapa
- 7 months agomengbinhao