Python Selenium 'module' object is not callable in python selenium script
<p>Learning Selenium driven by Python and in my practice I keep getting the following error. I am stuck and could use some guidance </p>

<blockquote>
  <p>Traceback (most recent call last):   File "test_login.py", line 14, in
  test_Login
      loginpage = homePage(self.driver) TypeError: 'module' object is not callable</p>
</blockquote>

<p>Here is my code</p>

<blockquote>
  <p>test_login.py</p>
</blockquote>

<pre><code>import unittest
import homePage
from selenium import webdriver

class Login(unittest.TestCase):

  def setUp(self):
     self.driver = webdriver.Firefox()
     self.driver.get("https://hub.docker.com/login/")

  def test_Login(self):
      loginpage = homePage(self.driver)
      loginpage.login(email,password)

  def tearDown(self):
      self.driver.close()

if __name__ == '__main__': unittest.main()
</code></pre>

<blockquote>
  <p>homePage.py</p>
</blockquote>

<pre><code>from selenium.webdriver.common.by import By

class BasePage(object):

    def __init__(self, driver):
        self.driver = drive


class LoginPage(BasePage):
    locator_dictionary = {
        "userID": (By.XPATH, '//input[@placeholder="Username"]'),
        "passWord": (By.XPATH, '//input[@placeholder="Password"]'),
        "submittButton": (By.XPATH, '//button[text()="Log In"]'),
    }



    def set_userID(self, id):
        userIdElement = self.driver.find_element(*LoginPage.userID)
        userIdElement.send_keys(id)

    def login_error_displayed(self):
        notifcationElement = self.driver.find_element(*LoginPage.loginError)
        return notifcationElement.is_displayed()

    def set_password(self, password):
        pwordElement = self.driver.find_element(*LoginPage.passWord)
        pwordElement.send_keys(password)        

    def click_submit(self):
        submitBttn = self.driver.find_element(*LoginPage.submitButton)
        submitBttn.click()

    def login(self, id, password):
        self.set_password(password)
        self.set_email(id)
        self.click_submit()
</code></pre>

<p>Any help is appreciated </p>

<p>I think here:</p>

<pre><code>loginpage = homePage(self.driver)
</code></pre>

<p>you meant to instantiate the <code>LoginPage</code> class:</p>

<pre><code>loginpage = homePage.LoginPage(self.driver)
</code></pre>

python selenium