使用Selenium WebDriver,我试图点击Manual Testing
选项Testing
菜单http://guru99.com/Manual Testing
选项出现在Testing
上悬停鼠标后。为了实现上述,我并以下 -无法点击列表中的元素从下拉列表
testing = $driver.find_element(:xpath, "//li[@class='item118 parent']")
mt = $driver.find_element(:xpath, "//li[@class='item119']/a")
$driver.action.move_to(testing).move_to(mt).perform
mt.click
但是,有时误差线路#3上面的代码 - 在上面的代码
Selenium::WebDriver::Error::MoveTargetOutOfBoundsError: Offset within element ca
nnot be scrolled into view: (85, 21): http://guru99.com/software-testing.html
有时误差线#4 -
Selenium::WebDriver::Error::ElementNotVisibleError: Element is not currently vis
ible and so may not be interacted with
请不要执行javascript来帮我解决此问题。
这里是HTML代码 -
<li class="item118 parent">
<a class="item" href="/software-testing.html"> Testing </a>
<span class="dropdown-spacer"></span>
<div class="dropdown columns-1 " style="width:180px;">
<div class="column col1" style="width:180px;">
<ul class="l2">
<li class="item119">
<a class="item" href="/software-testing.html"> Manual Testing </a>
</li>
.
.
.
请发表你的HTML代码片断,如果可能的 – Sighil
更新与HTML代码段的问题。 – TDHM