Guest User

Untitled

a guest
Jul 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.31 KB | None | 0 0
  1. String[][] vplmns = readVPLMN.getArrayData("Test_Data.xlsx","VPLMNS");
  2. Object[][] testObjArray = ExcelUtils.getTableArray("Test_Data.xlsx","Sheet2");
  3.  
  4. @Test(priority=2)
  5. public void createCampaignNew() throws Exception{
  6.  
  7. String[][] cars = readVPLMN.getArrayData("Test_Data.xlsx","Cars");
  8. Object[][] ObjArray = ExcelUtils.getTableArray("Test_Data.xlsx","Personal_Deails");
  9. System.out.println("Running name test");
  10.  
  11. for (int i = 351; i<ObjArray.length; i++){
  12.  
  13.  
  14. Create_Person.setName((String) testObjArray[i][0]);
  15. Create_Person.setAge(Integer.parseInt((String) testObjArray[i][1]));
  16. Create_Person.setAddress((String) testObjArray[i][2]);
  17. Create_Person.setNumberOfCars(Integer.parseInt((String) testObjArray[i][3]));
  18. Create_Person.setType((String) testObjArray[i][4]);
  19. Create_Person.setVplmns(cars[i]);
  20. Create_Person.createCampaginNew();
  21.  
  22.  
  23.  
  24. }
  25.  
  26. public class FactoryTestSimple {
  27.  
  28. String i;
  29. String j;
  30.  
  31. @Factory(dataProvider = "userModeProvider")
  32. public FactoryTestSimple(String i,String j) {
  33. this.i = i;
  34. this.j = j;
  35. }
  36.  
  37. public String getI() {
  38. return i;
  39. }
  40.  
  41. public void setI(String i) {
  42. this.i = i;
  43. }
  44.  
  45. public String getJ() {
  46. return j;
  47. }
  48.  
  49. public void setJ(String j) {
  50. this.j = j;
  51. }
  52.  
  53.  
  54. @BeforeClass(alwaysRun = false)
  55. public void init() throws Exception {
  56. System.out.println("Before Running the class userMode is ");
  57. }
  58.  
  59.  
  60.  
  61. @Test(groups = "testFactory", description = "test method1")
  62. public void testMethod1() throws Exception {
  63. FactoryTestSimple s =new FactoryTestSimple("Input one","Input2");
  64. System.out.println("------");
  65. System.out.println(s.getI());
  66. System.out.println("------");
  67. System.out.println(s.getJ());
  68.  
  69. }
  70.  
  71.  
  72.  
  73. @DataProvider
  74. private static String [][] userModeProvider() {
  75.  
  76.  
  77. String[][] obj = new String[3][2];
  78.  
  79. for (int i=0;i<=3;i++) {
  80. for (int j=0;j<=2;j++){
  81.  
  82. }
  83.  
  84. }
  85. return obj;
  86. }
  87. }
  88.  
  89. @BeforeClass(alwaysRun = true)
  90. public void setup() throws MalformedURLException{
  91. FirefoxBinary binary = new FirefoxBinary(new File("C:\Program Files (x86)\Mozilla Firefox\firefox.exe"));
  92. FirefoxProfile profile = new FirefoxProfile();
  93. this.driver = new FirefoxDriver(binary, profile);
  94.  
  95. //this.driver = new FirefoxDriver();
  96. wait = new WebDriverWait(driver, 10);
  97. Create_Person = PageFactory.initElements(driver, Create_Person.class );
  98. }
  99.  
  100. @AfterClass(alwaysRun = true)
  101. public void teardown(){
  102. this.driver.quit();
  103. }
  104.  
  105. @Test(priority=1,retryAnalyzer=Retry.class)
  106. public void testSignUpMainPage(){
  107. Create_Person.loadPage();
  108.  
  109. }
  110.  
  111. @Test(priority=2)
  112. public void createCampaignNew() throws Exception{
  113.  
  114. String[][] cars = readVPLMN.getArrayData("Test_Data.xlsx","Cars");
  115. Object[][] ObjArray = ExcelUtils.getTableArray("Test_Data.xlsx","Personal_Deails");
  116. System.out.println("Running name test");
  117.  
  118. for (int i = 351; i<ObjArray.length; i++){
  119.  
  120.  
  121. Create_Person.setName((String) testObjArray[i][0]);
  122. Create_Person.setAge(Integer.parseInt((String) testObjArray[i][1]));
  123. Create_Person.setAddress((String) testObjArray[i][2]);
  124. Create_Person.setNumberOfCars(Integer.parseInt((String) testObjArray[i][3]));
  125. Create_Person.setType((String) testObjArray[i][4]);
  126. Create_Person.setVplmns(cars[i]);
  127. Create_Person.createCampaginNew();
  128.  
  129.  
  130.  
  131. }
Add Comment
Please, Sign In to add comment