title: Selenium, pop up form (Python)
body: <p>I am trying to fill forms on certain webpages. I am having success with most 
  pages however certain ones are giving me trouble. </p>
  
  <p>Some pages have a format where the form is not initially visible on the page itself, instead you need to click a button which then opens a (what seems to be JavaScript) pop up within the page which then needs to be filled. </p>
  
  <p>I have looked around and have seen examples which address how to fill forms which get created in a new pop up window and which get created in alert windows. However I can not seem to find any examples which can solve this particular case.</p>
  
  <p>This is the code I have so far.</p>
  
  <pre><code>     driver = webdriver.Chrome()
       driver.implicitly_wait(10)
  
       mouse = webdriver.ActionChains(driver)    
       driver.get(url)
  
       driver.maximize_window()
  
       value = 'fill form'
       span_xpath = '//span[contains(text(), "' + value + '")]'
       span_element = driver.find_element_by_xpath(span_xpath)
       mouse.move_to_element(span_element).click().perform()
       time.sleep(5)
  </code></pre>
  
  <p>Everything works till here, the fill form button gets clicked which opens the form in the browser page.</p>
  
  <p>But when the following is execute an error always arises: "no such element: unable to locate element"</p>
  
  <pre><code>     n =driver.find_element_by_id('name')
       n.send_keys('john smith')
  </code></pre>
  
  <p>I have tried to locate the element by, name, id, xpath and so on but no matter what try, it can not locate any of the form elements.</p>
  
  <p>I would greatly appreciate any help on this matter.</p>