Forum Discussion

boncwik's avatar
boncwik
New Contributor
5 years ago
Solved

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 belo...
  • boncwik's avatar
    boncwik
    5 years ago

    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:

     

    2. Inside the TestCase we define 2 steps:

     

    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:

     

    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  :)