コード例 #1
0
  @Test
  public void exportTimesheetrough() throws IOException, InterruptedException {
    initialize();
    openBrowser();
    driver.get(CONFIG.getProperty("testSiteName"));
    login_Valid();

    // moving on to payslip for generating new payslip
    getObject("payBillX").click();
    getObject("timeSheetLinkX").click();
    getObject("exportTimesheetsX").click();

    // getObjectById("exportFormatTimesheetsId").sendKeys("");
    // for Export Timesheets Date Starting
    getObjectById("exportExportDateStartingId").click();
    Select monthForExportTimesheetstart = new Select(getObject("exportDateStartingMonthX"));
    monthForExportTimesheetstart.selectByVisibleText("Sep");
    Select yearForExportTimesheetstart = new Select(getObject("exportDateStartingYearX"));
    yearForExportTimesheetstart.selectByValue("2015");
    getObject("exportDateStartingSep3X").click();

    // For Timesheets Export Date Ending
    getObjectById("exportDateEndingId").click();
    Select monthForExportTimesheetend = new Select(getObject("exportDateEndingMonthX"));
    monthForExportTimesheetend.selectByVisibleText("Sep");
    Select yearForExportTimesheetend = new Select(getObject("exportDateEndingYearX"));
    yearForExportTimesheetend.selectByValue("2015");
    getObjectById("exportCandidateNameId").sendKeys("");
    getObject("exportDateStartingSep3X").click();
  }
 public static String Navigate(String objname, String data) {
   if (objname.equals("testsiteurl")) {
     Objvalue = CONFIG.getProperty("testsiteurl");
     return Spicejetpage.navigate(Objvalue, data);
   } else {
     Objvalue = OBJECTS.getProperty(objname);
     return Functionlibrary.navigate(Objvalue, data);
   }
 }
コード例 #3
0
  @Test
  public void dayBookRough() throws IOException, InterruptedException, AWTException {
    initialize();
    openBrowser();
    driver.get(CONFIG.getProperty("testSiteName"));
    login_Valid();

    Set<String> handles = driver.getWindowHandles();
    System.out.println(handles.size());
    Iterator<String> iterate = handles.iterator();
    Thread.sleep(5000);
    String dayBookNumber = getObjectValue("dayBookBullsEyeStatsX");
    Thread.sleep(4000);
    System.out.println(dayBookNumber);
    getObject("dayBookBullsEyeX").click();
    getObjectById("dayBookExportPdfId").click();
    handles = driver.getWindowHandles();
    iterate = handles.iterator();
    String firstWindow = iterate.next();
    String SecondWindow = iterate.next();

    driver.switchTo().window(SecondWindow);
    // waitForElementClickableId(15, "dayBookExportPdfDownloadId");

    System.out.println(driver.getCurrentUrl());
    driver.findElement(By.xpath("//*[@id='download']")).click();
    Thread.sleep(4000);

    Robot rob = new Robot();
    rob.keyPress(KeyEvent.VK_ENTER);
    rob.keyRelease(KeyEvent.VK_ENTER);
    rob.keyPress(KeyEvent.VK_ENTER);
    rob.keyRelease(KeyEvent.VK_ENTER);
    rob.keyPress(KeyEvent.VK_ENTER);
    rob.keyRelease(KeyEvent.VK_ENTER);
    rob.keyPress(KeyEvent.VK_ENTER);
    rob.keyRelease(KeyEvent.VK_ENTER);
    rob.keyPress(KeyEvent.VK_ENTER);
    rob.keyRelease(KeyEvent.VK_ENTER);
    rob.keyPress(KeyEvent.VK_ENTER);
    rob.keyRelease(KeyEvent.VK_ENTER);
    // getObjectById("dayBookExportPdfDownloadId").click();

  }
コード例 #4
0
  @Test
  public void candidateManualCheck() throws IOException, InterruptedException {
    initialize();
    openBrowser();
    driver.get(CONFIG.getProperty("testSiteName"));
    login_Valid();
    System.out.println("logged in Recruiters Portal");
    driver1 = new FirefoxDriver();
    driver1.get("https://staging.tempbuddy.com");
    // login_Candidate();
    driver1.findElement(By.id("username")).sendKeys("temp-buddy");
    driver1.findElement(By.id("password")).sendKeys("qwerty1");
    driver1.findElement(By.id("_submit")).click();
    System.out.println("in worker portal");
    Thread.sleep(3000);
    driver1.findElement(By.xpath("//*[@id='checkin-button']/div/span")).click();
    Thread.sleep(10000);
    driver1.findElement(By.xpath("//*[@id='checkin-button']/div/span")).click();
    Thread.sleep(5000);
    driver1.close();
    System.out.println("closed driver1");
    getObject("clientsLinkx").click();
    // getObject("addNewClientX").click();
    // Thread.sleep(5000);
    driver.quit();
    System.out.println("closed driver");

    /*Set<String> windows = driver.getWindowHandles();
    String recruiterHandle = driver.getWindowHandle();

    //opening another window using javascript
    ((JavascriptExecutor)driver).executeScript("window.open();");
    Set<String> window2 = driver.getWindowHandles();
    window2.removeAll(windows);
    String workerHandle = (String) window2.toArray()[0];
    driver.switchTo().window(workerHandle);
    driver.get("https://staging.tempbuddy.com");
    login_Candidate();
    System.out.println("in worker portal");
    driver.switchTo().window(recruiterHandle);
    System.out.println("back on recruiter portal");*/

  }
コード例 #5
0
  public LandingPage doLogin(String userName, String password) {

    try {
      Assert.assertEquals(
          "XXXWelcome to Facebook — Log in, sign up or learn more", driver.getTitle());
    } catch (Throwable t) {
      Page.takeScreenshot("Login.jpg"); // get screenshot on error, need to know how to delete
    }

    driver.get(CONFIG.getProperty("testSiteLadingPageURL"));
    System.out.println(isElementPresent("//input[@id='email']"));
    input("Email", userName);
    input("Password", password);
    click("Login_Button");

    if (isElementPresent("go_To_Profile")) {
      return new LandingPage();
    } else {
      return null;
    }
  }
コード例 #6
0
ファイル: TestEnd2End.java プロジェクト: MGQA/mgqaautomation
 @Override
 protected void initialize() {
   getURL(CONFIG.getProperty("sbgDesktopURL"));
 }
コード例 #7
0
ファイル: LoginTest.java プロジェクト: HadiAbu/DDF
 @org.junit.Test
 public void loginTest() {
   evDriver.get(CONFIG.getProperty("testSiteName"));
 }
コード例 #8
0
  public LandingPage doLogin() {

    return doLogin(CONFIG.getProperty("defaultUserName"), CONFIG.getProperty("defaultPassword"));
  }