Forum Discussion

Marshall's avatar
Marshall
Occasional Contributor
11 years ago

Scripting Mock Response's port number

SmartBear/Support Community,

I have a question and am optimistic that someone will be able to shed some light on the answer.

First a description of my testing scenario:
In my testing using soapUI, I have a workflow consisting of multiple SOAP test step requests to the same endpoint. After each request, there is a subsequent Mock Response test step which waits for an asynchronous response from the aforementioned endpoint. This async response notifies my soapUI client when the previous request has succeeded so the flow can progress to the next step. These async responses are very important because each step depends on the one before it to have completed successfully before executing itself and the time each step takes to complete varies depending on the request.

This process works great when using one thread, however when performing stress testing with multiple threads I have encountered an issue. Each thread runs through the workflow with its own unique dataset, and thus, each Mock Response requires its own unique port number to listen for the async response on. Each thread receives its dataset/values through a combination of DataGen and Groovy Script test steps. However, I have been unable to find a way to script the Port number on which the Mock Response test step listens. Is there a way to do this?

My question is: How can I script the Port number on which a Mock Response test step listens. Is there a way to do this?

Below is a screen capture of the value I am trying to change in my script:



I am running:
Software Version: soapUI Pro 4.5.2
Build Date: 20130522-1354

Thank you all in advance for your time and expertise!

4 Replies

  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Answered in your duplicate topic in community forums, so that the community can provide suggestions aswell.
    Right here

    Best regards,
    Mikael
    SmartBear Sweden
  • Marshall's avatar
    Marshall
    Occasional Contributor
    Thanks for looking into my question!

    When I try to set the "Port" property of a MockResponse test step to a custom property value such as "${#TestCase#RESPONSEADDR}", it does not seem to be allowed. When I enter the variable text and click out of the field, the text changes to "0". Please see the screen captures below for a depiction of what I am describing:





    Please let me know if I am doing this wrong or if there is another way scripting the Mock Response's port number can be accomplished.
    Regards,
    Marshall
  • Marshall's avatar
    Marshall
    Occasional Contributor
    Has anyone had a chance to look at my last comment? Please let me know if I am doing this wrong or if there is another way scripting a Mock Response's port number can be accomplished.
    Regards,
    Marshall
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi Marshall,

    I tried this, and I experienced the same behavior as you did when trying to set the port with property expansion. I've done some digging in the source code, and unfortunately I can't find any other way to do this. Thank you for bringing this to our attention; I will log a ticket in our internal issue tracking system, but unfortunately I cannot think of a workaround that would solve your problem right now.

    Please let me know if there is anything else I can assist with.

    Regards,
    Arian
    SmartBear Sweden