Identify controls by properties
To create stable, conclusive tests, you need to make sure that Tosca Cloud can reliably identify and interact with screen elements in your application ("controls").
There are different ways to identify controls. This topic takes you through identifying controls by properties, where you identify a control by its technical properties in the application code. Typically, properties are the fastest and easiest way to identify controls. We recommend that you always try this method first.
Access this option
The option to identify controls is available in all views of Tosca XScan. Properties are the default identification method in all three views.
Identification by properties is the only available method in Cloud Scanner.
This topic is about identification via properties in Tosca XScan. For information on how to use Cloud Scanner, check out Use Cloud Scanner.
Use this option
To identify a control by property in Tosca XScan, follow these steps:
-
In Basic View or Condensed View, select the control in your application.
-
In Advanced View, select the control in the tree view of the scan window.
In either case, Tosca Cloud chooses properties as identifiers for your control.
If these properties don't make the control uniquely identifiable, Tosca Cloud gives a warning. Use the additional options in Basic or Advanced View to fine-tune your identification. For example, let Tosca Cloud make the control unique, manually select additional properties, or change property values.
Considerations
When it comes to identifying controls by property, keep these things in mind:
-
Select multiple properties to create a combination that's unique to a control.
-
Use parent controls for identification if you can't find a workable combination of properties. The parent node might have a unique ID, which also makes the control itself unique. To do that, switch to Advanced View, select the parent node first and then the control itself.
By the way, the right parent might not be the control that's directly above in the hierarchy. To find the right parent, turn on Highlight Selection, and move through the parent nodes in the tree view of the scan window. This highlights the respective section in your application.
-
Use parent controls for identification if your application loads a pop-up as part of a page. A good example are embedded pop-ups. The controls in the pop-up might be unique within the pop-up itself, but not within the whole screen. In this case, use the pop-up's top-level container for identification. For example, with the properties ClassName or InnerText.
-
Watch out for dynamic values and fix them with a * wildcard. Let's say that a property adds a hit counter at the end of its value: Example property value_20. This means that the property value is only valid for the current session. At runtime, the hit counter will be at least 21, but Tosca Cloud's looking for a control with 20. To avoid this, change the property value to Example property value*.
One of the more common troublemakers are the Title or Caption properties, which often have session-based information, such as numbers or search terms. You need to fix that with a wildcard, or Tosca Cloud won't find the window or tab.
-
Select More > Load all to load all available properties for a control. Certain properties, such as reflected parameters, will only appear after you select Load all.
-
Double-check user permissions. Some users have elevated permissions, which means they see controls and properties that other users don't. Make sure that the users who scans the application has the same permissions as the user of the machine where you run your tests.
What's next
Identification by property not working for what you need? No problem—try images, index, or anchor.
However, if you're happy with your module, then it's time to start creating tests.