Skip to main content
Modules

Browser

Browser

The Browser module is responsible for performing every action inside a browser. Its methods can be accessed as in the example below:

js
const navegador = await Browser.open["v1_0_0"]({
url: `https://www.google.com.br/`,
browser: `chrome`,
})

Methods

apiRequest

Method responsible for performing requests to a given API through its url.

js
const response = await Browser.apiRequest["v1_0_0"]({
browser: navegador,
url: `https://api.com.br/api/v1/cars/${carsID}}/`,
requestConfig: {
method: 'GET',
}
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method.
  • url: String - URL of the API.

Optional parameters

  • requestConfig: Object - expects an object with the request settings. The options are all the properties available in the API Request class, which can be found by clicking here.

Return

The constant or variable created, such as the response of the example shown earlier, receives the return of the request.

checkBox

Method responsible for checking or unchecking a browser element.

js
await Browser.checkBox["v1_0_0"]({
browser: navegador,
selector: `#btn-checkBox`,
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method. This parameter must not be filled in if the element parameter is passed.
  • selector: String - expects a string indicating the element that will be clicked.
  • element: Element<SVGElement|HTMLElement> - expects a value of the Element<SVGElement|HTMLElement> type obtained through the getElement method. This value is optional if the selector and browser parameters are filled in.

Optional parameters

  • option: Boolean - expects a boolean value representing whether it will be checked or unchecked.
  • timeout: Number - expects a value in milliseconds indicating the maximum waiting time for the element to be recognized. If it is not passed, the default value is 30000 milliseconds.
  • state: String - expects a string indicating the state of the element that will be clicked. If it is not passed, the default value is visible. The state types are:
    • visible - Visible element;
    • hidden: Hidden element;
    • attached: Element present in the DOM structure (page HTML);
    • detached: Element not present in the DOM structure.

click

Method responsible for clicking on a browser element.

js
await Browser.click["v1_0_0"]({
browser: navegador,
selector: `#btn-click`,
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method. This parameter must not be filled in if the element parameter is passed.
  • selector: String - expects a string indicating the element that will be clicked.
  • element: Element<SVGElement|HTMLElement> - expects a value of the Element<SVGElement|HTMLElement> type obtained through the getElement method. This value is optional if the selector and browser parameters are filled in.

Optional parameters

  • button: String - expects a string indicating the mouse button that will be used to click on the element. If it is not passed, the default value is left. The button types are:
    • left - Left mouse button;
    • middle: Middle mouse button;
    • right: Right mouse button.
  • delay: Number - expects a value in milliseconds indicating the waiting time between pressing and releasing the mouse button. If it is not passed, the default value is 0.
  • timeout: Number - expects a value in milliseconds indicating the maximum waiting time for the element to be recognized. If it is not passed, the default value is 30000 milliseconds.
  • state: String - expects a string indicating the state of the element that will be clicked. If it is not passed, the default value is visible. The state types are:
    • visible - Visible element;
    • hidden: Hidden element;
    • attached: Element present in the DOM structure (page HTML);
    • detached: Element not present in the DOM structure.
  • force: Boolean - expects a boolean value indicating whether the click will be performed ignoring the element states. If it is not passed, the default value is false.

clickLocator

Action responsible for clicking on an element by its XPath on a given page already opened in a browser.

js
await Browser.clickLocator["v1_0_0"]({
browser: navegador,
xPath: `/html/body/div/div[1]/main/div[3]/div[2]/div/div/div/a/button`,
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method. This parameter must not be filled in if the element parameter is passed.
  • xPath: String - expects a string indicating the element that will be clicked.

clickText

Action responsible for performing a click on an element with a text provided on a given page already opened. The click can be on the first element found with the text provided, on all of them or on one with an index indicated.

js
await Browser.clickText["v1_0_0"]({
browser: navegador,
text: `Clique aqui`,
indice: 1
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method. This parameter must not be filled in if the element parameter is passed.
  • text: String - expects a string with the text of the element

Optional parameters

  • indice: Number - expects a number with the index of the element.

close

Method responsible for closing a browser.

js
await Browser.close["v1_0_0"]({
browser: navegador,
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method.

downloadFile

Method responsible for downloading a file through an element or selector that has the download event, or downloading it through a URL.

js
await Browser.downloadFile["v2_0_0"]({
browser: browser,
selector: '#hl > a',
downloadPath: 'C:/Users/Roberty/Downloads',
filename: 'documento.pdf',
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method.
  • selector: String - expects a string indicating the element that has the download event.
  • element: Element<SVGElement|HTMLElement> - expects a value of the Element<SVGElement|HTMLElement> type obtained through the getElement method. This value is optional if the selector and browser parameters are filled in.
  • url: String - expects a string indicating the URL that will be used to perform the download. This value is optional if the selector and browser parameters are filled in.
  • downloadPath: String - expects a string indicating the path where the file will be saved.

Optional parameters

  • filename: String - expects a string indicating the name of the file that will be saved. This value is optional; if it is not passed, the file name is generated randomly.

existElement

Method responsible for checking whether an element exists on the page.

js
const flagElement = await Browser.existElement["v1_0_0"]({
browser: browser,
selector: '#input-id',
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method.
  • selector: String - expects a string indicating the element that will be checked.

Optional parameters

  • timeout: Number - expects a value in milliseconds indicating the maximum waiting time for the element to be recognized. If it is not passed, the default value is 30000 milliseconds.
    • state: String - expects a string indicating the state of the element that will be clicked. If it is not passed, the default value is visible. The state types are:
      • visible - Visible element;
      • hidden: Hidden element;
      • attached: Element present in the DOM structure (page HTML);
      • detached: Element not present in the DOM structure.

Return

The constant or variable created, such as the flagElement shown in the previous example, receives true if the element exists on the page and false otherwise.

fillField

Action responsible for filling in an element of a given page already opened in a browser. This element can be filled in by its label or placeholder.

js
const fillField = await Browser.fillField["v1_0_0"]({
browser: browser,
text: string
fillText: string
option?: `placeholder` | `label`
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method.
  • text: String - expects a string indicating the element that will be filled in.
  • fillText: String - expects a string with the text you want to fill in.

Optional parameters

  • option: String - expects a string indicating from which text it will fill in. The types are:
    • placeholder - Placeholder;
    • label: Label.

Return

The constant or variable created, such as the flagElement shown in the previous example, receives true if the element exists on the page and false otherwise.

focus

Method responsible for focusing on a browser element.

js
const focusedElement = await Browser.focus["v1_0_0"]({
browser: navegador,
selector: `#input`,
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method. This value is optional if the element parameter is filled in.
  • selector: String - expects a string indicating the element that will be focused. This value is optional if the element parameter is filled in.
  • element: Element<SVGElement|HTMLElement> - expects a value of the Element<SVGElement|HTMLElement> type obtained through the getElement method. This value is optional if the selector and browser parameters are filled in.

Return

The constant or variable created to receive the return of the method, such as the focusedELement constant shown in the previous example, receives a value of the Element<SVGElement|HTMLElement> type — that is, the element that was focused.

getElement

Method responsible for getting an element of the browser or of an element already obtained by another getElement method.

js
const elemento = await Browser.getElement["v1_0_0"]({
browser: navegador,
selector: `#btn-click`,
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method. This parameter must not be filled in if the element parameter is passed.
  • selector: String - expects a string indicating the element that will be obtained.
  • element: Element<SVGElement|HTMLElement> - expects a value of the Element<SVGElement|HTMLElement> type obtained through the getElement method. This value is optional if the selector and browser parameters are filled in.

Optional parameters

  • timeout: Number - expects a value in milliseconds indicating the maximum waiting time for the element to be recognized. If it is not passed, the default value is 30000 milliseconds.
  • state: String - expects a string indicating the state of the element that will be obtained. If it is not passed, the default value is visible. The state types are:
    • visible - Visible element;
    • hidden: Hidden element;
    • attached: Element present in the DOM structure;
    • detached: Element not present in the DOM structure.

Return

In the elemento constant shown in the previous example, a value of the Element<SVGElement|HTMLElement> type is returned, so every method belonging to the Element<SVGElement|HTMLElement> type can be used. You can find all of these methods by clicking here.

getElementAttributeHtml

Method responsible for getting the value of an html attribute of an element.

js
const atributo = await Browser.getElementAttributeHtml["v1_0_0"]({
browser: navegador,
selector: `#btn-click`,
attribute: `id`,
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method. This parameter must not be filled in if the element parameter is passed.
  • selector: String - expects a string indicating which element the html attribute value will be obtained from.
  • element: Element<SVGElement|HTMLElement> - expects a value of the Element<SVGElement|HTMLElement> type obtained through the getElement method. This value is optional if the selector and browser parameters are filled in.
  • attribute: String - expects a string indicating the html attribute that will be obtained.

Return

In the atributo constant shown in the previous example, a String with the value present in the html attribute passed is returned.

getElementHtml

Method responsible for getting the value of an html element.

js
const atributo = await Browser.getElementHtml["v1_0_0"]({
browser: navegador,
selector: `#btn-click`,
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method. This parameter must not be filled in if the element parameter is passed.
  • selector: String - expects a string indicating which element the html will be obtained from.
  • element: Element<SVGElement|HTMLElement> - expects a value of the Element<SVGElement|HTMLElement> type obtained through the getElement method. This value is optional if the selector and browser parameters are filled in.

Return

It returns a String with the value present in the element.

getElementText

Method responsible for getting the value of a text element.

js
const atributo = await Browser.getElementText["v1_0_0"]({
browser: navegador,
selector: `#btn-click`,
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method. This parameter must not be filled in if the element parameter is passed.
  • selector: String - expects a string indicating which element the text will be obtained from.
  • element: Element<SVGElement|HTMLElement> - expects a value of the Element<SVGElement|HTMLElement> type obtained through the getElement method. This value is optional if the selector and browser parameters are filled in.

Return

It returns a String with the value present in the element.

getElements

Method responsible for getting several elements and storing them in an array.

js
const elementos = await Browser.getElements["v1_0_0"]({
browser: navegador,
selector: `#btn-click`,
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method. This parameter must not be filled in if the element parameter is passed.
  • selector: String - expects a string indicating the element that will be obtained.
  • element: Element<SVGElement|HTMLElement> - expects a value of the Element<SVGElement|HTMLElement> type obtained through the getElement method. This value is optional if the selector and browser parameters are filled in.

Optional parameters

  • timeout: Number - expects a value in milliseconds indicating the maximum waiting time for the element to be recognized. If it is not passed, the default value is 30000 milliseconds.
  • state: String - expects a string indicating the state of the element that will be obtained. If it is not passed, the default value is visible. The state types are:
    • visible - Visible element;
    • hidden: Hidden element;
    • attached: Element present in the DOM structure;
    • detached: Element not present in the DOM structure.

Return

In the elementos constant shown in the previous example, a value of the Element<SVGElement|HTMLElement>[] type is returned, that is, an array of elements of the Element<SVGElement|HTMLElement> type. So you can use any array method or property to handle the elements in it. Click here to see every method and property of an array.

getIframe

Method responsible for getting an iframe.

js
const iframe = await Browser.getIframe["v1_0_0"]({
browser: navegador,
selector: `#iframe`,
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method. This parameter must not be filled in if the element parameter is passed.
  • selector: String - expects a string indicating the element that will be obtained.

Return

  • iframe._args: Object - returns an object with the iframe settings.
  • iframe._browser: Browser - returns an instance of the Browser type with the context of the iframe that was obtained.
  • iframe._page: Page - returns a Page instance of the Iframe.

getPageURL

Method responsible for getting the URL of the current page.

js
const url = await Browser.getPageURL["v1_0_0"]({
browser: navegador,
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method.

Return

It returns a string that is the URL of the current page.

goto

Method responsible for directing the browser page to a given URL.

js
await Browser.goto["v1_0_0"]({
browser: navegador,
url: `https://roberty.app/`,
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method.
  • url: String - expects a valid url to direct the browser page to.

Optional parameters

  • timeout: Number - expects a value in milliseconds indicating the maximum waiting time for the page to load. If it is not passed, the default value is 30000 milliseconds.
  • waitUntil: String - expects a string indicating the type of waiting condition for the page to load. If it is not passed, the default value is load. The waiting condition types are:
    • Load - Standard loading: Waits for the page to load (default option);
    • DOMContentLoaded: Waits for the full loading of the page structure (HTML components without the CSS and images);
    • Loading via *network*: Waits for the loading through the network resources. If there is no network request for 0.5 second, the action understands that the page is completely loaded.

open

Method responsible for opening a browser and directing it to a URL.

js
const navegador = await Browser.open["v1_0_0"]({
url: `https://roberty.app/`,
browser: `chrome`,
})

Required parameters

  • url: String - expects a valid url to direct the browser to as soon as it opens.
  • browser: String - expects the name of the browser that will be used.

Optional parameters

  • incognito: Boolean - expects a boolean value indicating whether the browser will be opened in incognito mode. If it is not passed, the default value is false.
  • options: Object - expects an object with the browser settings. It accepts every browser context setting provided by the Playwright library.

Retornos

  • navegador._args: Object - returns an object with the browser settings.
  • navegador._browser: Browser - returns an instance of the Browser type with the context of the browser that was opened.
  • navegador._page: Page - returns an instance of the Page type with the page that was opened.

pressKey

Method responsible for pressing a key on a browser element.

js
const pressedElement = await Browser.pressKey["v1_0_0"]({
browser: navegador,
selector: `#button-login`,
key: `Enter`,
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method.
  • selector: String - expects a string indicating the element that will be pressed.
  • element: Element - expects an element obtained through the getElement method. This parameter is optional if the selector parameter is filled in.
  • key: String - expects a string indicating the key that will be pressed.

Optional parameters

  • count: Number - expects an integer value indicating how many times the key will be pressed on the element. If it is not passed, the default value is 1.
  • delay: Number - expects a value in milliseconds indicating the waiting time between each press. If it is not passed, the default value is 0.

Return

The constant or variable created to receive the return of the method, such as the pressedElement constant shown in the previous example, receives a value of the Element<SVGElement|HTMLElement> type — that is, the element that was focused.

reload

Method responsible for reloading the page of a browser instance.

js
await Browser.reload["v1_0_0"]({
browser: navegador,
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method.

Optional parameters

  • timeout: Number - expects a value in milliseconds indicating the maximum waiting time for the page to load. If it is not passed, the default value is 30000 milliseconds.
  • waitUntil: String - expects a string indicating the type of waiting condition for the page to load. If it is not passed, the default value is load. The waiting condition types are:
    • Load - Standard loading: Waits for the page to load (default option);
    • DOMContentLoaded: Waits for the full loading of the page structure (HTML components without the CSS and images);
    • Loading via *network*: Waits for the loading through the network resources. If there is no network request for 0.5 second, the action understands that the page is completely loaded.

screenShot

Method responsible for capturing the image of a browser element.

js
const screenshot = await Browser.screenshot["v1_0_0"]({
browser: navegador,
selector: `#button-login`,
filePath: 'C:/Users/Murillo Candioto/Download',
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method.
  • selector: String - expects a string indicating the element that will be captured.
  • element: Element - expects an element obtained through the getElement method. This parameter is optional if the selector parameter is filled in.
  • filePath: String - expects a string indicating the path where the element capture will be saved.

Optional parameters

  • fileName: String - expects a string indicating the name of the file that will be saved. If it is not passed, a random name is generated.
  • fileType: String - expects a string indicating the type of the file that will be saved. If it is not passed, a JPEG file is generated.

Return

The constant or variable created to receive the return of the method, such as the screenshot constant shown in the previous example, receives a value of the String type — that is, the path of the file saved.

typeInput

Method responsible for typing a text into a browser element.

js
const typedElement = await Browser.typeInput["v1_0_0"]({
browser: navegador,
selector: `#input-login`,
value: `usuario`,
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method.
  • selector: String - expects a string indicating the element that will be typed into.
  • element: Element - expects an element obtained through the getElement method. This parameter is optional if the selector parameter is filled in.
  • value: String - expects a string that will be the text to be typed into the element.

Optional parameters

  • clearBefore: Boolean - expects a boolean value indicating whether the element must be cleared before the text is typed. If it is not passed, the default value is false.
  • delay: Number - expects a value in milliseconds indicating the waiting time between each character that will be typed. If it is not passed, the default value is 0.
  • state: String - expects a string indicating the state of the element that will be clicked. If it is not passed, the default value is visible. The state types are:
    • visible - Visible element;
    • hidden: Hidden element;
    • attached: Element present in the DOM structure (page HTML);
    • detached: Element not present in the DOM structure.

Return

The constant or variable created to receive the return of the method, such as the typedElement constant shown in the previous example, receives a value of the Element<SVGElement|HTMLElement> type — that is, the element that was focused.

upload

Method responsible for uploading a file into a browser element.

js
const uploadedElement = await Browser.upload["v1_0_0"]({
browser: navegador,
selector: `#input-file`,
files: [`C:/Users/Roberty/Download/file1.txt`,`C:/Users/Roberty/Download/file2.txt`]
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method.
  • selector: String - expects a string indicating the element that will be clicked.
  • element: Element - expects an element obtained through the getElement method. This parameter is optional if the selector parameter is filled in.
  • files: String[] - expects an array of strings with the paths of the files that will be sent.

Optional parameters

  • noWaitAfter: Boolean - expects a boolean value indicating whether the method must wait for the end of the upload. If it is not passed, the default value is false.
  • timeout: Number - expects a value in milliseconds indicating the waiting time for the end of the upload. If it is not passed, the default value is 0.

Return

The constant or variable created to receive the return of the method, such as the uploadedElement constant shown in the previous example, receives a value of the Element<SVGElement|HTMLElement> type — that is, the element that received the files.

waitForNavigation

Method responsible for waiting for the browser page to load.

js
await Browser.waitForNavigation["v1_0_0"]({
browser: navegador,
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method.

Optional parameters

  • timeout: Number - expects a value in milliseconds indicating the maximum waiting time for the page to load. If it is not passed, the default value is 30000 milliseconds.
  • waitUntil: String - expects a string indicating the type of waiting condition for the page to load. If it is not passed, the default value is load. The waiting condition types are:
    • Load - Standard loading: Waits for the page to load (default option);
    • DOMContentLoaded: Waits for the full loading of the page structure (HTML components without the CSS and images);
    • Loading via *network*: Waits for the loading through the network resources. If there is no network request for 0.5 second, the action understands that the page is completely loaded.

newTab

Method responsible for opening a new page in a browser. The browser can be one that is already open or one that can be opened by the action itself. Just pass the browser field instead of schemaBrowser so the page opens in a new browser.

js
const pagina = await Browser.newTab.v1_0_0({
schemaBrowser: navegador,
url: 'https://google.com'
})

Required parameters

  • url: String - expects a valid url that will open in the new page.

Optional parameters

  • schemaBrowser: Browser - expects an instance of the Browser type that can be obtained through the open, newTab, getTab getTabFromList or getMostRecentTab methods. This field is only optional if the browser field is filled in.
  • browser: String - expects the name of the browser installed on the user's machine, either chrome or edge. This field is optional if the schemaBrowser field is filled in.
  • headless: Boolean - expects a true or false value indicating whether the browser will appear on the screen or run hidden. This field only needs to be passed when browser is filled in.
  • incognito: Boolean - expects a true or false value indicating whether the browser will open in anonymous mode. This field only needs to be passed when browser is filled in.
  • keepOpened: Boolean - expects a true or false value indicating whether the browser will stay open after the execution or not. This field only needs to be passed when browser is filled in.
  • timeout: Number - expects a value in milliseconds indicating the maximum waiting time for the page to load. If it is not passed, the default value is 30000 milliseconds.
  • waitUntil: String - expects a string indicating the type of waiting condition for the page to load. If it is not passed, the default value is load. The waiting condition types are:
    • Load - Standard loading: Waits for the page to load (default option);
    • DOMContentLoaded: Waits for the full loading of the page structure (HTML components without the CSS and images);
    • Loading via *network*: Waits for the loading through the network resources. If there is no network request for 0.5 second, the action understands that the page is completely loaded.

Retornos

  • pagina._args: Object - returns an object with the settings of the browser where the new page is.
  • pagina._browser: Browser - returns an instance of the Browser type with the context of the browser where the new page is.
  • pagina._page: Page - returns an instance of the Page type with the page that was opened.

closeTab

Method responsible for closing a specific page opened in a browser.

js
await Browser.closeTab.v1_0_0({
browser: pagina
})

Required parameters

getTab

Method responsible for getting a browser page that was opened out of context — for example, clicking a button that opens a new page which then needs to be handled with the actions.

js
const pagina = await Browser.getTab.v1_0_0({
schemaBrowser: navegador,
getBy: `url`,
value: `google.com`

})

Required parameters

  • schemaBrowser: Browser - expects an instance of the Browser type that can be obtained through the open, newTab, getTab,getTabFromList or getMostRecentTab methods.
  • getBy: This field dictates what will be used to get the page that was opened out of context. One of the options below must be chosen:
    • url: String - with this option, the page is searched for through its url.
    • selector: String - with this option, the page is searched for through the selector of an element that exists in it.
    • title: String - with this option, the page is searched for through the page title.
    • position: Number - it gets the page at the position passed.
  • value: expects the value according to the previous getBy field.

Retornos

  • pagina._args: Object - returns an object with the settings of the browser where the page obtained is.
  • pagina._browser: Browser - returns an instance of the Browser type with the context of the browser where the page obtained is.
  • pagina._page: Page - returns an instance of the Page type with the page that was opened.

getAllTabs

Method responsible for getting every page opened in a browser.

js
const todasPaginas = await Browser.getAllTabs.v1_0_0({
browser: navegador
})

Required parameters

Retornos

The return of this method is an array containing the structure of every page obtained. The structure contains the following properties:

  • pagina._args: Object - returns an object with the browser settings.
  • pagina._browser: Browser - returns an instance of the Browser type with the browser context.
  • pagina._page: Page - returns an instance of the Page type with the page that was opened.

getTabFromList

Method responsible for getting a page present in the list of pages obtained by the getAllTabs action

js
const pagina = await Browser.getTabFromList.v1_0_0({
listSchemaBrowser: todasPaginas,
getBy: `url`,
value: `google.com`

})

Required parameters

  • listSchemaBrowser: Browser - expects a list that can be obtained through the getAllTabs method.
  • getBy: This field dictates what will be used to get the page that is inside the list. One of the options below must be chosen:
    • url: String - with this option, the page is searched for through its url.
    • selector: String - with this option, the page is searched for through the selector of an element that exists in it.
    • title: String - with this option, the page is searched for through the page title.
    • position: Number - it gets the page at the position passed.
  • value: expects the value according to the previous getBy field.

Retornos

  • pagina._args: Object - returns an object with the settings of the browser where the page obtained is.
  • pagina._browser: Browser - returns an instance of the Browser type with the context of the browser where the page obtained is.
  • pagina._page: Page - returns an instance of the Page type with the page that was opened.

getMostRecentTab

Method responsible for getting a browser page that was opened out of context — for example, clicking a button that opens a new page which then needs to be handled with the actions.

js
const pagina = await Browser.getMostRecentTab.v1_0_0({
schemaBrowser: navegador,
})

Required parameters

Retornos

  • pagina._args: Object - returns an object with the settings of the browser where the page obtained is.
  • pagina._browser: Browser - returns an instance of the Browser type with the context of the browser where the page obtained is.
  • pagina._page: Page - returns an instance of the Page type with the page that was opened.

commonCaptchaSolve

Method responsible for solving an image captcha in the browser that has symbols hiding the letters and numbers.

js
const commonCaptchaSolve = await Browser.commonCaptchaSolve["v1_0_0"]({
browser: navegador,
selectorImg: `#imagemCaptcha`,
selectorInput: '#input',
})

Required parameters

  • browser: Browser - expects an instance of the Browser type obtained through the open method.
  • selectorImg: String - expects a string that must be the selector of the element where the captcha image is.
  • selectorInput: String - expects a string that must be the selector of the captcha input field.

Return

This action has no returns.

reCaptchaImageSolve

Action responsible for solving browser captchas that require you to click on given images of the same aspect.

js
const reCaptchaImageSolve = await Browser.reCaptchaImageSolve.v1_0_0({
browser: navegador
})

Required parameters

Retornos

  • reCaptchaImageSolve.value: Value - Returns the answer of the captcha resolution.

reCaptchaSolve

Action responsible for solving browser captchas that need only one click confirming "I am not a robot".

js
const recaptchaSolve = await Browser.reCaptchaSolve.v1_0_0({
browser: navegador
})

Required parameters

Retornos

  • recaptchaSolve.value: Value - Returns the answer of the captcha resolution.

setSelectOptions

Action responsible for setting a value, either by text or by position, in an option menu.

js
const setSelectOptions = await Browser.setSelectOptions.v1_0_0({
value: '',
browser: navegador,
selector: ''
})

Required parameters

  • browser: Browser - expects an instance of the Browser type that can be obtained through the open, newTab, getTab or getTabFromList methods.
  • value: String/Number - This field must be filled in with the value corresponding to the value you want to select.
  • selector: String - expects a string indicating the element that will be clicked.

Optional parameters

  • type: This field lets the user choose the type of the value entered in the previous field. The options are:
    • Position: Number - Selects the value according to the position provided;
    • Text: String - Selects the value. Gets the element if it is invisible/hidden from the user's view but is present in the page structure.