CITS DevOps integration issue when Browser parameter is not exposed for overriding from Command Line at test set level

65 views
Skip to first unread message

pappuj...@gmail.com

unread,
Apr 17, 2019, 4:40:39 AM4/17/19
to Cognizant Intelligent Test Scripter

Requirement:

a.      We have multiple frameworks and browsers to be supported for the same test suite –  Chrome, IE,  different browsers and other internal frameworks

b.       We are following the devops and hence would be integrating the automation suite into the pipeline where the automation is invoked via command line without any manual intervention.

 

Problem Statement:

a.      The parameter to change the browser/framework is possible from command line at a test case level, however we need this capability at a test suite level for us to successfully integrate to the devops pipeline.

b.      We also don’t want to create multiple instances of the same suite to achieve the above. Hence we would want to have a solution for the same.



shantha laxmi kumar

unread,
Apr 23, 2019, 4:48:24 AM4/23/19
to Cognizant Intelligent Test Scripter
In order to run all test cases in a test set against the same browser specified through command line, please find the changes to be made in the CITS engine below.

- Package : com.cognizant.cognizantits.engine.cli 
class name : CLI.java
Method : static void executeWith(Map<String, Option> execution)
Add the below block of code inside the if block - if (execution.containsKey(Op.RS_NAME))

if (execution.containsKey(Op.BROWSER_NAME)) {
                           gSettings.setBrowser(execution.get(Op.BROWSER_NAME).getValue());
                    } else {
                           gSettings.setBrowser("");
                    }

- Package : com.cognizant.cognizantits.engine.core
class name : RunManager.java
Method : private static void addRunContext(ExecutionStep step, Queue<RunContext> execQ)
Replace the line "exe.BrowserName = step.getBrowser();" by the below code snippet,

String browser = RunManager.getGlobalSettings().getBrowser();
if (browser != null && !(browser.equals(""))) {
                    exe.BrowserName = RunManager.getGlobalSettings().getBrowser();
             } else {
                    exe.BrowserName = step.getBrowser();
             }

A sample command line option to trigger the above execution  is,  

Run.bat -run -project_location "D:\CITS_1.1\cognizant-intelligent-test-scripter-1.1\Projects\DemoProject" -release "spritz" -testset "BasicWebFlow_Environment1" –browser chrome

Thanks,
Shantha
Reply all
Reply to author
Forward
0 new messages