Skip to content

User Interface "Interrogation" Commands

This category includes commands help your automation to find user interface (UI) elements on your application's pages (screens) and retrieve the information from those elements.

Most of these commands that start with 'get', 'assert' and 'verify' belong to this category. This category also includes commands that help you print the value of variables within your automated tests like standard output commands do in programming languages ('echo' in shell and batch scripts OR 'print' and 'println' in Java).


If you are familiar with Selenium WebDriver, Interrogations work at two levels:

  • Driver level: These are web driver level interrogations like getting the title of the current page, getting the current URL in context, and getting the source of the current page. 
  • DOM level: DOM stands for "Document Object Model". It defines the logical structure of HTML (and XML documents) and the way a page is accessed and manipulated. Everything in a web page such as text input field, button, radio button, checkbox, drop-down, plain text, text area, etc. is a web element in Web Driver.

Interrogation is to be done in two steps, and Worksoft SaaS supports commands for each step: 

  1. First, your automated script has to find (also known as 'locate') the element which we want to interrogate. Finding or Locating the elements can be done by id, name, link text, partial link text, class attribute name, HTML tag name, CSS Selectors or XPath Selectors.
  2. Then, your automated script can interrogate that element and retrieve information from it. 'Asserts' & 'Verify' series of commands belong to this category.

Assert and Verify are both 'Assertions' which check that the state of the application conforms to what is expected of you(test). Examples include “make sure the page title is X” and “verify that this checkbox is checked”. Effectively an “assert” will fail the test and abort the currently executing test, whereas a “verify” will fail the test and continue to run the currently executing test.
 
The 'echo' command is useful for providing informational progress notes in your test which display on the console as your test is running. These notes also can be used to provide the context within your test result reports, which can be useful for finding where a defect exists on a page in the event your test finds a problem. Finally, echo statements can be used to print the contents of variables within your automated test scripts.

The table(s) below lists the commands in the ascending alphabetic order within each category along with a brief description of the purpose of the command. By clicking on the hyperlinked command name in the table(s) below, you can review more detailed information about a specific command that includes the syntax for you to follow when using the commands.

You can visit Commands for Native/Hybrid Mobile User Interface, to find the powerful command set that Worksoft SaaS has, to automate your Native/Hybrid Mobile Apps.  

Command Purpose
assertAlert assertAlert will also verify text same as verifyAlert and take action on the alert box but if the alert text does not match then it will stop execution
assertAlertPresent This command checks for the presence of an alert and this function never throws an exception
assertAllFields If a given field has no ID, it will appear as "" in this array. It Returns the IDs of all input fields on the page. If a given field has no ID, it will appear as "" in this array.
assertAllLinks If a given link has no ID, it will appear as "" in this array. Returns the IDs of all links on the page.If a given link has no ID, it will appear as "" in this array.
assertAttribute Gets the value of an element attribute. The value of the attribute may differ across browsers (this is the case for the 'style' attribute, for example).
assertBackgroundColor Retrieves the CSS background-color attribute value applied to that element
assertBackgroundImage Retrieves the CSS background-image attribute value applied to that element.
assertChecked Gets whether a toggle-button (checkbox/radio) is checked. Fails if the specified element doesn't exist or isn't a toggle-button.
assertColor Retrieves the CSS color attribute value applied to that element
assertConfirmation Retrieves the message of a JavaScript confirmation dialog generated during the previous action.

By default, the confirm function will return true, having the same effect as manually clicking OK. This can be changed by prior execution of the chooseCancelOnNextConfirmation command.

If a confirmation is generated but you do not consume it with getConfirmation, the next QaSCRIBE action will fail.

NOTE: under QaSCRIBE, JavaScript confirmations will NOT pop up a visible dialog.

NOTE: QaSCRIBE does NOT support JavaScript confirmations that are generated in a page's onload() event handler. In this case, a visible dialog WILL be generated and QaSCRIBE will hang until you manually click OK.
assertCookie Generated from getCookie()

