0

There is a desktop window, which has more tabs, and some tabs include a text editor. The editor buttons have the following mapping on the first tab (simplified here):

Window.PageControl.Tab1.Editor.Panel.Button1
Window.PageControl.Tab1.Editor.Panel.Button2 and so on.

The editor buttons have the following mapping on the second tab (simplified here):

Window.PageControl.Tab2.Editor.Panel.Button1
Window.PageControl.Tab2.Editor.Panel.Button2 and so on.

(Sometimes the Editor and other objects between Editor and Panel are cached and their mapping is not stable.)

I wrote a test which checks the functions of the text editor in the following way:

Window.PageControl.TabIndex := 1;
editor_test;
Window.PageControl.TabIndex := 2;
editor_test;

The editor_test looks like:

Window.PageControl.Refresh;

lprops := ['FullName','WndClass'];
lvals := ['*Panel', 'TWPToolPanel'];
ltarget := Aliases.(application name).Find(lprops,lvals,20,true);

ltarget.Button1.Click;
ltarget.Button2.Click...

editor_test properly works on any single tab of the window. Although, when I try to run the editor_test more times in one test, the test fails after changing tab, because it searches the buttons on the previous tab. I tried Refresh and RefreshMappingInfo methods on the common parent object of the tabs (see above), but they doesn't help. (The names and number of tabs can change in the window depending on the conditions.)

Is there any other way to clear cached mapping tree during test run? Is there any mistake in the concept?

Thank you in advance for any suggestion!

1 Answer 1

0

The solution was to complement the editor test in the following way:

lprops := ['FullName','WndClass', 'VisibleOnScreen'];
lvals := ['*Panel', 'TWPToolPanel', true];

Using this, TestComplete does not recognize editor buttons on inactive tabs of the window, which happened in the original scenario.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.