Skip to content

Ui-licious API Reference

Navigate to a URL, switch between tabs, and assert the page URL and title.

APIDescription
I.goTo()Navigate to a URL
I.refreshPage()Refresh the current page
I.amAt()Validate the current page URL
I.getURL()Get the current page URL
I.getPageTitle()Get the current page title
I.seePageTitle()Assert the current page title
I.switchTab()Switch to another tab
I.closeTab()Close the current tab

Mouse Actions

Interact with the page using the mouse.

Click and Hover

APIDescription
I.click()Click an element or position with the left mouse button
I.doubleClick()Double click an element or position with the left mouse button
I.rightClick()Click an element or position with the right mouse button
I.hoverOn()Hover over an element or a position

Drag and Drop

APIDescription
I.dragTo()Drag an element and drop on another element.
I.dragBy()Drag an element by a distance, in pixels.
I.dragUp()Drag an element up, in pixels.
I.dragDown()Drag an element down, in pixels.
I.dragLeft()Drag an element to the left, in pixels.
I.dragRight()Drag an element to the right, in pixels.

Scroll

APIDescription
I.scrollBy()Scroll the page horizontally and vertically, in pixels.
I.scrollUp()Scroll the page up, in pixels.
I.scrollDown()Scroll the page down, in pixels.
I.scrollLeft()Scroll the page to the left, in pixels.
I.scrollRight()Scroll the page to the right, in pixels.
I.scrollTo()Scroll to a position on the page.
I.scrollToTop()Scroll to the top of the page.
I.scrollToBottom()Scroll to the bottom of the page.

Keyboard Actions

Send keyboard input to the page.

APIDescription
I.type()Type a string of text
I.press()Press a key or a combination of key

Form Input and Validation

Enter data and validate existing value in form input fields.

APIDescription
I.fill()Fill in a text input field
I.filled()Assert the value of a text input field.
I.select()Select a dropdown option or check a checkbox or radio button
I.selected()Assert that a dropdown option is selected or that a checkbox or radio button is checked
I.deselect()Uncheck a checkbox
I.deselected()Assert that a dropdown option is NOT selected or that a checkbox or radio button is unchecked.
I.upload()Uploads a file to a file input field.
I.clear()Clears an input field.

Page Content Assertions

Validate the content and attributes of elements on the page.

APIDescription
I.see()Assert that a text or element is visible.
I.dontSee()Assert that a text or element is NOT visible.
I.count()Assert the number of occurrences of a matching text or element.
UI.hasAttribute()Assert that a matching element has a specific attribute.
UI.doesNotHaveAttribute()Assert that a matching element does NOT have a specific attribute.
UI.hasClass()Assert that a matching element has a specific CSS class.
UI.doesNotHaveClass()Assert that a matching element does not have a specific CSS class

Page Content Extraction

Read the content and attributes of elements on the page.

APIDescription
I.getCount()Return the number of occurrences of a matching text or element.
I.getText()Return the text of a matching element.
I.getValue()Return the current value of an input element.
UI.getAttribute()Return the value of an attribute for a matching element.
UI.getAttributes()Return a map of attributes for a matching element.
UI.getInnerHTML()Return the inner HTML of a matching element.
UI.getOuterHTML()Return the outer HTML of a matching element.

Scoping and Targeting

Control how elements are located by limiting the search scope or providing contextual hints for target resolution.

APIDescription
UI.context()Scopes a block of test commands to a specific DOM subtree or iframe.
I.see.hint()Variant of I.see().
Mark a target as a hint for resolving nearby elements in subsequent steps.

Browser

Access information about the current browser and control its window size for responsive and cross-browser testing.

APIDescription
TEST.browser(Read-only property) Returns the name of the browser the current test is running with.
UI.resize()Resize the browser
UI.innerWidth(Read-only property) The inner width of the browser
UI.innerHeight(Read-only property) The inner height of the browser
UI.outerWidth(Read-only property) The outer width of the browser
UI.outerHeight(Read-only property) The outer height of the browser

Cookies

Read, set, and validate cookies on the current page.

APIDescription
UI.COOKIE.set()Set the value of a cookie on the current page.
UI.COOKIE.isSet()Assert the presence of a cookie on the current page.
UI.COOKIE.isEqual()Assert the value of a cookie on the current page.
UI.COOKIE.delete()Delete a cookie on the current page.
UI.COOKIE.deleteAll()Delete all cookies on the current page.

Local Storage

Read, set, and validate items in the local storage.

APIDescription
UI.LocalStorage.get()Get the value of an item in local storage on the current page.
UI.LocalStorage.set()Set the value of an item in local storage on the current page.
UI.LocalStorage.delete()Delete an item in local storage on the current page.
UI.LocalStorage.deleteAll()Clear the local storage on the current page.

Downloaded Files

List and validate downloaded files.

APIDescription
UI.Downloads.files(Read-only property) List of files.
UI.Downloads.files.first(Read-only property) First file downloaded.
UI.Downloads.files.last(Read-only property) Last file downloaded.
UI.Downloads.listFiles()List downloaded files.
UI.Downloads.hasFile()Assert that a file with a specified name or name pattern has been downloaded.

Browser Dialogs

Interact with native browser alerts, confirmation, and prompt dialogs.

APIDescription
I.seeAlert()Assert that a browser alert is open, optionally checks the alert text.
I.acceptAlert()Accept a browser alert and closes it.
I.cancelAlert()Cancel a browser confirmation dialog and closes it.
I.fillAlert()Fill in the input box of a browser prompt dialog.

JavaScript Execution

Execute javascript code on the browser.

APIDescription
UI.execute()Run arbitrary code inside the browser context.

HTTP Requests

Send HTTP requests.

APIDescription
UI.httpGet()Send a HTTP GET request.
UI.httpPost()Send a HTTP POST request.
UI.httpRequest()Send a HTTP request

Test Execution & Control

Control test flows and timeouts.

APIDescription
I.see$()Variant of I.see().
Returns a boolean without failing the test (used for conditional flows).
I.must.see()Variant of I.see().
Fails and stops the test if the target is not visible.
TEST.run()Run another test file.
TEST.runOnce()Run a test file only once, even if TEST.runOnce() is called multiple times for the same file.
TEST.stop()Stop the test.
TEST.commandTimeoutConfigure the timeout for test commands.
I.wait()Wait for a fixed duration.

Reporting and Screenshots

Control screenshot behaviour and log custom messages to the test reports.

APIDescription
TEST.log.info()Log a message to the test report.
TEST.log.pass()Log a message with a success status to the test report.
TEST.log.fail()Log a message with a failure status to the test report.
TEST.assert()Assert a condition and log a message with a success / failure status to the test report depending on the condition.
TEST.autoScreenshotWhen enabled, a screenshot is taken for every test command.

Loading Data Files

Load test data from files.

APIDescription
TEST.loadDataFromCsv()Load data from a CSV file.
TEST.loadDataFromJson()Load data from a JSON file.