Skip to content

Instantly share code, notes, and snippets.

@SarahElson
Created April 28, 2023 16:38
setting up Selenium in the Express framework
const express = require("express");
const { By, Builder, Select } = require("selenium-webdriver");
const app = express();
const port = 3002;
let driver;
const URL = "https://jqueryui.com/datepicker/#date-range";
const expected_fr_date = "20";
const expected_to_date = "26";
app.get("/", async (request, response) => {
try {
const data = await DatePickerWithLambdaTest();
response.status(200).json(data);
} catch (error) {
console.log(error);
response.status(500).json({
message: "Server error occurred",
});
}
});
app.listen(port, () => {
console.log(`Example app listening at http://localhost:${port}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment