Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel
panelIconIdatlassian-info

...

panelIcon

...

Описание

The action constructor
:info:

...

We want to provide you with the latest help content in your language as soon as possible. This page has been translated automatically and may contain grammatical errors or inaccuracies. We want this content to be useful to you. Please let us know at the bottom of this page if this information was helpful.

View the original article in Russian: Конструктор действий и Поиск по XPath

bgColor#E3FCEF

Please read the Terms of Use for Materials on ZennoLab

Table of contents

Expand
titleClick here to expand the table of contents
Table of Contents
minLevel1
maxLevel7
exclude^Оглавление$

Description

The action designer is a universal tool for working with page elements, which allows you to select the optimal signs for its search.

Note

To use this feature, you need to have a basic understanding of the HTML markup language.


How to call?

There are two ways to call a constructordesigner:

  1. you need to right-click on the element of interest on the page and select

Add
  1. to the action

constructor
  1. designer from the context menu.

Image RemovedImage Added

2. The second method is from the Element Tree window. Right-click on the desired element and select In to the action constructordesigner.

Image RemovedImage Added

Info

When an element is added to the Action

Designer

Builder, its available properties and

they

their attributes are automatically transferred to the Element Properties window.

Search options

Classic search

Image RemovedImage Added

1. Document

No

.

It is recommended to set the value -1 (search in all documents on the page). 

2. Form

No

.

It is also better to set -1 (search in all forms on the page). Choosing this value will make the template more versatile.

Example: on page 3 of the form - search, registration, ordering goods. We need to click on the button in the order form and we have chosen as the value of the “Form” field - 2 (numbering from zero). After some time, a new login form appears on the site, and it is inserted in front of the order form. Number 2 will now be the login form, and our template will either give an error that the button was not found, or (much worse) will click on another button in another form.

Info

In the program settings (Settings → Recording), you can mark two checkboxes -

“Search in the page” and “Search in the page”

pageand then always when searching for elements for the document number and form will be -1.

3. Tag

HTML tag to find.

Example:

Code Block
languagehtml
<div class="visible" id="username"></div>

div - this is a tag.

4. Attribute name

The HTML tag attribute for the search.

Code Block
languagehtml
<div class="visible" id="username"></div>

class and id - attributes.

5. Value

The value of the attribute of the selected HTML tag

Code Block
languagehtml
<div class="visible" id="username"></div>

visible and username - attribute values.

6. Search type

  1. text - search by full or partial text occurrence;

  2. notext - search for elements that do not contain the specified text;

  3. regexp - search using regular expressions

;

  1. By default RegeXp search is case insensitive. To change it you can prepend (?-i) to your expression (this mean “disable case insensitive mode”).

The screenshot shows that after clicking on the Search button, three elements were found, which is not very good - always try to select such search parameters so that in the end there is only one element.

XPath search

With the help of XPath expressions, you can implement a more universal and resistant to changes in site layout algorithm for finding elements, in comparison with classic search or regular expressions.

Image RemovedImage Added

Document number and form number are responsible for the same as in the classic search.

1. XPath

XPath expression input field.

2. Options

Here you can select one of the suggested expression designer.

Info

If none of the proposed options suits you, then you can compose the XPath expression yourself.

Action selection

You can choose one of three possible actions

Image RemovedImage Added

Set - Setting a value

  • Attribute - an attribute of an element for which a new value must be set

  • Value is the text to be inserted. You can use both plain text and project variables {-Variable.someVar-} , {-Profile.Name-} .

Image RemovedImage Added

Get - Get Getting a value

  • Attribute - the attribute whose value you want to get.

  • Value - the value of the found attribute will be displayed here.

Image RemovedImage Added

Rise - Perform Action Rise event

  • here you can select the required action to be done with the found element.

Image RemovedImage Added

  • Two additional fields are available for drag and drop actions, for coordinates


Final actions

Image RemovedImage Added

1.

Testing

Test

After you have selected the necessary search parameters and decided on the desired action, it does not hurt to test the selected parameters by clicking the appropriate button.

2.

Commentary

Comment

It's not a bad idea to leave a comment for the action as automatic comments carry little information

Comments
default

Image RemovedImage Added

The same actions, only
with custom comments

Image RemovedImage Added

3. Adding to the project

And already at the very end, when the parameters are selected, the element is found, the required action is selected and tested, you can click Add to project.

useful