`

Parallel = tests, classes,methods in testing.xml of testNG

阅读更多
How to understand parameter "parallel" when setting up it in testing.xml file;


Structure of test suites

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Suite1" parallel="classes" thread-count="4">
<test name="search">
        <classes>
            <class name="com.testcase.Search8"></class>
            <class name="com.testcase.Search9"></class>
        </classes> 
    </test>
    <test name="search2">
        <classes>
            <class name="com.testcase.Search10"></class>
            <class name="com.testcase.Search11"></class>
        </classes> 
    </test>
</suite>
      
parallel = "tests":
<test> search and search2 run in parallel, all the items under the test  ( search8, search9 ) run in order.


parallel = "classes":
<classes> all the <class> under <classes> run in parallel, but <classes> and <classes> run in order.  Search8 and Search9 run in parallel, after running completed. the Search10 and Search11 will run in parallel.


parallel = "methods":
<class> will run in order, all the methods under class will run in parallel.


Conclusion comes out:
if the parallel equals to a small scope. ( parallel = "methods"). then all the big scope (class,test,suite) will run in order, and methods will run in parallel.

(parallel = "classes"), then all the big scope (test,suite) will run in order, the class under classes will run in parallel.

(parallel = "tests"), then all the big scope( suite..)  will run in order, the test will run in parallel.


So if we want to run some scope in parallel, we must make sure the scope running in parallel will be separated from others. This is say, there is no any dependency for any small scope you want to run. Or else, you will get error when you run them in parallel.



分享到:
评论

相关推荐

    Selenium.Testing.Tools.Cookbook.2nd.Edition.178439251

    Set up Selenium Grid for faster and parallel running of tests, increasing test coverage and reducing test execution time for cross-browser testing Build extended Selenium WebDriver tests for ...

    Next_Generation_Java_Testing._TestNG_and_Advanced_Concepts.rar

    6. **并发测试**:TestNG支持并行测试执行,通过@Parallel注解或testng.xml配置文件可以控制测试的并发级别,提高测试效率。 7. **异常处理**:TestNG的@Test注解可以设置expectedExceptions属性,指定预期的异常...

    TestNG官方文档中文版.pdf

    &lt;suite name="CalculatorTestSuite" verbose="1" parallel="classes"&gt; &lt;test name="CalculatorTests"&gt; &lt;include name="add"/&gt; &lt;include name="subtract"/&gt; &lt;classes&gt; &lt;class name="CalculatorTest"/&gt; ...

    eclipse-testng离线包

    8. **并发测试**:TestNG支持使用@Parallel注解实现并发执行测试,这在测试多线程或者性能测试时非常有用。 9. **异常处理**:TestNG允许使用@Test注解的expectedExceptions属性声明预期的异常,如果测试抛出的异常...

    maven settings.xml配置文件的作用

    8. **并发构建(Parallel Builds)**:在`settings.xml`中,可以通过`threadCount`属性设置Maven并行构建的线程数,提高构建效率。 9. **Maven仓库管理器(Repository Manager)**:企业环境中,可能需要使用Nexus...

    parallel-netcdf-1.8.1.tar.gz_-baijiahao_gavez1d_pNetCDF_parallel

    tar zxf parallel-netcdf-1.8.1.tar.gz Build with: cd parallel-netcdf-1.8.1 FC=mpifort CC=mpicc CFLAGS=-fPIC ./configure --prefix=/usr/local/pnetcdf-1.8.1_mpich-3.2 make all check sudo make install

    Apress.Pro.dotNET.4.Parallel.Programming.in.CSharp.May.2010.rar

    《Apress.Pro.dotNET.4.Parallel.Programming.in.CSharp.May.2010》是一本专注于.NET Framework 4中的并行编程技术的专著,由Apress出版社于2010年5月出版。这本书主要针对C#开发者,详细讲解了如何利用.NET ...

    Parallel.Programming.in.C.with.Mpi.and.Openmp

    ### 并行编程在C语言中的MPI与OpenMP应用 #### 并行编程基础概念 在探讨并行编程以及如何利用MPI(Message Passing Interface)与OpenMP这两种技术进行并行编程之前,我们首先需要理解一些基本的概念。...

    Maven settings.xml配置理解

    9. **并发构建(Parallel Builds)** Maven 3.0以上版本支持多线程构建,可以在`settings.xml`中通过`&lt;threadCount&gt;`配置并发度,以加快构建速度。 10. **全局设定(Global Settings)** 如果希望某些设置对所有...

    .net高级并行编程 Apress.Pro.dotNET.4.Parallel.Programming.in.CSharp.May.2010

    《.NET高级并行编程 Apress.Pro.dotNET.4.Parallel.Programming.in.CSharp.May.2010》这本书深入探讨了.NET框架4.0中的并行编程技术,主要针对C#语言进行讲解。在现代计算环境中,利用多核处理器的优势进行并行计算...

    Apress.Pro.dotNET.4.Parallel.Programming.in.CSharp.May.2010

    《Apress.Pro.dotNET.4.Parallel.Programming.in.CSharp.May.2010》这本书专注于.NET Framework 4中的并行编程技术,特别是使用C#语言进行高效并发处理的方法。并行编程是现代计算机科学中的重要概念,尤其是在多核...

    Wrox.Parallel.Programming.with.Intel.Parallel.Studio.XE.2012

    techniques, and language extensions to implement parallelism, this essential resource teaches you how to write programs for multicore and leverage the power of multicore in your programs. Sharing ...

    org.testng.ecplise_6.10

    5. **并行测试(Parallel Testing)**:TestNG允许并行执行测试,可以按方法、类或测试套件级别设置,提高测试效率。 6. **报告**:TestNG自动生成详细的测试报告,包括测试结果、失败信息等,方便开发者快速定位...

    PyPI 官网下载 | parallel_wavegan-0.5.3.tar.gz

    标题中的"PyPI 官网下载 | parallel_wavegan-0.5.3.tar.gz"指出这是一个从Python Package Index (PyPI) 官网上获取的软件包。PyPI是Python社区广泛使用的软件仓库,用于发布和发现Python开源项目。"parallel_wavegan...

    Parallel and Concurrent Programming in Haskell.pdf

    Parallel and Concurrent Programming in Haskell.pdf Parallel and Concurrent Programming in Haskell.pdf

    Parallel.ForEach的卡死现象(线程操作问题C#源码实例)

    在.NET编程环境中,`Parallel.ForEach`是一个非常有用的并行处理工具,它允许开发者将数据集中的每个元素在多个线程上并行处理,以提高应用程序的执行效率。然而,正如标题所指出的,`Parallel.ForEach`可能会遇到...

    Java+Maven+TestNG参考案例

    &lt;suite name="Api Test Suite" parallel="tests" thread-count="2"&gt; &lt;test name="User API Test"&gt; &lt;classes&gt; &lt;class name="com.example.ApiTest"/&gt; &lt;/classes&gt; ``` 配置了并行执行和线程数量,可以根据实际...

    PyPI 官网下载 | parallel_wget-0.0.8.tar.gz

    《PyPI官网下载 | parallel_wget-0.0.8.tar.gz:探索Python分布式下载工具》 在Python的生态系统中,PyPI(Python Package Index)是最重要的资源仓库,它为开发者提供了海量的开源库和模块,便于他们构建、分享和...

Global site tag (gtag.js) - Google Analytics