class SignUpPage(AbstractPage):
def __init__(self, driver):
super(SignUpPage, self).__init__(driver)
def open_sign_up_page(self):
self.driver.find_element_by_css_selector('a.home-button.js-popup-link').click()
return SignUpPage(self.driver)
def sign_up(self, first_name, last_name, email, req_password, school_name, city_name):
self.driver.find_element_by_id('moderator_first_name').send_keys(first_name)
self.driver.find_element_by_id('moderator_last_name').send_keys(last_name)
self.driver.find_element_by_id('moderator_email').send_keys(email)
self.driver.find_element_by_id('moderator_password').send_keys(req_password)
self.driver.find_element_by_id('moderator_password_confirmation').send_keys(req_password)
self.driver.find_element_by_id('moderator_school_attributes_name').send_keys(school_name)
self.driver.find_element_by_id('moderator_school_attributes_city').send_keys(city_name)
**Select(self.driver.find_element_by_xpath('//*[@id="moderator_school_attributes_state"]')).select_by_visible_text('Alabama')**
self.driver.find_element_by_xpath('//*[@id="new_moderator"]/div[8]/input').click()
return PostSignUpPage(self.driver)
This is my form filling 'script' ,
http://screencast.com/t/ofjvjgwH7 -> source code for select.
I tried locating the select item with xpath, id, css-locator, name attribute, none of them worked. The error I get goes as follows
File "/Library/Python/2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 181, in check_response raise exception_class(message, screen, stacktrace) ElementNotVisibleException: Message: Element is not currently visible and so may not be interacted with Stacktrace: