title: what "self" is doing in the selenium python code?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/2709821/python-self-explained">Python ‘self’ explained</a>  </p>
  </blockquote>
  
  
  
  <p>I just wrote a code as below with the help of <code>selenium</code> documentation, but confused with one what <code>self</code> does some methods <code>argument list</code>? Why I need to import <code>unittest</code> class?</p>
  
  <pre><code>import unittest
  from selenium import webdriver
  from selenium.webdriver.common.keys import Keys
  
  class PythonOrgSearch(unittest.TestCase):
  
      def setUp(self):
          self.driver = webdriver.Firefox()
  
      def test_search_in_python_org(self):
          driver = self.driver
          driver.get("http://www.python.org")
          self.assertIn("Python", driver.title)
          elem = driver.find_element_by_name("q")
          elem.send_keys("selenium")
          elem.send_keys(Keys.RETURN)
          self.assertIn("Google", driver.title)
  
      def tearDown(self):
          self.driver.close()
  
  if __name__ == "__main__":
      unittest.main()
  </code></pre>