Get DIV Value - WebDriver (Selenium)
5 answers
Using java you should write:
WebElement element = webdriver.findElement(By.className("headerbande"));
Take a look at Introducing the Selenium-WebDriver Example API for examples in other languages.
+11
You can also get the value / text using xpath, as shown below:
WebElement webElement = driver.findElement(By.xpath("//div[@class='headerbande']")); webElement.getText();
OR, you can get the text / value using css Selector, as shown below:
WebElement webElement = driver.findElement(By.cssSelector("div.headerbande")); webElement.getText();
+1