Selenium opens browsers and test it like how an user test the application, but if you have a server with (linux) no GUI mode but still you need to run your selenium scripts means you need to install Virtual Frame Buffer and then you can run your scripts, this is called as running selenium scripts in headless mode.
The below example is tested in ubuntu 14.04
The below example is tested in ubuntu 14.04
Install Xvfb – the X Virtual FrameBuffer
This piece of software emulates the framebuffer using virtual memory which lets you run X-Server in machines with no display devices. This service is required to make browsers run normally by making them believe there is a display available. To install xvfb in ubuntu or Debian, run the following command,
sudo apt-get install xvfb
After installing Xvfb, run your scripts using xvfb-run --server-number=10 python test.py
Thats it...
No comments:
Post a Comment