Wrap Selenium in xvfb-run if available#93
Conversation
|
I would prefer a flag for the |
|
How about a [-X|--no-xvfb] since xvfb is what you want most of the time? |
|
Would work as well. The explicit "enable" variant could handle missing binary a bit better though - such as refusing to start with the explanation ("xvfb-run not found" or so) |
|
I don't think that there's any need to do that - not everyone needs xvfb. Only for certain window managers for example, and certain OSs. As an example, I don't need it with Awesome on Debian, or with OS X. I think it makes sense to use it if it's available by default, but not otherwise. Thinking about it some more, it could be an [-x|--xvfb|-X|--no-xvfb] option on the CLI, with a default applied in config. If it is requested and not present, then we could error. if it's not requested, we could just not use it? |
|
Hi Andrew, I am happy to merge this, but I think that allowing both options is an overkill. So essentially I would be inclined to:
Hmm, now I'm thinking, if you run selenium with phantom, could xvfb be a problem? To be honest, I have no idea what it is ;-). Thanks! |
|
For the record, this is how I sorted out the focus stealing issue I had with Selenium in XFCE. I use tmux (but some other terminal multiplexer such as I was trying to give Xaphyr a chance but it gives me segfault for some reason and I'm too lazy to diagnose it now. |
|
Fred - "most likely you will never want to run without xvfb if you want to use it on your system" - turns out not to be the case (I think), for me at least. At the moment I run tests on a remote machine. I have Xvnc running and control where selenium's browser goes using the DISPLAY environment variable. I can minimise my VNC client window if I don't need to see what's going on, or I can bring it into the foreground if I do (or if I want to interact with it e.g. by pausing the scenario execution just before a problem). I generally run all the tests without wanting to interact first, then re-run the problematic ones, sometimes with a pause added to allow me to test what extra steps might be needed to make it work. I'm not familiar with xvfb, but my impression is that it won't allow this kind of interaction, so if I wanted to use it for the full runs I'd need the command-line option to be able to switch it to something else depending on what I wanted from each run. |
87b93e4 to
0a1b6c2
Compare
By popular request