Skip to main content

Supported Selenium commands

This table lists the Selenium commands Veracode supports in sequence scripts. You can upload scripts to a Dynamic Analysis for a web application scan. Your Selenium IDE version might not support all these commands. Review the best practices.

For further information about these commands, see the Selenium documentation.

CommandDescription
assertAlert, assertPrompt, or assertConfirmationThese commands have identical implementations. They switch focus to the current alert box on the page and determine if the user-provided text matches the alert text. If it does not match or there is no alert box on the page, these commands fail.
assertCheckedThis command succeeds when you select the targeted checkbox or radio button and fails when when you do not select them.
assertElementPresentThis command always uses the timeout period of 30 seconds. If you cannot locate the targeted element within that amount of time, the command times out and fails.
assertText or verifyTextassertText and verifyText have identical implementations.
assertTextPresent or verifyTextPresentVeracode checks the provided text against the HTML source of the currently rendered page, not the original source. Therefore, HTML elements you add to the page through JavaScript can be matched with this command only if the JavaScript code mutating the DOM finishes executing before this command is executed. This command requires the scan engine to fully serialize the page currently loaded in the browser. It can be extremely time-consuming for complex pages.
check or uncheckcheck can operate on checkbox and radio button types of form inputs, but uncheck can only operate on checkboxes.
click or clickAndWaitThese commands have identical implementations and functionality.
clickAt
deleteAllCookies
doubleClick or doubleClickAndWaitdoubleClick and doubleClickAndWait have identical implementations and functionality.
fireEvent or focusfocus fails if the element to be focused is not focusable, such as an <img> or <br /> element. Elements that are not focusable might have focus events bound to them. In this case, you can use the fireEvent command to force an event that you want to fire to focus on elements that are not focusable.
keyUp
keyDown
keyPress
mouseDown or mouseUpmouseDown and mouseUp are always fired together when the simulated mouse left button clicks on an element.
mouseOver or mouseMovemouseOver and mouseMove are always fired together when the simulated mouse moves on an element.
mouseOut
open or closeIf you must manage multiple windows, Veracode recommends explicitly selecting them by name or title before attempting to execute any commands. If more than one window is still open after you close the originally selected window, selection of the new main window is unpredictable.
pauseThere is no need for long, duplicated pause commands.
refresh
runScript
select
selectAndWaitThis command fails if the targeted dropdown menu does not load within the timeout period, which is 60 seconds by default.
selectFrame
selectPopUpWhen there is only one window currently open, this command fails because the only open window must be the main window.
selectWindowIf there is only one window currently open, this command always succeeds.
submit
type
typeKeys or sendKeystypeKeys and sendKeys have identical implementations.
verifyHtmlSourceVeracode checks the provided text against the HTML source of the currently rendered page, not the original source. Therefore, HTML elements you add to the page through JavaScript can be matched with this command only if the JavaScript code mutating the DOM finishes executing before you execute the command. This command requires the scan engine to fully serialize the page currently loaded in the browser. This process can be extremely time-consuming for complex pages.
waitForElementToLoad, waitForTitle, waitForTextPresent, or waitForElementPresentYou can provide an optional timeout value in the value element of these Selenium IDE commands. If the value element does not have a value, the default timeout is 30 seconds. If the scan engine cannot locate the element within that amount of time, the command times out and fails.
waitForFrameToLoadSupport for this command only includes the name and ID string locators.When this command returns successfully, it automatically switches to the loaded frame, as if the selectFrame command was called. In place of this command, a generic pause is often a better solution.
waitForPageToLoadYou can provide an optional timeout period in the target element of the command. The default value is 30 seconds. The maximum value is 60 seconds. If the page does not load within the configured timeout period, the command fails.