当我运行我的脚本时:
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()
我得到错误:
Error
TypeError: 'NoneType' object is not callable
我读到我没有正确传递一些东西,但我不知道去哪里看。在此先感谢您的帮助!