testng

测试工具

断了今生、忘了曾经 提交于 2021-02-12 04:52:57
概述 使用 idea 自带的 code coverage 工具 背景 了解 白盒测试用例设计 和 测试覆盖率 之后, 大概就需要 实践 了 实践的话, 还是需要 工具 来检验效果 工具选取 选项 JaCoCo IDEA Code Coverage 结果 两个都想试试 先看看 IDEA CC, 这个比较简单 JaCoCo 感觉更加复杂 指标 使用的场景都更加复杂 先讲 IDEA Code Coverage 简单 Idea 自带, 集成方便 1. 准备 理论基础 白盒测试用例设计 测试覆盖率 环境 os win 10 ide idea 2018.2 组件 java jdk8 testng 6.14.3 maven 3.6.0 代码 maven architecture quickstart 其他 idea 插件 coverage 这个一定要有 有了, 一定要打开 idea 添加插件, 我就不讲了 testng 的配置文件 这个我也不细讲了 自动生成配置文件的插件, 我之前讲过 配置文件里一些主要的配置, 我也讲过 2. 触发 概述 通过 执行测试, 触发 Coverage 插件 步骤 执行测试 进入某个测试类 比如 maven 工程自带的 AppTest 类 执行测试 在 类 中右键 选择 'Run Apptest with Coverage' 当然, 执行方式有很多 方法 类

TestNG Selenium ChromeDriver : java.lang.NoSuchMethodError

梦想的初衷 提交于 2021-02-11 14:59:50
问题 by wanting to perform a first execution of my framework, i launch a simple testcase with Selenium - testNG on intellij IDEA and, i have an error of which I do not know the real origin. This is my POM.xml dependencies <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion>

How to run a single test case (method) instead of whole test suite (class) using Selenium/TestNG/Maven

元气小坏坏 提交于 2021-02-11 14:12:01
问题 So basically I am wondering how could I run a specific test case (a method) instead of running a whole class. I am running tests using a combination of Selenium/Maven/TestNG. My current testing setup looks something like this: simplified command to run tests: mvn test -DtestSuiteName="test" contents of test.xml used in the command above: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="Selenium Testng Template"> <test name=

How to run a single test case (method) instead of whole test suite (class) using Selenium/TestNG/Maven

懵懂的女人 提交于 2021-02-11 14:11:45
问题 So basically I am wondering how could I run a specific test case (a method) instead of running a whole class. I am running tests using a combination of Selenium/Maven/TestNG. My current testing setup looks something like this: simplified command to run tests: mvn test -DtestSuiteName="test" contents of test.xml used in the command above: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="Selenium Testng Template"> <test name=

Parameterization in Selenium and TestNG

一笑奈何 提交于 2021-02-10 11:31:45
问题 I am learning Selenium by my own. I am not sure about the right way to parameterize the test cases while using Selenium with TestNG Framework. Is it better to pass the parameters in TestNG.XML file OR keep a seperate spreadsheet. For example, I need to parameterize LOGIN functionality with 100 different users' login details. Where to keep the username/password details of 100 users? If Parametrization through a spreadsheet works best, then what exactly is the purpose of having a testng.xml

Parameterization in Selenium and TestNG

和自甴很熟 提交于 2021-02-10 11:29:53
问题 I am learning Selenium by my own. I am not sure about the right way to parameterize the test cases while using Selenium with TestNG Framework. Is it better to pass the parameters in TestNG.XML file OR keep a seperate spreadsheet. For example, I need to parameterize LOGIN functionality with 100 different users' login details. Where to keep the username/password details of 100 users? If Parametrization through a spreadsheet works best, then what exactly is the purpose of having a testng.xml

“Couldn't connect to the RemoteTestNG Client” at launch of TestNG on OSX-mountain-lion

孤街醉人 提交于 2021-02-10 09:22:09
问题 I am attempting to run the most basic example test using Eclipse, Selenium, Maven, and TestNG. I can run a test with Eclipse (or IntelliJ), Selenium, and Maven, (jUnit also works) but when I try to add in TestNG, I get the following: "Couldn't connect to RemoteTestNG client. Make sure you don't have an older version of testng.jar on your class path. Reason: Timeout while trying to contact RemoteTestNG." I have followed several tutorials and youtube walkthroughs. I performed the same steps on

Why is throw new SkipException() skipping all my methods?

我的未来我决定 提交于 2021-02-10 06:53:29
问题 Why is throw new SkipException() skipping all my methods across all classes? Class one has a method which fails therefore the remaining methods in that class are skipped and the skipcounter is set to 0. Class two should execute all methods and all methods should pass in class two because the skip counter was set to 0 and after class one was executed. The following code seems to skip all methods even though there is only one assert.fail which is contained in class one? Test Base: import org

Running Specific TestNG Groups from Maven

自作多情 提交于 2021-02-10 05:17:10
问题 I have 2 groups of test cases as mentioend below. @Test(groups="one", dataProvider = "TestData") public void firstTest(String data){ //Code } @Test(groups="one", dataProvider = "TestData") public void secondTest(String data){ //Code } @Test(groups="two", dataProvider = "TestData") public void thirdTest(String data){ //Code } Below is the XML file. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="Test-Automation" parallel="methods"

Running Specific TestNG Groups from Maven

陌路散爱 提交于 2021-02-10 05:17:01
问题 I have 2 groups of test cases as mentioend below. @Test(groups="one", dataProvider = "TestData") public void firstTest(String data){ //Code } @Test(groups="one", dataProvider = "TestData") public void secondTest(String data){ //Code } @Test(groups="two", dataProvider = "TestData") public void thirdTest(String data){ //Code } Below is the XML file. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> <suite name="Test-Automation" parallel="methods"