基于linux的web自动化(selenium+jenkins+linux+firefox)

  1. 安装Xvfb

 yum install xorg-x11-server-Xvfb

   查检安装是否成功

   yum search xvfb

说明已经安装成功了

2. 安装firefox

yum install firefox

确保fire和xvfb s上ud关联

需要添加host:/etc/hosts 

127.0.0.1 localhost.localdomain localhost

2. 启动Xvfb

Xvfb -ac :99 -screen 0 1280x1024x8

有报错,

原因是:Xvfb 默认使用 ipv6,而当前机器不支持,解决办法:

  1. EnableIPv6

  2. 启动 Xvfb 时,带上参数“ -nolisten inet6”,比如:

    Xvfb :99 -screen 0 1024x768x24 -extension RANDR -nolisten inet6 &

继续报错:

 

   启动firefox

    export DISPLAY=:99

cd firefox目录:

export DISPLAY=:99

执行./firefox -new-windowbaidu.com 

因此需要安装dejavu相关字体

ps -ef|grep firefox

起动完成。

查看xvfb 启动情况:ps -aux|grep X

目前7的接口已经启动

安装驱动:

地址:http://rpmfind.net/linux/rpm2html/search.php?query=mesa-dri-drivers

wget http://rpmfind.net/linux/rpm2html/search.php?query=mesa-dri-drivers

安装:

 

具体执行待续

参考文档:

  1. https://www.coveros.com/setting-up-headless-selenium-tests-on-rhel-6-7/
  2. https://blog.csdn.net/GO_D_OG/article/details/78904617
  3. http://blog.51cto.com/casey/1763141
  4. https://www.xuebuyuan.com/zh-hant/424723.html
  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值