Time for action – running tests with XVFB - Selenium

We will have to make sure that we have XVFB running on the machine.

  1. Open a terminal.

  2. We need to export the display so that everything that is launched from it uses the one that we have set up earlier. We do this with:
    Export DISPLAY=0.1

  3. Now we just need to run our tests. You will see that the browser may launch in the dock but it should not actually be visible.

What just happened?

We have successfully managed to get our tests running using XVFB. We saw that the tests that we were running, and launching a browser on our displays, still finished with the same results as before.

This can be useful for situations where you may have your tests running on change and you know that the browser will not try stealing focus.

Have a go hero - running tests in parallel with XVFB

Now that we know how to run tests with XVFB, try getting this running while running tests in parallel and see how it works together!


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Selenium Topics