I have a <div name="myDiv">0</div>.
I try to write a test that myDiv has 0 text in it. With WebDriver it is:
String text = webDriver.findElement(By.xpath("//div[@name='myDiv']")).getText();
But in the result I have an empty string. Shouldn’t I use getText() for getting a content of a div?
I just need use a real browser for my webDriver:
Then it works.
Maybe it is a JavaScript issue.