type
codebolt.browser.type(elementid: string, text: string): Promise<unknown>
Types text into a specified element on the page.
Parameters
Name | Type | Description |
---|---|---|
elementid | string | The ID of the element to type into. |
text | string | The text to type. |
Returns:
Promise<unknown>
A promise that resolves when the typing action is complete.Example
// Type "John Doe" into the input field with the ID "name"
await codebolt.browser.type("name", "John Doe");
// Type "[email protected]" into the email field with the ID "email"
await codebolt.browser.type("email", "[email protected]");
// Type "password123" into the password field with the ID "password"
await codebolt.browser.type("password", "password123");
Explanation
The codebolt.browser.type(elementid: string, text: string) function is used to put text into a specified element on the current web page. the type() have two parameter one is elementid and second is value. we can put the value automatic using this type() function.