edoceo

Headless Selenium WebDriver for Chrome and Firefox

I've got Selenium server running, controlling Chrome, Chromium and Firefox on a headless Linux system.

Install Dependencies

emerge -av dev-php/pear
pear channel-discover pear.phpunit.de
pear install phpunit/PHPUnit_Selenium
apt-get install chromium-chromedriver firfox php5-cli php5-curl php5-json
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
dpkg -i google-chrome-stable_current_amd64.deb

Install Selneium

mkdir ~/selenium
cd selenium
wget ...

Configure It?

#!/bin/bash

cd $(dirname $(readlink -f $0 ))

export DISPLAY=:90

nohup java \
	-jar selenium.jar \
	-log selenium.log \
	-maxSession 8 \
	-browserTimeout 64 \
	>selenium.out 2>&1 &
	
echo $! >selenium.pid
http://tomash.wrug.eu/blog/2010/06/12/headless-selenium-firefox-xvfb-stack/ http://stackoverflow.com/questions/3422262/take-a-screenshot-with-selenium-webdriver https://raw.githubusercontent.com/sebastianbergmann/phpunit-selenium/master/PHPUnit/Extensions/SeleniumTestCase.php http://beagile.biz/a-simple-phpunit-xml-configuration-example/ https://code.google.com/p/selenium/wiki/InternetExplorerDriver https://code.google.com/p/selenium/issues/detail?id=3054

Loading Comments from Disqus...