I have a 0.
0
I try to write a test that myDiv has 0 text in it. With WebDriver it is:
Try this
WebDriver driver = new YourBrowserdirver(); //FirefoxDriver or ChromeDriver etc.. String Text = driver.findElement(By.id("myDiv")).getText(); System.out.println("The text present in myDiv = "+Text);