When I run my script:
from selenium import webdriver
# from selenium.webdriver.firefox.firefox_binary import FirefoxBinary
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
import os
import pytest
import unittest
from nose_parameterized import parameterized
class multiBrowsers(unittest.TestCase):
@parameterized.expand([
("chrome"),
("firefox"),
])
def setUp(self, browser):
if browser == "firefox":
caps = DesiredCapabilities.FIREFOX
caps["marionette"] = True
caps["binary"] = "/Applications/Firefox.app/Contents/MacOS/firefox-bin"
self.driver = webdriver.Firefox(capabilities=caps)
elif browser == "chrome":
self.driver = webdriver.Chrome()
def test_loadPage(self):
driver = self.driver
driver.get("http://www.google.com")
def tearDown(self):
self.driver.quit()
I get the error:
Error
TypeError: 'NoneType' object is not callable
I read that I am not passing something correctly but I don't know where to look. Thanks in advance for the help!
I was getting the same error while using parametrized.expand with unittest.TestCase class. While building suit parametrized adds suffices to tests _0, _1 and so if you are adding tests manually into suite it throws this error. Best solution is to use,