複選框,我試圖用objectIdentifierValue
無法點擊使用硒網絡驅動程序
id - cntMain_chkPrimaryInvestigator_A
name - ctl00$cntMain$chkPrimaryInvestigator_A
xpath - //input[@id='cntMain_chkPrimaryInvestigator_A']
xpath - //span/div/input
但都不是工作,我收到錯誤,如「網頁上找不到這樣的元素」。
Going through the examples given for all the other related questions I could not find a proper solution that works in a concise way that allows me to check a checkbox with a few lines of code or method.
如何使用webdriver腳本選擇此複選框?
任何幫助,將不勝感激。
這裏是HTML代碼如下:
<div class="input-heading nonresearchHide">
<span id="cntMain_lbl_Primary_investigator">Primary investigator</span>
</div>
<div class="nonresearchHide">
<div class="icon-info" data-content='Please add the Primary Investigator that was responsible for the research if they are not already added to this activity' data-placement="top" data-toggle="popover" data-container="body" data-trigger="hover"></div>
<p class="defaultP">
<div class="RadAjaxPanel" id="ctl00_ctl00_cntMain_chkPrimaryInvestigator_APanel">
<span class="check_box">
<input id="cntMain_chkPrimaryInvestigator_A" type="checkbox" name="ctl00$cntMain$chkPrimaryInvestigator_A" tabindex="7" />
</span>
</div>
</p>
</div>
你應該增加更多的細節,比如你的代碼的母公司。 – Prateek