这是我的Python
代码:
class SearchTest(BaseTestCase,unittest.TestCase):
@classmethod
def setUpClass(cls):
super(SearchTest, cls).setUpClass()
cls.navigate_to_page(keyword_Constants['URL'])
def test1_Search(self):
homepageObj= HomePage(self.driver)
homepageObj._verifypage()
searchObj = SearchPage(self.driver)
searchField = searchObj.searchKeyword("chicken")
def test2_CountSearchResultVal(self):
searchObj = SearchPage(self.driver)
#searchField = searchObj.countSearchResultVal("chicken")
@classmethod
def tearDownClass(cls):
super(SearchTest, cls).tearDownClass()
if __name__ == "__main__":
unittest.main(verbosity=2)
当我尝试使用此类方法时,弹出以下错误:
TypeError: unbound method navigate_to_page() must be called with SearchTest instance as first argument (got str instance instead).