@Parameter with @DataProvider

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

@Parameter with @DataProvider

Naresh
Hi,

I want to pass parameters from test suite to data provider method.

            @Parameters( { "param1"})
        @DataProvider(name = "dp")
        public Object[][] data1(String param1) {
      }

 I have tried and getting below exception.

java.lang.IllegalArgumentException: wrong number of arguments
I explored google and forums. Didnt find solution. Is this possible with testNG in any otherway? Thanks in advance
       
Reply | Threaded
Open this post in threaded view
|

Re: @Paramets with @DataProvider

krishnan.1000
Hi Naresh,

How do you determine the order of precedence?

Kartik

On Tue, Jan 12, 2010 at 12:03 AM, Naresh <[hidden email]> wrote:

Hi,

I want to pass parameters from test suite to data provider method.

           @Parameters( { "param1"})
       @DataProvider(name = "dp")
       public Object[][] data1(String param1) {
     }

 I have tried and getting below exception.

java.lang.IllegalArgumentException: wrong number of arguments
I explored google and forums. Didnt find solution. Is this possible with
testNG in any otherway? Thanks in advance

--
View this message in context: http://old.nabble.com/%40Paramets-with-%40DataProvider-tp27123881p27123881.html
Sent from the testng-users mailing list archive at Nabble.com.


--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.





--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to [hidden email].
To unsubscribe from this group, send email to [hidden email].
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: @Paramets with @DataProvider

Naresh
Hi Karik,

Thanks for the reply. I am not sure abt order of preference. Got same result with different order.

However for timebeing I found a workaround by reading parameters requrired using @BeforeClass for another method and reading parameters from testsuite.


regards,
Naresh

krishnan.1000 wrote
Hi Naresh,

How do you determine the order of precedence?

Kartik

On Tue, Jan 12, 2010 at 12:03 AM, Naresh <mailnareshg@yahoo.co.in> wrote:

>
> Hi,
>
> I want to pass parameters from test suite to data provider method.
>
>            @Parameters( { "param1"})
>        @DataProvider(name = "dp")
>        public Object[][] data1(String param1) {
>      }
>
>  I have tried and getting below exception.
>
> java.lang.IllegalArgumentException: wrong number of arguments
> I explored google and forums. Didnt find solution. Is this possible with
> testNG in any otherway? Thanks in advance
>
> --
> View this message in context:
> http://old.nabble.com/%40Paramets-with-%40DataProvider-tp27123881p27123881.html
> Sent from the testng-users mailing list archive at Nabble.com.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "testng-users" group.
> To post to this group, send email to testng-users@googlegroups.com.
> To unsubscribe from this group, send email to
> testng-users+unsubscribe@googlegroups.com<testng-users%2Bunsubscribe@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/testng-users?hl=en.
>
>
>
>

--

You received this message because you are subscribed to the Google Groups "testng-users" group.

To post to this group, send email to testng-users@googlegroups.com.

To unsubscribe from this group, send email to testng-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
Reply | Threaded
Open this post in threaded view
|

Re: @Parameter with @DataProvider

vishal
This post has NOT been accepted by the mailing list yet.
In reply to this post by Naresh
Hi,

Please let me know if you got any solution for this

thanks