getValue

Get the value of a <textarea>, <select> or text <input> found by given selector.

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>: requested input value

Uses