Version 8.0.1 |
A scope can be used to narrow the search area for components. This is useful to make component references unique or to improve the readability of a test. Example: There are three panels with address data with identically labeled text fields. The scope can now be set to one of the panels. Now the specified SmartIDs refer exclusively to the fields in this panel.
Scope can also be used to speed up component detection under certain circumstances, especially for windows or web pages that contain a large number of components. An example of this is web applications that load all GUI elements with the status "invisible" from the start, and only make the relevant ones visible. Here it can be useful to use the scope to limit component detection to at least the visible window.
The scope is set in the comment of a node, via the SmartID
or even the 'QF-Test ID' of the recorded component with prefixed @scope
,
for example @scope #myDialog
.
If the scope should apply to multiple event or check nodes,
the scope is set in the comments of a node
(for example 'Sequence', 'Test step', or 'Test case')
which contains these nodes directly or indirectly via procedure calls.
The scope currently active can be referenced via a SmartID consisting
just of the hash symbol #
.
If a component is not part of the scope,
a ComponentNotFoundException
will occur.
Scopes can be bypassed when needed
by inserting the doctag @noscope
in the comments of the respective event or check node
or by inserting noscope:
at the start of the SmartID.
For example, its possible to click a button "Save"
via the SmartID #noscope:Save
, even though the button
is outside of the scope set for the sequence in which the click event is located
(see section 47.3).
Scopes can be nested, whereby the inner scope
must lie in the outer scope and further restrict it.
This, too, can be bypassed with the doctag @noscope
.
To do this, the doctags @noscope
and @scope NEWSCOPE
are specified
in the comments of the node whose components
lie in a scope outside the current one
(NEWSCOPE denotes the new scope).
The order of the doctags does not matter.
The scope always refers only to the respective nodes
and nodes executed within it.
Therefore the nodes of a procedure called from inside a scope
must either be inside this scope
or be marked with #noscope:...
or doctag
@noscope
.
Scopes can be set via SmartIDs or via the 'QF-Test ID' of a recorded 'Component'. Still, they are only respected when referencing a component via SmartID. Referencing a recorded 'Component' will always ignore the current scope.
Last update: 9/10/2024 Copyright © 1999-2024 Quality First Software GmbH |
1. Functional cookies
We use functional cookies to ensure the basic functionality of the website.
2. Performance and statistic cookies
We use Matomo for analyzing and optimizing our website. Cookies permit an anonymous collection of information that help us offering you a clear and user-friendly visit of our web pages.
This cookie contains a unique, pseudonymized visitor ID internal to Matomo for recognizing returning visitors.
This cookie is used to track from which website the anonymized user proceeded to our website.
The Matomo session cookie is used to track the visitor's page requests during the session.
is created and should be then directly deleted (used to check whether the visitor’s browser supports cookies).
short lived cookies used to temporarily store data for the visit.
short lived cookies used to temporarily store data for the visit.