-
Notifications
You must be signed in to change notification settings - Fork 1
General Concepts
#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.
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 B is the "action" column and column C and subsequent columns are for data parameters.
- from row two onwards the spreadsheet consists of "heading" rows and "test step" rows
- a heading row is one that does not have an action - its column B is blank. Columns C, D and so on contain headings which are used as parameter names. There can be a variable number of parameter names but there should not be any gaps. The parameter names will be used as JavaScript property names so their case and spelling is IMPORTANT.
- a test step row contains an action in column B and parameter values in columns C, D and so on. The parameter values correspond to the parameter names and can be blank.
- multiple test step rows can follow a heading row. This helps to keep things succinct and readable. A heading row applies to all subsequent test step rows until the next heading row is encountered.
- the use of explicit parameter names (and values) means they can be specified in any order.
- column A is the "skip" column and can be used to "skip" a test step. If column A of a test step contains any value then the test step will be skipped. It has no effect on heading rows.
Pasilla
Links: Home, [General Concepts](General Concepts), Tutorial - Create a New Test, Data Parameters