olegtut last edited by
Consent to add module to BAS: yes;
Briefly: waits for at least one element out of all possible. You can search by CSS, XPATH, MATCH and base64.
a) wait for the appearance on the page of one of the elements of different types (CSS, base64, etc.);
d) set a timeout for the implementation of the above actions;
e) set simple actions when an element is detected (click, move the mouse over the element, clear the field)
Working with the result: The module returns the [[ELEM]] variable as an object containing information:
1) [[ELEM]].timeout - a boolean value (true or false) indicating that the timeout has been triggered and that the specified elements are not present on the page. The timeout does not throw a default die error and does not abort the script. To check if the timeout has expired, simply insert the [[ELEM]].timeout construct into the IF cube.
2) [[ELEM]].found - the first element found, returns either undefined (a timeout has occurred or the element is not on the page), or a string with a selector;
3) [[ELEM]].bool[N] - where N is an id number. Returns either true or false. Allows you to check whether the element specified in the module under a certain number is found. For example, [[ELEM]].bool will return true or false for the 5th element that was typed into this function to be searched. Remember that an element can be false even if it is present on the page, this is due to the fact that the element with the ordinal number above was found first, and the module stops working as soon as it finds the first element found;
4) [[ELEM]].bool.nN - where N is an id number. This is an analogue of the previous spelling. For example, [[ELEM]].bool.n5 will return true or false for element 5;
5) [[ELEM]].val or [[ELEM]].val.n5 - the value of the 5th element entered by the user for the search, replace "5" with any other number of interest.
Features of the module:
- The module interrupts its execution as soon as it finds the first element it encounters;
- By default, the timeout is set to 0, which means an infinite search, but for reasonable reasons I do not recommend building the search logic this way, however, you will decide for yourself;
- Base64 search has default parameters: it won't scroll the page and sets the similarity index to 80.