複選框標籤存在內標籤與使用方面我不能點擊複選框,因爲沒有目前該複選框
<label class="field-item-header" for="fragment-1996782958_acceptAgreement">
I agree to the
<a target="_blank" href="example.com/terms-of-use">Terms of Use.</a>
</label>
以前我能點擊複選框的鏈接,但現在它的點擊在使用
方面的鏈接我用下面的XPath來定位複選框
I_AGREE_CHECKBOX = By.xpath("//div[@class='account-information']/fieldset[2]/ul/li[2]/span[1]/label");
和
I_AGREE_CHECKBOX = By.xpath("//*[contains(text(), 'I agree to the')]");
請給我一些想法,這樣我可以在複選框上的使用條款的事先單擊不但不 感謝
下標籤上只有一個標籤。你確定你在這裏提供正確的html代碼片段嗎?請重新檢查。 – 2015-02-23 10:39:51