Forum Discussion

luke_devon's avatar
luke_devon
Occasional Visitor
4 years ago

input multiple entries using a text file

Hi , 

 

I use spml to execute some commands using soap UI. I have a modify request which should be executed for around 100 entries. Can I keep these entries (for example mobile numbers) in a text file and call that txt file using the spml? 

Then the same commands will execute for all the 100 mobile numbers.

Please send me a little guide.

 

Thanks

Luke

  • richie's avatar
    richie
    Community Hero
    Hey luke_devon,

    I dont know what spml is,but if you need to execute a request multiple times by sourcing request testdata from multiple files (or multiple values from a single file) for eacj iteration and then loop round to next file for next test? Yep,thats totally do-able.

    SmartBear call this "data driven" functionality and the licensed version of soapui (called readyapi!) comes with some native functionality built in to do all the heavy lifting for you. The open source soapui doesnt come with that functionality built in, so you need a bit of groovy scripting to do it.


    If you google variations of "data driven groovy script soapui" or "data driven data loop groovy script soapui text file datasource", youll find loads of pages giving you what you need.

    I advise 2 things:
    1. Ensure testdata is spread across multiple files with single phone number values in each rather than a single file with multiple phone number values as i find it easier to script for that.
    2. Make sure you datasource file is .txt or .csv. dont bother sticking testdata in .xls files, i find it a lot easier (code is more basic) to code to source the values from a .txt/.csv file rather than from a .xls

    Any more help, just shout

    Cheers,

    Rich


    Ricj