Selenium2使用vncserver启动firefox

24 篇文章 0 订阅
9 篇文章 0 订阅

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:

hostname:displaynumber.screennumber

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,


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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值