findElementById(driver, id) → {Object}
findElementById
Parameters:
Name | Type | Description |
---|---|---|
driver |
Object |
webdriver object of web browser. |
id |
String |
id attribute of HTML element. |
Returns:
return a object of "webElement".
- Type
- Object
Example
Examples usage of findElementById by HTML element id
findElementById(driver, 'testId' ).then((webElement) => {
// After resolve promise We'll get the "webElement" object for HTML element whose "id" we pass.
// Here 'testId' is id attribute value of HTML element.
}).catch((error) => {
// handle error
});