An introduction to Agilitest Capture Tool
Tags: testing, webdev, devops, agile
Published: 2022-07-22 13:00:00

Customers who have already received us for a presentation on their premises know this: the Agilitest capture tool is an essential component of the solution which makes it possible to select the UI elements to be captured and to re-use in tests as as action targets. Detailed presentation of this tool for the ergonomics of the automation engineer, and the robustness of the tests!

## What is the capture tool?

During the course of a manual test or an automated test, it is essential to define the target of each action programmed in the scenario. For example, a "click" type action requires a target element on which to interact so that the test clicks on the right button, or the right interface element.

It is the Agilitest capture tool - also called a locator - that allows you to define these action targets. It allows you to go far in identifying the components of your applications, to set up tailor-made detection rules with the relevant attributes.

In practice, the capture tool allows you to fly over the graphical interface elements of your web, mobile, desktop applications, or data structures (XML for your SOAP webservices, JSON for your REST webservices).

For each element so flown over, the capture tool presents the tree structure in which it is located, and the attributes it possesses.

It is the same capture tool that allows you to capture HTML tags from the DOM of your web applications, Widgets from your desktop or mobile applications, or even a graphical presentation of the data structures of your webservices.

The Agilitest capture tool is graphic, versatile, and dedicated the the mulitchannel tests creations.

## Locator opening

The Agilitest capture tool should not be run blank from the start of the software, because the latter requires opening the application on which you want to run it. Logically, to capture an element, you need an application on which to capture!

To start, you need to create a project, then create a new ATS Script component. Then you need to create a channel opening action, such as a Chrome browser channel. You can execute this first action with the button to the right of the line.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nc804l6c4p1m19ooihpm.png)

After opening the channel, you can finally open the capture tool with the "Capture" icon in the form of a magnifying glass which is located in the banner at the bottom right of Agilitest.

## Using the locator
The Agilitest capture tool is composed of a "Capture window". Its first button allows you to switch between the HTML capture mode (for web apps) and the system capture mode for desktop elements. At the top right of this window, you find the x, y coordinates of the cursor which can be useful for defining eccentric clicks relative to the targeted element.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2487r6l7fhx9emsnj1om.png)

The mouse over each element of your application is accompanied by a tooltip specifying its type (either the name of the HTML tag for the web, or the name of the GUI component for the desktop).

The Ctrl key is used to capture the element overflown. There comes the second window "Parents of the captured element" which displays the captured element (at the bottom) and which traces all its parents to the root of the application. These parents unfold in an accordion, and we can check the attributes that we want to retain to perform the detection of the element. These attributes are of type class, id, name, or even CSS attributes for web applications. Or, they can be of the TitleBar, Button, TabItem type for desktop applications.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mc5y17jlw44lkblm5f46.png)

Finally, the "Drag and drop in editor" icon allows you to use this detection rule in the element in an Agilitest action. You can drag and drop either after the last lines of the test (Create action tooltip) or inside an action line in the "Interface element" part.

## Advanced locator features

## Captured item statistics
Read full article [here](https://www.agilitest.com/blog/the-agilitest-capture-tool-a-powerful-tool-for-robust-testing).