カピバラでキュウリを使用して、Web アプリケーションを自動化しています。ドロップダウンから値を選択する必要がありますが、多くの場合、次のようなエラーが発生します。「引数の型が間違っています (配列が必要です) (TypeError)」
私が試した:1。
second_option_xpath = ".//*[@id='selecttype']/option[2]"
second_option = find(:xpath, second_option_xpath).text
select(second_option, :from => 'selecttype')
2.
select "Selenium Core", :from => 'selecttype'
3.
page.find_and_select_option("selecttype", 2)
4.
select( "selecttype", {"Selenium Core" => 2})
ページのソースは次のようなものです:
<select id="selecttype">
<option value="Selenium IDE">Selenium IDE</option>
<option value="Selenium Code">Selenium Core</option>
<option value="Selenium RC">Selenium RC</option>
<option value="Selenium Grid">Selenium Grid</option>
</select>"
私が間違っているところを教えてください。
ありがとう