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>
************