title: what is a browser variable in python?
body: <p>I'm a newb trying to write a Selenium script using Python. There's a section of the script where I'm asking the program to wait until the iframe has appeared before selecting another element.</p>
  
  <p>I've got and error:</p>
  
  <p>NameError: global name 'browser' is not defined</p>
  
  <p>I understand the nature of the problem - the variable needs to be defined before it can be used, but I don't know what to initialise the variable with!</p>
  
  <p>I know this sounds like a strange question, as why would I use a variable that I haven't initialised. Problem is, that part of my code I took from a fix on here where the definition of the variable isn't given. </p>
  
  <p>Any help much appreciated. </p>
  
  <pre><code>from selenium import webdriver 
  from selenium.webdriver.common.by import By
  from selenium.webdriver.support.ui import Select
  from selenium.common.exceptions import NoSuchElementException
  from selenium.webdriver.support.wait import WebDriverWait
  import unittest, time, re
  
  class Gymboxtest3(unittest.TestCase):
      def setUp(self):
          self.driver = webdriver.Firefox()
          self.driver.implicitly_wait(5)
          self.base_url = "http://gymbox.com"
          self.verificationErrors = []
          self.accept_next_alert = True
  
      def test_gymboxtest3(self):
          driver = self.driver
          driver.get(self.base_url + "/Login")
          time.sleep(30)
  
          frame = WebDriverWait(browser, 30).until(lambda x: x.find_element_by_id("iframe"))
          browser.switch_to_frame(frame)
  </code></pre>