cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple SOAP requests, increasing one parameter

SOLVED
New Contributor

Multiple SOAP requests, increasing one parameter

Hi All,

At first, apologize if this is a wrong place for this question and if that question has already been asked.

I'm a new SOAP user and have to run hundreds of SOAP requests, like that one below:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xmii="http://www.sap.com/xMII">
<soapenv:Header/>
<soapenv:Body>
<xmii:XacuteRequest>
<xmii:InputParams>
<xmii:DateStarted>2020-03-26T07:00:00.000</xmii:DateStarted>
<xmii:ExpiryTime>2021-03-26T07:00:00.000</xmii:ExpiryTime>
<xmii:Item>Material1</xmii:Item>
<xmii:Quantity>1</xmii:Quantity>
<xmii:Resource>Machine1</xmii:Resource>
<xmii:Sfc>TEST000001</xmii:Sfc>
<xmii:ShopOrder>1234567890</xmii:ShopOrder>
<xmii:UserId>QW1234</xmii:UserId>
</xmii:InputParams>
</xmii:XacuteRequest>
</soapenv:Body>
</soapenv:Envelope>

Each time I run the request I have to just increase SFC parameter with "+1". So with the second call I will send TEST000002, with the third it will be TEST000003 and so on...

I assume that I could create a test case which will do that job very quickly but I don't knwo how, I'm a dumb Smiley Happy

Can someone help me creating a test case for that or maybe there is an another solution?

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
New Contributor

Re: Multiple SOAP requests, increasing one parameter

Hello @nmrao,

 

Apologize for a late reply, I was too busy recently.

In fact I didn't checked yet your solution but I was managed (with a help of my friend) to solve my issue.

So, I will just describe how we solve it and maybe someone could use it in the future:

 

1. I create a new TestSuite (called Loop) and a new TestCase (called test1) under the project:

2020-04-02 12_47_20.png

 

2. Inside the TestCase we define 2 steps:

test1 steps.png

 

3. In Request1 in put a SOAP call from my first email but I replace:

<xmii:Sfc>TEST000001</xmii:Sfc>

With the property, which I declare in point 4:

<xmii:Sfc>${#TestCase#sfc}</xmii:Sfc>

 

4. Next we define couple of properties:

properties.png

 

5. In loop step we put a code:

def prefix = context.expand( '${#TestCase#prefix}' );
def step = context.expand( '${#TestCase#step}' );
def limit = context.expand( '${#TestCase#limit}' ).toInteger();
step = step.toInteger() + 1;

if (step <= limit) {
testRunner.testCase.setPropertyValue("step", step.toString());
testRunner.testCase.setPropertyValue("sfc", prefix+step.toString());
log.info "step: " + step;
testRunner.gotoStepByName("Request1");
}

 

Now, playing with the step, sfc and limit values I was able to execute exactly what I needed  Smiley Happy

View solution in original post

3 REPLIES 3
Highlighted
Community Hero

Re: Multiple SOAP requests, increasing one parameter

Dynamic property can be used here assuming unique value is required in each call.

Refer

https://community.smartbear.com/t5/SoapUI-Pro/API-Masterminds-How-to-use-dynamic-properties-to-get-t...



Regards,
Rao.
Highlighted
New Contributor

Re: Multiple SOAP requests, increasing one parameter

Hello @nmrao,

 

Apologize for a late reply, I was too busy recently.

In fact I didn't checked yet your solution but I was managed (with a help of my friend) to solve my issue.

So, I will just describe how we solve it and maybe someone could use it in the future:

 

1. I create a new TestSuite (called Loop) and a new TestCase (called test1) under the project:

2020-04-02 12_47_20.png

 

2. Inside the TestCase we define 2 steps:

test1 steps.png

 

3. In Request1 in put a SOAP call from my first email but I replace:

<xmii:Sfc>TEST000001</xmii:Sfc>

With the property, which I declare in point 4:

<xmii:Sfc>${#TestCase#sfc}</xmii:Sfc>

 

4. Next we define couple of properties:

properties.png

 

5. In loop step we put a code:

def prefix = context.expand( '${#TestCase#prefix}' );
def step = context.expand( '${#TestCase#step}' );
def limit = context.expand( '${#TestCase#limit}' ).toInteger();
step = step.toInteger() + 1;

if (step <= limit) {
testRunner.testCase.setPropertyValue("step", step.toString());
testRunner.testCase.setPropertyValue("sfc", prefix+step.toString());
log.info "step: " + step;
testRunner.gotoStepByName("Request1");
}

 

Now, playing with the step, sfc and limit values I was able to execute exactly what I needed  Smiley Happy

View solution in original post

Highlighted
Community Manager

Re: Multiple SOAP requests, increasing one parameter

@boncwik glad to hear that! thank you for sharing the solution with us!

 

Thank you for helping nmrao, always great to have multiple options to try and solve an issue.


Sonya Mihaljova
Community and Education Specialist

 Join the virtual SmartBear Connect user conference on April 27-28! Get your free virtual ticket today!