Data Parameters

Provides variable data storage


Madcow provides an intuitive method for providing data parameters to Madcow tests.

Data Parameters

Define a Data Parameter

To define a data parameter in a Madcow test we use the @ symbol followed by the name you give the data parameter.

@myFirstName=Madcow

Use a Defined Data Parameter

To use a data parameter in a Madcow test we again use the @ symbol followed by the name of the data parameter you require.

firstNameField.value = @myFirstName

Runtime Data

Madcow provides the ability to store the value of a web page element during test execution and then to use the stored value within the Madcow test.

Define a Runtime Data Parameter

To define a runtime data parameter in a Madcow test we use the Madcow store operation on an web page element passing it the name of the data parameter to store.

generatedReferenceNumber.store = MyReferenceNumber

Use a Runtime Data Parameter

To use a runtime data parameter in a Madcow test we again use the @ symbol followed by the name of the stored data parameter.

searchField.value = @MyReferenceNumber

Global Data Parameters

Madcow provides the following common global data parameters.

@global.currentDatedd/MM/yyyy
@global.currentTime12hrhh:mm a
@global.currentTime24hrhh:mm:ss
@global.currentDateTime12hrdd/MM/yyyy hh:mm a
@global.currentDateTime24hrdd/MM/yyyy hh:mm:ss

Use a Global Data Parameter

To use a global data parameter in a Madcow test we again use the @ symbol followed by the name of the global data parameter.

date.value = @global.currentDate
time.value = @global.currentTime24hr

Advanced Data Parameter Usage

Data Parameters can be used within a list and with the Madcow table syntax.

@newZealand = NZD
@australian = AUD
@japanese = JPY
@selectDollarFieldValues = [@newZealand, @australian, @japanese]
dollarList.verifySelectFieldOptions = @selectDollarFieldValues
@selectedCountry = New Zealand
@selectedCountryCurrency = NZD
@selectRowCriteria = ['Country' : @selectedCountry]
@searchResultsCheckValues = ['Country' : '@selectedCountry', 'lastColumn' : '@selectedCountryCurrency']
searchResults.table.selectRow = @selectRowCriteria
searchResults.table.currentRow.checkValue = @searchResultsCheckValues

Embedded Inline Data Parameters

Data Parameters can be used within a Madcow Value. This allows partial substitution of the value with the data parameter. This is done through @{...} syntax, with the contents within the curly braces defining the name of the data parameter.

@expectedResultCount = 20
verifyText = There are @{expectedResultCount} countries found

Ignore “@” symbol as String value

Symbol that start with “@” sign as value can be also treated a string value by appending curly braces “{}” between them.

@invalidEmail = {@gmail.com}, this will be saved as invalidEmail = "@gmail.com"
id.value = {@gmail.com}