Forum Discussion
Alex99
7 years agoContributor
You could define your own assertion list for the scripts.
For example like this, here you will get a list of true/false values, depending on the result.
def assertionList = [] assertionList.add(testValues(45, "GB")) assertionList.add(testValues(45, 45)) assertionList.add(testValues(45, 12)) assertionList.add(testValues(true, "ad")) log.info assertionList def testValues(valueA, valueB) { try { assert valueA == valueB return true } catch(AssertionError e) { return false } }
The output will look like this: Sat Oct 27 23:06:04 CEST 2018:INFO:[false, true, false, false]
For your script example it could look like this:
if(Medium == 'fasfafa') { 12312 = holder.getNodeValue('//Results/ResultSet/Row['+count+']/fsafasf') purpose = holder.getNodeValue('//Results/ResultSet/Row['+count+']/saffsafsa') actSecDate = holder.getNodeValue('//Results/ResultSet/Row['+count+']/asffsfsafsa') assertionList.add(testValues(actSecDate.toString(), qeqwqfa)) if(purpose == 'fsafsa') { if(12312.toInteger() == 1) { type = holder.getNodeValue('//Results/ResultSet/Row['+count+']/saffsafsa') assertionList.add(testValues(type.toString(), propTestStep.getPropertyValue("qwttqyy").toString())) } else if (12312.toInteger() == 3) { type = holder.getNodeValue('//Results/ResultSet/Row['+count+']/saffsafsa') assertionList.add(testValues(type.toString(), propTestStep.getPropertyValue("qwerqwrqw").toString())) } ... ... //writeout the assertionList to a csv here
Related Content
- 8 years ago
- 6 years ago
- 7 years ago
- 8 years ago
- 6 years ago
Recent Discussions
- 15 years ago