1
我是watir webdriver和ruby的新手。在我的第一个scipt中,我试图输入一个搜索字符串,并触发点击操作,看起来像一个按钮,但通过元素检查并不是一个按钮。插入搜索字符串后,我的watir脚本无法点击搜索按钮。Watir - Webdriver - 无法点击元素
None of the following three options worked.
browser.a(:id=> "search0_SearchIcon").submit
browser.button(:id=> "search0_SearchIcon").submit
browser.div(:id=> "header").div(:class=> "head-container").div(:class=> "search-field").button(:class => "rb-search-button js-rb-search-button").click
*******Test target code is listed below****
</div>
<div class="search-field">
<input accesskey="s" aria-autocomplete="list" aria-haspopup="true" autocomplete="off" class="js-rb-search-input" id="rbSearchInput" name="rbSearchInput" role="textbox" type="text" value="" />
<a id="search0_SearchIcon" class="rb-search-button js-rb-search-button"></a>
<form id="GeneralSearchForm" method="GET" action="/Search">
<input name="query" type="hidden" id="rbSearchInputHidden" class="js-rb-search-input-hidden" />
</form>
</div>
</div>
************