【发布时间】:2021-03-28 13:44:35
【问题描述】:
如何勾选这个复选框?enter image description here
我试过了:
within('div[id="modalPersistEtapa"]') do
element = @driver.find_element(:xpath, '//*[@id="2018_4"]/i')
@driver.execute_script("arguments[0].click();"
没有成功! =(
我收到了这个错误:
element click intercepted: Element <i class="i i-logout"></i> is not clickable at point (1878, 56). Other element would receive the click: <div class="modal fade bs-example-modal-lg in" id="modalPersistEtapa" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="false" style="display: block;">...</div>
(Session info: chrome=87.0.4280.88) (Selenium::WebDriver::Error::ElementClickInterceptedError)
Backtrace:
Ordinal0 [0x012DC0C3+3326147]
...
【问题讨论】:
-
从错误中,听起来您需要更改框大小或元素的 z 顺序。由于您的问题中没有可执行或可测试的代码,因此您不太可能得到完整的答案。
-
请在代码中使用换行符,使其适合窗口。
-
代码末尾缺少括号。
-
请在问题中包含包含您尝试点击的内容的整行的 HTML。
标签: javascript ruby selenium capybara