object has no attribute 'assertEqual'
问题 Getting object has no attribute 'assertEqual' when I try to use the below statement in my code: self.assertEqual("IRELAND INSTITUTE OF PITTSBURGH", driver.find_element_by_id("cname").get_attribute("value")) This works fine when I use in my test case instead. I understand that it is a good practice to put asserts in the test case. But I would like to understand why this piece of code cannot work in the page instead if we are following page object pattern 回答1: assertEqual is a method that