Skip to content

Predefined Function

You can use validation and condition while filling the form using predefined function. The predefined function can be added to the field of the form.

You can also use variables in the value of predefined functions. like this

{$excel_column_name$}

checkAttributeExists

If you want to check attribute in the html element whether the attribute is in the element or not also check attribute value match or not match, then you can use it.

OptionsRequiredDescriptionValue
Selector TypetrueElement Selector Type
Selector QuerytrueElement Selector Query
Field ValuetrueFill Value with Condition[attribute_name][attribute_value][force_check]
Wait Until Element Foundfalse
  • Field Value - [string][string][boolean]

checkAttributeNotExists

If you want to check attribute in the html element not exists also check attribute value match or not match, then you can use it.

OptionsRequiredDescriptionValue
Selector TypetrueElement Selector Type
Selector QuerytrueElement Selector Query
Field ValuetrueFill Value with Condition[attribute_name][attribute_value][force_check]
Wait Until Element Foundfalse
  • Field Value - [string][string][boolean]
  • [name][][true], if name attribute not exists in element then return true
  • [name][username][true], if name attribute exists in element but attribute value is not username then return true

checkElementText

To match the text/value of an element according to the condition, then you can use this function.

OptionsRequiredDescriptionValue
Selector TypetrueElement Selector Type
Selector QuerytrueElement Selector Query
Field ValuetrueFill Value with Condition[comparison_operators][text][force_check]
Wait Until Element Foundfalse
Execute the action of the function on multiple elementsfalse

Structure of Field Value

  • [parameter-1][parameter-2][parameter-3]
  • [comparison operators][text][wait until text matches]
  • [operator][string][boolean]

INFO

Comparison Operators (==, !=, >, <, <=, >=)

checkElementLength

To match the length of an element according to the condition, then you can use this function.

OptionsRequiredDescriptionValue
Selector TypetrueElement Selector Type
Selector QuerytrueElement Selector Query
Field ValuetrueFill Value with Condition[comparison_operators][length_number][force_check]
Wait Until Element Foundfalse

Structure of Field Value

  • [parameter-1][parameter-2][parameter-3]
  • [comparison operators][length_number][wait until length matches]
  • [operator][string][boolean]

INFO

Comparison Operators (==, !=, >, <, <=, >=)

Value Example

  • [==][20][true]
  • [>][3][false]

checkElementExists

If you want to check an element whether the element is in the page or not, then you can use it.

OptionsRequired
Selector Typetrue
Selector Querytrue
Wait Until Element Foundfalse

checkElementDestroy

If you want to check an element whether the element is in the page or not, then you can use it.

OptionsRequired
Selector Typetrue
Selector Querytrue
Wait Until Element Foundfalse

checkElementVisible

If you want to check an element whether the element is there in the page or not and the element is visible to us then you can use this.

OptionsRequired
Selector Typetrue
Selector Querytrue
Wait Until Element Foundfalse

checkElementInvisible

If you want to check an element whether the element is in the page or not and the element is invisible then you can use this.

OptionsRequired
Selector Typetrue
Selector Querytrue
Wait Until Element Foundfalse

removeElement

If you want to remove element from page.

OptionsRequired
Selector Typetrue
Selector Querytrue

cleanSessionStorage

This method removes all the Session Storage Object item for this domain.

cleanLocalStorage

This method removes all the Local Storage Object item for this domain.

countCharLength

You can count given character in the element string.

OptionsRequiredDescriptionValue
Selector TypetrueElement Selector Type
Selector QuerytrueElement Selector Query
Field ValuetrueFill Value with Condition[a][true]
[In][false]
Wait Until Element Foundfalse

Structure of Field Value

  • [parameter-1][parameter-2]
  • [string matching][case-sensitive]
  • [string][boolean]

Example

If element string is "Indian" and field value is "[i][true]" then this function return 2;

Indian => [i][true] => 2
Indian => [i][false] => 1
Indian => [In][false] => 1
Indian => [A][false] => 0

countCharsLength

You can count total characters in string.

OptionsRequiredDescriptionValue
Selector TypetrueElement Selector Type
Selector QuerytrueElement Selector Query
Wait Until Element Foundfalse

Example

If element string is "India" then this function return 5;

countSplitArrayLength

You can count split array length.

OptionsRequiredDescriptionValue
Selector TypetrueElement Selector Type
Selector QuerytrueElement Selector Query
Field ValuetrueSplit String,,
\r\n
Wait Until Element Foundfalse

Example

If element string is "India,,Israel" and field value is ",," then this function return 2;

NOTE

If there are values ​​in new line then use this \r\n for split values.

countTableRows

You can check the rows of the table according to the condition.

OptionsRequiredDescriptionValue
Selector TypetrueElement Selector Type
Selector QuerytrueElement Selector Query
Field ValuetrueFill Value with Condition[==][2][true]
[<=][3][false]
Wait Until Element Foundfalse

Structure of Field Value

  • [parameter-1][parameter-2][parameter-3]
  • [comparison operators][number of rows][wait until row matches]
  • [string][number][boolean]

INFO

Comparison Operators (>, <, ==, !=, <=, >=)

