摘要: 写好的自动化程序怎么让它运行呢,总不能每次都启动eclipse吧,下面就先介绍一种用dos命令运行testNG的方法。 1、把项目打成jar吧,我用的是Fat jar工具。 2、在电脑的某个盘建一个文件夹,如testng 3、将项目jar包、selenium-server-standalone-2. 阅读全文
posted @ 2019-12-09 23:41 peachlf 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 网上看到一篇整理的非常详细的xml文件详解,分享一下: 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> 3 <!--suite(测试套件)为根路 阅读全文
posted @ 2019-12-09 22:48 peachlf 阅读(571) 评论(0) 推荐(0) 编辑
摘要: 1.TestNG的运行方式如下: 1 With a testng.xml file 直接run as test suite 2 With ant 使用ant 3 From the command line 从命令行 4 IDE 直接在IDE中执行 在IDEA中直接运行的时候,需要说明的是:可以运行一 阅读全文
posted @ 2019-12-09 22:47 peachlf 阅读(1076) 评论(0) 推荐(1) 编辑
摘要: 简单介绍 运行TestNG测试脚本有两种方式:一种是直接通过IDE运行(例如使用eclipse中的“Run TestNG tests”),另一种是从命令行运行(通过使用xml配置文件)。当我们想执行某个包或者某个类中的一部分测试脚本的时候,使用xml配置文件是非常便利的。在xml配置文件里,不仅可以 阅读全文
posted @ 2019-12-09 22:45 peachlf 阅读(1471) 评论(0) 推荐(0) 编辑
摘要: <packages>表示以测试类所在的包的方式定义测试用例,包中的所有测试类都被涉及,粒度较大。 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <su 阅读全文
posted @ 2019-12-09 21:09 peachlf 阅读(322) 评论(0) 推荐(0) 编辑
摘要: Testng是一套开源测试框架,是从Junit继承而来,testng意为test next generation,主要有以下特性: annotations 注释,如 @test @BeforeMethod 支持多线程执行case 支持数据驱动 dataProvider 支持参参数 能够作为eclip 阅读全文
posted @ 2019-12-09 21:02 peachlf 阅读(1728) 评论(0) 推荐(0) 编辑
摘要: testng.xml testng.xml是为了更方便的管理和执行测试用例,同时也可以结合其他工具 You can invoke TestNG in several different ways: 你可以用以下三种方式执行测试 With a testng.xml file 直接run as test 阅读全文
posted @ 2019-12-09 20:54 peachlf 阅读(1112) 评论(0) 推荐(0) 编辑
摘要: 1、项目的pom.xml中build下添加maven插件,xmlFileName为可变参数 2、jenkins新建maven项目 构建脚本: 原文:https://www.jianshu.com/p/010773dd9f12 阅读全文
posted @ 2019-12-09 11:05 peachlf 阅读(471) 评论(0) 推荐(0) 编辑
摘要: 前言: 在我们使用maven+testng+restassured+reportng实现接口测试框架时,会发现在本机创建项目,进行一些pom引用和简单的封装后,很快就可以直接利用idea自带的testng插件直接运行testng.xml文件中我们写好的case,但当我们脱离了idea等编辑工具时,怎 阅读全文
posted @ 2019-12-09 10:09 peachlf 阅读(948) 评论(0) 推荐(1) 编辑