Is there a way to launch testSuites in parallel (concurrently) for selenium code using MultiThreading, Concurrent ExecutorServices

巧了我就是萌 提交于 2019-12-11 14:31:45

问题


I have set of suites which run in sequential order one after an another handled by a for loop. I would want to do run the available TestSuites in parallel concurrently by just using coreJava. Could any one help me out on how to do it ?

Xls_Reader suiteLauncherXls=new Xls_Reader("src/XlsFiles/SuiteLauncher.xlsx");

int RowCount=suiteLauncherXls.getRowCount(Constants.TEST_SUITE_SHEET);

for(int suiteCount = 2; suiteCount <= RowCount; suiteCount++)
        {
             SUITE_ID = suiteLauncherXls.getCellData(Constants.TEST_SUITE_SHEET, Constants.Test_Suite_ID, suiteCount);
             RUNMODE = suiteLauncherXls.getCellData(Constants.TEST_SUITE_SHEET, Constants.COL_HEAD_RUNMODE, suiteCount);
             NODEPC = suiteLauncherXls.getCellData(Constants.TEST_SUITE_SHEET, Constants.COL_HEAD_NODEPC, suiteCount);

        if(isRunableMode(RUNMODE))
         {
            // Report file location declaration 
            ExReport = new ExtentReports(System.getProperty("user.dir")+"\\src\\TestReports\\"+SUITE_ID+"\\HTMLReport.html");

            nodeURL = "http://" + NODEPC + ":5566/wd/hub";

            //Initiating Suite File       
            String SuiteFile = "src/XlsFiles/"+SUITE_ID+"/Suite.xlsx";
            suiteXLS = new Xls_Reader(SuiteFile);

            DriverScript test = new DriverScript();
            test.start();

            //ExReport.endTest(ExTest);
            ExReport.flush();
            sendAutomationReport();
            }
        }
    }

来源:https://stackoverflow.com/questions/57463293/is-there-a-way-to-launch-testsuites-in-parallel-concurrently-for-selenium-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!