예제 #1
0
 @Test
 public void testLoginMaster2() throws Exception {
   driver.get(baseUrl + "/login.html");
   driver.findElement(By.name("j_username")).clear();
   driver.findElement(By.name("j_username")).sendKeys("*****@*****.**");
   driver.findElement(By.name("j_password")).clear();
   driver.findElement(By.name("j_password")).sendKeys("master");
   driver.findElement(By.xpath("//input[@value='Login']")).click();
   driver.findElement(By.linkText("Sign out")).click();
 }
 @Test
 public void testBookSearch5() throws Exception {
   driver.get(baseUrl + "/proyectoBiblioteca/");
   new Select(driver.findElement(By.name("type"))).selectByVisibleText("Editorial");
   driver.findElement(By.name("search")).clear();
   driver.findElement(By.name("search")).sendKeys("De Bolsillo");
   driver.findElement(By.xpath("//button[@type='submit']")).click();
   assertEquals(
       "Libros Encontrados", driver.findElement(By.cssSelector("div.panel-heading")).getText());
 }
 @Test
 public void testUntitled2() throws Exception {
   driver.get(baseUrl + "php4dvd/");
   WebElement userNameWebEdit = driver.findElement(By.id("username"));
   WebElement passwordWebEdit = driver.findElement(By.name("password"));
   WebElement subminButton = driver.findElement(By.name("submit"));
   userNameWebEdit.clear();
   userNameWebEdit.sendKeys("admin");
   passwordWebEdit.clear();
   passwordWebEdit.sendKeys("admin");
   subminButton.click();
 }
 @Test
 public void testAltaDePrestamo1() throws Exception {
   driver.get(
       baseUrl
           + "/proyectoBiblioteca/Prestamos?action=new&id=1"); // El 1 es el id del ejemplar, debe
                                                               // estar disponible para que
                                                               // funcione la prueba
   new Select(driver.findElement(By.name("prestamoLocal"))).selectByVisibleText("No");
   driver.findElement(By.name("idSocio")).clear();
   driver.findElement(By.name("idSocio")).sendKeys("5"); // id de gonza, está inhabilitado
   driver.findElement(By.id("fecha")).clear();
   driver
       .findElement(By.id("fecha"))
       .sendKeys(Utilidades.getSimpleDate(new Date())); // pongo la fecha de hoy
   driver.findElement(By.cssSelector("button.btn.btn-success")).click();
   assertEquals(
       "Préstamo no creado. El socio ingresado no se encuentra habilitado para recibir préstamos.",
       driver.findElement(By.cssSelector("div.alert.alert-info")).getText());
 }
 @Test
 public void testAssigneUsScrumMaster2() throws Exception {
   driver.get(baseUrl + "/login.html");
   driver.findElement(By.name("j_username")).clear();
   driver.findElement(By.name("j_username")).sendKeys("*****@*****.**");
   driver.findElement(By.name("j_password")).clear();
   driver.findElement(By.name("j_password")).sendKeys("product");
   driver.findElement(By.xpath("//input[@value='Login']")).click();
   driver.findElement(By.cssSelector("input.btn.btn-success")).click();
   driver.findElement(By.id("tag_input")).clear();
   driver.findElement(By.id("tag_input")).sendKeys("Crea Git");
   driver.findElement(By.id("description_input")).clear();
   driver.findElement(By.id("description_input")).sendKeys("Creation Depot git");
   driver.findElement(By.id("priority_input")).clear();
   driver.findElement(By.id("priority_input")).sendKeys("1");
   driver.findElement(By.id("difficulty_input")).clear();
   driver.findElement(By.id("difficulty_input")).sendKeys("5");
   new Select(driver.findElement(By.id("master_input"))).selectByVisibleText("Scrum1 Master1");
   driver.findElement(By.cssSelector("button.btn.btn-success")).click();
   driver.findElement(By.linkText("Sign out")).click();
 }
예제 #6
0
 @Test
 public void testCreateFilm() throws Exception {
   driver.findElement(By.cssSelector("img[alt=\"Add movie\"]")).click();
   driver.findElement(By.name("name")).clear();
   driver.findElement(By.name("name")).sendKeys("Новый фильм");
   driver.findElement(By.name("year")).clear();
   driver.findElement(By.name("year")).sendKeys("1999");
   driver.findElement(By.name("duration")).clear();
   driver.findElement(By.name("duration")).sendKeys("90");
   driver.findElement(By.id("own_no")).click();
   driver.findElement(By.id("seen_no")).click();
   driver.findElement(By.id("submit")).click();
 }
