2017 © Pedro Peláez
 

library selenium-handler

Get, Start & Stop selenium server

image

fonsecas72/selenium-handler

Get, Start & Stop selenium server

  • Friday, December 2, 2016
  • by fonsecas72
  • Repository
  • 2 Watchers
  • 0 Stars
  • 40,162 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 14 Versions
  • 1 % Grown

The README.md

Selenium Handler

Download, Start & Stop Selenium Server with PHP >= 5.4 as a kind of a client or by command line., (*1)

Build Status Scrutinizer Code Quality Dependency Status, (*2)

Latest Stable Version Total Downloads Daily Downloads Latest Unstable Version License, (*3)

This package was written to avoid downloading selenium by hand and to avoid those complex commands to make selenium to start. It also allows you to use it with-in your own package., (*4)

Installation

With Composer:, (*5)

  composer require --dev fonsecas72/selenium-handler

Usage

In your application

You can create a downloader, a starter, a stopper and a watcher. E.g. to create a starter:, (*6)

$seleniumStarterOptions = new SeleniumStartOptions();
$process = new Process('');
$exeFinder = new ExecutableFinder();
$waiter = new ResponseWaitter(new Client());
$starter = new SeleniumStarter($seleniumStarterOptions, $process, $waiter, $exeFinder);

Then you can call:, (*7)

$starter->start();

And it will just work., (*8)

Of course, you can also change de default settings. This is done by calling options classes that each one if this has. E.g. to change a setting for the starter:, (*9)

// timeout is changed in the "waitter" class:
$starter->getResponseWaitter()->setTimeout($input->getOption('timeout'));
// to set a specific selenium location you do:
$starterOptions = $starter->getStartOptions();
$starterOptions->setSeleniumJarLocation($input->getOption('selenium-location'));
// to enable xvfb:
$starterOptions->enabledXvfb();

You can also create a "handler" that will allow you to start, stop, download, etc. through one single class., (*10)

$this->handler = new SeleniumHandler($starter, $stopper, $downloader, $logWatcher);

see the tests and the built-in commands for more examples, or open an issue, (*11)

Built-in commands

get selenium

(it will download to current directory by default), (*12)

bin/selenium get

You can set the destination directory with, (*13)

bin/selenium get -d someDir/

You can set the selenium version with, (*14)

bin/selenium get -s 2.44

start selenium

bin/selenium start

You can give the selenium location with, (*15)

bin/selenium start --selenium-location /someDir/selenium-server-standalone.jar

Optionally, you may choose whether or not you want to use xvfb, (*16)

bin/selenium start --xvfb

You can throw selenium options too. For example: You can set the firefox profile to use:, (*17)

bin/selenium start --selextra firefox-profile=/someDir/toFirefoxProfile

You can also set how much you are willing to wait for selenium to start (in seconds), (*18)

bin/selenium start --timeout 60

stop selenium

bin/selenium stop
Tips & Tricks

You can also tail the selenium log after start with follow option:, (*19)

bin/selenium start --follow

You can even track a specific log level, (*20)

bin/selenium start --follow ERROR

This can be specially useful if you start selenium in the background before running tests., (*21)

bin/selenium start --follow ERROR &

Then if some error happens you will see it in your test log / output., (*22)

The Versions

02/12 2016

dev-master

9999999-dev

Get, Start & Stop selenium server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hugo Fonseca

selenium download start get handle

02/12 2016

0.4.1

0.4.1.0

Get, Start & Stop selenium server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hugo Fonseca

selenium download start get handle

29/11 2016

0.4.0

0.4.0.0

Get, Start & Stop selenium server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hugo Fonseca

selenium download start get handle

29/11 2016

0.3.0

0.3.0.0

Get, Start & Stop selenium server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hugo Fonseca

selenium download start get handle

21/03 2016

0.2.0

0.2.0.0

Get, Start & Stop selenium server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hugo Fonseca

selenium download start get handle

21/03 2016

dev-fonsecas72-patch-3

dev-fonsecas72-patch-3

Get, Start & Stop selenium server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hugo Fonseca

selenium download start get handle

20/01 2016

dev-fonsecas72-patch-2

dev-fonsecas72-patch-2

Get, Start & Stop selenium server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hugo Fonseca

selenium download start get handle

27/11 2015

dev-fonsecas72-patch-1

dev-fonsecas72-patch-1

Get, Start & Stop selenium server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hugo Fonseca

selenium download start get handle

10/09 2015

0.1.2

0.1.2.0

Get, Start & Stop selenium server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hugo Fonseca

selenium download start get handle

10/09 2015

0.1.1

0.1.1.0

Get, Start & Stop selenium server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hugo Fonseca

selenium download start get handle

20/08 2015

0.1.0

0.1.0.0

Get, Start & Stop selenium server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hugo Fonseca

selenium download start get handle

10/08 2015

0.0.3

0.0.3.0

Get, Start & Stop selenium server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hugo Fonseca

selenium download start get handle

08/08 2015

0.0.2

0.0.2.0

Get, Start & Stop selenium server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hugo Fonseca

selenium download start get handle

07/08 2015

0.0.1

0.0.1.0

Get, Start & Stop selenium server

  Sources   Download

MIT

The Requires

 

The Development Requires

by Hugo Fonseca

selenium start get handle