Skip to content

Commit

Permalink
add docker examle (#252)
Browse files Browse the repository at this point in the history
  • Loading branch information
Uunnamed authored Jul 28, 2020
1 parent 52d503a commit 62646c2
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ after a mysteries note was produced on it.
* [Screening elements](#screening-elements)
- [Using headless drivers](#using-headless-drivers)
- [Connection to remote webdriver](#connection-to-remote-webdriver)
- [Webdriver in Docker](#webdriver-in-docker)
- [Devtools: tracking HTTP requests, XHR (Ajax)](#devtools-tracking-http-requests-xhr-ajax)
- [Postmortem: auto-save artifacts in case of exception](#postmortem-auto-save-artifacts-in-case-of-exception)
- [Reading browser's logs](#reading-browsers-logs)
Expand Down Expand Up @@ -619,10 +620,10 @@ Example:

```clojure
;; Chrome
(def driver (create-driver :chrome {:host "127.0.0.1" :port 9515})) ;; localhost and 9515 port is default setting, use own
(def driver (create-driver :chrome {:host "127.0.0.1" :port 9515})) ;; 127.0.0.1 is default host, use own

;; Firefox
(def driver (create-driver :firefox {:host "127.0.0.1" :port 4444})) ;; localhost and 4444 port is default setting, use own
(def driver (create-driver :firefox {:host "127.0.0.1" :port 4444}))
```

Then pass the `capabilities` to the browser with `chromeOptions` or `:moz:firefoxOptions` for Chrome or Firefox respectively:
Expand All @@ -639,6 +640,22 @@ Then pass the `capabilities` to the browser with `chromeOptions` or `:moz:firefo
{:moz:firefoxOptions {:args ["--headless"]}}})
```

## Webdriver in Docker

To work with the driver in Docker, you can take ready-made images and explore the section [Connection to remote webdriver](#connection-to-remote-webdriver)

Example for [Chrome](https://hub.docker.com/r/robcherry/docker-chromedriver/):

```
docker run --name chromedriver -p 9515:4444 -d -e CHROMEDRIVER_WHITELISTED_IPS='' robcherry/docker-chromedriver:latest
```

for [Firefox](https://hub.docker.com/r/instrumentisto/geckodriver):

```
docker run --name geckodriver -p 4444:4444 -d instrumentisto/geckodriver
```

## Devtools: tracking HTTP requests, XHR (Ajax)

With recent updates, the library brings a great feature. Now you can trace
Expand Down

0 comments on commit 62646c2

Please sign in to comment.