View unanswered posts | View active topics It is currently Thu May 23, 2013 1:45 pm



Reply to topic  [ 1 post ] 
 Launcher: Pass all the selected attributes to the appl. 
Author Message

Joined: Thu Sep 23, 2010 12:32 pm
Posts: 84
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.


Thu Oct 28, 2010 7:11 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 1 post ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF.