You need to print the result of the getText()
. You’re currently printing the object TxtBoxContent
.
getText()
will only get the inner text of an element. To get the value, you need to use getAttribute()
.
WebElement TxtBoxContent = driver.findElement(By.id(WebelementID));
System.out.println("Printing " + TxtBoxContent.getAttribute("value"));
More Related Contents:
- Selenium webdriver: Modifying navigator.webdriver flag to prevent selenium detection
- How to resolve ElementNotInteractableException: Element is not visible in Selenium webdriver?
- How many ways to click on webElement In WebDriver?
- Selenium WebDriver throws Exception in thread “main” org.openqa.selenium.ElementNotInteractableException
- How to switch to the new browser window, which opens after click on the button?
- How to perform mouseover function in Selenium WebDriver using Java?
- Do we have any generic function to check if page has completely loaded in Selenium
- Exception in thread “main” java.lang.NoClassDefFoundError: org/openqa/selenium/WebDriver
- How to handle windows file upload using Selenium WebDriver?
- Alert handling in Selenium WebDriver (selenium 2) with Java
- Unable to import org.openqa.selenium.WebDriver using Selenium and Java 11
- How to select/get drop down option in Selenium 2
- Cannot resolve constructor FirefoxDriver(org.openqa.selenium.firefox.FirefoxProfile)
- Selenium IE WebDriver only works while debugging
- How to automate drag & drop functionality using Selenium WebDriver Java
- How to auto-download through Firefox browser using FirefoxProfile?
- ChromeDriver and WebDriver for Selenium through TestNG results in 4 errors
- How to select an item from a dropdown list using Selenium WebDriver with java?
- How to perform Mouse Wheel scrolling over HTML5 Canvas in Selenium?
- How to automate Google Home Page auto suggestion?
- Take full page screenshot in Chrome with Selenium
- Does Selenium v3.141 support Java 13?
- How to disable push-notifications using Selenium for Firefox and Chrome?
- How to find the coordinates of the buttons on a canvas, and click on them after using Java and Selenium?
- How to resolve, Stale element exception? if element is no longer attached to the DOM?
- How to download a pdf file in chrome using selenium webdriver
- Error executing testng.xml through CLI : Could not find or load main class org.testng.TestNG
- How to select the Date Picker In Selenium WebDriver
- Is there a way to search webelement on a main window first, if not found, then start searching inside iframes?
- Set Chrome’s language using Selenium ChromeDriver