Download the PHP package lionmm/laravel-ff-webdriver without Composer
On this page you can find all versions of the php package lionmm/laravel-ff-webdriver. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-ff-webdriver
Webdriver adapter (for Larave or standalone usage)
[]()
[
]()
[
]()
Selenium Firefox web-driver adapter (for Laravel 5.2.* and standalone use)
This package uses the facebook's php-webdriver library
Collect all mostly used methods in one class and give providers and aliases for working vs it
Now can be used standalone
Laravel supporting
-
Laravel 5.3.x:
in developing
-
Laravel 5.2.x:
1.0.1
-
Laravel 5.1.x:
0.1.2
- Laravel < 5.1:
not supported
Quick start
Install
Run composer require lionmm/laravel-ff-webdriver
Laravel 5.1.x to 5.2.x
In your config/app.php
add LionMM\WebDriver\WebDriverServiceProvider::class,
to the end of the providers
array
Add the WebDriver
facade to the end of the aliases
array as well
Usage
Selenium requirement
For using library you must install and run Selenium server
By default, library try to connect to http://localhost:4444/wd/hub
You can change that path in config/webdriver.php
(see above)
Using library
Best way - using Facade by alias WebDriver::method()
Also, you can make instance of \LionMM\WebDriver\WebDriver
class
OR
Next step - you must init Driver with method initDriver($parameters, $request_time_limit)
Instead, the parameter lang
You can specify directly 'accept_languages' => 'ru-RU,ru,en,en-US,uk'
By default flash is enabled and accept_languages
set to ru-RU,ru,en,en-US,uk
Go to url
Use method get($url)
for load a new web page in the current browser window.
Operate vs page content
waitForElement($selector, $index, $timeout)
checkForElement($selector)
getAllElements($selector, $need, $timeout)
Frames
switchToFrame($element)
: Switch to the iframe by its id or name.switchToDefaultContent()
: Switch to the main document if the page contains iframes. Otherwise, switch to the first frame on the page.
Service functions
quit($wait = 0)
: run automatically in__destruct()
method. Quits driver, closing every associated window. (hope this...)deleteAllCookies()
: Delete all the cookies that are currently visible.getCookies()
: Get all the cookies for the current domain.addCookie($cookie)
: Add a specific cookie.getCurrentURL()
: Get a string representing the current URL that the browser is looking atgetTitle()
: Get the title of the current page.getPageSource()
: Get the source of the last loaded page.takeScreenshot($pathToSave)
: Take a screenshot of the current page. if parameter$pathToSave
not set method return the screenshot contents in PNG formatexecuteScript($jsCode, $arguments, $async)
: Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame. The result of evaluating the script will be returned.
All versions of laravel-ff-webdriver with dependencies
symfony/console Version 2.8.*|3.0.*|3.3.*
facebook/webdriver Version ^1.5