Skip to content

I.getValue()

Gets the current value of an input element.

Usage

js
var val = I.getValue(element: string)

Parameters

ParameterTypeDescription
elementstringTarget input element — by visible text, name attribute, accessibility or descriptive attributes (e.g. aria-label, title), CSS or XPath selector

Returns

Returns the current value of the input element as a string.

Example

js
var productDescription = I.getValue("textarea[name='description']")
TEST.log.info("Product Description:", productDescription)

In this example, the test retrieves the current value of the product description textarea using I.getValue(), and logs the value to the test report.