Return all cookies of the current page under test.
assertCookieByName Generated from getCookieByName(name)

>If the cookie is present it returns the value of the cookie with the specified name.
assertCookieNotPresent Generated from isCookieNotPresent(name)

Checks whether the cookie is not present or not.
assertCookiePresent Generated from isCookiePresent(name)

Checks whether the cookie is present or not.
assertEditable Determines whether the specified input element is editable, i.e., hasn't been disabled. This method will fail if the specified element isn't an input element.
assertElementNotPresent Generated from isElementNotPresent(locator)

It will check whether the element is present or not and returns corresponding boolean value.br>
assertElementPresent Generated from isElementPresent(locator)

his command will check whether the particular element is present or not.
assertEval Generated from getEval(script)

script - the JavaScript snippet to run

It will check whether the script is present or not.
assertExpression This command is useful for JavaScript preprocessing. It compares two expressions and returns the value whether it is true or false.

If the pattern does not match the pattern which we get from the UI, it aborts the execution.
assertFontFamily This command is useful for verifying the CSS font-family attribute value applied to that element.

If the pattern does not match the pattern which we get from the UI, it aborts the execution.
assertFontSize This command is useful for verifying the CSS font-size attribute value applied to that element.

If the value does not match with the attribute value which we get from the UI, it aborts the execution.
assertFontStyle This command is useful for retrieving the CSS font-style attribute value applied to that element and asserts the value.

If the value does not match with the attribute value which we get from the UI, it aborts the execution.
assertFontWeight This command is useful for retrieving the CSS font-weight attribute value applied to that element and asserts the value.

If the value does not match with the attribute value which we get from the UI, it aborts the execution.
assertLocation This command is useful for verifying the absolute URL of the current page.
assertNotAllButtons This command is used to verify the ID's of all buttons given are not present on the web page.

If there are any buttons of the specified ID's present on the UI, it aborts the execution.
assertNotAllFields This command is used to verify the ID's of all fields given are not present on the web page.

If there are any ID's of the fields present on the UI, it aborts the execution.
assertNotAllLinks This command is used to verify the ID's of all links given are not present on the web page.

If there are any links present on the UI, it aborts the execution.
assertNotAttribute This command checks for the specified attribute of an element.

Here the specified attribute should not be present. If the attribute is present on the UI this command returns that particular attribute value and aborts the execution.
assertNotChecked This command checks for the checkbox/radio button is checked or not on the UI.

If the checkbox/radio button is checked on the UI, the execution gets aborted.
assertNotColor This command is used to verify the CSS color of an element applied is not equaled to given value.

It gives the color in RGB format.If the specified RGB format is present on the UI, the execution gets aborted. It checks for the color code which is not present.
assertNotConfirmation This command checks for the JavaScript confirmation dialogs.

Pass if there is no JavaScript confirmation dialog generated during the previous action. By default, the confirm function will return true, having the same effect as manually clicking OK. This can be changed by prior execution of the chooseCancelOnNextConfirmation command.
assertNotCookie This command verifies all cookies of the current page under test.

There should not be any cookies present under the test. If there are any, the execution gets aborted.
assertNotCookieByName This command verifies the value of the cookie with the specified name given is not present under test.

If there are any specified cookies present, the execution gets aborted.
assertNotEditable It checks for the specified input element is not editable, ie has been disabled.

If the element is not disabled, the execution gets aborted.
assertNotEval This command is used to verify the result of specified JavaScript snippet does not match with given value. The snippet may have multiple lines, but the result of the last line will be returned.
assertNotLocation This command is used to verify the absolute URL of the current page does not match with the specified URL.

