Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Setting up Remote Selenium Webdriver, VNC server and Firefox on Centos 6

mbacchi edited this page Aug 13, 2015 · 6 revisions

Run the following script on your Centos 6 machine:

#!/bin/bash -xe

yum -y install wget

wget http://selenium-release.storage.googleapis.com/2.44/selenium-server-standalone-2.44.0.jar

yum -y groupinstall Desktop

yum -y install gnome-core xfce4 firefox # or try yum -y groupinstall Xfce I got error on centos "No package xfce4 available." (mbacchi 8/13/2015)

yum -y install tigervnc-server

yum -y install expect

chkconfig vncserver on

prog=/usr/bin/vncpasswd

mypass="foobar"

/usr/bin/expect <<EOF

spawn "$prog"

expect "Password:"

send "$mypass\r"

expect "Verify:"

send "$mypass\r"

expect eof

EOF

echo "Hello!"

echo 'VNCSERVERS="1:root" VNCSERVERARGS[1]="-geometry 1280x1024"' >> /etc/sysconfig/vncservers

service vncserver restart

pkill vnc

echo 'exec gnome-session &' >> ~/.vnc/xstartup

sed -i "s/twm/#twm/g" /root/.vnc/xstartup

service vncserver start

service vncserver restart

export DISPLAY=:1

yum install -y java

java -jar selenium-server-standalone-2.44.0.jar -Dwebdriver.enable.native.events=1 &