Skip to content

Instantly share code, notes, and snippets.

@ShamaUgale
Created September 22, 2020 12:33
Embed
What would you like to do?
A sample js script for selenium 4 with Selenium JS binding
const {Builder,Buy,Key} = require("selenum-webdriver");
async function searchTest(){
// create and open a firefox driver object
let driver = await new Builder.forBrowser("firefox").build();
// navigate to google.com
await driver.get("https://www.google.com");
// locate the google search textbox and enter "Selenium 4", hit Enter key
await driver.findElement(By.name("q").sendKeys("Selenium 4",Key.RETURN));
}
searchTest();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment