Skip to content

General Concepts

John edited this page Mar 24, 2015 · 7 revisions

#Test Script ##JavaScript test script The Pasilla test script that is actually "executed" at run-time is a JavaScript array of objects, like this:

var Session1 = [
	[{action:'Example.Start',params:[{browser:'chrome',url:'http://www.Example.com'}]}],
	[{action:'Example.Signin',params:[{username:'testuser1',password:'3X4mpl3'}]}],
	[{action:'Example.DoSomethingA',params:[{param1:'data1',param2:'data2'}]}],
	[{action:'Example.DoSomethingB',params:[{param1:'data1',param2:'data2'}]}],
	[{action:'Example.DoSomethingC',params:[{param1:'data1',param2:'data2'}]}],
	[{action:'Example.DoSomethingD',params:[{param1:'data1',param2:'data2'}]}],
	[{action:'Example.DoSomethingE',params:[{param1:'data1',param2:'data2'}]}],
	[{action:'Example.Signout',params:[{none:''}]}],
	[{action:'Example.End',params:[{none:''}]}]
];

module.exports = Session1;

##Spreadsheet test script Creating and maintaining files in this JavaScript format may be considered a bit too much like programming for some users. Users are likely to be more comfortable with designing their test scripts using Excel. So an Excel test script format has been developed from which the JavaScript test scripts can be generated. The test script above was, in fact, generated from the following spreadsheet.

Example.xlsx.PNG

The format of a test script spreadsheet is fairly rigid. Here are the main "rules":

  • the first row is ignored. It is used to indicate that column be is the "action" column and subsequent columns are for data parameters.
  • after that the spreadsheet consists of "heading" rows and "test step" rows
  • a heading row is one with a blank column B
  • column B is only used to indicate the action data row

Clone this wiki locally