We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 84f0f34 commit 19d6bc9Copy full SHA for 19d6bc9
py/selenium/webdriver/remote/webelement.py
@@ -76,7 +76,13 @@ def click(self):
76
77
def submit(self):
78
"""Submits a form."""
79
- self._execute(Command.SUBMIT_ELEMENT)
+ if self._w3c:
80
+ form = self.find_element(By.XPATH, "./ancestor-or-self::form")
81
+ self._parent.execute_script("var e = arguments[0].ownerDocument.createEvent('Event');"
82
+ "e.initEvent('submit', true, true);"
83
+ "if (arguments[0].dispatchEvent(e)) { arguments[0].submit() }", form)
84
+ else:
85
+ self._execute(Command.SUBMIT_ELEMENT)
86
87
def clear(self):
88
"""Clears the text if it's a text entry element."""
0 commit comments