Forum Discussion

nac20's avatar
nac20
New Contributor
15 years ago

Template driven testing not working

Hi,

I've followed the advice on the 'Template Driven Testing' page but this is not working as expected.
<>

The 2nd and 3rd groovy scripts fail with error 'java.lang.NullPointerException: Cannot get property 'null' on null object'.
If I merge the 1st and 2nd groovy scripts they process successfully so I assume there is a problem with passing then reading the context variables  between scripts.
I tried upgrading to the latest version (3.0.1) but this didn't help.
We would really like to use this feature to perform stress testing but I don't understand what's causing the problem.
Please could someone advise how to get this working.

Thanks,

Alan

3 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    The context object is persisted for the entire run of the TestCase, so by setting a context variable in one TestStep, it should be readable in another, during the same execution. However, if you run the individual TestSteps one by one a new context will be created each time. So if you are testing just a script by itself it will fail if the required context variables are set in a different script, but when run as a TestCase, it should work. Hope this clears things up!

    Regards,
    Dain
    eviware.com
  • nac20's avatar
    nac20
    New Contributor
    Hi Dain,

    Thanks for the information that's useful to know.

    Even when I try to run the load test as one complete package I receive 'TestStep [Init run] result status is FAILED; [String index out of range: -1]' which suggests there is still a problem with reading in the context values.

    Any ideas how I can resolve this issue?

    Thanks in advance,

    Alan
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hello,

    Could you post the entire contents of your scripts?

    Regards,
    Dain
    eviware.com