Skip to content

Commit 030f2bd

Browse files
committed
use atoms for submit
1 parent 9babdd2 commit 030f2bd

File tree

2 files changed

+1
-40
lines changed

2 files changed

+1
-40
lines changed

packages/selenium-ide/src/content/selenium-api.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1289,8 +1289,7 @@ Selenium.prototype.doSubmit = function(formLocator) {
12891289
* @param formLocator an <a href="#locators">element locator</a> for the form you want to submit
12901290
*/
12911291
let form = this.browserbot.findElement(formLocator);
1292-
return this.browserbot.submit(form);
1293-
1292+
return bot.action.submit(form);
12941293
};
12951294

12961295
Selenium.prototype.makePageLoadCondition = function(timeout) {

packages/selenium-ide/src/content/selenium-browserbot.js

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1785,44 +1785,6 @@ BrowserBot.prototype.replaceText = function(element, stringValue) {
17851785
} catch (e) {} // eslint-disable-line no-empty
17861786
};
17871787

1788-
BrowserBot.prototype.submit = function(formElement) {
1789-
let actuallySubmit = true;
1790-
this._modifyElementTarget(formElement);
1791-
1792-
if (formElement.onsubmit) {
1793-
if (browserVersion.isHTA) {
1794-
// run the code in the correct window so alerts are handled correctly even in HTA mode
1795-
let win = this.browserbot.getCurrentWindow();
1796-
let now = new Date().getTime();
1797-
let marker = "marker" + now;
1798-
win[marker] = formElement;
1799-
win.setTimeout("var actuallySubmit = " + marker + ".onsubmit();" +
1800-
"if (actuallySubmit) { " +
1801-
marker + ".submit(); " +
1802-
"if (" + marker + ".target && !/^_/.test(" + marker + ".target)) {" +
1803-
"window.open('', " + marker + ".target);" +
1804-
"}" +
1805-
"};" +
1806-
marker + "=null", 0);
1807-
// pause for up to 2s while this command runs
1808-
let terminationCondition = function() {
1809-
return !win[marker];
1810-
};
1811-
return Selenium.decorateFunctionWithTimeout(terminationCondition, 2000);
1812-
} else {
1813-
actuallySubmit = formElement.onsubmit();
1814-
if (actuallySubmit) {
1815-
formElement.submit();
1816-
if (formElement.target && !/^_/.test(formElement.target)) {
1817-
this.browserbot.openWindow("", formElement.target);
1818-
}
1819-
}
1820-
}
1821-
} else {
1822-
formElement.submit();
1823-
}
1824-
};
1825-
18261788
BrowserBot.prototype.clickElement = function(element, clientX, clientY) {
18271789
this._fireEventOnElement("click", element, clientX, clientY);
18281790
};

0 commit comments

Comments
 (0)