Forum Discussion

SiKing's avatar
SiKing
Community Expert
12 years ago

[Resolved] missing results log file

I have a testcase where I need to run the individual steps in different order based on some criteria. I am using a Groovy script to determine the order of steps, using something like:
def macAddress = context.expand( '${retrieve devices#sMacAddress}' )
def mdn = context.expand( '${retrieve devices#sMDN}' )
def customerId = context.expand( '${retrieve devices#biCustomerID}' )

if (macAddress != null && !macAddress.isEmpty()) {
def result = testRunner.testCase.getTestStepByName("findDeviceByMacAddress").run(testRunner, context)
}
if (mdn != null && !mdn.isEmpty()) {
def result = testRunner.testCase.getTestStepByName("findDeviceByPhoneNumber").run(testRunner, context)
}
if (customerId != null && !customerId.isEmpty()) {
def result = testRunner.testCase.getTestStepByName("findDevicesByCustomerId").run(testRunner, context)
}

Everything works just the way I want.

However, when I run my testcase from CLI (testrunner.bat) with the -a or -A switch, I do not get any result log files for any of my steps. I am wondering: is this by design? How can I get the result log files?

4 Replies

  • nmrao's avatar
    nmrao
    Community Hero
    When below script is run from soapui, do you see any log?
    May be you try by using some log statements in side groovy and see that helps?

    By the way, I know below is not something you are looking for

    if (macAddress != null && !macAddress.isEmpty())

    if (macAddress) -- is pure groovy form and equivalent to the above statement which of java nature
  • SiKing's avatar
    SiKing
    Community Expert
    nmrao wrote:
    When below script is run from soapui, do you see any log?
    May be you try by using some log statements in side groovy and see that helps?

    I don't get it. As I mentioned in my OP, everything works in SoapUI-GUI as expected. The only thing that I am missing is the results file that you normally get when running
    testrunner.bat -a <project>
  • SiKing's avatar
    SiKing
    Community Expert
    Right, it is being kicked off from the script! I just did not know if the missing result file in this case is a defect or a feature.

    The workaround does work, BTW.
    Thanx.