Установка selenium + FireFox + Ubuntu 16

Описание необходимо для удаленного тестирования через PhpUnit тесты

#!/bin/bash

# Following the guide found at this page
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html

echo "\r\nUpdating system ...\r\n"
sudo apt-get update

# Create folder to place selenium in
#
echo "\r\nCreating folder to place selenium in ...\r\n"
sudo mkdir ~/selenium
cd ~/selenium

# Get Selenium and install headless Java runtime
#
echo "\r\nInstalling Selenium and headless Java runtime ...\r\n"
sudo wget http://selenium-release.storage.googleapis.com/2.44/selenium-server-standalone-2.44.0.jar
sudo apt-get install openjdk-7-jre-headless -y

# Install Firefox
#
echo "\r\nInstalling Firefox ...\r\n"
sudo apt-get install firefox -y

# Install headless GUI for firefox.  'Xvfb is a display server that performs graphical operations in memory'
#
echo "\r\nInstalling XVFB (headless GUI for Firefox) ...\r\n"
sudo apt-get install xvfb -y

# Finally, starting up Selenium server
#
echo "\r\nStarting up Selenium server ...\r\n"
DISPLAY=:1 xvfb-run java -jar ~/selenium/selenium-server-standalone-2.44.0.jar

Дополнительно

apt-get install software-properties-common
apt-add-repository ppa:mozillateam/firefox-next
apt-get update

apt-get install firefox xvfb
Xvfb :10 -ac &

wget https://github.com/mozilla/geckodriver/releases/download/v0.18.0/geckodriver-v0.18.0-linux64.tar.gz
tar -xvzf geckodriver*
chmod +x geckodriver
export PATH=$PATH:/path-to-extracted-file/geckodriver 

# run 
xvfb-run java -jar /usr/local/bin/selenium-server-standalone.jar

# если ошибка xvfb-run: error: Xvfb failed to start то
xvfb-run --auto-servernum --server-num=1 java -jar /usr/local/bin/selenium-server-standalone.jar
10 апреля 2018, 04:35    336

Комментарии ()

  1. Андрей Степаненко 29 августа 2018, 13:53 # 0
    Новый комментарий

    Вы должны авторизоваться, чтобы оставлять комментарии.

    Наверх