addValue
Overview
Use the addValue
command to add a value to an <input>
or <textarea>
element.
Usage
await browser.$(selector).addValue(value);
Command Parameters
Name | Type | Description |
value | String or Number | The 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
});
Related Commands
References
We'd like to give credit to the original WebdriverIO docs article, from which we drew some information while writing our version.