且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Selenium Grid:一次一次在节点上依次运行测试

更新时间:2023-01-31 14:27:47

您可以将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 :