isEnabled

Return true or false if the selected DOM-element found by given selector is enabled.

Usage

1
browser.isEnabled(selector);

Parameters

Param Type Details
selector String DOM-element

Example

index.html
1
2
3
<input type="text" name="inputField" class="input1">
<input type="text" name="inputField" class="input2" disabled>
<input type="text" name="inputField" class="input3" disabled="disabled">
isEnabled.js
1
2
3
4
5
6
7
8
9
10
it('should detect if an element is enabled', function () {
var isEnabled = browser.isEnabled('.input1');
console.log(isEnabled); // outputs: true

var isEnabled2 = browser.isEnabled('.input2');
console.log(isEnabled2); // outputs: false

var isEnabled3 = browser.isEnabled('.input3')
console.log(isEnabled3); // outputs: false
});

Uses