Package org.openqa.selenium

Examples of org.openqa.selenium.WebElement.click()


    public void testNavigationActionOverview() throws MalformedURLException
    {
        driver.get(new URL(contextPath, "origin.xhtml").toString());

        WebElement button = driver.findElement(By.id("parameter:pb005Overview"));
        button.click();
        Assert.assertTrue(ExpectedConditions.textToBePresentInElement(By.id("overviewPage"),
                "You arrived at overview page")
                .apply(driver));
        System.out.println(driver.getCurrentUrl());
        Assert.assertTrue(driver.getCurrentUrl().contains("param1=staticValue2"));
View Full Code Here


    public void testNavigationActionIndex() throws MalformedURLException
    {
        driver.get(new URL(contextPath, "origin.xhtml").toString());

        WebElement button = driver.findElement(By.id("parameter:pb005Index"));
        button.click();
        Assert.assertTrue(ExpectedConditions.textToBePresentInElement(By.id("indexPage"),
                "You arrived at index page")
                .apply(driver));
        System.out.println(driver.getCurrentUrl());
        Assert.assertTrue(driver.getCurrentUrl().contains("param1=staticValue2"));
View Full Code Here

        WebElement inputField = driver.findElement(By.id("test:valueInput"));
        inputField.sendKeys("23");

        WebElement button = driver.findElement(By.id("test:saveButton"));
        button.click();

        Assert.assertTrue(ExpectedConditions.textToBePresentInElement(By.id("test:valueOutput"), "23").apply(driver));
    }

}
View Full Code Here

        WebElement inputField = driver.findElement(By.id("test:valueInput"));
        inputField.sendKeys("23");

        WebElement button = driver.findElement(By.id("test:saveButton"));
        button.click();

        Assert.assertTrue(ExpectedConditions.textToBePresentInElement(By.id("valueOutput"), "23").apply(driver));

    }
View Full Code Here

        inputFieldX.sendKeys("abc");
        WebElement inputFieldY = driver.findElement(By.id("testForm1:valueInputY"));
        inputFieldY.sendKeys("xyz");

        WebElement button = driver.findElement(By.id("testForm1:next"));
        button.click();

        Assert.assertTrue(ExpectedConditions.textToBePresentInElement(By.id("valueX"), "abc").apply(driver));

        button = driver.findElement(By.id("testForm2:back"));
        button.click();
View Full Code Here

        button.click();

        Assert.assertTrue(ExpectedConditions.textToBePresentInElement(By.id("valueX"), "abc").apply(driver));

        button = driver.findElement(By.id("testForm2:back"));
        button.click();

        Assert.assertTrue(ExpectedConditions.textToBePresentInElement(By.id("valueOutputX"), "abc").apply(driver));
        Assert.assertFalse(ExpectedConditions.textToBePresentInElement(By.id("valueOutputY"), "xyz").apply(driver));
    }
}
View Full Code Here

    @RunAsClient
    public void testNavigationActionWithParameter() throws MalformedURLException
    {
        driver.get(new URL(contextPath, "origin.xhtml").toString());
        WebElement button = driver.findElement(By.id("parameter:pb003ActionMethod"));
        button.click();

        Assert.assertTrue(ExpectedConditions.textToBePresentInElement(By.id("simplePageConfig"),
                "You arrived at simplePageConfig page")
                .apply(driver));
        System.out.println(driver.getCurrentUrl());
View Full Code Here

    public void testNavigationActionWithParameter() throws MalformedURLException
    {
        //first click
        driver.get(new URL(contextPath, "origin.xhtml").toString());
        WebElement button = driver.findElement(By.id("parameter:pb004ActionMethod"));
        button.click();

        //second click
        driver.get(new URL(contextPath, "origin.xhtml").toString());
        button = driver.findElement(By.id("parameter:pb004ActionMethod"));
        button.click();
View Full Code Here

        button.click();

        //second click
        driver.get(new URL(contextPath, "origin.xhtml").toString());
        button = driver.findElement(By.id("parameter:pb004ActionMethod"));
        button.click();

        Assert.assertTrue(ExpectedConditions.textToBePresentInElement(By.id("simplePageConfig"),
                "You arrived at simplePageConfig page")
                .apply(driver));
        Assert.assertTrue(driver.getCurrentUrl().contains("&cv="));
View Full Code Here

    public void testNavigationActionWithoutError() throws MalformedURLException
    {
        driver.get(new URL(contextPath, "origin.xhtml").toString());

        WebElement button = driver.findElement(By.id("destination:pb002ActionWithoutError"));
        button.click();
        Assert.assertTrue(ExpectedConditions.textToBePresentInElement(By.id("overviewPage"),
                "You arrived at overview page").apply(driver));
        // Was redirected ?
        Assert.assertTrue(driver.getCurrentUrl().contains("overview.xhtml"));
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.