PHPackages                             fonsecas72/selenium-handler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. fonsecas72/selenium-handler

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

fonsecas72/selenium-handler
===========================

Get, Start &amp; Stop selenium server

0.4.1(9y ago)044.6k1MITPHP

Since Aug 7Pushed 9y ago2 watchersCompare

[ Source](https://github.com/fonsecas72/selenium-handler)[ Packagist](https://packagist.org/packages/fonsecas72/selenium-handler)[ RSS](/packages/fonsecas72-selenium-handler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (14)Used By (0)

Selenium Handler
================

[](#selenium-handler)

Download, Start &amp; Stop [Selenium Server](http://www.seleniumhq.org/) with PHP &gt;= 5.4 as a kind of a client or by command line.

[![Build Status](https://camo.githubusercontent.com/2468fe6cf10b1d089e7ce542f8608a84c2bd01381bd5abc7b3868166f8c58f64/68747470733a2f2f7472617669732d63692e6f72672f666f6e736563617337322f73656c656e69756d2d68616e646c65722e737667)](https://travis-ci.org/fonsecas72/selenium-handler) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/d863c0e0ec3561ad3b2a7dac00f88d3dea1cdbcc663744cad2b24c8d8a0381b4/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f666f6e736563617337322f73656c656e69756d2d68616e646c65722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/fonsecas72/selenium-handler/?branch=master)[![Dependency Status](https://camo.githubusercontent.com/16ea3a77a7d94cfcb2eee729084c18f842f4e67630cdd0d5857ba630f1f9b8c0/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f757365722f70726f6a656374732f3535303261633730346131303634646230653030303462612f62616467652e7376673f7374796c653d666c6174)](https://www.versioneye.com/user/projects/5502ac704a1064db0e0004ba)

[![Latest Stable Version](https://camo.githubusercontent.com/f216bac13b7b0c4eb79ed6e20998a5ac31b16371bd5ebd5b9b1a4c3123fc2402/68747470733a2f2f706f7365722e707567782e6f72672f666f6e736563617337322f73656c656e69756d2d68616e646c65722f762f737461626c652e737667)](https://packagist.org/packages/fonsecas72/selenium-handler) [![Total Downloads](https://camo.githubusercontent.com/47ec85c128bce48e5bec1bf70dfe9e6bc557563935d108603cd16276d4329582/68747470733a2f2f706f7365722e707567782e6f72672f666f6e736563617337322f73656c656e69756d2d68616e646c65722f646f776e6c6f6164732e737667)](https://packagist.org/packages/fonsecas72/selenium-handler) [![Daily Downloads](https://camo.githubusercontent.com/141bef4abcad815ac0bacc5652262d4f8652e4b02a1e426dab232ae5c59d412c/68747470733a2f2f706f7365722e707567782e6f72672f666f6e736563617337322f73656c656e69756d2d68616e646c65722f642f6461696c792e706e67)](https://packagist.org/packages/fonsecas72/selenium-handler) [![Latest Unstable Version](https://camo.githubusercontent.com/d387a3a55e13caf3fd31b2be1fcbf676ff26a5b28372c499a5a4176b9989b3c1/68747470733a2f2f706f7365722e707567782e6f72672f666f6e736563617337322f73656c656e69756d2d68616e646c65722f762f756e737461626c652e737667)](https://packagist.org/packages/fonsecas72/selenium-handler) [![License](https://camo.githubusercontent.com/0cd8d27dd1d48b7aa57ceb3f3a74ac4312d72700ba09ea36094189713c32be99/68747470733a2f2f706f7365722e707567782e6f72672f666f6e736563617337322f73656c656e69756d2d68616e646c65722f6c6963656e73652e737667)](https://packagist.org/packages/fonsecas72/selenium-handler)

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.

### Installation

[](#installation)

With Composer:

```
  composer require --dev fonsecas72/selenium-handler

```

### Usage

[](#usage)

### In your application

[](#in-your-application)

You can create a downloader, a starter, a stopper and a watcher. E.g. to create a starter:

```
$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:

```
$starter->start();
```

And it will just work.

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:

```
// 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.

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

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

### Built-in commands

[](#built-in-commands)

#### get selenium

[](#get-selenium)

`(it will download to current directory by default)`

```
bin/selenium get

```

You can set the destination directory with

```
bin/selenium get -d someDir/

```

You can set the selenium version with

```
bin/selenium get -s 2.44

```

#### start selenium

[](#start-selenium)

```
bin/selenium start

```

You can give the selenium location with

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

```

Optionally, you may choose whether or not you want to use xvfb

```
bin/selenium start --xvfb

```

You can throw selenium options too. For example: You can set the firefox profile to use:

```
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)

```
bin/selenium start --timeout 60

```

#### stop selenium

[](#stop-selenium)

```
bin/selenium stop

```

##### Tips &amp; Tricks

[](#tips--tricks)

You can also tail the selenium log after start with follow option:

```
bin/selenium start --follow

```

You can even track a specific log level

```
bin/selenium start --follow ERROR

```

This can be specially useful if you start selenium in the background before running tests.

```
bin/selenium start --follow ERROR &

```

Then if some error happens you will see it in your test log / output.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 86.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~53 days

Recently: every ~112 days

Total

10

Last Release

3454d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/08332523acffe7f60deea89f54df3897d473de43116d7a110b74d0c0acf663be?d=identicon)[fonsecas72](/maintainers/fonsecas72)

---

Top Contributors

[![fonsecas72](https://avatars.githubusercontent.com/u/1098293?v=4)](https://github.com/fonsecas72 "fonsecas72 (39 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (6 commits)")

---

Tags

seleniumdownloadgetstarthandle

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/fonsecas72-selenium-handler/health.svg)

```
[![Health](https://phpackages.com/badges/fonsecas72-selenium-handler/health.svg)](https://phpackages.com/packages/fonsecas72-selenium-handler)
```

###  Alternatives

[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[symplify/monorepo-builder

Not only Composer tools to build a Monorepo.

5205.3M82](/packages/symplify-monorepo-builder)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

19462.3M1.3k](/packages/drupal-core)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
