Main WebART Script


The main script consists mostly of calls to the MDS framework and jWebART, with just a few statements to include the WebART versions of login, createUserId, and deleteUserId. Here's what it looks like:

 xtrackif  !script xtrackif !param cfile = "" !param gTestCaseFile(Test Cases)="xtrackif.testcase" !include zdutil !include login !include createuserid !include deleteuserid !include jwebart ! {   init();   getTestCase();   getTestCaseName(gtTestCase1);   jWebartInterface();   log ( script, gOutCome);   } !end 

The first line provides the name for the script (xtrackif). This has to match what we specified in the XTrackWebARTInterface in Chapter 23.

The next two lines declare two parameters for the script. Parameters are variables whose values can be specified to the script when it's run. The first, cfile, is the name of a file the jWebART package uses to pass parameters and results back and forth between the Java environment and WebART. It gets specified by jWebART when it starts the script. The second parameter, gTestCaseFile, is the name of the file that contains test data and validation data. In this case, the test data is coded into the executable tests in Java, so this TestCase file is used only for the validation. We'll provide an example of this file later.

The next line, !include zdutil, includes the definitions for the MDS framework. The next three include our WebART versions of login, createUserId, and deleteUserId. These are the files where we need to do the most work. We'll take a look at examples of these as well.

The next line includes jWebART utilities, peers to the Java versions we discussed in the previous chapter but written in the WebART scripting language. The executable tests pass parameters through the Java jWebART functions, which communicate with these versions in the WebART scripting language, which in turn passes them on to to the WebART versions of login, createUserId, and deleteUserId.

The remaining lines consist of calls to utilities in the MDS framework (init, getTestCase, getTestCaseName, and log) and to the jWebART package. These calls perform initialization, read the TestCase file, and parse out test and validation data. They then enter the jWebARTInterface to accept requests from the executable tests in the Java environment. When a request is received, one of the modules login, createUserId, or deleteUserId is called; it interacts with the XTrack system via HTTP, and the result is returned to the Java environment.



Testing Extreme Programming
Testing Extreme Programming
ISBN: 0321113551
EAN: 2147483647
Year: 2005
Pages: 238

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net