{"id":15138619,"url":"https://github.com/jeremyc2/selenium-repl","last_synced_at":"2025-04-06T09:19:43.966Z","repository":{"id":65493857,"uuid":"426727189","full_name":"jeremyc2/Selenium-REPL","owner":"jeremyc2","description":"Selenium Webdriver REPL and test suite scaffolding in JavaScript","archived":false,"fork":false,"pushed_at":"2021-12-13T20:34:14.000Z","size":2074,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-24T22:01:06.344Z","etag":null,"topics":["selenium-javascript","selenium-webdriver","testing-tools"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeremyc2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-10T18:09:13.000Z","updated_at":"2021-12-13T20:34:17.000Z","dependencies_parsed_at":"2023-01-25T21:15:31.128Z","dependency_job_id":null,"html_url":"https://github.com/jeremyc2/Selenium-REPL","commit_stats":null,"previous_names":[],"tags_count":106,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyc2%2FSelenium-REPL","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyc2%2FSelenium-REPL/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyc2%2FSelenium-REPL/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremyc2%2FSelenium-REPL/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeremyc2","download_url":"https://codeload.github.com/jeremyc2/Selenium-REPL/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247458226,"owners_count":20941992,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["selenium-javascript","selenium-webdriver","testing-tools"],"created_at":"2024-09-26T07:42:27.432Z","updated_at":"2025-04-06T09:19:43.940Z","avatar_url":"https://github.com/jeremyc2.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Getting Started\n\u003cimg src=\"https://jeremyc2.github.io/Selenium-REPL/REPL-Infographic.svg\" width=\"400\"\u003e\n\n*Currently supports testing in Google Chrome, Edge, and Firefox*\n## Before you begin\n1. Make sure you have [NodeJS](https://nodejs.org/en/) installed\n2. If you do not have PowerShell installed, make sure you have downloaded the webdriver executable\n\n## Options\n```\nOptions:\n  -b, --browser \u003cbrowser\u003e  chrome, edge, or firefox\n  -d, --driverPath \u003cpath\u003e  folder location of webdriver\n  -h --headless            webdriver headless mode\n  -s --selectors           add additional selector functions to the REPL\n  --help                   display help for command\n```\n\n## Quickstart\nOpen PowerShell. Enter ```npx selenium-repl```.\n\n## Setup\n*If you have PowerShell installed, execute ***Setup.ps1*** and skip the remaining setup instructions.*  \n1. In a Terminal Window, navigate to this repository and enter the command ```npm install```\n2. Enter the command ```npm run setup BROWSER DRIVER_PATH``` replacing ***BROWSER*** with chrome, edge, or firefox and ***DRIVER_PATH*** with the path to your folder containing webdriver†\n\n## Run the REPL\n*If you have PowerShell installed, execute **Start.ps1** and skip the remaining steps.*\n1. In a Terminal Window, navigate to this repository and enter the command ```npm start```  \n\n[Learn about Selenium REPL exclusive functions](https://github.com/jeremyc2/Selenium-REPL/wiki/Selenium-REPL-Exclusive-Functions).  \nRight-click an element to copy its CSS Selector.\n\n## Creating Tests\nRefer to the [Official Selenium Documentation](https://www.selenium.dev/documentation/). It is recommended you follow the [Page Object Model\n](https://www.selenium.dev/documentation/guidelines/page_object_models/). \n\n### Example Test\n#### test.js\n```javascript\nconst DriverFactory = require('selenium-repl/DriverFactory'),\n    LoginPage = require('./pages/LoginPage');\n\nfunction test() {\n    var driver = new DriverFactory('chrome').driver;\n\n    driver.get('https://www.google.com');\n\n    var loginPage = new LoginPage(driver);\n    var homePage = loginPage.login('Username', 'Password');\n\n    // ...\n}\n\nmodule.exports = test;\n```\n#### LoginPage.js\n```javascript\nconst { By } = require('selenium-webdriver'),\n    HomePage = require('./pages/HomePage');\n\nclass LoginPage {\n\n    usernameField = By.css('#UserName');\n    passwordField = By.css('#Password');\n    loginButton = By.css('#LoginButton');\n\n    constructor(driver) {\n        this.driver = driver;\n    }\n\n    inputUsername(username) {\n        this.driver.findElement(this.usernameField).sendKeys(username);\n    }\n\n    inputPassword(password) {\n        this.driver.findElement(this.passwordField).sendKeys(password);\n    }\n\n    clickLogin() {\n        this.driver.findElement(this.loginButton).click();\n    }\n\n    login(username, password) {\n        this.inputUsername(username);\n        this.inputPassword(password);\n        this.clickLogin();\n        return new HomePage(this.driver);\n    }\n}\n\nmodule.exports = LoginPage;\n```\n[Selenium REPL Cheatsheet](https://jeremyc2.github.io/Selenium-REPL/docs/selenium-repl-cheatsheet.html)\n\n[JavaScript API Documentation](https://www.selenium.dev/selenium/docs/api/javascript/)\n\n†*If the webdriver folder is your current directory or if it is in your PATH, you may omit this step.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeremyc2%2Fselenium-repl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeremyc2%2Fselenium-repl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeremyc2%2Fselenium-repl/lists"}