Object Identification Center (OIC) (Linux/Mac)
The OIC for Linux/Mac lets you spy on the objects in your Web-based application, experiment with different ways to identify those objects, and generate code to use in your scripts.
The OIC window
- Make sure your browsers are set up to work with LeanFT.
Make sure the LeanFT runtime engine is up and running.
Open your browser.
Launch the OIC from your IDE's toolbar or from its LeanFT menu.
For example, in Eclipse on a Linux environment:
Arrange your application and the OIC so that you can see both on the screen, or use dual monitors to display one on each screen.
In the OIC, click the Start spying button.
Tip: If you have just opened the OIC, a large green Start spying button appears in the center of the OIC window.
As you hover over objects in your web application, each object you point to is highlighted.
A tooltip displays some basic information about the object.
To temporarily pause the spying operation, for example to use your mouse to bring another application into focus:
Linux: Press Ctrl on your keyboard
Mac: Press command/cmd on your keyboard
Click the object in the application to capture it in the OIC.
On the left of the OIC window, the hierarchy tree displays the object's hierarchy. Starred objects indicate that LeanFT recommends these as the hierarchy to identify the object that is currently selected in the OIC.
On the right, the OIC displays a full list of supported identification properties for the selected object, and the current values captured from your application are displayed. Starred properties indicate that LeanFT recommends these as the properties to uniquely identify your object.
Tip: To highlight an object in the application, hover over the object's node in the hierarchy tree, and click Highlight icon.
Tip: By default, LeanFT always provides recommendations, and these recommendations are automatically selected.
If you do you want to receive recommendations, go to the OIC settings and clear the Calculate recommendations option.
If you want recommendations but do not want them automatically selected, go to the OIC settings and clear the Automatically select recommendations option.
In the hierarchy tree, select the object that you want to identify. Click anywhere the object's node, and select the check box as well.
On the right, select identification properties that you want the OIC to use to identify the test object.
Tip: You can modify the values for any selected property. To enter a regular expression value for a string, click the Set as Regular Expression asterisk to the right of the value box. For more details, see Regular expression guidelines.
Hover over the Start spying button to show the floating toolbar, and click the Validate button.
LeanFT searches the application for objects that match the object's description in the OIC.
Matching objects are highlighted in your application. A message displays how many matches were found.
Note: If more than 20 matched are found, the objects are not highlighted in the application.
If no matches are found, or if multiple matches are found, adjust the set of identification properties that you selected, and/or their values, and try to validate again. Repeat until you get a unique match.
After you have spied a test object and validated that you have a unique test object description, you can generate code for it, and paste the code into your test script.
Hover over the Start spying button and click the Generate code to clipboard button.
A programmatic description of the test object is generated, and is copied to the clipboard.
In your IDE, paste the code into your test script.
Note: When you paste the generated code, the browser parent object is called browser. If you assigned a different name to your browser test object, modify as needed in the pasted code.
Capture an image of the object in your application that corresponds to the currently selected object in the OIC. This can be useful, for example, if you are building a reporting framework for test executions.
Make sure no other application is covering any part of your application while performing the image capture.
In the OIC, make sure the object you want to capture is both in focus in the hierarchy tree, and that its check box is also selected.
Hover over the Start Spying button, and click the Capture object image button.
- Save the image.
Open an existing application model. For details, see Application models.
From the Application Model editor, open the OIC.
Spy objects in your application, and validate the object you want to add to the Application Model. For details, see Spy your application and validate test object.
Recommended: Customize the test object name and/or add a tag. This will facilitate finding that object in your application model in the future.
Click the Add button. The object, as well as any marked parent objects that do not yet exist in the application model, are added to the application model.
Click the Settings button in the top left corner of the OIC window.
|Clipboard Code Language||
By default, Generate code to clipboard generates test object description code in Java.
|Calculate recommendations||Calculates a set of recommended test object properties and values that uniquely identify an object. A star icon is displayed next to the recommended objects and properties.|
|Automatically select recommendations||Automatically selects the set of recommended test object properties and values that uniquely identify an object.|