python+selenium断言

方法

检查

assertEqual(a,b)

a==b

assertNotEqual(a,b)

a!=b

asserTrue(x)

bool(x) is true

asserFalse(x)

bool(x) is False

assertIs(a,b)

扫描二维码关注公众号,回复: 7908983 查看本文章

a is b

assertIsNot(a,b)

a is not b

assertIsNone(x)

x is None

assertIsNoneNot(x)

x is not None

assertIn(a,b)

a in b

assertInNot

a not in b

assertIsInstance(a,b)

isinstance(a,b)

assertNotIsInstance(a,b)

not isinstance (a,b)

使用:

        title = driver.title
        self.assertEqual("审核投诉",title)

猜你喜欢

转载自www.cnblogs.com/seven7777/p/11890670.html