setValue
Send a sequence of key strokes to an element (clears value before). If the element doesn't need to be cleared first then use addValue. 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
$(selector).setValue(value)
Parameters
Name | Type | Details |
---|---|---|
value | string , number , boolean , object , Array .<any> | Value to be added |
Example
it('should set value for a certain element', () => {
const input = $('.input');
input.setValue('test123');
console.log(input.getValue()); // outputs: 'test123'
});