Forum Discussion

es's avatar
es
Occasional Contributor
16 years ago

[SOLVED]Teststep dependencies

Hi,

I have a testcase with the following steps:

1. SOAP request: sends a guid to a loginscript and receives an encrypted sessionid
2. Groovy script: decrypts the sessionid and returns it
3. SOAP request: grabs the return value of the Groovy script and uses it as a parameter:

${DecryptSID#result}


This works well when I run it from TestRunner, but when I create a loadtest from these steps, the Groovy script fails, seemingly because it wasn't able to grab the response from the first SOAP request, which is done this way:

context.expand( '${Login#Response#//ns2:LoginResponse[1]/SessionId[1]}' )


Is there a way to set dependencies between the teststeps, so that step 2 waits for the response from step 1 before it starts? Or am I doing something else wrong?

Thanks in advance for any help or pointers!

14 Replies

  • es's avatar
    es
    Occasional Contributor
    Hm, "File > Preferences > UI Settings > Do not disable Groovy Log", and I still get "INFO:Disabling logs during loadtests", even after a restart. Known issue?

    Update: nevermind this, the script log was still updated...
  • Exactly what error are you getting? Any info in any of the logs? Can you attach a screenshot?

    regards!

    /Ole
    eviware.com
  • es's avatar
    es
    Occasional Contributor
    Well, the problem happens when this Groovy-script runs from the loadtest (works when running from TestRunner):
    def encryptedSessionId = context.expand( '${Login#Response#//ns2:LoginResponse[1]/SessionId[1]}' )
    def userPrivateKey = context.expand( '${#TestCase#userPrivateKey}' )
    def userPassword = context.expand( '${#TestCase#userPassword}' )

    log.info("eSID: " + encryptedSessionId)

    log.info("Base64 decode")
    byte[] privateKeyEncrypted = EncodingUtil.base64Decode(userPrivateKey)

    log.info("pKEY: " + privateKeyEncrypted)

    log.info("Decrypt private key")
    byte[] decryptedPrivateKey = CryptoUtil.decrypt(privateKeyEncrypted, userPassword)


    The script is longer than that, but that last line is the one that fails. The exception is:

    Caused by: java.security.InvalidKeyException: Illegal key size

    Could the loadtest be running under a different JRE from when running with TestRunner? We have explicitly installed "Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 6", perhaps these need to be included elsewhere too?
  • es's avatar
    es
    Occasional Contributor
    That was indeed the problem, adding the correct local_policy.jar and US_export_policy.jar to %JAVA_PATH%/lib/security did the trick.

    Thanks for helping, much appreciated, sorry I bothered you