const {Builder, By, Key, until, ExpectedConditions} = require('selenium-webdriver');
const webdriver = require('selenium-webdriver');
const driver = new Builder()
.forBrowser('firefox')
.build();
driver.then(driver => driver.get('URL THIS'))
.then(() => driver.sleep(4000))
.then(() => driver.findElement(By.name('identifier')))
.then(element => element.sendKeys('LOGIN THIS', Key.RETURN))
.then(() => driver.sleep(4000))
.then(() => driver.findElement(By.name('password')))
.then(element => element.sendKeys('PASSWORD THIS', Key.RETURN))
.then(driver => driver.get('URL THIS'))
.then(() => driver.sleep(15000))
.then(() => driver.executeScript("location.reload()"))
.then(() => driver.quit());
document.getElementById("form").addEventListener("submit", function() {
document.getElementById("button").classList.add("class_1");
setTimeout(function() {
document.getElementById("button").classList.remove("class_1");
}, 3000);
});
function validateForm() {
var x = document.forms["myForm"]["fname"].value;
if (x == "") {
alert("Name must be filled out");
return false;
}
}
И чтобы она не срабатывала просто при клике