1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-20 22:08:39 +00:00

update selenium

This commit is contained in:
kev 2016-02-04 10:12:14 +08:00
parent f77474a4e9
commit 4ca28d21a4
2 changed files with 42 additions and 3 deletions

@ -4,21 +4,55 @@ selenium
[Selenium][1] is an umbrella project for a range of tools and libraries that enable
and support the automation of web browsers.
Watch [this][2] video to get started.
## Server
docker-compose.yml
```
```yaml
firefox:
image: selenium/standalone-firefox
image: selenium/standalone-firefox-debug
ports:
- "4444:4444"
- "5900:5900"
environment:
- JAVA_OPTS=-Xmx512m
restart: always
```
docker-compose-grid.yml (not tested yet)
```yaml
hub:
image: selenium/hub
container_name: hub
ports:
- "4444:4444"
retart: always
chrome:
image: selenium/node-chrome
container_name: chrome
ports:
- "5555"
links:
- hub
retart: always
firefox:
image: selenium/node-firefox
container_name: firefox
ports:
- "5555"
links:
- hub
retart: always
```
> Access grid console at <http://127.0.0.1:4444/grid/console>
```bash
$ docker-compose up -d
```
@ -80,6 +114,9 @@ driver.quit();
```
```
# VNC
$ open vnc://:secret@127.0.0.1:5900
# PYTHON
$ pip3 install selenium
$ python3 baidu-search.py
@ -90,3 +127,4 @@ $ node search-baidu.js
```
[1]: http://seleniumhq.org/
[2]: https://www.youtube.com/watch?v=S4OkrnFb-YY

@ -1,7 +1,8 @@
firefox:
image: selenium/standalone-firefox
image: selenium/standalone-firefox-debug
ports:
- "4444:4444"
- "5900:5900"
environment:
- JAVA_OPTS=-Xmx512m
restart: always