Skip to main content
Skip table of contents

Functions

Basic Functions

This following table describes some basic functions used to perform various operations in UI tests.

FunctionDescription
(sim’use viewPath1)Ensures that a control with the given semantic view path exists in the DOM, and sets it as the active control.
(sim’useXPath xPath 2)Sets the active control to a WebElement with the given XPath.
(sim’click)Performs a left click on the active control.
(sim’rclick)Performs a right click on the active control.
(sim’dblclick)Performs a double left click on the active control.
(sim'hover)Performs a mouseover on the active control.
(sim'drag path)Performs a drag and drop from the active control to the control represented by the given argument.
(sim'text)Retrieves the text content of the active control.
(sim’text text3)Writes text to the current active control.
(sim’clear)Clears the current control of text.
(sim'attribute name)Returns the value of the named attribute for the HTMLElement representing the active control.
(sim’assertText text4)Asserts that the text content of the current control is equivalent to the supplied text.
(sim’assertNotFound viewPath1)Ensures that a control with the given semantic view path does not exist in the DOM.
(sim’assertXPathNotFound xPath2)Ensures that a control with the given XPath does not exist in the DOM.
(sim’login username password)Logs into some application with the given username and password credentials.
(sim’navigate workspace5)Navigates to a visible workspace with the given caption.
(sim'scrollIntoView)Scrolls the active control into the center of the screen.
(sim’quit)Closes the browser instance associated with this application's WebDriver.
(sim’checked)Determines if the given checkbox is checked (returns #t or #f).
(sim’addAttachment fileName6 content)Adds a text attachment with the given file name and content to the active control.
(sim’addPDFAttachment fileName6 content)Adds a valid PDF attachment with the given file name and content to the active control.
(sim’addPNGAttachment fileName6 content)Adds a valid PNG attachment with the given file name and content to the active control.

(sim'waitUntil length)

Wait until lambda function returns true. Useful for waiting on a server invocation before proceeding with test.

Length of timeout is measured in milliseconds. Omit length to use default global timeout.

(sim'waitUntilStale)

Wait until chosen view is stale. Useful for clicking action buttons on nested dialogs.

(sim'waitForMovement)Wait until the active control has stopped moving for 2 consecutive animation frames.
(sim'assertValue)Assert DOM property on selected view.
Useful for assert control specific properties like style, model properties, and so on.
(sim'get)

Getter for DOM properties.
Useful for getting control specific properties like style, model properties, and so on.

(sim'executeJavascript)Advanced API for running JavaScript within a Scheme environment.

(sim'takeScreenshot fileName6)

Takes a screenshot of the current screen. Omit the filename to set the filename to the current time.
(sim'back)Loads the previous URL in the history.
(sim'forward)Loads the next URL in the history.
(sim'refresh)Refreshes the page.
(sim'title)Returns the title of the current page.
(sim'currentURL)Returns the URL of the current page.
(sim'localize stringID)Returns the caption of the defined stringID in the local of the loaded browser.  
(sim'localize stringID locale)Returns the caption of the defined stringID in the specified locale.
(sim'switchFrame frameID)Switches to defined application iFrame with given ID.  Null returns to parent document.
(sim'switchTab windowID)

Navigates to another tab using the window ID.

(sim'clickAssertSwitchNewTab)Opens a new tab by clicking on an active control. Switches to the new tab.
(sim'windowID)Extracts the unique window ID for the current window.
(sim'closeTab closeWindowID targetWindowID)Closes a window based on window ID and navigates to another tab using the window ID.
(sim'now)Returns the current time and day.  Can be used with uitest.time and uitest.timezone customizations to return specific time and date.
(sim'today)Returns the current day. Can be used with uitest.time and uitest.timezone customizations to return specific date.
(sim'enableAlarms Boolean)Enables alarms if Boolean value is equal to #t. Disables alarms if Boolean value is equal to #f.
(sim'appReadyCheck Boolean)Sets the value #t or #f to determine whether to execute App Ready checks. The application performs application ready checks to ensure it is finished loading before proceeding. In cases where the page under test is not a part of these checks (for example, third party windows), it may be necessary to turn the check off for automation.
(sim'appReadyCheck)Retrieves the current state of App Ready checks.
(sim'stats)Retrieves current session application performance statistics.


1: The semantic viewpath of the control.
2: The XPath of control to be set as active.
3: The text that will be parsed and written into the control.
4: The expected text.
5: The caption of the workspace to navigate to.
6: The attached file name that will be added to the active control.


Helper Functions

Helper functions provide a fast and easy way to perform a number of actions in the application.  It is preferable to use these where possible. 

Often these functions combine several basic functions in one to make code easier to write and follow.  When helpers are not granular enough for solving your use case, reverting back to basic functions is recommended.

FunctionDescription
(ui-click sim . viewPath)Performs a click on the given view path.
(ui-rclick sim . viewPath)Performs a right click on the given view path.
(ui-dblclick sim . viewPath)Performs a double click on the given view path.
(ui-set-text sim clear? value . viewPath)Sets a text value in given view path, optionally by clearing it first.
(ui-clear sim . viewPath)Clears the value of given view path.
(ui-assertText sim expectedValue . viewPath)Assert text value of given view path.
(ui-assertIcon sim expectedValue . viewPath)Assert icon value of given view path.
(ui-assertValue sim propertyPath expectedValue . viewPath)Assert value of controller property path for given view path.
(ui-assertCell sim expectedValue row colName . viewPath)Assert text value of a given cell in a table. Retrieves cell by row index and column caption.
(ui-getValue sim propertyPath . viewPath)Get value of controller property path for given view path.
(ui-hover sim . viewPath)Perform a hover action on given view path.
(ui-getAttribute sim attribute . viewPath)Get DOM attribute value of a given view path.
(ui-view-enabled? sim . viewPath)Whether view path is enabled, based on the "disabled" DOM attribute.
(ui-clickXPath sim . viewPath)Performs a click on the given XPath.
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.