Go to Robotic Automation version 22.1 documentation

TabbedReparentContainer - Selecting Tabs

Use thse methods for selecting (focusing) tabs through automations:

Also see the Tab Creation section of this topic for information about the order in which tabs appear when a project is run.

 

SelectDesignComponent

When reparenting is configured with two levels, one for the design component and one for the windows within the design components, use the TabbedReparentContainer.SelectDesignComponent method select a specific design component (adapter) tab and have the most recent window tab in focus.

The following sample scenario describes how this method can be used:

A TabbedReparentContainer reparents the Windows and web applications. One set of tabs display for design components and another set of tabs for active windows. The Windows application is Calc.exe and the web application is Google. When running the project, if the Statistics box is open from the Calc program, a secondary tab is displayed which contains the Statistics box and this tab will be in focus.

If you click the Google tab, the Google tab receives focus. Calling the SelectDesignComponent method for the Calculator application brings the Calculator tab to the top and the sub-tab showing the Statistics box in focus since this was the last window in the application that had focus.

The SelectDesignComponent method contains one parameter: DesignComponent. This parameter lets you specify the design component you want to bring into focus. Use the This property of the application adapter for the corresponding design component to specify the SelectDesignComponent (DesignComponent) parameter. For more information, see Using the TabbedReparentContainer.

Note: If the currently open window for the Design Component is an pop-up window (such as a Login window), calling the SelectDesignComponent method for the application adapter brings the application tab to the top and shows the pop-up window as the focussed window within the project. If you are automating selecting tabs in the TabbedReparentContainer and your applications contain pop-up windows, using the SelectDesignComponent method for the adapter makes sure that the tab displays. For more information, see the Activate method.

 

Activate

Use the Activate method for a Windows or web form to select and focus a specific tab in the reparenting control. This method works with either one- or two-level tabs. For example, if the Calculator application is reparented and both the Calculator and the Statistics Box windows are open, the control will have a tab containing the main Calculator form and another tab containing the Statistics Box. In this case, calling the Activate method for the Calculator form (Calculator.Activate()) brings the main Calculator tab into focus and calling the Activate method on the Statistics window brings the Statistics tab into focus.

Note: You can use the Activate method also to focus pop-up windows that have been interrogated. For example, the Open dialog in Notepad (choose File | Open) can be interrogated. If, while running the project, another tab is in focus, you can call the Activate method on the Open Dialog to bring the Notepad tab to the front and display the active Open window. If, however, you call the Activate method on the Notepad window while the Open dialog is displaying, an error message is displayed indicating the Notepad window is disabled due to the presence of the modal window. Instead, if you call the SelectDesignComponent method for the Notepad window, then the Notepad tab is brought to the top and the Open dialog displays without error.

 

Tab creation

When new tabs are created within the TabbedReparentControl, the currently selected tab remains in focus unless a newly created tab is a reparented window within the same design component. For example, when starting several adapters at the same time, the first reparented window should remain as the selected tab while more tabs appear in the TabbedReparentControl.

If an action performed on a window in the current tab causes a new tab to be created for another adapter, the current tab will remain in focus. For example, if clicking a button in Calc causes Notepad to launch, the reparented Notepad window will be created without changing focus away from the current Calc tab. However, clicking on Notepad's Help Topics option will cause the new Help Topics tab to become the currently selected tab. This occurs because the new window is owned by the same adapter (in this case, the Windows adapter for Notepad.exe).


Privacy | Trademarks | Terms of Use | Feedback

Updated: 28 March 2024

© 2016 - 2024 Pegasystems Inc.  Cambridge, MA All rights reserved.

 

OpenSpan data classification label