setValue

Send a sequence of key strokes to an element (clears value before). You can also use unicode characters like Left arrow or Back space. WebdriverIO will take care of translating them into unicode characters. You’ll find all supported characters here. To do that, the value has to correspond to a key from the table.

Usage

1
browser.setValue(selector,values);

Parameters

Param Type Details
selector String Input element
values String/Number/Array Input element

Example

setValue.js
1
2
3
4
5
6
7
8
9
it('should set value for a certain element', function () {
var input = $('.input');
input.setValue('test123');

// same as
browser.setValue('.input', 'test123');

console.log(input.getValue()); // outputs: 'test123'
});

Uses