PHPackages                             mccaulay/duskless - 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. mccaulay/duskless

ActiveLibrary

mccaulay/duskless
=================

Laravel Duskless provides browser automation.

11PHP

Since Jan 19Pushed 5y ago1 watchersCompare

[ Source](https://github.com/McCaulay/duskless)[ Packagist](https://packagist.org/packages/mccaulay/duskless)[ RSS](/packages/mccaulay-duskless/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

[![](https://camo.githubusercontent.com/2412744304860c125827160c9e585c7f7ac8f07496671794f829c68761b900de/68747470733a2f2f6c61726176656c2e636f6d2f6173736574732f696d672f636f6d706f6e656e74732f6c6f676f2d6475736b2e737667)](https://camo.githubusercontent.com/2412744304860c125827160c9e585c7f7ac8f07496671794f829c68761b900de/68747470733a2f2f6c61726176656c2e636f6d2f6173736574732f696d672f636f6d706f6e656e74732f6c6f676f2d6475736b2e737667)

[![Total Downloads](https://camo.githubusercontent.com/82fddde0f90cface36ef38acd7be5e5e6f064c82929373714ab4ba10f5ff9e7e/68747470733a2f2f706f7365722e707567782e6f72672f6d636361756c61792f6475736b6c6573732f642f746f74616c2e737667)](https://packagist.org/packages/mccaulay/duskless)[![Latest Stable Version](https://camo.githubusercontent.com/059ea4af46fb2ce659734e9fc467aac885fee4b173096b353dbbea223e37457b/68747470733a2f2f706f7365722e707567782e6f72672f6d636361756c61792f6475736b6c6573732f762f737461626c652e737667)](https://packagist.org/packages/mccaulay/duskless)[![License](https://camo.githubusercontent.com/3abf237625098c31191e3e2cc6829c0ca61dc92f28f1b4fd223a3ea0f5d9edab/68747470733a2f2f706f7365722e707567782e6f72672f6d636361756c61792f6475736b6c6573732f6c6963656e73652e737667)](https://packagist.org/packages/mccaulay/duskless)

Laravel Duskless
================

[](#laravel-duskless)

- [Introduction](#introduction)
- [Installation](#installation)
    - [Managing ChromeDriver Installations](#managing-chromedriver-installations)
- [Getting Started](#getting-started)
    - [Creating Browsers](#creating-browsers)
- [Interacting With Elements](#interacting-with-elements)
    - [Duskless Selectors](#duskless-selectors)
    - [Clicking Links](#clicking-links)
    - [Text, Values, &amp; Attributes](#text-values-and-attributes)
    - [Using Forms](#using-forms)
    - [Attaching Files](#attaching-files)
    - [Using The Keyboard](#using-the-keyboard)
    - [Using The Mouse](#using-the-mouse)
    - [JavaScript Dialogs](#javascript-dialogs)
    - [Scoping Selectors](#scoping-selectors)
    - [Waiting For Elements](#waiting-for-elements)
- [Pages](#pages)
    - [Generating Pages](#generating-pages)
    - [Configuring Pages](#configuring-pages)
    - [Navigating To Pages](#navigating-to-pages)
    - [Shorthand Selectors](#shorthand-selectors)
    - [Page Methods](#page-methods)
- [Components](#components)
    - [Generating Components](#generating-components)
    - [Using Components](#using-components)

Introduction
------------

[](#introduction)

Laravel Duskless provides an expressive, easy-to-use browser automation API. By default, Duskless does not require you to install JDK or Selenium on your machine. Instead, Duskless uses a standalone [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/home) installation. However, you are free to utilize any other Selenium compatible driver you wish.

Installation
------------

[](#installation)

To get started, you should add the `mccaulay/duskless` Composer dependency to your project:

```
composer require mccaulay/duskless

```

> {note} You can register Duskless in production as all of the issues with Laravel Duskless that prevent you from doing so are removed. Such as the loginAs method.

After installing the Duskless package, run the `duskless:install` Artisan command:

```
php artisan duskless:install

```

A `Browser` directory will be created within your `app` directory and will contain an example page. Next, set the `APP_URL` environment variable in your `.env` file. This value should match the URL you use to access your application in a browser.

### Managing ChromeDriver Installations

[](#managing-chromedriver-installations)

If you would like to install a different version of ChromeDriver than what is included with Laravel Duskless, you may use the `duskless:chrome-driver` command:

```
# Install the latest version of ChromeDriver for your OS...
php artisan duskless:chrome-driver

# Install a given version of ChromeDriver for your OS...
php artisan duskless:chrome-driver 74

# Install a given version of ChromeDriver for all supported OSs...
php artisan duskless:chrome-driver --all

```

> {note} Duskless requires the `chromedriver` binaries to be executable. If you're having problems running Duskless, you should ensure the binaries are executable using the following command: `chmod -R 0755 vendor/laravel/dusk/bin/`.

Getting Started
---------------

[](#getting-started)

### Creating Browsers

[](#creating-browsers)

To get started, let's write an example controller that visits the github repository. To create a browser instance, call the `browse` method:

```
