{"id":15026735,"url":"https://github.com/itnelo/reactphp-webdriver","last_synced_at":"2025-10-04T02:29:28.733Z","repository":{"id":56994378,"uuid":"317091959","full_name":"itnelo/reactphp-webdriver","owner":"itnelo","description":"An async, W3C compliant PHP client for Selenium Grid server (hub) that uses event loop and promise API","archived":false,"fork":false,"pushed_at":"2021-02-24T21:47:36.000Z","size":125,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-13T20:43:07.970Z","etag":null,"topics":["php-webdriver","php74","reactphp","selenium","selenium-grid","webdriver"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itnelo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-30T02:39:24.000Z","updated_at":"2023-09-12T00:47:10.000Z","dependencies_parsed_at":"2022-08-21T10:40:52.251Z","dependency_job_id":null,"html_url":"https://github.com/itnelo/reactphp-webdriver","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/itnelo/reactphp-webdriver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itnelo%2Freactphp-webdriver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itnelo%2Freactphp-webdriver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itnelo%2Freactphp-webdriver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itnelo%2Freactphp-webdriver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itnelo","download_url":"https://codeload.github.com/itnelo/reactphp-webdriver/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itnelo%2Freactphp-webdriver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278254671,"owners_count":25956649,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php-webdriver","php74","reactphp","selenium","selenium-grid","webdriver"],"created_at":"2024-09-24T20:04:59.595Z","updated_at":"2025-10-04T02:29:28.713Z","avatar_url":"https://github.com/itnelo.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# ReactPHP WebDriver\n\nThis is a direct port of [RemoteWebDriver](https://github.com/php-webdriver/php-webdriver/blob/1.8.3/lib/Remote/RemoteWebDriver.php)\nlogic from the [php-webdriver/webdriver](https://github.com/php-webdriver/php-webdriver) package, which utilizes [ReactPHP](https://github.com/reactphp/reactphp)\nevent loop and promise API for browser interaction w/o execution flow blocking.\n\n**Selenium WebDriver** is a software that is used to manipulate browsers from the code (primarily, for testing and web scraping).\nYou can find more here: [https://selenium.dev](https://selenium.dev).\n\nThis PHP client sends async HTTP requests to the [Grid](https://www.selenium.dev/documentation/en/grid). It is a central\nendpoint for commands, a bridge between your code and browser instances. See\n[SeleniumHQ/docker-selenium](https://github.com/SeleniumHQ/docker-selenium) to get your own remote browser (or a cluster).\n\nEnjoy!\n\n## Requirements\n\n- **PHP 7.4** or higher.\n- ReactPHP v1 (http **^1**, stream **^1**).\n- Symfony conflicts: 5.1 (or newer) environments are preferred; the package uses (and will use) some components from\nthere, and their code / version constraints may need a review, to include a wider range of supported environments\n(otherwise, you need to adjust your platform).\n\n## Installation\n\nWith [composer](https://getcomposer.org/download):\n\n```\n$ composer require itnelo/reactphp-webdriver:^0.4\n```\n\n## How to use\n\nCall a factory method to get your instance (recommended). The minimal configuration is:\n\n```php\nuse React\\EventLoop\\Factory as LoopFactory;\nuse Itnelo\\React\\WebDriver\\WebDriverFactory;\n\n$loop = LoopFactory::create();\n\n$webDriver = WebDriverFactory::create(\n    $loop,\n    [\n        'hub' =\u003e [\n            'host' =\u003e 'selenium-hub',\n            'port' =\u003e 4444,\n        ],\n    ]\n);\n```\n\nYou can customize a set of parameters for the underlying [ReactPHP Browser](https://github.com/reactphp/http#browser)\nand tune driver options:\n\n```php\nuse React\\EventLoop\\Factory as LoopFactory;\nuse Itnelo\\React\\WebDriver\\WebDriverFactory;\n\n$loop = LoopFactory::create();\n\n$webDriver = WebDriverFactory::create(\n    $loop,\n    [\n        'browser' =\u003e [\n            'tcp' =\u003e [\n                'bindto' =\u003e '192.169.56.10:0',\n            ],\n            'tls' =\u003e [\n                'verify_peer' =\u003e false,\n                'verify_peer_name' =\u003e false,\n            ],\n        ],\n        'hub' =\u003e [\n            'host' =\u003e 'selenium-hub',\n            'port' =\u003e 4444,\n        ],\n        'command' =\u003e [\n            'timeout' =\u003e 30,\n        ],\n    ]\n);\n```\n\nManual configuration (if you prefer to configure each component as a separate service, e.g. compiling a DI container\nand want to reuse existing service definitions):\n\n```php\nuse React\\EventLoop\\Factory as LoopFactory;\nuse React\\Socket\\Connector as SocketConnector;\nuse React\\Http\\Browser;\nuse Itnelo\\React\\WebDriver\\Client\\W3CClient;\nuse Itnelo\\React\\WebDriver\\Timeout\\Interceptor as TimeoutInterceptor;\nuse Itnelo\\React\\WebDriver\\SeleniumHubDriver;\n\n$loop = LoopFactory::create();\n\n$socketConnector = new SocketConnector(\n    $loop,\n    [\n        'tcp' =\u003e [\n            'bindto' =\u003e '192.169.56.10:0',\n        ],\n        'tls' =\u003e [\n            'verify_peer' =\u003e false,\n            'verify_peer_name' =\u003e false,\n        ],\n    ]\n);\n$browser = new Browser($loop, $socketConnector);\n$browser = $browser-\u003ewithRejectErrorResponse(false);\n\n$hubClient = new W3CClient(\n    $browser,\n    [\n        'server' =\u003e [\n            'host' =\u003e 'selenium-hub',\n            'port' =\u003e 4444,\n        ],\n    ]\n);\n\n$timeoutInterceptor = new TimeoutInterceptor($loop, 30);\n\n$webDriver = new SeleniumHubDriver(\n    $loop,\n    $hubClient,\n    $timeoutInterceptor\n);\n```\n\nSee a self-documented [WebDriverInterface.php](src/WebDriverInterface.php) (and [ClientInterface.php](src/ClientInterface.php))\nfor the API details. Not all methods and arguments are ported (only the most necessary), so feel free to open\nan issue / make a pull request if you want more.\n\n## See also\n\n- [php-webdriver/webdriver](https://github.com/php-webdriver/php-webdriver) — the original, \"blocking\" implementation;\nto get information how to use some advanced methods. For example, [WebDriverKeys](https://github.com/php-webdriver/php-webdriver/blob/main/lib/WebDriverKeys.php#L10)\nhelper describes Unicode strings for sending special inputs to page elements (e.g. `Ctrl`, `Alt` and other keys).\n\n## Changelog\n\nAll notable changes to this project will be documented in [CHANGELOG.md](CHANGELOG.md).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitnelo%2Freactphp-webdriver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitnelo%2Freactphp-webdriver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitnelo%2Freactphp-webdriver/lists"}