私は次のようなページにangular.js
を持っています。表示されている項目はangular.js
Li
です。一方がグレー表示され、もう一方が有効になります。 Selenium webdriver
メソッド.isEnabled()
を使用すると、グレー表示項目と有効項目の両方が「有効」に戻ります。Selenium webdriver anglejs Li要素の有効状態を取得する方法
最初の質問は、.isEnabled()
をこのタイプの要素でどのように動作させるのですか? 2番目の質問は、webdriverをはそれをしないだろうと私はxpath
に必要と仮定すると、ある Qは、私はこのようなものを使用することができると思います:
$x("//li[@class ='ng-scope disabled' and @id='actionCUSTARD']")
$x("//li[@class ='ng-scope' and @id='actionRHUBARB']")
与えられたIDは、無効になっている場合にのみ、最初のリターンの何か指定されたIdが有効な場合にのみ二番目に、このメソッドをJavaメソッドに組み込んで、指定されたidの要素が有効か無効かを確認できます。これを行う簡単な方法はありますか?
</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>