Forum Discussion

Franky's avatar
Franky
Occasional Contributor
17 years ago

Clone the specific XML Tag ,in DDT.

Hi,

Here is my requirement.

I want to send email notification using the below XMl tag.


But , when i am executing as a Data Driven Test , i just want to clone the same tag depends on the number of email id given in the XLS.

So, how to do this..?

Regards,
Franky.

4 Replies

  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Franky,

    hmm.. you will need to create a groovy-script that creates the aggregated xml and adds it to the request.. if you give some more details maybe I can help you..

    regards!

    /Ole
    eviware.com
  • Franky's avatar
    Franky
    Occasional Contributor
    Hi,


    Let me explain the thing.

    I need to send notification to "n" number of users ."n" may be 5, 10 or etc.
    so, i want to create n number of
    " " tags in my request soap xml, depends on the number of email ids provided in the  xls sheet.


    For example if i provide 5 email ids in my xl sheet ,
    the i need to get my request as follows:







    OR

    way2:
    = = = =

    is there any way to pass array of email ids to a single



    tag itself.


    Regards,
    Franky.
  • omatzura's avatar
    omatzura
    Super Contributor
    Hi Franky,

    hmm.. you would probably need to create a groovy-script that builds the desired xml for each row in your xls and then refer to the created xml string using property-expansion, ie:

    step 1: DataSource for your XSL file
    step 2: Groovy script that gets the current email and adds it to an xml string in the current context
    step 3: DataSourceLoop back to the groovy script
    step 4: Your request that referes to the created xml-string using property-expansion, ie..

    ${notify_emails}

    which contains the xml built by the groovy script above..

    Hope this helps!

    regards,

    /Ole
    eviware.com
  • Franky's avatar
    Franky
    Occasional Contributor
    Hi,

    Thanks for ur response.

    But , is  any other way  to pass Array of values to  an XML tag , without the help of Groovy ?

    If not, can i have the needed  Groovy snippet ?


    Regards,
    Franky.