Skip to content

Instantly share code, notes, and snippets.

@ShamaUgale
Created September 22, 2020 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ShamaUgale/c20bdc0dc70e19737e0dfcbe29d9d826 to your computer and use it in GitHub Desktop.
Save ShamaUgale/c20bdc0dc70e19737e0dfcbe29d9d826 to your computer and use it in GitHub Desktop.
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