Selenium server at startup

I am using Selenium RC on an Ubuntu system. I want to automate tests, and I need to run Selenium-server.jar when the machine starts.

I created seleniumServer.conf in / ect / init / s:

start on startup
start on runlevel 3

respawn

exec xvfb-run java -jar /home/condde/selenium-server-1.0.3/selenium-server.jar -port 4444

When I restart the computer, it is working fine, the process is running. But when I run the test, the result is:

PHPUnit_Framework_Exception: Could not connect to the Selenium RC server.

Any ideas? Thank!

+3
source share
5 answers

, . selenium , , java SecureRandom , /dev/random , . /dev/random /dev/urandom, selenium :

sudo mv /dev/random /dev/random.real
sudo ln -s /dev/urandom /dev/random

$JAVA_HOME/jre/lib/security/java.security :

securerandom.source=file:/dev/random

securerandom.source=file:/dev/urandom

, , .

+3

ubuntu 14, npm.

npm.

sudo npm install selenium-standalone -g
sudo selenium-standalone install

/etc/init.d .

sudo ln -s /usr/local/bin/selenium-standalone /etc/init.d/
sudo update-rc.d selenium-standalone defaults
+1

- . - :

sudo docker run -d -p 4444:4444 selenium/standalone-chrome

-d - , . -p webdriver (4444) .

, , . firefox! https://github.com/SeleniumHQ/docker-selenium .

+1

-debug, Selenium , , - .

 java -jar selenium-server.jar -debug  > /var/log/selenium-server.log 2>&1
0

selenium -log, , , - , ..

:

  • Do you get any response if you enter http: // localhost: 4444 It should display a 403 error when the Jetty engine is running.

  • If this does not work, I would try with your actual IP: 4444, which may indicate a problem with the localhost variable, proxy settings, etc.

  • Can firewall settings block port 4444? Perhaps the Selenium server process is not allowed to launch the browser.

0
source

Source: https://habr.com/ru/post/1763770/


All Articles