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.
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):
-
hostname
- The hostname specifies the name of themachine to which the display is physically connected. If the hostname isnot given, the most efficient way of communicating to a server on thesame machine will be used. displaynumber
- The phrase "display" is usuallyused to refer to collection of monitors that share a common keyboard andpointer (mouse, tablet, etc.). Most workstations tend to only have one keyboard,and therefore, only one display. Larger, multi-user systems, however, frequentlyhave several displays so that more than one person can be doing graphicswork at once. To avoid confusion, each display on a machine is assigneda display number (beginning at 0) when the X server for that display isstarted. The display number must always be given in a display name. screennumber
- Some displays share a single keyboard and pointer among two or more monitors.Since each monitor has its own set of windows, each screen is assigneda screen number (beginning at 0) when the X server for that display isstarted. If the screen number is not given, screen 0 will be used.
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,
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