Comment #6 on issue 882 by [email protected]: Java class to manage commandline creation for running RF
http://code.google.com/p/robotframework/issues/detail?id=882

Some sample client code. Some of the uses of this are

1) Setting default args based on application configuration.
3) Setting args for a particular run (eg. test run based on some include tags or dry run etc.) 2) Parsing command line options in case we want to send some native robotframework parameters for a run.

private static RobotCommandLine getDefaultArgs(Map<String, String> environment) {
                RobotCommandLine cmdLine = new RobotCommandLine();
                
cmdLine.addListener(RobotListenerHandler.class.getCanonicalName());
cmdLine.setOutputDir(environment.get(ToolsConstants.TOKEN_ROBOT_OUTPUT_DIR)); cmdLine.setOutputFileName(environment.get(ToolsConstants.TOKEN_ROBOT_OUTPUT_FILE)); cmdLine.addVariable(ToolsConstants.TOKEN_INITFILE_VAR, environment.get(ToolsConstants.TOKEN_ROBOT_INIT_FILE)); cmdLine.setReportFileName(environment.get(ToolsConstants.TOKEN_ROBOT_REPORT_FILENAME)); cmdLine.setLogFileName(environment.get(ToolsConstants.TOKEN_ROBOT_LOG_FILENAME));
                                
cmdLine.addExcludeTag(ToolsConstants.TOKEN_ROBOT_IGNORE_TAG);
                cmdLine.setRunEmptySuite(true);
                return cmdLine;
        }



Reply via email to