If the given URL matches with current web page URL, the execution will get aborted.
assertNotSelectedLabel This command is used to verify the label (visible text) for selected option in the specified select element doesn't match with the specified value.
assertNotSelectedLabels This command is used to verify the labels (visible text) for selected options in the specified select drop-down doesn't match with the specified value.
assertNotSelectedValue This command is used to verify the value of value attribute for selected option in the specified select element doesn't match with the specified value.
assertNotSpeed This command is used to verify that the execution speed doesn't match with the speed the execution is currently set up with. 
assertNotText This command is used to verify the text of an element doesn't match with the specified text. This works for any element that contains text. This command uses either the textContent (Mozilla-like browsers) or the innerText (IE-like browsers) of the element, which is the rendered text shown to the user.
assertNotTitle This command is used to verify the title of the page doesn't match with the given title. 

If the title matches, the execution gets aborted.
assertNotValue This command is used to verify that the input field doesn't contain the specified value in the page.
assertNotVisible This command is used to determine if the specified element is not visible on UI. An element can be rendered invisible by setting the CSS "visibility" property to "hidden", or the "display" property to "none", either for the element itself or one if its ancestors.
assertPosition This command is used to verify the CSS position attribute value applied to that element.
assertPrompt This command is used to verify the message of a JavaScript question prompt dialog generated during the previous action. Successful handling of the prompts requires prior execution of the answerOnNextPrompt command.
assertSelectedLabel This command is used to verify the label (visible text) for selected option in the specified select element.

If the label of the option does not match with given value, the execution gets aborted.
assertSelectedLabels This command is used to verify all the labels (visible text) for selected options in the specified select or multi-select element.
assertSelectedValue This command is used to verify the value of value attribute for selected option in the specified select element.
assertSelectOptions This command is used to verify all the option labels in the specified select drop-down.

The execution gets aborted if the options did not match.
assertSomethingSelected This command is used to verify whether some option in a drop-down menu is selected or not.
assertSpeed This command is used to verify that the execution speed with the execution speed is currently set up with. See also the setSpeed command.
assertTable his command is used to verify the text from the specified cell in the table.

In this command, the cell Address must be mentioned. Syntax for cellAddress is tableLocator.row.column, where row and column start at 0.
assertText This command is used to verify the text of an element. This works for any element that contains text.

This command uses either the textContent (Mozilla-like browsers) or the innerText (IE-like browsers) of the element, which is the rendered text shown to the user.
assertTextAlign This command is used to retrieves the text-align - CSS attribute applied to that element.
assertTextPresent This command is used to verify the specified text pattern appears somewhere on the rendered page is shown to the user.
assertTitle This command is used to verify the title of the current page.
assertValue This command is used to verify the (whitespace-trimmed) value of an input field (or anything else with a value parameter). For checkbox/radio elements, the value will be "on" or "off" depending on whether the element is checked or not.
assertVisible Determines if the specified element is visible on the web page. An element can be rendered invisible by setting the CSS "visibility" property to "hidden", or the "display" property to "none", either for the element itself or one of its ancestors. This method will fail if the element is not present.
assertXpathCount This command is used to verify the number of nodes that match with the specified XPath given, eg. "//table/tbody/tr" would give the number of rows in a table.
echo Prints the specified message into the third table cell in your Selenese tables. Useful for debugging.
getOverlappingUserInterfaceElementsThis command is used to identify the list of UI elements/locators that overlap. Input is the element locators given in a dataset. The response of this command is the dataset with the list of UI elements/locators that overlap with any other element/locator in the input/request dataset.

Note:
Data Definition that defines the request dataset must contain the following column names: Element, ElementGroup, GroupParentIndicator, CoordinateRight, CoordinateLeft, CoordinateTop, CoordinateBottom.

The response data set is an 'n+1' matrix where 'n' is the number of UI element/locators in the input/request dataset.

