Service Virtualization

  • 1.  Injection of XMLs one by one in test case on ITR

    Posted Oct 06, 2017 10:29 AM

    Hello All,

     

    We have requirement in which we have 100 XMLs in Data folder in Lisa project which we want to inject one by one in test case to get response. As we know different data sets also we can see by copying these XMLs content in Excel we can achieve this. But how we can inject XMLs one by one in test case on ITR?

     

    Please advise.

     

    Cheers..

    Shivam Garg



  • 2.  Re: Injection of XMLs one by one in test case on ITR
    Best Answer

    Posted Oct 06, 2017 10:47 AM

    In the soap/rest test write a loop that uses the dataset Load a set of File Names, which you then target to the file system folder (ex. {{LISA_PROJ_ROOT}}/Data) and file pattern (ex. *.xml), and give the dataset a variable name.  Then use a Read A File step, that takes in the variabe name from the Load a set of File Names dataset.  Now use that variable name in the consequent request payload of the soap/rest call.  At end of the dataset end the test, so that it does not go into infinite loop



  • 3.  Re: Injection of XMLs one by one in test case on ITR

    Posted Oct 06, 2017 10:56 PM

    Thanks Mark.

     

    I shall try this way and let you in case of any issue.

     

    Cheers..



  • 4.  Re: Injection of XMLs one by one in test case on ITR

    Posted Oct 09, 2017 01:01 AM

    Morning Mark,

     

    Can you please assist me in providing screen shots ? I am not understanding writing a loop concept.

     

    Cheers..



  • 5.  Re: Injection of XMLs one by one in test case on ITR

    Posted Oct 09, 2017 03:33 AM

    Hello Mark,

     

    As you suggested , I have created above test case but not able to get where we have to write loop. please check and suggest if any thing wrong.

     

    Cheers..

     

    Shivam Garg



  • 6.  Re: Injection of XMLs one by one in test case on ITR

    Posted Oct 09, 2017 08:48 AM

    What you have is the loop, as you see the last step going back to the dataset.  Here are screens of a simple, working minimal loop that will read a directory of xml files, then for each xml populate the xml body into the payload of the soap request, loop back and do the same until the xml dataset(all xmls in the directory) is exhausted...

     



  • 7.  Re: Injection of XMLs one by one in test case on ITR

    Posted Oct 09, 2017 08:55 AM

    Yes I tried in morning and it worked.

     

    Thank you so much..:)