[英]why does my histogram look weird in this stochastic problem plot in python?
[英]Why do Selenium Python tests look so weird?
我已经使用Selenium IDE为我的应用程序生成了一些测试代码。 为断言生成的Python代码如下所示。
try: self.failUnless(sel.is_text_present("Path"))
except AssertionError, e: self.verificationErrors.append(str(e))
错误不会快速失败,而是将错误添加到列表中,然后脚本继续。
我想知道这样做的理由是什么? 快速失败不是更好吗? 还是会使页面处于不一致状态?
这是Selenium中verify
和assert
之间的区别。 使用verify
将记录任何故障,但测试将继续,实际上是“软断言”。 如果要停止执行失败的测试,请尝试使用assert
。
//verifyTextPresent
try: self.failUnless(sel.is_text_present("My Text"))
except AssertionError, e: self.verificationErrors.append(str(e))
//assertTextPresent
self.failUnless(sel.is_text_present("My Text"))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.