The first column and the first row in the dataset contain the UI element/locators whereas the cells within the matrix contain a boolean value that indicates whether or not there is an overlap.
highlight This command is used to highlight the specified element in yellow color. Useful for debugging.
highlightOverlappingUserInterfaceElements This command is used to highlight all the UI elements on the page using the dataset of elements provided in the 'Target' field.

The input is the return value dataset from either of the two commands:
  • getOverlappingUserInterfaceElements 
  • verifyOverlappingUserInterfaceElements
verifyAlert This command is used to verify the most recent javascript alert is present on the page or not.
verifyAlertNotPresent This command is used to verify, If an alert is generated and it is handled, is no longer present on the page.
verifyAlertPresent If an alert is generated, you would want to verify the alert is present.
verifyAllButtons This Command is used to Verify the IDs of all buttons on that page
verifyAllFields This Command is used to Verify the IDs of all fields on the page
verifyAllLinks This Command is used to Verify the IDs of all links on the page
verifyAttribute This Command is used to Verify the value of an element attribute. The value of the attribute may differ across browsers (this is the case for the "style" attribute, for example).
verifyBackgroundColor This Command is used to Verify the CSS background-color attribute value applied to that element.
verifyChecked This Command is used to Verify the whether the toggle-buttons (checkbox/Radi buttons) is checked or not
verifyColor This Command is used to Verify the CSS color of an element on the web page.
verifyConfirmation This Command is used to Verify the confirmation messages of the most recent JavaScript confirmation dialogs.
verifyCookie This Command is used to Verify whether there are any cookies present on that particular page
verifyCookieByName This Command is used to Verify the cookie is present in the page by its name
verifyCookieNotPresent This Command is used to Verify whether the cookie is not present on the page.
verifyCookiePresent This Command is used to Verify whether the cookie is present in the page.
verifyEditable This Command is used to Verify whether the particular input field is editable or not
verifyElementHeight This Command is used to Verify the height of an element
verifyElementIndex This Command is used to verify relative index of the element to its parent (starting from 0).The comment node and empty text node will be ignored.
verifyElementNotPresent This Command is used to Verify whether the element is present on the page or not
verifyElementPositionLeft Retrieves and verifies the horizontal position of an element, pixels from the edge of the frame.
verifyElementPositionTop Retrieves and verifies the vertical position of an element, pixels from the edge of the frame.
verifyElementPresent Verifies that the specified element is somewhere on the page.
verifyElementWidth Retrieves the width of an element
verifyEval Gets the result of evaluating the specified JavaScript snippet. The snippet may have multiple lines, but only the result of the last line will be returned.Note that, by default, the snippet will run in the context of the "QaSCRIBE" object itself, so this will refer to the QaSCRIBE object. Use window to refer to the window of your application, e.g. window.document.getElementById('foo')If you need to use a locator to refer to a single element in your application page, you can use this.browserbot.findElement("id=foo") where "id=foo" is your locator.
verifyExpression This is useful because of JavaScript preprocessing. It is used to generate commands like assertExpression and waitForExpression.Returns the specified expression in true or false and continues with execution.
verifyFontFamily Retrieves the CSS font-family attribute value applied to that element.Returns the font-family with true or false and continues with execution.
verifyFontSize Retrieves the CSS font-size attribute value applied to that element.Returns the font-family with true or false and continues with execution.
verifyFontStyle This command is used to verify the CSS font style attribute value applied to that element
verifyFontWeight Retrieves the CSS font-weight attribute value applied to that element.Returns the font-family with true or false and continues with execution.
verifyHeight Retrieves and verifies the CSS height attribute value applied to that element, height in pixels.
verifyLocation Gets the absolute URL of the current page.
verifyNotAllButtons  
verifyNotAllFields  
verifyNotAllLinks  
verifyNotAttribute Retrieves and verifies if the value of the specified element is not an attribute. The value of the attribute may differ across browsers (this is the case for the "style" attribute, for example).Returns true or false and continues execution.
verifyNotAttributeFromAllWindows This command is used not to verify the attributes from all windows.
verifyNotBackgroundColor This command is used to verify the element color is not similar to the background color.
verifyNotChecked Gets whether a toggle-button (checkbox/radio) is checked. Fails if the specified element doesn't exist or isn't a toggle-button.
verifyNotCookie To check all cookies of the current page under test.
verifyNotCookieByName To verify the value of the cookie with the specified name or throws an error if the cookie is not present.
verifyNotDisplay To Retrieves the CSS display attribute value applied to that element.
verifyNotEditable To determine whether the specified input element is editable, ie hasn't been disabled.
verifyNotEval To verify the result of evaluating the specified JavaScript snippet.
verifyNotLocation To verify the absolute URL of the current page.
verifyNotSelectedLabel To verify the option label (visible text) for selected option is not in the specified select element.
verifyNotSelectedLabels To verify all the option labels (visible text) for selected options is not in the specified select or multi-select element.
verifyNotSpeed To Get execution speed.
verifyNotText To Gets the text of an element.
verifyNotTitle To verify the title of the selected window is not equaled to given title.
verifyNotValue To verify checkbox/radio elements, the value will be "on" or "off" depending on whether the element is checked or not.
verifyNotVisible To verify checkbox/radio elements, the value will be "on" or "off" depending on whether the element is checked or not.
verifyOverflow This command is used to verify the CSS overflow attribute value applied to that element.
verifyOverlappingUserInterfaceElements This command is used to know whether or not each UI element/locator in the input data set overlaps with at least one other UI element/locator in the input dataset.

