I have the following angular.js on a page. The items being displayed are angular.js Li items. One is greyed out the other is enabled. When I use the Selenium webdriver method .isEnabled(), both the greyed out and enabled items return "enabled".
The first question is how do I get .isEnabled() to work with this type of element?
Q
The second question is, assuming webdriver won't do it and I need to xpath, I guess I could use something like this:
$x("//li[@class ='ng-scope disabled' and @id='actionCUSTARD']")
$x("//li[@class ='ng-scope' and @id='actionRHUBARB']")
The first returns something only if the given id is disabled, the second only if the given Id is enabled, this could be built into a Java method to check that for a given id the element is enabled or disabled. Is there an easier way of doing this?
</li>
<li id="actionRHUBARB" class="ng-scope" on="deriveInvokeType(action)" ng-switch="" ng-class="{'disabled': false}" ng-repeat="action in getActionList()">
<!--
ngSwitchWhen: LINK_DYNAMIC
-->
<!--
ngSwitchWhen: NO_INVOKE_PERMISSION
-->
<!--
ngSwitchDefault:
-->
<a class="ng-scope ng-binding" ng-click="doAction(action)" ng-switch-default="" href=""></a>
</li>
<li id="actionCUSTARD" class="ng-scope disabled" on="deriveInvokeType(action)" ng-switch="" ng-class="{'disabled': true}" ng-repeat="action in getActionList()">
<!--
ngSwitchWhen: LINK_DYNAMIC
-->
<!--
ngSwitchWhen: NO_INVOKE_PERMISSION
-->
<!--
ngSwitchDefault:
-->
<a class="ng-scope ng-binding" ng-click="doAction(action)" ng-switch-default="" href=""></a>
</li>