How can I get the text that I entered in a text-area using Selenium where the text entered in the developer options in Chrome and Mozilla where in IE its visible in the developer section. Using gettext() I am able to get the text from IE but giving me nothing using the same for Chrome and Mozilla.
string text =
driver.findelement(
by.xpath("//textarea[@placeholder='Enter a description']")
).gettext();
尝试这个:
String text=driver.findelement(By.xpath("//textarea[@placeholder='Enter a description']")).getAttribute("value");
One of the below attributes should get the text using following :
Providing vague solution since it is difficult to suggest without HTML
String text=driver.findelement(By.xpath("//textarea[@placeholder='Enter a description']")).getAttribute("innerHTML")//or .getAttribute("outerHTML") ;
Use string functions to get the required value!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.