// check if the suite is runnable @BeforeSuite public void checkSuiteSkip() throws Exception { initialize(); APP_LOGS.debug("Checking Runmode of Shop Suite"); if (!TestUtil.isSuiteRunnable(suiteXls, "Shop Suite")) { APP_LOGS.debug("Skipped Shop Suite as the runmode was set to NO"); throw new SkipException("RUnmode of Shop Suite set to no. So Skipping all tests in Suite A"); } }
// check if the suite execution has to be skipped or not @BeforeSuite public void checkSuiteSkip() throws IOException { initialize(); APP_LOGS.debug("Checking Run mode of Suite C"); if (!TestUtil.isSuiteRunnable(suiteXls, "C Suite")) { APP_LOGS.debug("Skipped because run mode was set to NO"); throw new SkipException("Runmode of Suite C set to no. So Skipping al test in Suite C"); } }
@BeforeTest public void checkTestSkip() { if (!TestUtil.isTestCaseRunnable( suiteHomePageXls, this.getClass() .getSimpleName())) // suites XlSX name is passed by the object from base class. and name // of the TestCase. // Instead of passing TestCase name,using this "this.getClass().getSimpleName()" to get the name // of the class as the name of the class is the TestCase name. { // writing the Skip in the Xls file for the test case TestUtil.reportDataSetResult( suiteHomePageXls, "Test Cases", TestUtil.getRowNum(suiteHomePageXls, this.getClass().getSimpleName()), "Skip"); APP_LOGS.debug("skipping test HomePage_TC4 as the runmode is NO"); throw new SkipException( "Skipping this testcase as the runmode is NO for this testcase : Payment_TC2"); } // Load the RunModes of the Test runmodes = TestUtil.getDataSetRunmodes(suiteHomePageXls, this.getClass().getSimpleName()); }
@BeforeTest public void checkTestSkip() { if (!TestUtil.isTestCaseRunnable(suiteHSHxls, this.getClass().getSimpleName())) { APP_LOGS.debug("Skipping Test Case as runmode is set to NO"); throw new SkipException("Skipping Test Case as runmode is set to NO"); } // Load the runmodes of test data runmodes = TestUtil.getDataSetRunmodes(suiteHSHxls, this.getClass().getSimpleName()); }
@BeforeTest public void checkTestSkip() { if (!TestUtil.isTestCaseRunnable(suiteCXls, this.getClass().getSimpleName())) { APP_LOGS.debug( "Skipping testcase as test" + this.getClass().getSimpleName() + " case runmode set to no in test case"); // logs throw new SkipException("Test Case skipped as runmode set to no"); // reports } }
@Test(dataProvider = "getTestData") public void testCaseHomeEquity(String col1) { // test the runmode of current dataset count++; if (!runmodes[count].equalsIgnoreCase("Y")) { skip = true; throw new SkipException("Runmode of test data is set to NO ," + count); } APP_LOGS.debug("Executing the Test Case HomeEquity "); APP_LOGS.debug(col1); openBrowser(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); driver.manage().deleteAllCookies(); driver.navigate().to(col1); driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); WebElement parentelement = driver.findElement(By.xpath("//div[@class='MFC_topwhite']")); List<WebElement> first = parentelement.findElements(By.xpath("//div[starts-with(@class,'MFC_radios')]")); // System.out.println(first.size()); WebElement Select = first.get(0); // System.out.println(Select.isDisplayed()); WebElement HOMEQU = Select.findElement(By.xpath("//*[@value='HOMEEQ']")); HOMEQU.sendKeys(Keys.SPACE); poorListing("HomeEquity"); // Verify Poor driver.findElement(By.xpath("//*[@id='mfcli_00']/a")).click(); driver.manage().timeouts().implicitlyWait(4, TimeUnit.SECONDS); poorListing("Poor"); // Verify fair driver.findElement(By.xpath("//*[@id='mfcli_01']/a")).click(); driver.manage().timeouts().implicitlyWait(4, TimeUnit.SECONDS); poorListing("fair"); driver.quit(); }
@Test(dataProvider = "getTestData") public void newArrivals() throws InterruptedException { try { count++; // test the Runmode of the current Dataset if (!runmodes[count].equalsIgnoreCase("Y")) { skip = true; System.out.println("skipping a" + count); throw new SkipException("Run mode for the test set data is Set to NO" + count); } // ************************** // testing code which can be Selenium /* APP_LOGS.debug("entering the test case A1"); //Productpurchase.purchaseItem(CONFIG.getProperty("testuser"),CONFIG.getProperty("testuserpassword"),CONFIG.getProperty("SearchItem")); System.out.println(cardno); System.out.println(EXmonth); System.out.println(CVV); System.out.println(EXyear); CreditCard cc = new CreditCard(); cc.creditcardVerification(cardno,EXmonth,EXyear,CVV,name); APP_LOGS.debug("Executed the test case for the Payment link test (For credit card)"); System.out.println("test case a"); */ // *********************************************** // this method is used to verify the HOme page option APP_LOGS.debug("verifying the Home Page Test Case 3"); APP_LOGS.debug("Verifying the TOP SELLERS on HOme page"); // Checking the New Arrivals header. WebElement topsellers = driver.findElement(By.xpath(".//*[@id='home']/div[2]/div[2]/div[10]")); String New_arrivals_String = topsellers.findElement(By.tagName("h1")).getText(); System.out.println(New_arrivals_String); Assert.assertEquals(New_arrivals_String, "NEW ARRIVALS"); checkboxes( ".//*[@id='home']/div[2]/div[2]/div[11]/ul/li[2]/div", ".//*[@id='home']/div[2]/div[2]/div[11]/ul/li[2]/div/h3", ".//*[@id='home']/div[2]/div[2]/div[11]/ul/li[2]/div/div[3]"); checkboxes( ".//*[@id='home']/div[2]/div[2]/div[11]/ul/li[3]/div", ".//*[@id='home']/div[2]/div[2]/div[11]/ul/li[3]/div/h3", ".//*[@id='home']/div[2]/div[2]/div[11]/ul/li[3]/div/div[3]"); checkboxes( ".//*[@id='home']/div[2]/div[2]/div[11]/ul/li[4]/div", ".//*[@id='home']/div[2]/div[2]/div[11]/ul/li[4]/div/h3", ".//*[@id='home']/div[2]/div[2]/div[11]/ul/li[4]/div/div[3]"); // *********************************************** } catch (Throwable t) { APP_LOGS.debug("*******Execution for the HomePage_TC4 is falied*****"); t.getMessage(); ErrorUtil.addVerificationFailure(t, this.getClass().getSimpleName()); fail = true; return; } }