I have got the solutions which is using xvfb to specified a display to selenium, when I test my web program. Envviroments: CentOS6, Selenium2, robotframwork, Firefox. And My steps are:
startup vncserver specified displaynumber. vncserver :6
set DISPLAY with same number. DISPLAY=:6
test my project.
kill vncserver. vncserver -kill :6
And firefox can startup correctly. Now, I know what to do to startup firefox, but I dont know why. What's the relationship among selenium2, vncserver, xvfb, robotframework? For short, I want to know how selenium2 or robotframework use xserver from vncserver or xvfb. I did not find my answer in http://docs.seleniumhq.org/docs/ and https://github.com/rtomac/robotframework-selenium2library. Anyone knows that? Any references? thx