Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
アラート ウィンドウの [キャンセル] ボタンを選択 (クリック) する方法はありますか?
私が使用した:
@browser.choose_cancel_on_next_confirmation() @browser.click("//td[text() = 'mailik@mm.com']/../td//a[text()='Delete']")
他に何も知らずに、Seleniumwebdriver2を使用していると仮定します...
@browserがwebdriverオブジェクトだと思います...
switch_toメソッドを使用して、フォーカスをアラートボックスに変更し、それを閉じる必要があります
alert = @browser.switch_to.alert alert.dismiss
http://selenium.googlecode.com/svn/trunk/docs/api/rb/Selenium/WebDriver/Alert.html#dismiss-instance_method