Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

Selenium client with ipython, read line etc. ideal to explore selenium

License

Notifications You must be signed in to change notification settings

BrightIT/docker-ipython-selenium-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python:3.5 selenium:2.x License MIT

Dockerfile

Prerequisites

Examples below use selenium_net network to make connection between containers, we also use a prebuild selenium container with firefox, you can get both using this commands:

$ docker network create --driver bridge selenium_net
$ docker run -e no_proxy=localhost --network=selenium_net --name selenium_firefox -d -p 4444:4444 -p 5900:5900 selenium/standalone-firefox-debug:2.53.1

This will start a firefox with vnc access that can be used to run selenium tests. To open vnc on osx run:

$ open vnc://localhost:5900
# and type password: secret

Usage - iPython interactive selenium session

Given the above container is running you can run an interactive ipython sessions as follows:

$ docker run -it --rm --network selenium_net -v $(pwd):/wrk -w /wrk brightit/ipython-selenium ipython
...
In [1]: from selenium import webdriver; from selenium.webdriver.common.keys import Keys; from selenium.webdriver.common.by import By; from selenium.webdriver.support.ui import WebDriverWait; from selenium.webdriver.support import expected_conditions as EC
In [2]: browser = webdriver.Remote(command_executor='http://selenium_firefox:4444/wd/hub', desired_capabilities=webdriver.DesiredCapabilities.FIREFOX)
In [3]: browser.get("http://www.bright-it.com")
In [4]: browser.close()
In [5]: exit();

Usage - script execution

To run a script.py in your current directory here you can run this:

$ docker run -it --rm --network=selenium_net -v "$(pwd):/wrk" -w /wrk brightit/ipython-selenium python script.py

About

Selenium client with ipython, read line etc. ideal to explore selenium

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages