Example #1
0
  @Ignore
  @Test
  public void TestCase_00X() throws Exception {
    LogGenerator.addLog(Level.INFO, "Starting Test Case_00X");
    driver.get("http://myitlabgrader.com/HTML5/SIMFrame.html");
    synchronized (driver) {
      driver.wait(6000);
    }

    driver.findElement(By.id("viewallbutton")).click();
    driver.findElement(By.xpath("//div[@id='ViewAllDlg']/div/table/tbody/tr[5]/td[2]")).click();
    driver.findElement(By.xpath("(//button[@type='button'])[2]")).click();
    driver
        .findElement(By.xpath("//div[@class='excelWorkBook']/div/div/div[2]/ul[3]/li[2]/div"))
        .click();

    ((JavascriptExecutor) driver)
        .executeScript("$('div#12_selectionBorder1.selectionBorderDiv').dblclick();");
    //
    // ((JavascriptExecutor)driver).executeScript("$('div#12_selectionBorder1.selectionBorderDiv').focus();")  ;

    driver.findElement(By.xpath("//*[@id='12_editableDiv1']/div")).sendKeys("Semester 1");
    //
    //	driver.findElement(By.xpath("//div[@class='excelWorkBook']/div/div/div[2]/ul[3]/li[4]/div")).click();

    driver.findElement(By.xpath("//*[@id='12_editableDiv1']/div")).sendKeys(Keys.RETURN);

    //					 ((JavascriptExecutor)driver).executeScript("$('div#12_editableDiv1').keypress(function
    // (e){if(e.keyCode == 13) });")  ;
    synchronized (driver) {
      driver.wait(6000);
    }
    String name = (new Exception().getStackTrace()[0].getMethodName());
    CaptureScreenshot.takeScreenshot(driver, name);
  }
Example #2
0
  @Ignore
  @Test
  public void TestCase_002() throws Exception {

    LogGenerator.addLog(Level.INFO, "Starting Test Case_002");

    driver.get("http://www.google.com");
    String name = (new Exception().getStackTrace()[0].getMethodName());
    CaptureScreenshot.takeScreenshot(driver, name);

    // Find the text input element by its name
    WebElement element = driver.findElement(By.name("q"));
    element.sendKeys("Junit");
    element.submit();

    synchronized (driver) {
      driver.wait(12000);
    }

    LogGenerator.addLog(Level.INFO, "my info message in test case 002");

    CaptureScreenshot.takeScreenshot(driver, name);
    // assertEquals("junit - Google Search", driver.getTitle());

    LogGenerator.addLog(Level.INFO, "Completing Test Case_002");
  }
Example #3
0
  //				@Ignore
  @Test
  public void testCase4() throws Exception {
    driver.get("http://myitlabgrader.com/HTML5/SIMFrame.html");
    synchronized (driver) {
      driver.wait(12000);
    }
    driver.findElement(By.id("viewallbutton")).click();
    driver.findElement(By.xpath("//div[@id='ViewAllDlg']/div/table/tbody/tr[2]/td[2]")).click();
    //					driver.findElement(By.cssSelector("td.DatagridSelectedTD")).click();
    driver.findElement(By.xpath("(//button[@type='button'])[2]")).click();
    synchronized (driver) {
      driver.wait(18000);
    }

    // Select Option A in Q#1

    driver.findElement(By.cssSelector("p.MsoNormal > span")).click();

    //					WebElement flash4 = driver.findElement(By.cssSelector("p.MsoNormal"));
    //
    //
    //
    //					JavascriptExecutor js4 = (JavascriptExecutor) driver;
    //					js4.executeScript( "document.getElementById('MsoNormal').select();", flash4);
    //					System.out.println("a"+flash4);
    //					synchronized (driver)
    {
      driver.wait(6000);
    }
    //
    //					driver.findElement(By.className("MsoNormal"));
    //
    //					String s = driver
    // .findElement(By.xpath("//div[@class='contentHolder']/p[@class='MsoNormal]")).getText().toString();
    //
    //					((JavascriptExecutor)driver).executeScript("$('p#MsoNormal').select();", s)  ;
    //					String flash =
    // driver.findElement(By.xpath("//div[@class='contentHolder']/p[@class='MsoNormal]")).getText().toString();
    //					JavascriptExecutor js = (JavascriptExecutor) driver;
    //					js.executeScript( "arguments[0].select();", flash);

    //					driver.findElement(By.cssSelector("contentHolder")).
    driver.findElement(By.cssSelector("#Bold > img.topMargin")).click();
    driver.findElement(By.xpath("//div[@id='Align Center']/img")).click();
    driver.findElement(By.id("ButtonDivFontTheme1")).click();
    driver.findElement(By.xpath("//div[@id='mcs_container_FontSize']/div/div/div/div[7]")).click();
  }
Example #4
0
  @Ignore
  @Test
  public void TestCase_005() throws Exception {

    LogGenerator.addLog(Level.INFO, "Starting Test Case_004");
    driver.get("http://myitlabgrader.com/HTML5/SIMFrame.html");
    // assertEquals("SIMs Demo", driver.getTitle());
    synchronized (driver) {
      driver.wait(12000);
    }
    System.out.println("test1");

    WebElement we = driver.findElement(By.cssSelector("#msword > img"));

    Actions action = new Actions(driver);
    action.doubleClick(we);
    action.perform();

    synchronized (driver) {
      driver.wait(12000);
    }

    String name = (new Exception().getStackTrace()[0].getMethodName());
    CaptureScreenshot.takeScreenshot(driver, name);

    synchronized (driver) {
      driver.wait(6000);
    }

    driver.findElement(By.cssSelector("span.ribbon-title.IDFileTab")).click();

    driver
        .findElement(By.xpath("html/body/div/div/div[3]/div/div/div/div/div[3]/div/div/div[4]"))
        .click();

    driver
        .findElement(
            By.xpath("/html/body/div/div/div[3]/div/div/div/div/div[3]/div/div[4]/div[3]/p[5]/img"))
        .click();

    we =
        driver.findElementByXPath(
            "/html/body/div/div/div[6]/div/div[2]/div/div/div[3]/div/div[2]/div[8]/img");

    action.doubleClick(we);
    action.perform();
  }