checkDropdownValue

If you want to check for a string in the dropdown element options value, then you can use it. If string matched then field return option text.

OptionsRequiredDescriptionValue
Selector TypetrueElement Selector Type
Selector QuerytrueElement Selector Query
Field ValuetrueFill Value with Condition[option1][true]
[M][false]

Structure of Field Value

  • [parameter-1][parameter-2]
  • [search string][wait until string matches]
  • [string][boolean]

checkDropdownText

If you want to check for a string in the dropdown element options name, then you can use it. If string matched then field return option value.

OptionsRequiredDescriptionValue
Selector TypetrueElement Selector Type
Selector QuerytrueElement Selector Query
Field ValuetrueFill Value with Condition[option1][true]
[M][false]

Structure of Field Value

  • [parameter-1][parameter-2]
  • [search string][wait until string matches]
  • [string][boolean]

downloadFile

Wait for download (file) to complete and perform given action when download is done, also you can attach this function with given button

INFO

Suppose you have a button when clicked, some file starts downloading and you want to wait until this downloading is done and perform some action after it.

Demo

OptionsRequiredDescriptionValue
Selector TypefalseElement Selector Type
Selector QueryfalseElement Selector Query
Trigger Javascript EventtrueEnter Event Nameclick

insertClassName

The insertClassName method adds one or more CSS class names to the element. This method does not remove existing class attributes, it only adds one or more class names to the class attribute.

OptionsRequiredDescriptionValue
Selector TypetrueElement Selector Type
Selector QuerytrueElement Selector Query
Field ValuetrueFill css class namebg-danger,text-white,..
Wait Until Element Foundfalse
Execute the action of the function on multiple elementsfalse

removeClassName

This removeClassName method removes one or more the element CSS class name.

OptionsRequiredDescriptionValue
Selector TypetrueElement Selector Type
Selector QuerytrueElement Selector Query
Field ValuetrueFill CSS class namebg-danger,text-white,..
Wait Until Element Foundfalse
Execute the action of the function on multiple elementsfalse

INFO

If you want to remove all element classes then set value remove-all-classes.

insertCSSText

The insertCSSText method sets the text of the element's inline style. This method removes the existing inline style.

OptionsRequiredDescriptionValue
Selector TypetrueElement Selector Type
Selector QuerytrueElement Selector Query
Field ValuetrueFill CSS style namefloat:left;margin-top:75px;
Wait Until Element Foundfalse
Execute the action of the function on multiple elementsfalse

removeCSSText

The removeCSSText method remove the text of the element's inline style.

OptionsRequiredDescriptionValue
Selector TypetrueElement Selector Type
Selector QuerytrueElement Selector Query
Field ValuetrueFill CSS style namefloat,margin-top,..
Wait Until Element Foundfalse
Execute the action of the function on multiple elementsfalse

INFO

If you want to remove all element style then set value remove-all-css-text.

insertElementAttribute

The insertElementAttribute method sets the value of an attribute on the element. If the attribute already exists, the value is updated otherwise a new attribute is added with the specified name and value.

OptionsRequiredDescriptionValue
Selector TypetrueElement Selector Type
Selector QuerytrueElement Selector Query
Field ValuetrueFill attribute name and valueattName,attValue
Wait Until Element Foundfalse
Execute the action of the function on multiple elementsfalse

removeElementAttribute

If you want to remove the attribute of an element then you can use it one or more.

OptionsRequiredDescriptionValue
Selector TypetrueElement Selector Type
Selector QuerytrueElement Selector Query
Field ValuetrueFill attribute nameattName,attName,attName,...
Wait Until Element Foundfalse
Execute the action of the function on multiple elementsfalse

scrollToTopLeft

Use this method to scroll the page from top to left.

scrollToTopRight

Use this method to scroll the page from top to right.

scrollToBottomLeft

Use this method to scroll the page from bottom to left.

scrollToBottomRight

Use this method to scroll the page from bottom to right.

scrollIntoView

The scrollIntoView method scrolls an element into the visible area of the browser window.

OptionsRequiredDescription
Selector TypetrueElement Selector Type
Selector QuerytrueElement Selector Query
Field ValuetrueParams
Wait Until Element Foundfalse

playSound

If you use this function, then the tab in which the sound is playing will not pause.

waitSeconds

If you want to wait for some time, then you can wait by giving value in seconds through this function.

OptionsRequiredDescription
Field ValuetrueFill seconds

TIP

Use variable {{random.integer[0][12]}} for random seconds.

getPageTitle

If you want to get page title string.

setPageTitle

If you want to set/change page title.

OptionsRequiredDescription
Field ValuetrueFill Title String

isWindowChild

If you want to check whether the current window is a child window or not, then you can use it. This function returns true (1) if it is a child window, false (0) otherwise.

isWindowIframe

If you want to check whether the current window is an iframe or not, then you can use it. This function returns true (1) if it is an iframe, false (0) otherwise.

countElementLength

To count the length of an element then you can use this function.

OptionsRequiredDescription
Selector TypetrueElement Selector Type
Selector QuerytrueElement Selector Query

Released under the MIT License.