Hi I have a Django form where one field is populated depending on the selection of a previous field. This is working fine when manually tested but I'm hitting a bump when testing with selenium.
Here is the failing test:
# --- functional tests --- #
class ProjectFormsTest(LiveServerTestCase):
def setUp(self):
self.browser = webdriver.Firefox()
self.browser.implicitly_wait(3)
def tearDown(self):
self.browser.quit()
def test_project_info_form(self):
...
wind = self.browser.find_element_by_id('id_wind_speed')
self.assertEquals('85', wind.text)
So, I can see selenium load up the browser and the field populates as expected. I'm guessing the root of the problem is that .text is not the correct attribute for a text input form field, as it is returning u''.
Anyone know what is the correct way?
Any help much appreciated.
wind.get_attribute()ANDwind.value. If you post an answer I'll accept it.