You can explore options like HTMLUnit Driver or Ghost Driver. HTMLUnit Driver works for testing on web servers where there is no question of a GUI. This is what you might be interested in.
If this does not work, you can also check how Ghost Driver or PhanthomJS Driver work. I have not tried them personally, but I've heard they do something similar.