我是 watir webdriver 和 ruby 的新手。在我的第一个 scipt 中,我试图输入搜索字符串并触发看起来像按钮的点击操作,但通过元素检查不会显示为按钮。插入搜索字符串后,我的 watir 脚本一直无法单击搜索按钮。
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>
************