@Test( dataProvider = "Valid_edit", dataProviderClass = Dataprovider_invoice.DataProvider_edit.class, groups = {"invoice"}) public void Valid_edit( String TC_ID, String Order, String invoice_name, String desp, String Exp_Res) throws IOException { String uname = c1.Reading_Properties("uname"); String pwd = c1.Reading_Properties("pwd"); log.info("Executing the testcase " + TC_ID + " Order of " + Order); // System.out.println("hi"); initBrowsersession1(); Pageobject_edit lpob = new Pageobject_edit(browser); lpob.Commonprocessinvoice(uname, pwd, TC_ID, invoice_name, desp); // , Pwd); String Actual_Res = lpob.Valid_edit(); sAssert.assertEquals(Exp_Res, Actual_Res); if (Actual_Res.equals(Exp_Res)) { log.info("Passed as Expected msg was Valid"); } else { log.info("Failed as Expected msg was " + Exp_Res + "Actual msg was " + Actual_Res); sAssert.fail("Failed as Expected msg was " + Exp_Res + "Actual msg was " + Actual_Res); } tearDown(); sAssert.assertAll(); log.info("******************************************"); }
@Test( dataProvider = "Valid_mul_item_cat_del", dataProviderClass = Dataprovider_item_cat.DataProvider_del.class, groups = {"branch"}) public void Valid_mul_item_cat_del(String TC_ID, String Order, String Exp_Res) throws IOException, InterruptedException { String uname = c1.Reading_Properties("uname"); String pwd = c1.Reading_Properties("pwd"); log.info("Executing the testcase " + TC_ID + " Order of " + Order); // System.out.println("hi"); initBrowsersession1(); Pageobject_del lpob = new Pageobject_del(browser); lpob.Commonprocess_item_cat_del(uname, pwd); String Actual_Res = lpob.Valid_mul_item_cat_del(); sAssert.assertEquals(Exp_Res, Actual_Res); if (Actual_Res.equals(Exp_Res)) { log.info("Passed as Expected msg was Valid"); } else { log.info("Failed as Expected msg was " + Exp_Res + "Actual msg was " + Actual_Res); sAssert.fail("Failed as Expected msg was " + Exp_Res + "Actual msg was " + Actual_Res); } tearDown(); sAssert.assertAll(); log.info("******************************************"); }
@Test( dataProvider = "Invalid_delete_blnk", dataProviderClass = Dataprovider_item_cat.DataProvider_del.class, groups = {"branch"}) public void Invalid_delete_blnk(String TC_ID, String Order, String Exp_Res) throws IOException { String uname = c1.Reading_Properties("uname"); String pwd = c1.Reading_Properties("pwd"); int j = (int) Double.parseDouble(Order); for (int i = 0; i < j; i++) { // System.out.println(j); log.info("Executing the testcase " + TC_ID + " Order of " + Order); initBrowsersession1(); Pageobject_del lpob = new Pageobject_del(browser); lpob.Commonprocess_item_cat_del(uname, pwd); // ,curr_name);//, Pwd); String Actual_Res = lpob.Invalid_delete_blnk(); sAssert.assertEquals(Exp_Res, Actual_Res); if (Actual_Res.equals(Exp_Res)) { log.info("Passed as Expected msg was Valid"); } else { log.info("Failed as Expected msg was " + Exp_Res + "Actual msg was " + Actual_Res); sAssert.fail("Failed as Expected msg was " + Exp_Res + "Actual msg was " + Actual_Res); } tearDown(); sAssert.assertAll(); log.info("******************************************"); } }
@Test( dataProvider = "dp_Invalidskill", dataProviderClass = Dataprovider_Employ_skill.DataProvider_create.class, groups = {"employ_SkillSet"}) public void test_Invalidskill( String TC_ID, String Order, String skill_name, String desp, String Exp_Res) throws IOException { String uname = c1.Reading_Properties("uname"); String pwd = c1.Reading_Properties("pwd"); log.info("Executing the testcase " + TC_ID + " Order of " + Order); // System.out.println("hi"); initBrowsersession1(); Pageobject_create lpob = new Pageobject_create(browser); lpob.Commonprocessskill(uname, pwd, TC_ID, skill_name, desp); // , Pwd); String Actual_Res = lpob.getInvalidskillResult(); sAssert.assertEquals(Exp_Res, Actual_Res); if (Actual_Res.equals(Exp_Res)) { log.info("Passed as Expected msg was Valid"); } else { log.info("Failed as Expected msg was " + Exp_Res + "Actual msg was " + Actual_Res); sAssert.fail("Failed as Expected msg was " + Exp_Res + "Actual msg was " + Actual_Res); } tearDown(); sAssert.assertAll(); log.info("******************************************"); }
public void PerformanceTabTest() { Reporter.log("In to PerformanceTabTest"); logger.info("Switching to Performance Tab"); PerformanceTab.click(); logger.info("Fetching Performance Cycle duration"); logger.info(PerformanceCycle.getText()); logger.info("Fetching Performance Details"); List<WebElement> EmployeePerformanceDetails = driver.findElements(By.xpath(Constants.Employeedetaillistxpath)); for (int i = 0; i < EmployeePerformanceDetails.size(); i++) { logger.info(EmployeePerformanceDetails.get(i).getText()); System.out.println( "Employee Performance Details " + EmployeePerformanceDetails.get(i).getText()); } logger.info("Navigating user to Performance Review section"); s_assert.assertNotNull( EmployeePerformanceDetails.get(0).findElement(By.tagName("a")), "First employee not found"); EmployeePerformanceDetails.get(0).findElement(By.tagName("a")).click(); logger.info("Displaying Review Information"); logger.info(Section1.getText()); logger.info(Userinfo.getText()); logger.info(Section2.getText()); logger.info("Switching to Self Review Tab"); Selfreviewsection.click(); List<WebElement> THeader = driver.findElements(By.xpath(Constants.TableHeaderxpath)); for (int j = 0; j < THeader.size(); j++) { logger.info(THeader.get(j).getText()); System.out.println("Printing table header " + THeader.get(j).getText()); } List<WebElement> Ratings = driver.findElements(By.xpath(Constants.ActualTablexpath)); int count = Ratings.size(); for (int k = 0; k < Ratings.size(); k++) { logger.info(Ratings.get(k).getText()); System.out.println("Printing real ratings " + Ratings.get(k).getText()); } if (count == 0) { s_assert.fail("User does not have any ratings"); } s_assert.assertAll(); }