A sample js script for selenium 4 with Selenium JS binding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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