I am running some tests in headless firefox using Xvfb. However, after my tests are finished I want to move back to normal display. But I am not able to do that .Here is What I am doing .
After step 4, I want to open the firefox in the same terminal but I am not able to see it as it is directed towards :10 display.
I wonder how can I shut this (xvfb :10) down so that I can open firefox and view it.
The simple solution is to keep the old value of DISPLAY, change it to point to the xvfb, and then after the test is run you can change it back to the saved value.
This leaves the xvfb running, so you should also get the pid of that process and kill it. Otherwise, if you run this set of steps a dozen times, you'll have a dozen xvfb processes running in the background.