Selenium2使用vncserver启动firefox
web自动化测试工具Selenium2使用vncserver启动firefox
1st startup vncserver(e.g. vncserver :1
).
2nd set DISPLAY
(e.g. DISPLAY=:1
).
3rd change directory to my project(e.g. cd /path/to/my/project
).
4th execute my project(e.g. pybot ··· ··· ···
).
5th kill vncserver(e.g. vncserver -kill :1
).
Ref:
Man Page of Xserver
:displaynumber
The X server runs as the given displaynumber, which by default is 0. If multiple X
servers are to run simultaneously on a host, each must have a unique display number.
See the DISPLAY NAMES section of the X(7) manual page to learn how to specify which
display number clients should try to use.
Man Page of X
Display Name
From the user's perspective,every X server has a display name of the form:
This information is used by the application to determine how it shouldconnect to the server and which screen it should use by default (on displayswith multiple monitors):
On POSIXsystems, the default display name is stored in your DISPLAY environmentvariable. This variable is set automatically by thexterm terminal emulator. However, when you log into another machine on a network, you will needto set DISPLAY by hand to point to your display. For example,
http://stackoverflow.com/questions/18820410/webdriverexception-message-the-browser-appears-to-have-exited-before-we-could
Links:
http://robotframework.cn/linux-centos6-zero-start-to-jenkins-robot/
http://www.wallix.org/2011/07/26/how-to-use-robotframework-with-the-selenium-library/
http://drumcoder.co.uk/blog/2010/nov/23/selenium-headless/
http://unix.stackexchange.com/questions/16815/what-does-display-0-0-actually-mean