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浏览器完成相应的操作 ...
随机推荐
- 在SrollView中嵌套GridView或ListView(转)
原文链接:http://blog.csdn.net/gaojinshan/article/details/17055511 我想在同一个界面中,使用两个GridView,两个GridView一起上下滚 ...
- WPF中的RichTextBox
原文链接:http://blog.csdn.net/wuzhengqing1/article/details/7010902 取出richTextBox里面的内容 第一种方法:将richTextBox ...
- "!function",自执行函数表达式
如题为自执行函数表达式.在这种情况下,解析器在解析function关键字的时候,会将相应的代码解析成function表达式,而不是function声明.下面2个括弧()都会立即执行 (function ...
- jmeter JDBC Request (查询数据库获取数据库数据) 的使用
JDBC Request 这个Sampler可以向数据库发送一个jdbc请求(sql语句),并获取返回的数据库数据进行操作.它经常需要和JDBC Connection Configuration配置原 ...
- WPF集合控件实现分隔符(ItemsControl Splitter)
在WPF的集合控件中常常需要在每一个集合项之间插入一个分隔符样式,但是WPF的ItemsControl没有相关功能的直接实现,所以只能考虑曲线救国,经过研究,大概想到了以下两种实现方式. 先写出Ite ...
- [笔记]Learning to Rank算法介绍:RankNet,LambdaRank,LambdaMart
之前的博客:http://www.cnblogs.com/bentuwuying/p/6681943.html中简单介绍了Learning to Rank的基本原理,也讲到了Learning to R ...
- 第一章 自定义MVC框架
第一章 自定义MVC框架1.1 MVC模式设计 组成:Model:模型,用于数据和业务的处理 View :视图,用于数据的显示 Controller:控制器 ...
- lua 模块
lua 模块 概述 lua 模块类似于封装库 将相应功能封装为一个模块, 可以按照面向对象中的类定义去理解和使用 使用 模块文件示例程序 mod = {} mod.constant = "模 ...
- winfrom 实现条形码批量打印以及将条形码信息生成PDF文件
最近,老大让给客户做个邮包管理程序.其中,包括一些基本信息的增.删.查和改,这些倒不是很难搞定它分分钟的事.其主要难点就在于如何生成条形码.如何批量打印条形码以及将界面条形码信息批量生成以其各自的 b ...
- 少年,是时候换种更优雅的方式部署你的php代码了
让我们来回忆下上次你是怎么发布你的代码的: 1. 先把线上的代码用ftp备份下来 2. 上传修改了的文件 3. 测试一下功能是否正常 4. 网站500了,赶紧用备份替换回去 5. 替换错了/替换漏了 ...