# coding:utf-8
from selenium import webdriver
import unittest
class Login_Logout1(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Chrome()
url = "xxx"
self.driver.get(url)
self.driver.implicitly_wait(30)
def verification(self, Info, data):
#判断是是否相等
#用法 self.verification("元素",u"对比项")
try:
self.assertEqual(self.driver.find_element_by_id(Info).text, data)
except NoSuchElementException as msg:
print (u"查找元素异常%s" % msg)
就比如我在这个文件中有个 def verification 方法 我另一个文件想用这个方法是该怎么用