Forum Discussion

jwturner421's avatar
jwturner421
New Contributor
15 years ago

Using a Value returned by a Web Service Test for a Subsequent Test

Hello,



I'm sure there there is an easy way to do this but I'm stumped.  I have a series of web services that I need to test.  The first service performs a login and returns a token that can be used by subsequent services to perform tasks.  How do I capture the return value from the login service to reuse as a variable during the remainder of the test?



Thank you in advance.



Joel 

2 Replies

  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Joel,


    If your web service returns a value, you can obtain it via the line that calls your service. In other words, you need to assign the value returned by the code line that calls the web service to a variable. After the service is called and returns any value, the value is automatically stored into the specified variable:

    resultVariable = WebServices.WebService1