私はモーダルを持っているとしましょう。Watir Webdriver:モーダル外をクリックしても閉じないとテストする
@my_modal = @brower.div(id: 'TheModal')
のは、私は、モーダルの外側をクリックするステップを定義するために今すぐモーダル(この例では、キュウリ)
Given I ...
When I ...
Then "My Modal" is visible
When I click outside the modal
Then "My Modal" is visible
が現れ、テストを持っているとしましょう:
When /^I click outside the modal$/ do
# what do I put here?
end
アイデア?
How to simulate mouse click on blank area in website by Selenium IDE?に基づいて@browser.element(xpath: '//html').click
を試しました。エラーが発生しましたSelenium::WebDriver::Error::UnknownError: unknown error: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
あなたが思いついた解決策を共有するための誇り、私はあなたがこのようなことをする必要がある唯一の人であることを疑う(または、逆に、モーダルの外側をクリックするとそれを閉じ、助言モーダルの別の一般的パラダイム) –