CSSボタンが選択されているかどうかを確認する必要があります。ボタンが選択されているかどうかを確認する方法
オフ= "お客様は18歳以上ではありません"、オン= "お客様は18歳以上です"とは、cssによって駆動されます。
状況を把握しようとすると、スクリプトがクリックしなければならないかどうかを判断する際に問題が発生します。どのように私はこれをチェックするのですか?
driver.findElement(By.xpath("//i[contains(@class,'c-option__button i-icon i-icon--plus-18-movie')]"));
とuib-tooltip="The Customer is NOT over 18">
変更したテキストです:
これは私が現在のそれをオン/オフ]をクリックして使用していますxpathがあります。
私はクリックする必要があるかどうかを確認する必要があります。 The Customer is over 18
かどうかの前にチェックする
<age-question-button class="ng-scope ng-isolate-scope" state="qc.answer[question.name]" icon="plus-18-movie" active-text="The Customer is over 18" inactive-text="The Customer is NOT over 18" ng-repeat="question in qc.questionsList track by question.name" audit="cc.utils.audit(qc.answer[question.name] ? question.auditInactive : question.auditActive)">
<label class="c-option u-p-0 u-ml-md u-pull-left" tooltip-append-to-body="true" uib-tooltip="The Customer is over 18">
<input class="ng-untouched ng-valid ng-dirty ng-valid-parse" ng-model="state" ng-change="audit()" style="" type="checkbox">
<i class="c-option__button i-icon i-icon--plus-18-movie"></i>
</label>
<label class="c-option u-p-0 u-ml-md u-pull-left" tooltip-append-to-body="true" uib-tooltip="The Customer is NOT over 18">
<input class="ng-untouched ng-valid ng-dirty ng-valid-parse" ng-model="state" ng-change="audit()" style="" type="checkbox">
<i class="c-option__button i-icon i-icon--plus-18-movie"></i>
申し訳DebanjanB指定されたが、私は、コードの一部を逃していなかったとして、あなたはおそらくあなたの問題の第二部のための新しい質問を開く必要があります私のポストでは... 最初に投稿したビットのために、コードが動作します。 –
あなたはあなたが探しているものを簡単に更新できますか? – DebanjanB
はちょうど私の質問を正しく説明する新しい投稿をしました。ありがとう。 –