Automated Front End Test - Xvfb, Chromedriver, Selenium, Jenkins
1. Install Xvfbm, google-chrome-stable and chromedriver in Jenkins
sudo apt-get install -y xvfb google-chrome-stable
Down chromedriver from
https://sites.google.com/a/chromium.org/chromedriver/
The current version running in my jenkins server is
Google Chrome version: 54.0.2840.100
Chrome driver version: 2.25
Selenium-Java version: 2.53.0
2. Start Xvfb
To start Xvfb by command line:
Xvfb :7 &
export DISPLAY=:7
To start Xvfb for each maven buid
<profiles>
<profile>
<id>cit-environment</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>build.environment</name>
<value>jenkins</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>start-xvfb</id>
<phase>process-test-classes</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo message="Starting xvfb" />
<exec executable="Xvfb" spawn="true">
<arg value=":1" />
</exec>
</tasks>
</configuration>
</execution>
<execution>
<id>shutdown-xvfb</id>
<phase>test</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<echo message="Ending xvfb" />
<exec executable="killall">
<arg value="Xvfb" />
</exec>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
mvn clean install -Dbuild.environment=jenkins will trigger this plugin. Aslo remember to inject DISPLAY env variable during the build.
3. Issues Observed
Sometimes selenium just hangs on calling driver = new ChromeDriver(); So the current temporary solution is to try 10 times in a row to bring up chromedriver, and of course this is not nice.
Another issue is the page may be loaded too slow in Jenkins, causing the Selenium tests failure. Current temporary solution is to use wait.until method to wait untill an element is available.
Automated Front End Test - Xvfb, Chromedriver, Selenium, Jenkins的更多相关文章
- maven + selenium + jenkins 教程收集
maven + selenium + jenkins 教程收集 Complete Guide for Selenium integration with jenkins Maven http://le ...
- 爬虫探索Chromedriver+Selenium初试
今天分享Python使用Chromedriver+Selenium爬虫的的方法,Chromedriver是一个有意思的爬虫插件,这个插件的爬虫方式主要是完全模拟浏览器点击页面,一步一步去找你要的东西, ...
- centos7服务器无GUI情况下安装使用Xvfb、selenium、chrome和selenium-server
最近需要用到selenium浏览器抓取,在windows下对照chrome浏览器开发的代码,在linux服务器上换成phantomjs驱动后,却不能运行了,通过截图发现phantomjs渲染效果和ch ...
- XVFB实现selenium在linux上无界面运行安装篇
selenium在linux上无界面运行,其实是非常简单的.具体的方法有使用HtmlUnitDriver或者PhantomJSDriver,有时间我会写写关于这两个东东的文章,其实基本和ChromeD ...
- Mac 下安装python3.7 + pip 利用 chrome + chromedriver + selenium 自动打开网页并自动点击访问指定页面
1.安装python3.7https://www.python.org/downloads/release/python-370/选择了这个版本,直接默认下一步 2.安装pipcurl https:/ ...
- selenium+jenkins网页自动化测试的构建
jenkins+selenium可以做到对web自动化的持续集成. Jenkins的基本操作: 一.新建视图及job 新建视图: 新建job: 可以选择构建一个自由风格的软件项目或者复制已有的item ...
- selenium+jenkins+maven+testNG搭建持续集成环境
为了简明起见,分几大部分,很基础的细节就不详述了 一·安装jenkins 二·创建一个maven项目的job 2.1 填上SVN的Repository URL 2.2 由于是在本地执行maven ...
- 连载三:RobotFramework+Selenium+Jenkins分布式构建
目标:Jenkins安装在服务器上,而使用Jenkins调用本机的脚本并在本机执行. 步骤: (1)需要有RobotFrameWork+Selenium的运行环境: python2.7,Robotfr ...
- ChromeDriver+Selenium安装
介绍 Selenium是一个自动化测试工具,利用它我们可以驱动浏览器执行特定的动作,如点击.下拉等操作. ChromeDriver是一个Chrome浏览器驱动,用于驱动Chrome浏览器完成相应的操作 ...
随机推荐
- C++实现动态顺序表
顺序表是在计算机内存中以数组的形式保存的线性表,是指用一组地址连续的存储单元依次存储数据元素的线性结构.这样的存储方式使得线性表逻辑上相邻的元素,其在物理存储单元中也是相邻的.只要知道了第一个元素的存 ...
- 转接口IC ADV7280/ADV7280-M:CVBS转MIPI转接口芯片 10位、4倍过采样标清电视视频解码器,支持去隔行
概述ADV7280/ADV7280-M是功能丰富的单芯片.多格式视频解码器.ADV7280/ADV7280-M可自动检测标准模拟基带视频信号,兼容复合.S视频和分量视频形式的NTSC.PAL和SECA ...
- 面试题(一)—Java基础(上)
1.面向对象的三大特征 (1)封装 封装性指的是隐藏了对象的属性和实现细节,对外仅提供公共的访问方式. 好处: 将变化隔离,提供复用性和安全性. (2)继承 提高代码的复 ...
- 在Centos中yum安装和卸载软件的使用方法
安装一个软件时 yum -y install httpd 安装多个相类似的软件时 yum -y install httpd* 安装多个非类似软件时 yum -y install httpd php p ...
- Jax-ws 开发webService ,并使用spring注入service类
由于使用myeclipse自动生成的Delegate,所以在使用service实现层的时候,默认创建的时候都是使用new的方法: 这样就导致每一次请求过来都得new一个新的:如果service有注入其 ...
- 笔记整理:计算CPU使用率 ----linux 环境编程 从应用到内核
linux 提供time命令统计进程在用户态和内核态消耗的CPU时间: [root@localhost ~]# time sleep real 0m2.001s user 0m0.001s sys 0 ...
- Cf #353 D. Tree Construction
题目链接:http://codeforces.com/problemset/problem/675/D 题目大意是将一个没有相同数字的数列中的数字依次插入到二叉搜索树中,问除了第一个数字以外,其他数字 ...
- xmlplus 组件设计系列之二 - 按钮
除了图标以外,按钮也许是最简单的组件了,现在来看看如何定义按钮组件. 使用原生按钮组件 在 xmlplus 中,HTML 元素也以组件的方式存在.所以,你可以直接通过使用 button 标签或者 in ...
- 纯JS单页面赛车游戏代码分享
分享一个以前写的小游戏,纯js游戏,代码很简单.欢迎大家来喷呦! 效果图: 代码展示://直接复制到html文件即可 支持IE9+版本 <!DOCTYPE html> <html&g ...
- [UWP]了解模板化控件(8):ItemsControl
1. 模仿ItemsControl 顾名思义,ItemsControl是展示一组数据的控件,它是UWP UI系统中最重要的控件之一,和展示单一数据的ContentControl构成了UWP UI的绝大 ...