This repository contains Playwright scripts for browser automation.
A simple script that opens a Chromium browser window and navigates to webeccentric.com.
A script that automates filling and submitting a sample form on https://example.com/form.
-
Install dependencies:
npm install -
Install Playwright browsers:
npx playwright install
Run the basic script with:
npm start
or
node open_browser.js
By default, this launches a visible Chromium browser window. To run in headless mode (no visible window):
node open_browser.js --headless
Run the form filling script with:
npm run survey
or
node open_browser_fill_and_submit_survey.js
By default, this launches a visible Chromium browser window. To run in headless mode:
node open_browser_fill_and_submit_survey.js --headless
Both scripts will perform their actions, wait briefly, and then close the browser.
Note: If running from VS Code's integrated terminal, the browser window may not appear. Run the scripts in a separate Command Prompt or PowerShell window outside of VS Code for the GUI to display.
- Node.js installed
- Internet connection for navigation
- If nothing happens when running the scripts:
- Ensure Playwright browsers are installed (
npx playwright install). - Run the scripts in a separate terminal window (not VS Code's integrated terminal).
- Check for any error messages in the console output.
- Ensure Playwright browsers are installed (