The response DataSet will have the true or false values against the locator.

For that details on which element overlaps, the command 'getOverlappingUserInterfaceElements' has to be used.

Note:
Data Definition that defines the request data set must contain the following column names: Element, ElementGroup, GroupParentIndicator, CoordinateRight, CoordinateLeft, CoordinateTop, CoordinateBottom.

The response dataset contains 2 columns.
  • The first column contains the list of UI element/locators in the input/request dataset. 
  • The second column will contain a boolean value that indicates whether or not the UI element/locator in that row overlaps with any other UI element/locator in the input/request dataset.
verifyPosition This command is useful to Verify the CSS position attribute value applied to that element.
verifyPromptNotPresent This command returns true if there is no pending prompt and never throws an exception
verifySelectedLabel Verifies option label (visible text) for selected option in the specified select element.
verifySelectedLabels Verifies all option labels (visible text) for selected options in the specified select or multi-select element.
verifySelectOptions Gets all option labels in the specified select drop-down.
verifySpeed Get execution speed (i.e., get the millisecond length of the delay following each QaSCRIBE operation). By default, there is no such delay, i.e., the delay is 0 milliseconds. See also setSpeed.
verifyTable Gets the text from a cell of a table. The cell address syntax tableLocator.row.column, where row and column start at 0.
verifyText Gets the text of an element. This works for any element that contains text. This command uses either the textContent (Mozilla-like browsers) or the innerText (IE-like browsers) of the element, which is the rendered text shown to the user.
verifyTextAlign Retrieves the text-align - CSS attribute applied on that element
verifyTextPresent Verifies that the specified text pattern appears somewhere on the rendered page is shown to the user.
verifyTitle To verify the title of the current page.
verifyValue This command verifies the (whitespace-trimmed) value of an input field (or anything else with a value parameter). For checkbox/radio elements, the value will be "on" or "off" depending on whether the element is checked or not.
verifyVisible Verifies the specified element is visible. An element can be rendered invisible by setting the CSS "visibility" property to "hidden", or the "display" property to "none", either for the element itself or one of its ancestors. This method will fail if the element is not present.
verifyWidth Verifies the CSS width (width in pixels.) attribute value applied to that element.
verifyXpathCount Verifies the number of nodes that match the specified XPath, eg. "//table" would give the number of tables.

 

 

 

Feedback and Knowledge Base