Namespace: findElementByClass

findElementByClass

findElementByClass(driver, className) → {Object}

findElementByClass

Parameters:
Name Type Description
driver Object

webdriver object of web browser.

className String

class attribute value of HTML element.

Returns:

return a object of "webElement".

Type
Object

Example

Examples usage of findElementByClass by HTML class

 findElementByClass(driver, 'testClass' ).then((webElement) => {
   //After resolve promise We'll get the "webElement" object for HTML element whose "class" we pass.
   // Here 'testClass' is class attribute value of HTML element.
 }).catch((error) => {
   //handle error
 });