How to set different value for same name in XML

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to set different value for same name in XML

Tushar Wase
please assist me parameterize below : 

<parameter name="A" value="1" />
<parameter name="A" value="2" />
<parameter name="A" value="3" />

Instead, i want to write something like below :

<parameter name="A" 
       value="1" 
        value="2"
           value="3"/>

or can i use  array here.
 



--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to set different value for same name in XML

Krishnan Mahadevan
You cannot do it the way you are looking for.

<parameter name="foo" value="bar"/> --- Here parameters can only take in a string.

But what you can do is, have the value be a comma separated values, and then within your test you can parse it (split it by commas into an array and work with it).

The other option would be to use a @DataProvider

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

On Thu, Feb 8, 2018 at 7:28 PM, Tushar Wase <[hidden email]> wrote:
please assist me parameterize below : 

<parameter name="A" value="1" />
<parameter name="A" value="2" />
<parameter name="A" value="3" />

Instead, i want to write something like below :

<parameter name="A" 
       value="1" 
        value="2"
           value="3"/>

or can i use  array here.
 



--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.