예제 #7
0
파일: scenario4.java 프로젝트: kudrix/1699
 @Test
 public void testScenario4() throws Exception {
   driver.get(baseUrl + "/recipe/index.php");
   driver.findElement(By.xpath("//div[@id='nav']/table/tbody/tr[7]/td/a/strong")).click();
   driver.findElement(By.name("title")).clear();
   driver.findElement(By.name("title")).sendKeys("Chicken Ramen");
   driver.findElement(By.name("shortdesc")).clear();
   driver.findElement(By.name("shortdesc")).sendKeys("Classic Ramen noodles");
   driver.findElement(By.name("ingredients")).clear();
   driver.findElement(By.name("ingredients")).sendKeys("Ramen package, 2 cups water");
   driver.findElement(By.name("directions")).clear();
   driver
       .findElement(By.name("directions"))
       .sendKeys(
           "Bring water to boil. Add noodles from package. Boil 7 minutes. Add flavor package.");
   driver.findElement(By.cssSelector("#main > form > input[type=\"submit\"]")).click();
   // Warning: assertTextPresent may require manual changes
   assertTrue(
       driver
           .findElement(By.cssSelector("BODY"))
           .getText()
           .matches("^[\\s\\S]*Recipe posted[\\s\\S]*$"));
 }
예제 #8
0
파일: Goal.java 프로젝트: casputman/Module2
 @Test
 public void testGoal() throws Exception {
   driver.get(baseUrl + "/ubercoaching/logout");
   driver.findElement(By.linkText("Login")).click();
   driver.findElement(By.name("username")).clear();
   driver.findElement(By.name("username")).sendKeys("test");
   driver.findElement(By.name("password")).clear();
   driver.findElement(By.name("password")).sendKeys("test");
   driver.findElement(By.name("commit")).click();
   driver.findElement(By.xpath("(//a[contains(text(),'PROCEED »')])[4]")).click();
   driver.findElement(By.name("weight")).clear();
   driver.findElement(By.name("weight")).sendKeys("75");
   driver.findElement(By.name("width")).clear();
   driver.findElement(By.name("width")).sendKeys("60");
   driver.findElement(By.cssSelector("input[type=\"submit\"]")).click();
   driver.findElement(By.name("goalWeight")).clear();
   driver.findElement(By.name("goalWeight")).sendKeys("70");
   driver.findElement(By.name("goalDate")).clear();
   driver.findElement(By.name("goalDate")).sendKeys("20/05/2016");
   driver.findElement(By.xpath("//input[@value='Set Goal']")).click();
 }
  @Test
  public void testMap2() throws Exception {
    driver.get(baseUrl + "/ModSolarPlatform/login.jsp;jsessionid=F33B6C551CBA0A359E87354993539EFA");
    driver.findElement(By.id("username")).clear();
    driver.findElement(By.id("username")).sendKeys("christianqa");
    driver.findElement(By.id("password")).clear();

    driver.findElement(By.id("password")).sendKeys("qa");
    driver.findElement(By.name("submit")).click();
    driver.findElement(By.cssSelector("div.newLeadList")).click();
    driver.findElement(By.id("tabResidential")).click();
    driver.findElement(By.id("firstNameResidential")).clear();
    driver.findElement(By.id("firstNameResidential")).sendKeys("christian");
    driver.findElement(By.id("lastNameResidential")).clear();
    driver.findElement(By.id("lastNameResidential")).sendKeys("Mabila");
    driver.findElement(By.id("addressResidential")).clear();
    driver.findElement(By.id("addressResidential")).sendKeys("600 Clipper rd");
    driver.findElement(By.id("cityResidential")).clear();
    driver.findElement(By.id("cityResidential")).sendKeys("Belmont");
    new Select(driver.findElement(By.id("stateResidential"))).selectByVisibleText("California");
    // driver.findElement(By.id("zipCodeResidential")).clear();
    // driver.findElement(By.id("zipCodeResidential")).sendKeys("90042");
    driver.findElement(By.cssSelector("#zipCodeResidential")).clear();
    driver.findElement(By.cssSelector("#zipCodeResidential")).sendKeys("90042");
    Thread.sleep(1500);
    driver.findElement(By.id("emailResidential")).clear();
    driver.findElement(By.id("emailResidential")).sendKeys("*****@*****.**");
    driver.findElement(By.id("utilityTaxRateInputAddressResidential")).clear();
    driver.findElement(By.id("utilityTaxRateInputAddressResidential")).sendKeys("1.2");
    driver.findElement(By.id("averageMonthlyBillResidential")).clear();
    driver.findElement(By.id("averageMonthlyBillResidential")).sendKeys("225");
    driver.findElement(By.id("nextBtn")).click();
    Thread.sleep(1000);

    WebElement mainCanvas = driver.findElement(By.xpath(".//*[@id='mapCanvas']/div/div[1]/div[2]"));

    Actions mouseAction = new Actions(driver);

    mouseAction.moveToElement(mainCanvas);

    mouseAction.contextClick(mainCanvas);

    mouseAction.moveByOffset(5, 25);

    mouseAction.sendKeys(Keys.ARROW_DOWN);

    mouseAction.sendKeys(Keys.RETURN);
    // mouseAction.keyDown(Keys.ARROW_DOWN);
    // mouseAction.moveToElement(subMenu);

    mouseAction.click();

    mouseAction.perform();

    WebElement mainCanvas2 =
        driver.findElement(
            By.xpath("html/body/div[1]/div/div[2]/div[5]/div[2]/div[2]/div/div[1]/div[2]"));

    Actions mouseAction2 = new Actions(driver);

    mouseAction2.moveToElement(mainCanvas2);

    mouseAction2.contextClick(mainCanvas2);

    mouseAction2.moveByOffset(70, 50);

    mouseAction2.sendKeys(Keys.ARROW_DOWN);

    mouseAction2.sendKeys(Keys.RETURN);
    // mouseAction.keyDown(Keys.ARROW_DOWN);
    // mouseAction.moveToElement(subMenu);

    mouseAction2.click();

    mouseAction2.perform();

    WebElement mainCanvas3 =
        driver.findElement(
            By.xpath("html/body/div[1]/div/div[2]/div[5]/div[2]/div[2]/div/div[1]/div[2]"));

    Actions mouseAction3 = new Actions(driver);

    mouseAction3.moveToElement(mainCanvas3);

    mouseAction3.contextClick(mainCanvas3);

    mouseAction3.moveToElement(mainCanvas2, 500, 220);

    mouseAction3.sendKeys(Keys.ARROW_DOWN);

    mouseAction3.sendKeys(Keys.RETURN);
    // mouseAction.keyDown(Keys.ARROW_DOWN);
    // mouseAction.moveToElement(subMenu);

    mouseAction3.click();

    mouseAction3.perform();

    // Clicking inside the Triangle

    WebElement e =
        driver.findElement(
            By.xpath("html/body/div[1]/div/div[2]/div[5]/div[2]/div[2]/div/div[1]/div[2]"));

    new Actions(driver).moveToElement(e, 0, 0).moveByOffset(520, 255).click().build().perform();
    driver.findElement(By.cssSelector("div.pgNext.right > input.btn")).click();
    driver.findElement(By.xpath("//div[@id='accordion']")).click();
    driver.findElement(By.id("regionsPaneTitle")).click();

    // Clicking inside the Triangle 1

    WebElement eI =
        driver.findElement(
            By.xpath("html/body/div[1]/div/div[2]/div[5]/div[2]/div[2]/div/div[1]/div[2]"));

    new Actions(driver).moveToElement(eI, 0, 0).moveByOffset(520, 255).click().build().perform();

    Thread.sleep(1000);

    // Clicking inside the Triangle 1

    WebElement eS =
        driver.findElement(
            By.xpath("html/body/div[1]/div/div[2]/div[5]/div[2]/div[2]/div/div[1]/div[2]"));

    new Actions(driver).moveToElement(eS, 0, 0).moveByOffset(520, 255).click().build().perform();
    Thread.sleep(1000);
    driver.findElement(By.id("accordion")).click();
    driver.findElement(By.id("mountTypeRegion1")).click();
    new Select(driver.findElement(By.id("mountTypeRegion1"))).selectByVisibleText("Flat Roof");
    driver.findElement(By.cssSelector("#mountTypeRegion1 > option[value=\"1\"]")).click();
    driver.findElement(By.id("mountTypeRegion1")).click();
    new Select(driver.findElement(By.id("mountTypeRegion1"))).selectByVisibleText("Ground Mount");
    driver.findElement(By.cssSelector("#mountTypeRegion1 > option[value=\"2\"]")).click();
    driver.findElement(By.id("mountTypeRegion1")).click();
    new Select(driver.findElement(By.id("mountTypeRegion1"))).selectByVisibleText("Flat Roof");
    driver.findElement(By.cssSelector("#mountTypeRegion1 > option[value=\"1\"]")).click();
    driver.findElement(By.id("mountTypeRegion1")).click();
    driver.findElement(By.id("mountTypeRegion1")).click();
    new Select(driver.findElement(By.id("mountTypeRegion1"))).selectByVisibleText("Sloped Roof");
    driver.findElement(By.cssSelector("#mountTypeRegion1 > option[value=\"0\"]")).click();
    ////
    // driver.findElement(By.xpath("/html/body/div[3]/div[1]/div/div[2]/div[4]/form/div[2]/div/div[3]/div[1]/div[2]/div/input")).click();
    driver
        .findElement(
            By.xpath(
                "/html/body/div[3]/div[1]/div/div[2]/div[4]/form/div[2]/div/div[3]/div[1]/div[2]/div/input"))
        .clear();
    driver
        .findElement(
            By.xpath(
                "/html/body/div[3]/div[1]/div/div[2]/div[4]/form/div[2]/div/div[3]/div[1]/div[2]/div/input"))
        .sendKeys("52");
    driver
        .findElement(
            By.xpath(
                "/html/body/div[3]/div[1]/div/div[2]/div[4]/form/div[2]/div/div[3]/div[1]/div[2]/div/input"))
        .click();
    driver
        .findElement(
            By.xpath(
                "/html/body/div[3]/div[1]/div/div[2]/div[4]/form/div[2]/div/div[3]/div[1]/div[2]/div/input"))
        .clear();
    driver
        .findElement(
            By.xpath(
                "/html/body/div[3]/div[1]/div/div[2]/div[4]/form/div[2]/div/div[3]/div[1]/div[2]/div/input"))
        .sendKeys("18");
    driver
        .findElement(
            By.xpath(
                "/html/body/div[3]/div[1]/div/div[2]/div[4]/form/div[2]/div/div[3]/div[1]/div[2]/div/input"))
        .click();
    driver
        .findElement(
            By.xpath(
                "/html/body/div[3]/div[1]/div/div[2]/div[4]/form/div[2]/div/div[3]/div[1]/div[2]/div/input"))
        .clear();
    driver
        .findElement(
            By.xpath(
                "/html/body/div[3]/div[1]/div/div[2]/div[4]/form/div[2]/div/div[3]/div[1]/div[2]/div/input"))
        .sendKeys("45");
    driver.findElement(By.id("mountTypeRegion1")).click();
    new Select(driver.findElement(By.id("mountTypeRegion1"))).selectByVisibleText("Flat Roof");
    driver.findElement(By.cssSelector("#mountTypeRegion1 > option[value=\"1\"]")).click();
    driver.findElement(By.id("mountTypeRegion1")).click();
    new Select(driver.findElement(By.id("mountTypeRegion1"))).selectByVisibleText("Sloped Roof");
    driver.findElement(By.cssSelector("#mountTypeRegion1 > option[value=\"0\"]")).click();
    driver.findElement(By.id("mountTypeRegion1")).click();

    new Select(driver.findElement(By.id("mountTypeRegion1"))).selectByVisibleText("Flat Roof");
    driver.findElement(By.cssSelector("#mountTypeRegion1 > option[value=\"1\"]")).click();
    driver.findElement(By.id("mountTypeRegion1")).click();
    new Select(driver.findElement(By.id("mountTypeRegion1"))).selectByVisibleText("Ground Mount");
    driver.findElement(By.cssSelector("#mountTypeRegion1 > option[value=\"2\"]")).click();
    driver.findElement(By.cssSelector("label.overTxtLabel")).click();
    driver.findElement(By.id("proposalName")).sendKeys("AUTOMATION TEST");
    driver.findElement(By.id("regionsPaneTitle")).click();
    driver.findElement(By.id("regionsPaneTitle")).click();
    Thread.sleep(500);
    /// driver.findElement(By.id("squareUpButton2")).click();
    driver.findElement(By.xpath("//input[@id='snapAzimuthButton1']")).click();
    driver.findElement(By.xpath("//input[@id='applySetbacksButton1']")).click();
    /// assertEquals("Setbacks cannot be less than zero.", closeAlertAndGetItsText());
    //// driver.findElement(By.id("delPolygonButton2")).click();
    Thread.sleep(1000);
    /// driver.findElement(By.id("squareUpButton3")).click();
    /// driver.findElement(By.id("squareUpButton3")).click();
    driver.findElement(By.id("accordion")).click();
    driver.findElement(By.cssSelector("div[title=\"Pan up\"]")).click();
    driver.findElement(By.cssSelector("div[title=\"Pan right\"]")).click();
    driver.findElement(By.cssSelector("div[title=\"Pan down\"]")).click();
    driver.findElement(By.cssSelector("div[title=\"Pan left\"]")).click();
    driver.findElement(By.cssSelector("div[title=\"Zoom out\"] > img")).click();
    driver.findElement(By.cssSelector("div[title=\"Zoom in\"] > img")).click();
    driver.findElement(By.id("accordion")).click();
    /////
    /////
    ////
    /// no need driver.findElement(By.xpath("//div[@id='solutionCategory']/ul/li[2]/h3")).click();
    /// no need driver.findElement(By.cssSelector("span.arrow")).click();
    driver.findElement(By.xpath("//input[@value='Next']")).click();
    driver.findElement(By.id("accordion")).click();
    driver.findElement(By.id("accordionTitleText")).click();
    driver.findElement(By.id("accordion")).click();
    driver.findElement(By.id("nextButton")).click();
    driver.findElement(By.id("accordion")).click();
    driver.findElement(By.id("contentUsagePaneTitle")).click();
    driver.findElement(By.id("accordion")).click();
    Thread.sleep(1000);
    // click on Inverters
    driver.findElement(By.xpath("//h3[text()= 'Inverters']")).click();

    // Click on Arrow

    driver.findElement(By.xpath("//span[@class = 'arrow']")).click();

    Thread.sleep(1000);
    // Default Invert select
    driver.findElement(By.xpath("html/body/ul/li[2]/span")).click();

    // Click on Arrow
    driver.findElement(By.xpath("//span[@class = 'arrow']")).click();

    Thread.sleep(2000);

    // Click on Next button
    driver.findElement(By.xpath("//input[@value='Next']")).click();
    Thread.sleep(2000);
    ////// errror--- driver.findElement(By.id("supplyLeadDetailsBtn1")).click();
    driver.findElement(By.id("accordion")).click();
    ///// driver.findElement(By.id("accordion")).click();
    ////// driver.findElement(By.id("accordion")).click();
    Thread.sleep(1500);

    ///// driver.findElement(By.id("backBtn")).click();
    //// driver.findElement(By.cssSelector("label > input[type=\"button\"]")).click();
    // Click on Next button

    driver.findElement(By.xpath("//input[@id='nextButton']")).click();

    /// PREVIEW PAGE STARTS HERE
    Thread.sleep(2000);

    driver.findElement(By.id("accordion")).click();
    Thread.sleep(250);
    driver.findElement(By.cssSelector("#buyForCashCheckbox")).click();
    Thread.sleep(250);
    driver.findElement(By.cssSelector("#nextButton")).click();
    Thread.sleep(1000);

    // ERROR: Caught exception [unknown command []]
  }
