Skip to main content

sdk.automation

Home > @matterway/sdk > Automation

Automation namespace

Functions

FunctionDescription
clearAndType(ctx, selector, value)Clears an input element and types the value into it.
clearAndTypeByXpath(ctx, selector, value)Selects an input element by Xpath, clears and types into it.
clearInput(ctx, selector)Clears the value in an input element.
clearInputByXPath(ctx, selector)Clears the value in an input element by Xpath.
click(ctx, selector, options)Clicks on an element.
clickByText(ctx, text, filterOptions)Clicks an element by its text content.
clickToNavigate(ctx, selector)Clicks on an element, and wait for navigation to complete.
closePage(ctx)Closes the current browser tab.
createBackgroundPage(ctx, url)Creates a new background browser tab, and returns its scoped Context.
createPage(ctx, url)Creates a new browser tab, and returns its scoped Context.
DOMclick(page, selector)Triggers a mouse click on an element.
doubleClick(ctx, selector, options)Double clicks on an element with provided selector.
errorStepWithRepeat(ctx, fn, options)If function will catch error, it will display bubble with message and option to retry.
fill(ctx, selector, value)Types the value into a form field, replacing the existing text.
fillByXPath(ctx, selector, value)Types the value into a form field by Xpath, replacing the existing text.
fillFileField(ctx, selector, fileContent, fileName, fileType, options)Attachs a base64 file to a file input field.
getDataFromFile(ctx, fileUrl, headers)Fetchs a URL and returns the response body as a base64 string.
getDataFromFileInput(ctx, selector, options)Returns the files attached to a file input.
getElementByText(ctx, text, options)Returns an element based on its text content.
getProperty(ctx, selector, propertyName, options)Returns the value of an element property.
getValue(ctx, selector, options)Returns the value of a form element.
getValueByXpath(ctx, selector)Returns the value of a form element by XPath.
goBack(ctx, options)Goes back to the previous page in the browser tab. Waits until domcontentloaded by default
goToPage(ctx, url, options)Navigates to the specified URL in the given browser tab.
makeXPathSelector(text, options)
mouseClick(ctx, selector, options)Mouse clicks on an element with provided selector, clickCount and button
press(ctx, keys, options)Simulates pressing a key, or a combination of keys.
pressEnterKey(ctx, selector)Simulates pressing the Enter key on the keyboard.
reloadPage(ctx, options)Reloads the current page in the given browser tab. Waits until domcontentloaded by default
retry(ctx, fn, options)Runs a function and retries it on exception.
selectFrame(ctx, selector, options)Selects an IFrame, and returns its scoped Context.
selectNestedFrame(ctx, selectors)Selects a nested IFrame, and returns its scoped Context.
selectRadioButton(ctx, selector, value)Selects a radio button.
setCheckbox(ctx, selector, value)Checks the checkbox element, unless a specific value is passed.
setProperty(ctx, selector, propertyName, value, options)Changes the value of an element property.
setValue(ctx, selector, value, options)Changes the value of a form element.
setValueByXPath(ctx, selector, value)Changes the value of a form element by XPath.
triggerContextMenu(ctx, selector, options)Triggers contextmenu event on element.
type(ctx, selector, value, options)Types into a form field, after the existing text.
typeByXPath(ctx, selector, value, options)Types into a form field by Xpath, after the existing text.

Interfaces

InterfaceDescription
Data
ErrorStepWithRepeatOptions
FillOptions
FilterOptions
MouseClickOptions
PressKeyOptions
RetryOptions

Variables

VariableDescription
clickByXPathClicks on an element by Xpath.
extractDataset element property