Skip to main content

addValue

Overview

Use the addValue command to add a value to an <input> or <textarea> element.

Usage

await browser.$(selector).addValue(value);

Command Parameters

NameTypeDescription
valueString or NumberThe value to add.

Usage Examples

it("should demonstrate the addValue command", async ({ browser }) => {
let input = await browser.$(".input");
await input.addValue("test");
await input.addValue(123);

value = await input.getValue();
assert.equal(value, "test123"); // true
});

References

We'd like to give credit to the original WebdriverIO docs article, from which we drew some information while writing our version.