Forum Discussion

mvandenberg2's avatar
mvandenberg2
Occasional Contributor
12 years ago
Solved

Jscript - Execute DOS command

Hi, I'm trying to execute a dos command in Jscript, but I keep getting "The system cannot find the file specified" I'm sure it has something to do with qoutes. I've tried every combination I...
  • nmrao's avatar
    6 years ago

    massimo65 

    You may use below Script Assertion:

     

    assert context.response, 'Response is empty or null'
    def xml = new XmlSlurper().parseText(context.response)
    
    def getElementValue = { element -> xml.'**'.find{element == it.name()}?.text() }
    
    log.info 'resultOperation value is ' + getElementValue('resultOperation')
    log.info 'errorCode value is ' + getElementValue('errorCode')

    Here is the script which you can play and test it online with fixed response.