Reputation: 1915
I want to get the len of a text field after calling .send_keys() method on and entering texts in.Although that after calling the method there are texts, the following len statement returns zero:
print len(driver.find_element_by_id('some id').text)
returns zero.
Is there anyway to overcome this problem and get the len of the field after having texts entered?
Upvotes: 0
Views: 281
Reputation: 1583
To take a text in a input area(textfield), you should get value of attribute.
print len(driver.find_element_by_id("textbox").get_attribute("value"))
Upvotes: 2