Selenium Grid:一次一次在节点上依次运行测试 [英] Selenium Grid: Tests are running in sequence at on node at one time

查看:231
本文介绍了Selenium Grid:一次一次在节点上依次运行测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在2节点机器上并行运行2个测试序列 同时.但是当前第一个测试在第一个节点及之后执行 执行完成,第二个测试在第二个节点开始.最大限度 每个节点的实例设置为1.

I Need to run a sequence of 2 tests in parallel in 2 node machine at same time.But currently 1st test gets executed in 1st node and after the execution is finished,second test gets started in second node. Max Instance for each node is set to 1.

这是我的套件文件:

Here is my suite file:

<!-- <package name="com.fico.triad.test.ApportionmentMethods" />
<package name="com.fico.triad.test.Audit" />  <package name="com.fico.triad.test.AuditTrial" />  -->  <package

name ="com.fico.triad.test.AuditTrialChangeDetailLog"/>

name="com.fico.triad.test.AuditTrialChangeDetailLog" />

我也在这里使用Thread local.任何帮助将不胜感激.

I am using Thread local here also.Any help would be appreciated.

推荐答案

您可以将TestNG框架与Selenium一起使用.只需参考下面的 testng.xml 文件并相应地编辑类名称:

You can do it using TestNG framework with Selenium. Just refer below testng.xml file and edit your classes name accordingly :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Parallel test suite" parallel="classes" thread-count="2">
    <test name="Test 1">
        <classes>
            <class name="com.sd.selenium.FirstTestSelenium" />
            <class
                name="com.sd.selenium.practice.Monday_Test_Selenium_Till_Scrum_Call" />
        </classes>

    </test>
</suite>   

注意:

1)different packages中必须有两个类.
2)您需要通过选择此xml文件作为套件将整个项目作为TestNG Suite运行.请参考下图:

1) Two classes must be in different packages.
2) You need to run entire project as TestNG Suite by selecting this xml file as your suite . Refer below image :

这篇关于Selenium Grid:一次一次在节点上依次运行测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