当我尝试这段代码时,我需要打开每个新的迭代,新的浏览器窗口:
class GoogleTest(unittest.TestCase):
def setUp(self):
self.browser = webdriver.Chrome('/home/andrew/Downloads/chromedriver')
self.wait = WebDriverWait(self.browser, 20)
self.browser.implicitly_wait(30)
def test_01_goole(self):
for i in range(3):
browser = self.browser
browser.get('http://www.google.com')
browser.close()
我收到:
WebDriverException: Message: no such session