0

我对这个问题感到沮丧。我有 3 个节点在多个浏览器上运行,并且网格启动良好。然后我有一个测试套件,其中包含 3 个测试,每个测试中有多个测试。当我执行测试时,三个浏览器被占用,但一段时间后,第一个节点中只有一个浏览器保持被占用,其他两个节点保持空闲。这是我的设置代码

public void setUpEagle() throws Exception {
        DesiredCapabilities cap = DesiredCapabilities.firefox();
        cap.setBrowserName("firefox");
        cap.setPlatform(Platform.ANY);          
        ffdriver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), cap);

        eagleLogin = new EagleLogin();
        LaunchEagle launchEagle = new LaunchEagle();
        driver = launchEagle.setUp(eagleLogin, LP1_GeneralManager, NonProductionPassword);

        // Print the Class Name
        System.out.println("Test Starting: " + this.getClass().getName());

        menuItem = new MenuItems();
        menu = new Menu();

        verify = new Verify();
    }

//testng.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">

<suite name="MRS_TestNGSuites1" verbose="10" parallel="tests" thread-count="30">    

<test name="mrs_testsuite1" junit="true">
    <classes> 
        <class    name="com.squaretwo.eagle.smoketests.noninvasive.AccountAssignmentTestNI"/>                   
        <class name="com.squaretwo.eagle.smoketests.noninvasive.AccountCommentPODDataVerifyTest"/>
        <class name="com.squaretwo.eagle.smoketests.noninvasive.AccountDebtorPODAddressDataVerifyTest"/>
        <class name="com.squaretwo.eagle.smoketests.noninvasive.AccountDebtorPODEmailDataVerifyTest"/>
        <class name="com.squaretwo.eagle.smoketests.noninvasive.AccountDebtorPODPhoneDataVerifyTest"/>
        <class name="com.squaretwo.eagle.smoketests.noninvasive.AccountDebtorPODPInfoDataVerifyTest"/>              
        <class name="com.squaretwo.eagle.smoketests.noninvasive.AccountDebtorTearOffTest"/>
        <class name="com.squaretwo.eagle.smoketests.noninvasive.AccountFinancialPODDataVerifyTest"/>
    </classes>
 </test>

 <test name="mrs_testsuite2" junit="true"> 
    <classes> 

        <class name="com.squaretwo.eagle.smoketests.noninvasive.AccountHeaderViewTest"/>
        <class name="com.squaretwo.eagle.test.accounts.AccountID_CTC_US5211Test"></class>                                       
        <class name="com.squaretwo.eagle.smoketests.noninvasive.AccountNotelineDataVerifyTest"/>                                    
        <class name="com.squaretwo.eagle.smoketests.noninvasive.AccountNotelineTearOffTest"/>       
        <class name="com.squaretwo.eagle.test.accounts.Account_ReOpen_And_CancelTimTest"/>          
        <class name="com.squaretwo.eagle.smoketests.noninvasive.PerformanceLegalAccountSearchTest"/>                                    
        <class name="com.squaretwo.eagle.smoketests.noninvasive.AdvDebtorsLifecycleCancelledTest"/>                     
        <class name="com.squaretwo.eagle.smoketests.noninvasive.AdvSearchAcctNumberTest"/>  
    </classes>
 </test>
 <test name="mrs_testsuite3" junit="true"> 
    <classes>                       
        <class name="com.squaretwo.eagle.smoketests.noninvasive.AdvSearchLifecycleCancelledTest" />                 
        <class name="com.squaretwo.eagle.smoketests.noninvasive.AdvSearchMultipleCriteriaTest" />                                       
        <class name="com.squaretwo.eagle.smoketests.noninvasive.AdvSearchSaveCriteriaTest" />                                       
        <class name="com.squaretwo.eagle.smoketests.noninvasive.AccountPODDataVerifyTest" />
        <class name="com.squaretwo.eagle.smoketests.noninvasive.AccountPODMediDataVerifyTest" />                    
        <class name="com.squaretwo.eagle.smoketests.noninvasive.AccountStatusPODDataVerifyTest" />                  
        <class name="com.squaretwo.eagle.smoketests.noninvasive.AccountsTouchedReportTest" />
        <class name="com.squaretwo.eagle.test.accounts.AddPaymentPlanArrangement" /> 
    </classes>
 </test> 

4

1 回答 1

0

您的套件 xml 中有 parallel=tests,其中只有 3 个测试(<test>)。所以你实际上一次运行不超过 3 个浏览器。你<test>的一个运行时间比其他两个长,这就是为什么“一段时间后,第一个节点中只有一个浏览器保持被占用,而其他两个节点保持空闲”。

于 2014-04-21T12:47:37.820 回答