shashi j shashi j - 3 months ago 26x
Java Question

How to do get text of read only text from Selenium webdriver java

Application has a

text filed
which displays dynamically changes, after getting value of the weight of a product,that is read only, I am not able to read the values from it. Here is the code:

WebElement input = driver.findElement(getLocator("Weight1Value"));


You can try JavascriptExecutor if the above is not working

JavascriptExecutor jse = (JavascriptExecutor)driver;
String Text = (String) jse.executeScript("return arguments[0].value;",driver.findElement(getLocator("Weight1Value"));