I want to getText() using By.id or By.cssSelector.
I managed to solve my problem by doing getAttribute("value"), but I don\'t understand why getText() doesn
You may use this if you want to search for a given text on a WebElement. Pass it directly or through a string:
String textoToSearch = "Text inside Webelement"; driver.findElement(By.id("someID).getText().contains("textToSearch");