List of usage examples for org.openqa.selenium WebElement getText
String getText();
From source file:com.dukescript.api.selenium.FindsByTest.java
License:Open Source License
@Test public void Element_findElementByCSSSelector() { WebElement parent = driver.findElement(By.cssSelector(".parent")); WebElement child = parent.findElement(By.cssSelector(".child")); Assert.assertEquals("blubla", child.getText()); }
From source file:com.dukescript.api.selenium.FindsByTest.java
License:Open Source License
@Test public void findElementByClassName() { WebElement element = driver.findElement(By.className("css-selector")); Assert.assertEquals("blabla", element.getText()); }
From source file:com.dukescript.api.selenium.FindsByTest.java
License:Open Source License
@Test public void Element_findElementByClassName() { WebElement parent = driver.findElement(By.className("parent")); WebElement child = parent.findElement(By.className("child")); Assert.assertEquals("blubla", child.getText()); }
From source file:com.dukescript.api.selenium.FindsByTest.java
License:Open Source License
@Test public void findElementById() { WebElement element = driver.findElement(By.id("my-id")); Assert.assertEquals("blabla", element.getText()); }
From source file:com.dukescript.api.selenium.FindsByTest.java
License:Open Source License
@Test public void Element_findElementById() { WebElement parent = driver.findElement(By.id("parent-id")); WebElement child = parent.findElement(By.id("child-id")); Assert.assertEquals("blubla", child.getText()); }
From source file:com.dukescript.api.selenium.FindsByTest.java
License:Open Source License
@Test public void findElementByXPath() { WebElement element = driver.findElement(By.xpath("/html/body/div/div/span")); Assert.assertEquals("xpath", element.getText()); }
From source file:com.dukescript.api.selenium.FindsByTest.java
License:Open Source License
@Test public void Element_findElementByXPath() { WebElement parent = driver.findElement(By.id("parent-id")); WebElement child = parent.findElement(By.xpath("div/span")); Assert.assertEquals("xpath", child.getText()); }
From source file:com.dukescript.api.selenium.FindsByTest.java
License:Open Source License
@Test public void findByLinkText() { WebElement element = driver.findElement(By.linkText("Text of link")); Assert.assertEquals("Text of link", element.getText()); }
From source file:com.dukescript.api.selenium.FindsByTest.java
License:Open Source License
@Test public void findByPartialLinkText() { WebElement element = driver.findElement(By.partialLinkText("Text")); Assert.assertEquals("Text of link", element.getText()); }
From source file:com.dukescript.api.selenium.FindsByTest.java
License:Open Source License
@Test public void Element_findByLinkText() { WebElement links = driver.findElement(By.id("links")); WebElement element = links.findElement(By.linkText("Text of link")); Assert.assertEquals("Text of link", element.getText()); }