예제 #10
0
 @Test
 public void testTemp() throws Exception {
   driver.get("http://cse.unl.edu/~mouna/WebApps/AddressBook/addressbookv3.4.7/index.php");
   driver
       .findElement(
           By.cssSelector(
               "html > body > table > tbody > tr:nth-child(2) > td:nth-child(3) > form > table:nth-child(2) > tbody > tr:nth-child(1) > td:nth-child(7) > a > img"))
       .click();
   driver.findElement(By.name("firstname")).clear();
   driver.findElement(By.name("firstname")).sendKeys("JamesEDIT");
   driver.findElement(By.name("lastname")).clear();
   driver.findElement(By.name("lastname")).sendKeys("PittEDIT");
   driver.findElement(By.name("address")).clear();
   driver.findElement(By.name("address")).sendKeys("44545 R street EDIT");
   driver.findElement(By.name("home")).clear();
   driver.findElement(By.name("home")).sendKeys("454545455 8989");
   driver.findElement(By.name("mobile")).clear();
   driver.findElement(By.name("mobile")).sendKeys("454554555 2398");
   driver.findElement(By.name("work")).clear();
   driver.findElement(By.name("work")).sendKeys("455455555 32323");
   driver.findElement(By.name("email")).clear();
   driver.findElement(By.name("email")).sendKeys("[email protected] EDIT");
   driver.findElement(By.name("email2")).clear();
   driver.findElement(By.name("email2")).sendKeys("[email protected] EDIT");
   driver.findElement(By.name("address2")).clear();
   driver.findElement(By.name("address2")).sendKeys("EDIT");
   driver.findElement(By.name("phone2")).clear();
   driver.findElement(By.name("phone2")).sendKeys("EDIT");
   driver.findElement(By.name("update")).click();
 }