Skip to content

Instantly share code, notes, and snippets.

@ShamaUgale
Created September 22, 2020 12:33
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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