Package org.openqa.selenium

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


        });

        WebElement grid1 = findElementById("horizontal1");
        List<WebElement> rows = grid1.findElements(By.tagName("tr"));
        Assert.assertEquals(1, rows.size());
        List<WebElement> cells = grid1.findElements(By.tagName("td"));
        Assert.assertEquals(4, cells.size());

        Assert.assertEquals(grid1.getAttribute("border"), "2");
        Assert.assertEquals(grid1.getAttribute("cellSpacing"), "3");
View Full Code Here


                horizontal1.setCellVerticalAlignment(cell1, PVerticalAlignment.ALIGN_BOTTOM);
            }
        });

        grid1 = findElementById("horizontal1");
        rows = grid1.findElements(By.tagName("tr"));
        cells = rows.get(0).findElements(By.tagName("td"));

        final WebElement cell1 = cells.get(1);
        Assert.assertEquals("100px", cell1.getAttribute("width"));
        Assert.assertEquals("30px", cell1.getAttribute("height"));
View Full Code Here

            }
        });

        final WebElement html1 = findElementById("html1");
        Assert.assertEquals("Pure HTML", html1.getText());
        Assert.assertEquals(1, html1.findElements(By.tagName("b")).size());

        final PHTML pHtml = get("html1");
        Assert.assertEquals("Pure <b>HTML</b>", pHtml.getHTML());
        Assert.assertEquals(false, pHtml.isWordWrap());
    }
View Full Code Here

                register(listBox1);
            }
        });

        final WebElement listBox1 = findElementById("listBox1");
        List<WebElement> options = listBox1.findElements(By.tagName("option"));
        final PListBox plistBox1 = get("listBox1");

        Assert.assertEquals(false, plistBox1.isEmptySelection());
        Assert.assertEquals(false, plistBox1.isMultipleSelect());
View Full Code Here

                listBox1.removeItem("Item 2");
                listBox1.removeItem(2);
            }
        });

        options = listBox1.findElements(By.tagName("option"));

        Assert.assertEquals(4, options.size());
        Assert.assertEquals("Item 1", options.get(0).getText());
        Assert.assertEquals("Item 3", options.get(1).getText());
        Assert.assertEquals("Item 5", options.get(2).getText());
View Full Code Here

                register(listBox2);
            }
        });

        final WebElement listBox2 = findElementById("listBox2");
        List<WebElement> options2 = listBox2.findElements(By.tagName("option"));
        final PListBox plistBox2 = get("listBox2");

        Assert.assertEquals(false, plistBox2.isEmptySelection());
        Assert.assertEquals(true, plistBox2.isMultipleSelect());
View Full Code Here

                listBox2.removeItem(2);
                listBox2.removeValue(new Long(6));
            }
        });

        options2 = listBox2.findElements(By.tagName("option"));

        Assert.assertEquals(3, options2.size());
        Assert.assertEquals("Item 1", options2.get(0).getText());
        Assert.assertEquals("Item 3", options2.get(1).getText());
        Assert.assertEquals("Item 5", options2.get(2).getText());
View Full Code Here

            }
        });

        WebElement menuBar = findElementById("menuBar1");

        List<WebElement> elements = menuBar.findElements(By.tagName("td"));
        Assert.assertEquals(4, elements.size());
        Assert.assertEquals("Item 1", elements.get(0).getText());
        Assert.assertEquals("Item 2", elements.get(1).getText());
        Assert.assertEquals("Item 3 with html", elements.get(2).getText());
        Assert.assertEquals("SubMenu", elements.get(3).getText());
View Full Code Here

        Assert.assertEquals("Click on command 3", e1.getBusinessMessage());

        elements.get(3).click();

        WebElement subMenuBar1 = findElementById("subMenuBar1");
        elements = subMenuBar1.findElements(By.tagName("td"));
        Assert.assertEquals(3, elements.size());

        elements.get(2).click();
        e1 = eventsListener.poll();
        Assert.assertEquals("Click on SubItem3", e1.getBusinessMessage());
View Full Code Here

        elements = menuBar.findElements(By.tagName("td"));
        elements.get(3).click();

        // check clear / insert
        subMenuBar1 = findElementById("subMenuBar1");
        elements = subMenuBar1.findElements(By.tagName("td"));
        Assert.assertEquals(1, elements.size());
        Assert.assertEquals("SubItem4", elements.get(0).getText());
    }

    @Test
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.