Experiencing a strange issue with Safari where it closes the browser immediately after running the code snippet below, while Chrome and Firefox behave as expected. I am using Webdriver with JavaScript for this automation.
let driver = await new Builder().forBrowser("safari").build();
await driver.get("http://website.com");
await driver.findElement(By.name("os_username")).sendKeys("username");
await driver.findElement(By.name("os_password")).sendKeys("password");
await driver.findElement(By.name("login")).sendKeys(Key.RETURN);
// Enter search bar data and press return.
await driver.sleep(5000);
await driver.findElement(By.name("searchString")).sendKeys("Name");
await driver.findElement(By.name("searchString")).sendKeys(Key.RETURN);
await driver.sleep(10000);
}
safariLogin();