Skip to content

Instantly share code, notes, and snippets.

@kuc-arc-f
Created February 9, 2025 06:26
Show Gist options
  • Save kuc-arc-f/fcfa1691971244f9d5433cd3cda89e77 to your computer and use it in GitHub Desktop.
Save kuc-arc-f/fcfa1691971244f9d5433cd3cda89e77 to your computer and use it in GitHub Desktop.
selenium-test-example
const {By, Builder, Browser} = require('selenium-webdriver');
const assert = require("assert");
(async function firstTest() {
let driver;
try {
driver = await new Builder().forBrowser(Browser.CHROME).build();
await driver.get('http://localhost:5173');
await driver.manage().setTimeouts({implicit: 500});
let textBox = await driver.findElement(By.name('title'));
let submitButton = await driver.findElement(By.css('button'));
await textBox.sendKeys('test');
} catch (e) {
console.log(e)
}
}())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment