hasFocus
Return true or false if the selected DOM-element currently has focus. If the selector matches multiple elements, it will return true if one of the elements has focus.
Usage
1 | browser.hasFocus(selector); |
Parameters
Param | Type | Details |
---|---|---|
selector | String | selector for element(s) to test for focus |
Example
1 | <input name="login" autofocus="" /> |
1 | it('should detect the focus of an element', function () { |
Returns
- <Boolean>: true if one of the matching elements has focus