getValue

Get the value of a <textarea>, <select> or text <input> found by given selector. If multiple elements are found via the given selector, an array of values is returned instead.

Usage

1
browser.getValue(selector);

Parameters

Param Type Details
selector String input, textarea, or select element

Example

index.html
1
<input type="text" value="John Doe" id="username">
getValue.js
1
2
3
4
5
6
it('should demonstrate the getValue command', function () {
var inputUser = $('#username');

var value = inputUser.getValue();
console.log(value); // outputs: "John Doe"
});

Returns

  • <String/String[]>: requested element(s) value

Uses