Selenium Commands Supported in Dynamic Analysis

Dynamic Analysis

Publication
Dynamic Analysis
Edition date
2022-11-29
Last publication
2022-11-29T16:31:45.191867

This table lists the Selenium commands Veracode supports in sequence scripts. You can upload scripts to a Dynamic Analysis. Your Selenium IDE version might not support all these commands.

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

Command Description
assertAlert, assertPrompt, or assertConfirmation These 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.
assertChecked This command succeeds when you select the targeted checkbox or radio button and fails when when you do not select them.
assertElementPresent This 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 verifyText assertText and verifyText have identical implementations.
assertTextPresent or verifyTextPresent Veracode 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 uncheck check can operate on checkbox and radio button types of form inputs, but uncheck can only operate on checkboxes.
click or clickAndWait These commands have identical implementations and functionality.
clickAt
deleteAllCookies
doubleClick or doubleClickAndWait doubleClick and doubleClickAndWait have identical implementations and functionality.
fireEvent or focus focus fails if the element to be focused is not focusable, such as an <img> or <br> element. Elements that are not focusable may 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 mouseUp mouseDown and mouseUp are always fired together when the simulated mouse left button clicks on an element.
mouseOver or mouseMove mouseOver and mouseMove are always fired together when the simulated mouse moves on an element.
mouseOut
open or close If 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.
pause There is no need for long, duplicated pause commands.
refresh
runScript
select
selectAndWait This command fails if the targeted dropdown menu does not load within the timeout period, which is 60 seconds by default.
selectFrame
selectPopUp When there is only one window currently open, this command fails because the only open window must be the main window.
selectWindow If there is only one window currently open, this command always succeeds.
submit
type
typeKeys or sendKeys typeKeys and sendKeys have identical implementations.
verifyHtmlSource Veracode 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 waitForElementPresent You 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.
waitForFrameToLoad Support 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.
waitForPageToLoad You 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.