Giter VIP home page Giter VIP logo

php-webdriver-archive's Introduction

This is archived version.

Use php-webdriver as up-to-date replacement.

php-webdriver โ€“ Selenium WebDriver bindings for PHP

Latest Stable Version Total Downloads License

Description

Php-webdriver library is PHP language binding for Selenium WebDriver, which allows you to control web browsers from PHP.

This library is compatible with Selenium server version 2.x, 3.x and 4.x.

The library supports JsonWireProtocol and also implements experimental support of W3C WebDriver. The W3C WebDriver support is not yet full-featured, however it should allow to control Firefox via Geckodriver and new versions of Chrome and Chromedriver with just a slight limitations.

The concepts of this library are very similar to the "official" Java, .NET, Python and Ruby bindings from the Selenium project.

Looking for API documentation of php-webdriver? See https://facebook.github.io/php-webdriver/

Any complaints, questions, or ideas? Post them in the user group https://www.facebook.com/groups/phpwebdriver/.

Installation

Installation is possible using Composer.

If you don't already use Composer, you can download the composer.phar binary:

curl -sS https://getcomposer.org/installer | php

Then install the library:

php composer.phar require facebook/webdriver

Getting started

Start Server

The required server is the selenium-server-standalone-#.jar file provided here: http://selenium-release.storage.googleapis.com/index.html

Download and run the server by replacing # with the current server version. Keep in mind you must have Java 8+ installed to run this command.

java -jar selenium-server-standalone-#.jar

Create a Browser Session

When creating a browser session, be sure to pass the url of your running server.

// This would be the url of the host running the server-standalone.jar
$host = 'http://localhost:4444/wd/hub'; // this is the default url and port where Selenium server starts
Launch Chrome

Install latest Chrome and Chromedriver.

The chromedriver binary must be placed in system PATH directory, otherwise you must provide the path when starting Selenium server (eg. java -Dwebdriver.chrome.driver="/path/to/chromedriver" -jar selenium-server-standalone-#.jar).

$driver = RemoteWebDriver::create($host, DesiredCapabilities::chrome());
Launch Firefox

Install latest Firefox and Geckodriver.

The geckodriver binary must be placed in system PATH directory, otherwise you must provide the path when starting Selenium server (eg. java -Dwebdriver.gecko.driver="/path/to/geckodriver" -jar selenium-server-standalone-#.jar).

$driver = RemoteWebDriver::create($host, DesiredCapabilities::firefox());

Customize Desired Capabilities

$desiredCapabilities = DesiredCapabilities::firefox();
$desiredCapabilities->setCapability('acceptSslCerts', false);
$driver = RemoteWebDriver::create($host, $desiredCapabilities);

NOTE: Above snippets are not intended to be a working example by simply copy-pasting. See example.php for working example.

Changelog

For latest changes see CHANGELOG.md file.

More information

Some how-tos are provided right here in our GitHub wiki.

You may also want to check out the Selenium docs and wiki.

Testing framework integration

To take advantage of automatized testing you may want to integrate php-webdriver to your testing framework. There are some projects already providing this:

Support

We have a great community willing to help you!

  • Via our Facebook Group - If you have questions or are an active contributor consider joining our facebook group and contribute to communal discussion and support
  • Via StackOverflow - You can also ask a question or find many already answered question on StackOverflow
  • Via GitHub - Another option if you have a question (or bug report) is to submit it here as a new issue

Contributing

We love to have your help to make php-webdriver better. See CONTRIBUTING.md for more information about contributing and developing php-webdriver.

php-webdriver-archive's People

Contributors

akshayminocha5 avatar andrefortin avatar andrewnicols avatar ashleydw avatar carusogabriel avatar cbergau avatar danielbeardsley avatar davertmik avatar davidsickmiller avatar dgcarramona avatar dsereni avatar dunglas avatar flarnie avatar gfosco avatar gkralik avatar jonstjohn avatar jsifalda avatar lctrs avatar localheinz avatar mordred avatar okrad avatar oleg-andreyev avatar ondram avatar phelipealves avatar sepehr avatar stephane-rbn avatar tobiaskappe avatar v-slenter avatar volch avatar whhone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.