Forum Discussion

changtime's avatar
changtime
Occasional Contributor
14 years ago

Using Task Variables within SOAP load test

SOAP web service load testing

--------------

I've defined the WSDL and Routine on my Task on the Request Tab and Test Complete correctly identifies and lists the required parameters for the SOAP request.



Shouldn't I then be able to put in a Task Variable there? I've entered @MyVariable (defined as a task variable as a random integer from 1 to 100) there as a value, but for some reason it's still passing through the text "@MyVariable" as opposed a random integer in the request. 

6 Replies


  • Hi Jason,





    Could you please send me a project you are working with? I will look into your test. Please pack the entire project suite folder.
  • changtime's avatar
    changtime
    Occasional Contributor
    Hi David,



    I'm unable to share the entire project due to our internal security policy.  Is there any more specific information I could provide you?



    What I'm seeing in my project looks very much like the image in "http://smartbear.com/support/viewarticle/17492/", except that I'm looking at the Request tab instead. 



    I am entering "@MyVariable" into one of the value fields on the SOAP tab, however the string "@MyVariable" is being passed in the request as opposed to a random integer that I've defined the variable in the Tasks Editor as outlined in "http://smartbear.com/support/viewarticle/18720/"



  • Hi Jason,





    In this case, is it possible for you to send us a bunch of images demonstrating all the actions you perform and the actual results you get? This will help us to understand that exactly you do and why this does not work for you. You can send the files us via the Contact Support form.





    Thanks in advance.
  • changtime's avatar
    changtime
    Occasional Contributor
    This is a follow up for the forum thread below



    http://smartbear.com/forums/forum/post/?mode=singleThread&thread=3ca51106-b9f4-4931-923d-558672003cc4



    Task Variables.JPG

    - I've defined my variable MyVariable a sa random value

    Task request details.JPG

    = I've defined set the @MyVariable as a parameter in the SOAP request.



    However, when running the test, the xml below is passed to our webservice.  "@MyVariable" as opposed to a random int as expected



    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

        <soap:Body>

            <GetAd xmlns="_____">

                <____Id>@MyVariable</____Id>

            </GetAd>

        </soap:Body>

    </soap:Envelope>
  • changtime's avatar
    changtime
    Occasional Contributor
    Hi David,



    Please let me know if you require any more screenshots or details.



    Task Variables.JPG

    - I've defined my variable MyVariable a sa random value

    Task request details.JPG

    = I've defined set the @MyVariable as a parameter in the SOAP request.



    However, when running the test, the xml below is passed to our webservice.  "@MyVariable" as opposed to a random int as expected



    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

        <soap:Body>

            <GetAd xmlns="_____">

                <____Id>@MyVariable</____Id>

            </GetAd>

        </soap:Body>

    </soap:Envelope>
  • Hi Jason,




    = I've defined set the @MyVariable as a parameter in the SOAP request.  



    Currently, it is not possible to use load testing variables to modify SOAP requests. However, it is possible to modify such requests using OnLoadTestingRequest event's handler. We have created a sample project suite that demonstrates how it can be accomplished with the help of regular expressions - check the attached archive.