最后在test_qqmail_login.py 中写的是
import csv
import codecs
from itertools import islice
from time import sleep
from page.qqmail_login_page import QQmailLogin
import unittest
from selenium import webdriver
import sys
# sys.setrecursionlimit(100000)
class TestLogin(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.driver=webdriver.Firefox()
cls.test_data=[]
cls.page=QQmailLogin(cls.driver)
cls.page.open()
with codecs.open('./data/qqmail_login_data.csv', 'r', 'utf_8_sig') as f:
data=csv.reader(f)
for line in islice(data,1,None):
cls.test_data.append(line)
======================================================================
ERROR: test_qqmail_loginin_success (__main__.TestLogin)
----------------------------------------------------------------------
Traceback (most recent call last):
File "F:/Users/jiaot/PycharmProjects/pyautoTest-master/test_dir/test_qqmail_login.py", line 40, in test_qqmail_loginin_success
self.test_qqmail_login(self.test_data[0][0],self.test_data[0][1])
File "F:/Users/jiaot/PycharmProjects/pyautoTest-master/test_dir/test_qqmail_login.py", line 35, in test_qqmail_login
self.page.switch_return_iframe()
File "F:\Users\jiaot\PycharmProjects\pyautoTest-master\page\qqmail_login_page.py", line 10, in switch_return_iframe
self.switch_return_iframe()
File "F:\Users\jiaot\PycharmProjects\pyautoTest-master\page\qqmail_login_page.py", line 10, in switch_return_iframe
self.switch_return_iframe()
File "F:\Users\jiaot\PycharmProjects\pyautoTest-master\page\qqmail_login_page.py", line 10, in switch_return_iframe
self.switch_return_iframe()
[Previous line repeated 977 more times]
RecursionError: maximum recursion depth exceeded
----------------------------------------------------------------------
Ran 2 tests in 21.064s