Hello,
here is a code snippet for passing all the selected attributes via a launcher to the application, which is executed through the test (e.g. Autoit, exe-appl. etc.)
new code is blue colored:
Quote:
// +==============================================================+
// | Attributes |
// +==============================================================+
static final String TRACE_HEADER = "{exe your Versioning V1.8 } ";
// parameters impacting executing at run time set by the test operator
private String testRootPath;
private boolean synchronous;
private int timeout = 600;
private File workingDir;
//new stuff
private String attribs[][];
private StringBuilder sb;
Quote:
public CReturnStatus preRun(int testId, String testPath, String testName, Vector<CAttribute> attributes, String additionalInfo) {
traceln(LOG_PRIORITY_INFO, "preRun testId=" + testId + " testPath=" + testPath + " [" + testName + "]...");
traceln(LOG_PRIORITY_INFO, "preRun (ver 1.9) Attributes=" + attributes.size() + " testPath=" + testPath + " [" + testName + "]...");
attribs = new String[attributes.size()][2];
//Glue part of the commandline parameters out of the attributes elements
sb = new StringBuilder( );
for (int i=0; i<attributes.size() ; i++)
{
traceln( LOG_PRIORITY_INFO, "attribute (" + i + ")" + attributes.elementAt(i).getName() + " = " + attributes.elementAt(i).getValue() );
sb.append (" /" + attributes.elementAt(i).getName() + " = " + attributes.elementAt(i).getValue().toString()); //glue the command line together
attribs[i][0] = attributes.elementAt(i).getName();
attribs[i][1] = attributes.elementAt(i).getValue().toString();
}
Vector<CExecutionStep> executionSteps = new Vector<CExecutionStep>();
return new CReturnStatus(RESULT_SUCCESS, executionSteps);
}
If you have question to this feel free to ask, also if you like to get an idea how to parse the attributes in the running application like Autoit, Selenium etc.
Regards
Val
P.S.: Tried to arrange the code better for reading, but there is a conflict with code and color. So I decided to use color, only.