How to select data by index out of a DataProvider Array

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

How to select data by index out of a DataProvider Array

ajourney
the auto generated testfailed.xml has an invocation-numbers variable. Is there some method for selecting indexes in general? If not is there a away to mark manually set invocation numbers prior to the test running?

--
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 http://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 select data by index out of a DataProvider Array

Krishnan Mahadevan
You can try and see if the following approach works :

1. Get the indexes to pick data from via JVM arguments.
2. Have your data provider first form the 2 D object array.
3. Then pick the rows that match the index values to form a new 2D Object array and then have your test method use it for its needs.

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 Tue, May 13, 2014 at 11:24 PM, ajourney <[hidden email]> wrote:
the auto generated testfailed.xml has an invocation-numbers variable. Is there some method for selecting indexes in general? If not is there a away to mark manually set invocation numbers prior to the test running?

--
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 http://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 http://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 select data by index out of a DataProvider Array

ajourney
Ok sounds good but how do I 
#1 get lets say  pass row 1 4 and 8  via jvm arguments. and how to capture that? Does Testng have a special jvm capture annotation?
On Friday, May 16, 2014 6:51:18 AM UTC-4, Krishnan wrote:
You can try and see if the following approach works :

1. Get the indexes to pick data from via JVM arguments.
2. Have your data provider first form the 2 D object array.
3. Then pick the rows that match the index values to form a new 2D Object array and then have your test method use it for its needs.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ <a href="http://wakened-cognition.blogspot.com/" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwakened-cognition.blogspot.com%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwakened-cognition.blogspot.com%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;">http://wakened-cognition.blogspot.com/
My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Frationaleemotions.wordpress.com%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Frationaleemotions.wordpress.com%2F\46sa\75D\46sntz\0751\46usg\75AFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;">http://rationaleemotions.wordpress.com/


On Tue, May 13, 2014 at 11:24 PM, ajourney <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="1P-U6GMr8e0J" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">ajou...@...> wrote:
the auto generated testfailed.xml has an invocation-numbers variable. Is there some method for selecting indexes in general? If not is there a away to mark manually set invocation numbers prior to the test running?

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="1P-U6GMr8e0J" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">testng-users...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="1P-U6GMr8e0J" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">testng...@....
Visit this group at <a href="http://groups.google.com/group/testng-users" target="_blank" onmousedown="this.href='http://groups.google.com/group/testng-users';return true;" onclick="this.href='http://groups.google.com/group/testng-users';return true;">http://groups.google.com/group/testng-users.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;">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 http://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 select data by index out of a DataProvider Array

Krishnan Mahadevan
Wouldnt something like this work for you ?

String indexes = System.getProperty("indexes"); //indexes is your own custom JVM argument for which you would pass value via : -Dindexes=1-4

You would then go about parsing the indexes String variable.

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 Fri, May 23, 2014 at 6:19 PM, ajourney <[hidden email]> wrote:
Ok sounds good but how do I 
#1 get lets say  pass row 1 4 and 8  via jvm arguments. and how to capture that? Does Testng have a special jvm capture annotation?
On Friday, May 16, 2014 6:51:18 AM UTC-4, Krishnan wrote:
You can try and see if the following approach works :

1. Get the indexes to pick data from via JVM arguments.
2. Have your data provider first form the 2 D object array.
3. Then pick the rows that match the index values to form a new 2D Object array and then have your test method use it for its needs.

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 Tue, May 13, 2014 at 11:24 PM, ajourney <[hidden email]> wrote:
the auto generated testfailed.xml has an invocation-numbers variable. Is there some method for selecting indexes in general? If not is there a away to mark manually set invocation numbers prior to the test running?

--
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 testng-users...@googlegroups.com.
To post to this group, send email to [hidden email].
Visit this group at http://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 http://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 http://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.