PrantaDas / web-driver

Automate Chrome browser tasks using the Chrome DevTools Protocol and Node.js. This project provides a set of functions to fetch the installed Chrome browser version, download the corresponding ChromeDriver binary, set up the driver, create a new Chrome DevTools session, and open a website in the active session.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chrome Automation Project

Automate Chrome browser tasks using the Chrome DevTools Protocol and Node.js. This project provides a set of functions to fetch the installed Chrome browser version, download the corresponding ChromeDriver binary, set up the driver, create a new Chrome DevTools session, and open a website in the active session.

Table of Contents

Introduction

This project aims to simplify the process of automating Chrome browser tasks by providing a collection of functions built on top of the Chrome DevTools Protocol. It includes functionality to determine the installed Chrome browser version, download the appropriate ChromeDriver binary, and automate various browser actions.

Prerequisites

Before using this project, ensure you have the following prerequisites installed:

Installation

  1. Clone the repository:

    git clone https://github.com/PrantaDas/web-driver.git
  2. Change to the project directory:

    cd web-driver
  3. Install dependencies:

    npm install or yarn

Usage

Import the functions you need from the main.js module and use them in your project. Make sure to handle errors appropriately.

const { getChromeVersion, downLoadDriver, saveZipFile, unzipFile, start, createSession, navigateToUrl, turnFullScreen, takeScreenShot, closeSession, getActiveElem } = require("./main");

(async () => {
    try {
        const version = await getChromeVersion();
        console.log(version);
        await downLoadDriver();
        // Additional functions can be called here
    } catch (e) {
        console.log(e);
    }
})();

About

Automate Chrome browser tasks using the Chrome DevTools Protocol and Node.js. This project provides a set of functions to fetch the installed Chrome browser version, download the corresponding ChromeDriver binary, set up the driver, create a new Chrome DevTools session, and open a website in the active session.


Languages

Language:JavaScript 100.0%