title: How to handle popup window by using python automation
body: <p>I am using Selenium Webdriver with Python for automation testing. While login my application I have got popup message for clicking 'OK' button. where i have used </p>
  
  <pre><code>from selenium import webdriver 
  def cbs_login(): 
      browser = webdriver.Firefox() 
      browser.get('172.20.31.1:7085/web/ccp/login') 
      user = browser.find_element_by_css_selector('#userid') 
      user.send_keys('admin') 
      password = browser.find_element_by_css_selector('#password')
      password.send_keys('admin2') 
      login_location = browser.find_element_by_css_selector('#loginlocation') 
      login_location.click() 
      location_name = browser.find_element_by_xpath('/html/body/div[2]/div/div/div‌​/div/div/form/div/di‌​v/div/div/table/tbod‌​y/tr[4]/td/select/op‌​tion[3]')     
      location_name.click() 
      driver.switchTo().alert().accept(); 
      cbs_login()
  </code></pre>
  
  <p>i can't use the code ,I am getting error like "unresolved reference" Please mention is there any alternate way to handle it by python 2.7 version.</p>