@Test public static void checktotalportstate() throws InterruptedException, IOException { getXpath("gettotalportstatexpath").click(); String ttps = getXpath("totalportstatettureadyxpath").getText(); if (ttps.equalsIgnoreCase("TTUReady")) { try { TakeScreenShot.captureScreenshot( "C://selenium//CheckPortStatus_" + System.currentTimeMillis() + ".jpg"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println("---Total port state is---" + ttps); getXpath("ttpsdonebuttonxpath").click(); Thread.sleep(8000); TestUtil.windowParent(); } else { System.out.println("---some issue found ,taking the screen shot"); try { TakeScreenShot.captureScreenshot( "C://selenium//CheckPortStatus_" + System.currentTimeMillis() + ".jpg"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }
@Test public static void ipcdownload() throws Exception { System.out.println("---clicking on ipcdownload link..."); getXpath("Ipcdownloadxpath").click(); Thread.sleep(10000); try { try { TakeScreenShot.captureScreenshot( "C://selenium//IPCDownload_" + System.currentTimeMillis() + ".jpg"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } System.out.println("---clicking on ipcdownload button"); explicitWaitclick("Ipcdownloadbuttonxpath"); explicitWaitclick("Ipcdownloaddonexpath"); System.out.println("Completed------ IPC Download"); logs.debug("Completed------ IPC Download"); Thread.sleep(10000); } catch (Exception e) { System.out.println("---some issue found,taking the screen shot..."); TakeScreenShot.captureScreenshot( "C://selenium//IPCDownload_" + System.currentTimeMillis() + ".jpg"); System.out.println("Failed------ IPC Download"); logs.debug("Failed------ IPC Download"); } TestUtil.windowParent(); }
@Test public static void nad() throws InterruptedException, IOException { System.out.println("Started------ NAD completion"); logs.debug("Started------ NAD completion"); // Complete the NAD try { explicitWaitclick("NADCompletexpath"); explicitWaitclick("NADCompleteOrderbuttonxpath"); try { TakeScreenShot.captureScreenshot( "C://selenium//NadComplete_" + System.currentTimeMillis() + ".jpg"); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } explicitWaitclick("NADCompleteDonexpath"); logs.debug("Completed------ NAD completion"); // Checking the status till the NAD gets closed. System.out.println("Completed------ NAD completion"); } catch (Exception e) { System.out.println("Exception happened while doing NAD and Taking Screenshots"); logs.debug("Failed------ NAD completion"); TakeScreenShot.captureScreenshot( "C://selenium//NadComplete_" + System.currentTimeMillis() + ".jpg"); } // String nads=getXpath("NADstatus").getText(); // // for(int j=1;j<=20;j++){ // if(!nads.equalsIgnoreCase("CLOSED")) // { // System.out.println("---NADstatus is"+"---"+nads+"... Please wait for sometime // until it get closed"); // logs.debug("---NADstatus is"+"---"+nads+"... Please wait for sometime until it get // closed"); // Thread.sleep(20000); // driver.navigate().refresh(); // } // else // { // try { // TakeScreenShot.captureScreenshot("C://selenium//applyorderpass_"+ // System.currentTimeMillis()+".jpg"); // } catch (Exception e) { // // TODO Auto-generated catch block // e.printStackTrace(); // } // System.out.println("---Port NADstatus is"+"---"+ nads); // getXpath("portscreencancelxpath").click(); // break; // } // TestUtil.windowParent(); // // } }