0.1.0 • Published 8 years ago

webdriver-ts v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

webdriver-ts

GitHub license Travis David David npm Commitizen friendly

A lowlevel selenium implementation in typescript.

Features

Usage

Installation

Install as npm package:

npm install webdriver-ts --save

Install latest development version:

npm install webdriver-ts@next --save

API

import { Pretend } from 'pretend';
import { SeleniumApi } from 'webdriver-ts';

async function local() {
  const browser = Pretend.builder().target(SeleniumApi, 'http://localhost:4444/wd/hub');
  const session = await api.newSession({
    desiredCapabilities: {
      browserName: 'firefox'
    }
  });
  const response = await api.get(session.sessionId, {url: 'https://www.google.com'});
  await api.deleteSession(session.sessionId);
}

async function browserStack() {
  const browser = Pretend.builder().target(SeleniumApi, 'https://hub.browserstack.com/wd/hub');
  const session = await api.newSession({
    desiredCapabilities: {
      'browserName': 'firefox',
      'browserstack.user': 'xxx',
      'browserstack.key' : 'yyy'
    }
  });
  const response = await api.get(session.sessionId, {url: 'https://www.google.com'});
  await api.deleteSession(session.sessionId);
}
0.1.0

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago