我是ruby / watir的新手并尝试在网页上自动执行搜索功能。当我点击搜索图标时,它会打开一个看起来像模态窗口的下拉叠加层,但实际上只是一个div。当我尝试设置搜索条件的值时,我遇到了这个异常 -
Selenium :: WebDriver :: Error :: InvalidElementStateError:无效的元素状态:元素当前不可交互,可能无法操作 (会话信息:chrome = 60.0.3112.113) (驱动程序信息:chromedriver = 2.29.461591(62ebf098771772160f391d75e589dc567915b233),platform = Windows NT 6.1.7601 SP1 x86_64)
这里是Watir无法与之互动的代码 -
<div class="top-search js-top-search">
<div class="container">
<form class="top-search-form" id="search" action="/search" accept-charset="UTF-8" method="get"><input name="utf8" type="hidden" value="✓">
<input id="search_class" name="c" type="hidden" value="users">
<div class="input-group">
<div class="input-group-btn">
<div class="btn btn-default dropdown-toggle search_menu" data-toggle="dropdown">
<span class="la la-caret-down"></span>
<i class="la" id="selected_search">
<span>Members</span>
</i>
</div>
<ul class="dropdown-menu">
<li>
<a class="search-link" data-search="users">
<i class="la la-user"></i>
Members
</a>
</li>
<li>
<a class="search-link" data-search="groups">
<i class="la la-users"></i>
Groups
</a>
</li>
</ul>
</div>
<input type="text" name="q" id="q" class="form-control" autofocus="autofocus" placeholder="Select a category and search...">
<div class="input-group-btn">
<button class="btn-default btn header-search-btn" id="go">
<i class="la la-search"></i>
</button>
</div>
</div>
</form>
<button class="btn close_search_bar js_close_search_bar text-danger">
<i class="la la-times"></i>
</button>
</div>
</div>
&#13;
到目前为止,我已经尝试了下面的失败 -
非常感谢任何关于此的指导。