|
|
There are some issues with your code. I don't think your code is data driven in nature.
That said and done, the below sample should help you get started. Its a factory powered by a data provider. The data provider provides values to the factory and the factory uses those values to instantiate your test class objects. All the @Test annotated methods in each of your test class instance work with the parameters that were passed to its constructor via the Factory.
public class DataDrivenSample { private RemoteWebDriver driver; private int a; private String b; private boolean c;
@Factory (dataProvider = "dp") public DataDrivenSample(Integer a, String b, Boolean c) { this.a = a; this.b = b; this.c = c; }
@BeforeClass public void setup() { driver = new ChromeDriver(); }
@AfterClass public void cleanup() { driver.quit(); }
@Test public void testMethod() { driver.get("http://www.google.com"); System.err.println("accessing the passed values "); System.err.println("a = " + a); System.err.println("b = " + b); System.err.println("c = " + c);
}
@Test public void anotherTestMethod() { //Here is another test method that works on the parameters passed. System.err.println("accessing the passed values "); System.err.println("a = " + a); System.err.println("b = " + b); System.err.println("c = " + c); }
@DataProvider (name = "dp") public static Object[][] getData(ITestContext ctx) { //Just showing how to access the parameters from the TestNG suite xml file. //You can use this incase, you want to have your .xls file also passed via the suite file. System.err.println("test name " + ctx.getName()); //Replace the below logic with your .xls reading logic. return new Object[][] { {10, "TestNG", true}, {20, "Selenium", false} }; } }
--
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.
|
|
HI Krishnan, Thank you, So from your code i understand dataprovider=dp works for only one class, if we want to write another class we need to create one more dp. also can you please send xl logic if you have?...please help...actually iam struggling alot to map xl to the dataProvider thanks Mahender On Wednesday, June 8, 2016 at 6:55:03 AM UTC+5:30, Krishnan wrote: There are some issues with your code. I don't think your code is data driven in nature.
That said and done, the below sample should help you get started. Its a factory powered by a data provider. The data provider provides values to the factory and the factory uses those values to instantiate your test class objects. All the @Test annotated methods in each of your test class instance work with the parameters that were passed to its constructor via the Factory.
public class DataDrivenSample { private RemoteWebDriver driver; private int a; private String b; private boolean c;
@Factory (dataProvider = "dp") public DataDrivenSample(Integer a, String b, Boolean c) { this.a = a; this.b = b; this.c = c; }
@BeforeClass public void setup() { driver = new ChromeDriver(); }
@AfterClass public void cleanup() { driver.quit(); }
@Test public void testMethod() { driver.get("<a href="http://www.google.com" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com';return true;" onclick="this.href='http://www.google.com';return true;">http://www.google.com"); System.err.println("accessing the passed values "); System.err.println("a = " + a); System.err.println("b = " + b); System.err.println("c = " + c);
}
@Test public void anotherTestMethod() { //Here is another test method that works on the parameters passed. System.err.println("accessing the passed values "); System.err.println("a = " + a); System.err.println("b = " + b); System.err.println("c = " + c); }
@DataProvider (name = "dp") public static Object[][] getData(ITestContext ctx) { //Just showing how to access the parameters from the TestNG suite xml file. //You can use this incase, you want to have your .xls file also passed via the suite file. System.err.println("test name " + ctx.getName()); //Replace the below logic with your .xls reading logic. return new Object[][] { {10, "TestNG", true}, {20, "Selenium", false} }; } }
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" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;">http://wakened-cognition.blogspot.com/My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;">http://rationaleemotions.wordpress.com/
On Tue, Jun 7, 2016 at 3:02 PM, Mahender Tirumala <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="paFsgVY1AgAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">2mah...@...> wrote: me (Mahender Tirumala change) | 11:39 AM (3 hours ago) |
--
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="paFsgVY1AgAJ" rel="nofollow" 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="paFsgVY1AgAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">testng...@....
Visit this group at <a href="https://groups.google.com/group/testng-users" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/group/testng-users';return true;" onclick="this.href='https://groups.google.com/group/testng-users';return true;">https://groups.google.com/group/testng-users.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" 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 https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
|
|
iam getting same issue with your code, browsers are launching parallely, with out quitting any browser On Wednesday, June 8, 2016 at 4:24:37 PM UTC+5:30, Mahender Tirumala wrote: HI Krishnan, Thank you, So from your code i understand dataprovider=dp works for only one class, if we want to write another class we need to create one more dp. also can you please send xl logic if you have?...please help...actually iam struggling alot to map xl to the dataProvider thanks Mahender On Wednesday, June 8, 2016 at 6:55:03 AM UTC+5:30, Krishnan wrote: There are some issues with your code. I don't think your code is data driven in nature.
That said and done, the below sample should help you get started. Its a factory powered by a data provider. The data provider provides values to the factory and the factory uses those values to instantiate your test class objects. All the @Test annotated methods in each of your test class instance work with the parameters that were passed to its constructor via the Factory.
public class DataDrivenSample { private RemoteWebDriver driver; private int a; private String b; private boolean c;
@Factory (dataProvider = "dp") public DataDrivenSample(Integer a, String b, Boolean c) { this.a = a; this.b = b; this.c = c; }
@BeforeClass public void setup() { driver = new ChromeDriver(); }
@AfterClass public void cleanup() { driver.quit(); }
@Test public void testMethod() { driver.get("<a href="http://www.google.com" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com';return true;" onclick="this.href='http://www.google.com';return true;">http://www.google.com"); System.err.println("accessing the passed values "); System.err.println("a = " + a); System.err.println("b = " + b); System.err.println("c = " + c);
}
@Test public void anotherTestMethod() { //Here is another test method that works on the parameters passed. System.err.println("accessing the passed values "); System.err.println("a = " + a); System.err.println("b = " + b); System.err.println("c = " + c); }
@DataProvider (name = "dp") public static Object[][] getData(ITestContext ctx) { //Just showing how to access the parameters from the TestNG suite xml file. //You can use this incase, you want to have your .xls file also passed via the suite file. System.err.println("test name " + ctx.getName()); //Replace the below logic with your .xls reading logic. return new Object[][] { {10, "TestNG", true}, {20, "Selenium", false} }; } }
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/" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;">http://wakened-cognition.blogspot.com/My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;">http://rationaleemotions.wordpress.com/
On Tue, Jun 7, 2016 at 3:02 PM, Mahender Tirumala <[hidden email]> wrote: me (Mahender Tirumala change) | 11:39 AM (3 hours ago) |
--
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 <a href="https://groups.google.com/group/testng-users" rel="nofollow" target="_blank" onmousedown="this.href='https://groups.google.com/group/testng-users';return true;" onclick="this.href='https://groups.google.com/group/testng-users';return true;">https://groups.google.com/group/testng-users.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" 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 https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
|
|
iam getting same issue with your code, browsers are launching parallely, with out quitting any browser
That cannot be possible because I sent you the code after personally executing it. Make sure that all your annotations are from TestNG and you aren't using the @BeforeClass and @AfterClass from JUnit. That can be the only reason why you don't see the browser cleaning up properly. Thank you, So from your code i understand dataprovider=dp works for only one class, if we want to write another class we need to create one more dp. I dont quite understand what you are saying here. The data provider here provides parameters for the constructor so that TestNG may use those parameters to invoke the constructor and produce test class instances. So if you want another test class with a different type of a constructor then obviously yes you would need to write up a new data provider.
also can you please send xl logic if you have?...please help...actually iam struggling alot to map xl to the dataProvider
No I don't have any ready made logic available at my hand. But if you would like to, then you could perhaps take a look at the data providers library that SeLion provides and see if you can leverage that.
To start with you would need to add a dependency on the Selion data provider
<dependency> <groupId>com.paypal.selion</groupId> <artifactId>SeLion-DataProviders</artifactId> <version>1.0.0</version> </dependency>
--
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.
|
|
Krishnan,
I use TestNG and restAssured for REST web services testing. I use dataProvider reading test data from xls files. In order to run a single test (one row from the test data file), can I use Selion? Thanks, Yanan
On Wednesday, June 8, 2016 at 10:49:25 AM UTC-4, Krishnan wrote: iam getting same issue with your code, browsers are launching parallely, with out quitting any browser
That cannot be possible because I sent you the code after personally executing it. Make sure that all your annotations are from TestNG and you aren't using the @BeforeClass and @AfterClass from JUnit. That can be the only reason why you don't see the browser cleaning up properly. Thank you, So from your code i understand dataprovider=dp works for only one class, if we want to write another class we need to create one more dp. I dont quite understand what you are saying here. The data provider here provides parameters for the constructor so that TestNG may use those parameters to invoke the constructor and produce test class instances. So if you want another test class with a different type of a constructor then obviously yes you would need to write up a new data provider.
also can you please send xl logic if you have?...please help...actually iam struggling alot to map xl to the dataProvider
No I don't have any ready made logic available at my hand. But if you would like to, then you could perhaps take a look at the data providers library that <a href="http://selion.io" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fselion.io\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFvnXruvo1sPwT7hjMu3m5jeFLG4A';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fselion.io\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFvnXruvo1sPwT7hjMu3m5jeFLG4A';return true;">SeLion provides and see if you can leverage that.
To start with you would need to add a dependency on the Selion data provider
<dependency> <groupId>com.paypal.selion</groupId> <artifactId>SeLion-DataProviders</artifactId> <version>1.0.0</version> </dependency>
You can then look at one of the unit tests to understand how to work with the different variants of data providers that SeLion provides by looking at the unit tests <a href="https://github.com/paypal/SeLion/tree/develop/dataproviders/src/test/java/com/paypal/selion/platform/dataprovider" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpaypal%2FSeLion%2Ftree%2Fdevelop%2Fdataproviders%2Fsrc%2Ftest%2Fjava%2Fcom%2Fpaypal%2Fselion%2Fplatform%2Fdataprovider\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEvhrTRiX9op8RNrkkSt6a5cx4vWg';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpaypal%2FSeLion%2Ftree%2Fdevelop%2Fdataproviders%2Fsrc%2Ftest%2Fjava%2Fcom%2Fpaypal%2Fselion%2Fplatform%2Fdataprovider\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEvhrTRiX9op8RNrkkSt6a5cx4vWg';return true;">here (or) looking at the samples from the SeLion archetype <a href="https://github.com/paypal/SeLion/blob/develop/archetype/src/main/resources/archetype-resources/src/test/java/sample/selion/SimpleDataDrivenTest.java" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpaypal%2FSeLion%2Fblob%2Fdevelop%2Farchetype%2Fsrc%2Fmain%2Fresources%2Farchetype-resources%2Fsrc%2Ftest%2Fjava%2Fsample%2Fselion%2FSimpleDataDrivenTest.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG8JeibcXNqAAwpD3yIrcXwdZosog';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpaypal%2FSeLion%2Fblob%2Fdevelop%2Farchetype%2Fsrc%2Fmain%2Fresources%2Farchetype-resources%2Fsrc%2Ftest%2Fjava%2Fsample%2Fselion%2FSimpleDataDrivenTest.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG8JeibcXNqAAwpD3yIrcXwdZosog';return true;">SimpleDataDrivenTest and <a href="https://github.com/paypal/SeLion/blob/develop/archetype/src/main/resources/archetype-resources/src/test/java/sample/selion/SimpleDataDrivenWithSelectiveRowsTest.java" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpaypal%2FSeLion%2Fblob%2Fdevelop%2Farchetype%2Fsrc%2Fmain%2Fresources%2Farchetype-resources%2Fsrc%2Ftest%2Fjava%2Fsample%2Fselion%2FSimpleDataDrivenWithSelectiveRowsTest.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE610kUF591Y__uvcaZC_F2Bpj-TA';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpaypal%2FSeLion%2Fblob%2Fdevelop%2Farchetype%2Fsrc%2Fmain%2Fresources%2Farchetype-resources%2Fsrc%2Ftest%2Fjava%2Fsample%2Fselion%2FSimpleDataDrivenWithSelectiveRowsTest.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE610kUF591Y__uvcaZC_F2Bpj-TA';return true;">SimpleDataDrivenWithSelectiveRowsTest.
For any further queries on SeLion data providers I would encourage you to post them here : <a href="https://groups.google.com/forum/#!forum/selion" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/forum/#!forum/selion';return true;" onclick="this.href='https://groups.google.com/forum/#!forum/selion';return true;">https://groups.google.com/forum/#!forum/selion
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" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;">http://wakened-cognition.blogspot.com/My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;">http://rationaleemotions.wordpress.com/
On Wed, Jun 8, 2016 at 4:39 PM, Mahender Tirumala <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="tzWeTDthAgAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">2mah...@...> wrote: iam getting same issue with your code, browsers are launching parallely, with out quitting any browser On Wednesday, June 8, 2016 at 4:24:37 PM UTC+5:30, Mahender Tirumala wrote: HI Krishnan, Thank you, So from your code i understand dataprovider=dp works for only one class, if we want to write another class we need to create one more dp. also can you please send xl logic if you have?...please help...actually iam struggling alot to map xl to the dataProvider thanks Mahender On Wednesday, June 8, 2016 at 6:55:03 AM UTC+5:30, Krishnan wrote: There are some issues with your code. I don't think your code is data driven in nature.
That said and done, the below sample should help you get started. Its a factory powered by a data provider. The data provider provides values to the factory and the factory uses those values to instantiate your test class objects. All the @Test annotated methods in each of your test class instance work with the parameters that were passed to its constructor via the Factory.
public class DataDrivenSample { private RemoteWebDriver driver; private int a; private String b; private boolean c;
@Factory (dataProvider = "dp") public DataDrivenSample(Integer a, String b, Boolean c) { this.a = a; this.b = b; this.c = c; }
@BeforeClass public void setup() { driver = new ChromeDriver(); }
@AfterClass public void cleanup() { driver.quit(); }
@Test public void testMethod() { driver.get("<a href="http://www.google.com" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com';return true;" onclick="this.href='http://www.google.com';return true;">http://www.google.com"); System.err.println("accessing the passed values "); System.err.println("a = " + a); System.err.println("b = " + b); System.err.println("c = " + c);
}
@Test public void anotherTestMethod() { //Here is another test method that works on the parameters passed. System.err.println("accessing the passed values "); System.err.println("a = " + a); System.err.println("b = " + b); System.err.println("c = " + c); }
@DataProvider (name = "dp") public static Object[][] getData(ITestContext ctx) { //Just showing how to access the parameters from the TestNG suite xml file. //You can use this incase, you want to have your .xls file also passed via the suite file. System.err.println("test name " + ctx.getName()); //Replace the below logic with your .xls reading logic. return new Object[][] { {10, "TestNG", true}, {20, "Selenium", false} }; } }
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/" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;">http://wakened-cognition.blogspot.com/My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;">http://rationaleemotions.wordpress.com/
On Tue, Jun 7, 2016 at 3:02 PM, Mahender Tirumala <[hidden email]> wrote: me (Mahender Tirumala change) | 11:39 AM (3 hours ago) |
--
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 <a href="https://groups.google.com/group/testng-users" rel="nofollow" target="_blank" onmousedown="this.href='https://groups.google.com/group/testng-users';return true;" onclick="this.href='https://groups.google.com/group/testng-users';return true;">https://groups.google.com/group/testng-users.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="tzWeTDthAgAJ" rel="nofollow" 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="tzWeTDthAgAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">testng...@....
Visit this group at <a href="https://groups.google.com/group/testng-users" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/group/testng-users';return true;" onclick="this.href='https://groups.google.com/group/testng-users';return true;">https://groups.google.com/group/testng-users.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" 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 https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
|
|
Hi Krishnan,
I use TestNG and restAssured for REST web services testing. I use dataProvider reading test data from xls files. Do you recommend using Selion to run a single test (one row from the test data file)? If not, what do you think is the best way to do it?
Thanks, Yanan On Wednesday, June 8, 2016 at 10:49:25 AM UTC-4, Krishnan wrote: iam getting same issue with your code, browsers are launching parallely, with out quitting any browser
That cannot be possible because I sent you the code after personally executing it. Make sure that all your annotations are from TestNG and you aren't using the @BeforeClass and @AfterClass from JUnit. That can be the only reason why you don't see the browser cleaning up properly. Thank you, So from your code i understand dataprovider=dp works for only one class, if we want to write another class we need to create one more dp. I dont quite understand what you are saying here. The data provider here provides parameters for the constructor so that TestNG may use those parameters to invoke the constructor and produce test class instances. So if you want another test class with a different type of a constructor then obviously yes you would need to write up a new data provider.
also can you please send xl logic if you have?...please help...actually iam struggling alot to map xl to the dataProvider
No I don't have any ready made logic available at my hand. But if you would like to, then you could perhaps take a look at the data providers library that <a href="http://selion.io" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fselion.io\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFvnXruvo1sPwT7hjMu3m5jeFLG4A';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fselion.io\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFvnXruvo1sPwT7hjMu3m5jeFLG4A';return true;">SeLion provides and see if you can leverage that.
To start with you would need to add a dependency on the Selion data provider
<dependency> <groupId>com.paypal.selion</groupId> <artifactId>SeLion-DataProviders</artifactId> <version>1.0.0</version> </dependency>
You can then look at one of the unit tests to understand how to work with the different variants of data providers that SeLion provides by looking at the unit tests <a href="https://github.com/paypal/SeLion/tree/develop/dataproviders/src/test/java/com/paypal/selion/platform/dataprovider" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpaypal%2FSeLion%2Ftree%2Fdevelop%2Fdataproviders%2Fsrc%2Ftest%2Fjava%2Fcom%2Fpaypal%2Fselion%2Fplatform%2Fdataprovider\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEvhrTRiX9op8RNrkkSt6a5cx4vWg';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpaypal%2FSeLion%2Ftree%2Fdevelop%2Fdataproviders%2Fsrc%2Ftest%2Fjava%2Fcom%2Fpaypal%2Fselion%2Fplatform%2Fdataprovider\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEvhrTRiX9op8RNrkkSt6a5cx4vWg';return true;">here (or) looking at the samples from the SeLion archetype <a href="https://github.com/paypal/SeLion/blob/develop/archetype/src/main/resources/archetype-resources/src/test/java/sample/selion/SimpleDataDrivenTest.java" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpaypal%2FSeLion%2Fblob%2Fdevelop%2Farchetype%2Fsrc%2Fmain%2Fresources%2Farchetype-resources%2Fsrc%2Ftest%2Fjava%2Fsample%2Fselion%2FSimpleDataDrivenTest.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG8JeibcXNqAAwpD3yIrcXwdZosog';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpaypal%2FSeLion%2Fblob%2Fdevelop%2Farchetype%2Fsrc%2Fmain%2Fresources%2Farchetype-resources%2Fsrc%2Ftest%2Fjava%2Fsample%2Fselion%2FSimpleDataDrivenTest.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG8JeibcXNqAAwpD3yIrcXwdZosog';return true;">SimpleDataDrivenTest and <a href="https://github.com/paypal/SeLion/blob/develop/archetype/src/main/resources/archetype-resources/src/test/java/sample/selion/SimpleDataDrivenWithSelectiveRowsTest.java" target="_blank" rel="nofollow" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpaypal%2FSeLion%2Fblob%2Fdevelop%2Farchetype%2Fsrc%2Fmain%2Fresources%2Farchetype-resources%2Fsrc%2Ftest%2Fjava%2Fsample%2Fselion%2FSimpleDataDrivenWithSelectiveRowsTest.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE610kUF591Y__uvcaZC_F2Bpj-TA';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpaypal%2FSeLion%2Fblob%2Fdevelop%2Farchetype%2Fsrc%2Fmain%2Fresources%2Farchetype-resources%2Fsrc%2Ftest%2Fjava%2Fsample%2Fselion%2FSimpleDataDrivenWithSelectiveRowsTest.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE610kUF591Y__uvcaZC_F2Bpj-TA';return true;">SimpleDataDrivenWithSelectiveRowsTest.
For any further queries on SeLion data providers I would encourage you to post them here : <a href="https://groups.google.com/forum/#!forum/selion" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/forum/#!forum/selion';return true;" onclick="this.href='https://groups.google.com/forum/#!forum/selion';return true;">https://groups.google.com/forum/#!forum/selion
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" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;">http://wakened-cognition.blogspot.com/My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;">http://rationaleemotions.wordpress.com/
On Wed, Jun 8, 2016 at 4:39 PM, Mahender Tirumala <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="tzWeTDthAgAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">2mah...@...> wrote: iam getting same issue with your code, browsers are launching parallely, with out quitting any browser On Wednesday, June 8, 2016 at 4:24:37 PM UTC+5:30, Mahender Tirumala wrote: HI Krishnan, Thank you, So from your code i understand dataprovider=dp works for only one class, if we want to write another class we need to create one more dp. also can you please send xl logic if you have?...please help...actually iam struggling alot to map xl to the dataProvider thanks Mahender On Wednesday, June 8, 2016 at 6:55:03 AM UTC+5:30, Krishnan wrote: There are some issues with your code. I don't think your code is data driven in nature.
That said and done, the below sample should help you get started. Its a factory powered by a data provider. The data provider provides values to the factory and the factory uses those values to instantiate your test class objects. All the @Test annotated methods in each of your test class instance work with the parameters that were passed to its constructor via the Factory.
public class DataDrivenSample { private RemoteWebDriver driver; private int a; private String b; private boolean c;
@Factory (dataProvider = "dp") public DataDrivenSample(Integer a, String b, Boolean c) { this.a = a; this.b = b; this.c = c; }
@BeforeClass public void setup() { driver = new ChromeDriver(); }
@AfterClass public void cleanup() { driver.quit(); }
@Test public void testMethod() { driver.get("<a href="http://www.google.com" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com';return true;" onclick="this.href='http://www.google.com';return true;">http://www.google.com"); System.err.println("accessing the passed values "); System.err.println("a = " + a); System.err.println("b = " + b); System.err.println("c = " + c);
}
@Test public void anotherTestMethod() { //Here is another test method that works on the parameters passed. System.err.println("accessing the passed values "); System.err.println("a = " + a); System.err.println("b = " + b); System.err.println("c = " + c); }
@DataProvider (name = "dp") public static Object[][] getData(ITestContext ctx) { //Just showing how to access the parameters from the TestNG suite xml file. //You can use this incase, you want to have your .xls file also passed via the suite file. System.err.println("test name " + ctx.getName()); //Replace the below logic with your .xls reading logic. return new Object[][] { {10, "TestNG", true}, {20, "Selenium", false} }; } }
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/" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;">http://wakened-cognition.blogspot.com/My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;">http://rationaleemotions.wordpress.com/
On Tue, Jun 7, 2016 at 3:02 PM, Mahender Tirumala <[hidden email]> wrote: me (Mahender Tirumala change) | 11:39 AM (3 hours ago) |
--
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 <a href="https://groups.google.com/group/testng-users" rel="nofollow" target="_blank" onmousedown="this.href='https://groups.google.com/group/testng-users';return true;" onclick="this.href='https://groups.google.com/group/testng-users';return true;">https://groups.google.com/group/testng-users.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="tzWeTDthAgAJ" rel="nofollow" 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="tzWeTDthAgAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">testng...@....
Visit this group at <a href="https://groups.google.com/group/testng-users" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/group/testng-users';return true;" onclick="this.href='https://groups.google.com/group/testng-users';return true;">https://groups.google.com/group/testng-users.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" 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 https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
|
|
Hi,
Please refer to complete Step-By-Step guide for implementing Data provider with examples. http://total-qa.com/testng-introduction/testng-feature-dataprovider-data-driven-framework/
Thanks, total-qa.com On Friday, February 10, 2017 at 5:09:06 AM UTC+5:30, Yanan wrote: Hi Krishnan, I resolved the problem myself.
Thanks. On Tue, Jan 31, 2017 at 10:46 PM, ⇜Krishnan Mahadevan⇝ <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="40bPaUH0BAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">krishnan.ma...@gmail.com> wrote: Yanan, Yes you should be able to use SeLion's data provider for this. Have you tried using it ? If yes, what issues do you face ?
I would also recommend that you post SeLion's specific questions in this forum for better traction : <a href="https://groups.google.com/forum/#!forum/selion" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/forum/#!forum/selion';return true;" onclick="this.href='https://groups.google.com/forum/#!forum/selion';return true;">https://groups.google.com/forum/#!forum/selion
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" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;">http://wakened-cognition.blogspot.com/My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;">http://rationaleemotions.wordpress.com/
On Tue, Jan 31, 2017 at 8:01 PM, Yanan <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="40bPaUH0BAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">bao...@...> wrote: Hi Krishnan,
I use TestNG and restAssured for REST web services testing. I use dataProvider reading test data from xls files. Do you recommend using Selion to run a single test (one row from the test data file)? If not, what do you think is the best way to do it?
Thanks, Yanan On Wednesday, June 8, 2016 at 10:49:25 AM UTC-4, Krishnan wrote: iam getting same issue with your code, browsers are launching parallely, with out quitting any browser
That cannot be possible because I sent you the code after personally executing it. Make sure that all your annotations are from TestNG and you aren't using the @BeforeClass and @AfterClass from JUnit. That can be the only reason why you don't see the browser cleaning up properly. Thank you, So from your code i understand dataprovider=dp works for only one class, if we want to write another class we need to create one more dp. I dont quite understand what you are saying here. The data provider here provides parameters for the constructor so that TestNG may use those parameters to invoke the constructor and produce test class instances. So if you want another test class with a different type of a constructor then obviously yes you would need to write up a new data provider.
also can you please send xl logic if you have?...please help...actually iam struggling alot to map xl to the dataProvider
No I don't have any ready made logic available at my hand. But if you would like to, then you could perhaps take a look at the data providers library that <a href="http://selion.io" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fselion.io\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFvnXruvo1sPwT7hjMu3m5jeFLG4A';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fselion.io\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFvnXruvo1sPwT7hjMu3m5jeFLG4A';return true;">SeLion provides and see if you can leverage that.
To start with you would need to add a dependency on the Selion data provider
<dependency> <groupId>com.paypal.selion</groupId> <artifactId>SeLion-DataProviders</artifactId> <version>1.0.0</version> </dependency>
You can then look at one of the unit tests to understand how to work with the different variants of data providers that SeLion provides by looking at the unit tests <a href="https://github.com/paypal/SeLion/tree/develop/dataproviders/src/test/java/com/paypal/selion/platform/dataprovider" rel="nofollow" target="_blank" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpaypal%2FSeLion%2Ftree%2Fdevelop%2Fdataproviders%2Fsrc%2Ftest%2Fjava%2Fcom%2Fpaypal%2Fselion%2Fplatform%2Fdataprovider\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEvhrTRiX9op8RNrkkSt6a5cx4vWg';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpaypal%2FSeLion%2Ftree%2Fdevelop%2Fdataproviders%2Fsrc%2Ftest%2Fjava%2Fcom%2Fpaypal%2Fselion%2Fplatform%2Fdataprovider\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEvhrTRiX9op8RNrkkSt6a5cx4vWg';return true;">here (or) looking at the samples from the SeLion archetype <a href="https://github.com/paypal/SeLion/blob/develop/archetype/src/main/resources/archetype-resources/src/test/java/sample/selion/SimpleDataDrivenTest.java" rel="nofollow" target="_blank" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpaypal%2FSeLion%2Fblob%2Fdevelop%2Farchetype%2Fsrc%2Fmain%2Fresources%2Farchetype-resources%2Fsrc%2Ftest%2Fjava%2Fsample%2Fselion%2FSimpleDataDrivenTest.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG8JeibcXNqAAwpD3yIrcXwdZosog';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpaypal%2FSeLion%2Fblob%2Fdevelop%2Farchetype%2Fsrc%2Fmain%2Fresources%2Farchetype-resources%2Fsrc%2Ftest%2Fjava%2Fsample%2Fselion%2FSimpleDataDrivenTest.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNG8JeibcXNqAAwpD3yIrcXwdZosog';return true;">SimpleDataDrivenTest and <a href="https://github.com/paypal/SeLion/blob/develop/archetype/src/main/resources/archetype-resources/src/test/java/sample/selion/SimpleDataDrivenWithSelectiveRowsTest.java" rel="nofollow" target="_blank" onmousedown="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpaypal%2FSeLion%2Fblob%2Fdevelop%2Farchetype%2Fsrc%2Fmain%2Fresources%2Farchetype-resources%2Fsrc%2Ftest%2Fjava%2Fsample%2Fselion%2FSimpleDataDrivenWithSelectiveRowsTest.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE610kUF591Y__uvcaZC_F2Bpj-TA';return true;" onclick="this.href='https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fpaypal%2FSeLion%2Fblob%2Fdevelop%2Farchetype%2Fsrc%2Fmain%2Fresources%2Farchetype-resources%2Fsrc%2Ftest%2Fjava%2Fsample%2Fselion%2FSimpleDataDrivenWithSelectiveRowsTest.java\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNE610kUF591Y__uvcaZC_F2Bpj-TA';return true;">SimpleDataDrivenWithSelectiveRowsTest.
For any further queries on SeLion data providers I would encourage you to post them here : <a href="https://groups.google.com/forum/#!forum/selion" rel="nofollow" target="_blank" onmousedown="this.href='https://groups.google.com/forum/#!forum/selion';return true;" onclick="this.href='https://groups.google.com/forum/#!forum/selion';return true;">https://groups.google.com/forum/#!forum/selion
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/" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;">http://wakened-cognition.blogspot.com/My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;">http://rationaleemotions.wordpress.com/
On Wed, Jun 8, 2016 at 4:39 PM, Mahender Tirumala <[hidden email]> wrote: iam getting same issue with your code, browsers are launching parallely, with out quitting any browser On Wednesday, June 8, 2016 at 4:24:37 PM UTC+5:30, Mahender Tirumala wrote: HI Krishnan, Thank you, So from your code i understand dataprovider=dp works for only one class, if we want to write another class we need to create one more dp. also can you please send xl logic if you have?...please help...actually iam struggling alot to map xl to the dataProvider thanks Mahender On Wednesday, June 8, 2016 at 6:55:03 AM UTC+5:30, Krishnan wrote: There are some issues with your code. I don't think your code is data driven in nature.
That said and done, the below sample should help you get started. Its a factory powered by a data provider. The data provider provides values to the factory and the factory uses those values to instantiate your test class objects. All the @Test annotated methods in each of your test class instance work with the parameters that were passed to its constructor via the Factory.
public class DataDrivenSample { private RemoteWebDriver driver; private int a; private String b; private boolean c;
@Factory (dataProvider = "dp") public DataDrivenSample(Integer a, String b, Boolean c) { this.a = a; this.b = b; this.c = c; }
@BeforeClass public void setup() { driver = new ChromeDriver(); }
@AfterClass public void cleanup() { driver.quit(); }
@Test public void testMethod() { driver.get("<a href="http://www.google.com" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com';return true;" onclick="this.href='http://www.google.com';return true;">http://www.google.com"); System.err.println("accessing the passed values "); System.err.println("a = " + a); System.err.println("b = " + b); System.err.println("c = " + c);
}
@Test public void anotherTestMethod() { //Here is another test method that works on the parameters passed. System.err.println("accessing the passed values "); System.err.println("a = " + a); System.err.println("b = " + b); System.err.println("c = " + c); }
@DataProvider (name = "dp") public static Object[][] getData(ITestContext ctx) { //Just showing how to access the parameters from the TestNG suite xml file. //You can use this incase, you want to have your .xls file also passed via the suite file. System.err.println("test name " + ctx.getName()); //Replace the below logic with your .xls reading logic. return new Object[][] { {10, "TestNG", true}, {20, "Selenium", false} }; } }
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/" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ';return true;">http://wakened-cognition.blogspot.com/My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" rel="nofollow" target="_blank" onmousedown="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;" onclick="this.href='http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ';return true;">http://rationaleemotions.wordpress.com/
On Tue, Jun 7, 2016 at 3:02 PM, Mahender Tirumala <[hidden email]> wrote: me (Mahender Tirumala change) | 11:39 AM (3 hours ago) |
--
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 <a href="https://groups.google.com/group/testng-users" rel="nofollow" target="_blank" onmousedown="this.href='https://groups.google.com/group/testng-users';return true;" onclick="this.href='https://groups.google.com/group/testng-users';return true;">https://groups.google.com/group/testng-users.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" 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 testng-users...@googlegroups.com.
To post to this group, send email to [hidden email].
Visit this group at <a href="https://groups.google.com/group/testng-users" rel="nofollow" target="_blank" onmousedown="this.href='https://groups.google.com/group/testng-users';return true;" onclick="this.href='https://groups.google.com/group/testng-users';return true;">https://groups.google.com/ group/testng-users.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="40bPaUH0BAAJ" rel="nofollow" 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="40bPaUH0BAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">testng...@....
Visit this group at <a href="https://groups.google.com/group/testng-users" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/group/testng-users';return true;" onclick="this.href='https://groups.google.com/group/testng-users';return true;">https://groups.google.com/group/testng-users.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" 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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="40bPaUH0BAAJ" rel="nofollow" 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="40bPaUH0BAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">testng...@....
Visit this group at <a href="https://groups.google.com/group/testng-users" target="_blank" rel="nofollow" onmousedown="this.href='https://groups.google.com/group/testng-users';return true;" onclick="this.href='https://groups.google.com/group/testng-users';return true;">https://groups.google.com/group/testng-users.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" 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 https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
|
|