MrNolan
MrNolan

Reputation: 154

How to get the text from disabled textbox using selenium Webdriver?

Provided that particular element doesn't have any attributes to make use of.

Upvotes: 0

Views: 2794

Answers (1)

Tapan Khimani
Tapan Khimani

Reputation: 118

The value attribute stores the content of a tag, does not matter whether it is disabled or not. So, you can do it like this:

driver.findElement(By.id("write_element_id_here")).getAttribute("value");

This will return you the value of the element and then you can proceed with the rest. Hope it helps..

Upvotes: 1

Related Questions