protractor get active element 1

protractor get active element

Grab active element 
browser.driver.switchTo().activeElement()

Grab active element id
browser.driver.switchTo().activeElement().getAttribute('id')

Here is what the above code is Doing:
1. Switch to the active element
2. Get the id of the active element
3. Switch to the element with the id of the active element
4. Send the keys to the element

Similar Posts