watir-webdriverを使用してselect_listから選択した値のテキストを返そうとしています。以下は通常は機能します(Watirサンプルページhttp://bit.ly/watir-exampleを使用した例)
browser = Watir::Browser.new :ie
browser.goto "http://bit.ly/watir-example"
browser.select_list(:id => "entry_6").option(:index, 2).select
puts browser.select_list(:id => "entry_6").select_list(:id => "entry_6").selected_options
=>Internet Explorer
しかし、同じコードをフレームに貼り付けても、何も返されません。
browser = Watir::Browser.new :ie
browser.goto "test_iframe.html"
browser.frame(:id => "test").select_list(:id => "entry_6").option(:index, 2).select
puts browser.frame(:id => "test").select_list(:id => "entry_6").select_list(:id => "entry_6").selected_options
=>Nothing returned
iframeの例:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<body>
<p>TEST IFRAME ISSUES</p>
<iframe src="http://bit.ly/watir-example" id="test" width="100%" height="1400px">
</iframe>
</body>
</html>
私は何かを逃したことがありますか、それともこれを達成する別の方法がありますか?