Skip to content

Commit

Permalink
Revert "[rb] Dispatch form "submit" event on window to prevent a form…
Browse files Browse the repository at this point in the history
… double submission (#6373)"

This reverts commit 946b7a2.
  • Loading branch information
barancev committed Sep 7, 2018
1 parent 427a0ce commit df28b11
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions rb/lib/selenium/webdriver/remote/w3c/bridge.rb
Expand Up @@ -388,10 +388,9 @@ def clear_element(element)

def submit_element(element)
form = find_element_by('xpath', "./ancestor-or-self::form", element)
execute_script("var win = arguments[0].ownerDocument;" \
"var e = win.createEvent('Event');" \
execute_script("var e = arguments[0].ownerDocument.createEvent('Event');" \
"e.initEvent('submit', true, true);" \
'if (win.dispatchEvent(e)) { arguments[0].submit() }', form.as_json)
'if (arguments[0].dispatchEvent(e)) { arguments[0].submit() }', form.as_json)
end

def drag_element(element, right_by, down_by)
Expand Down

0 comments on commit df28b11

Please sign in to comment.