简体   繁体   English

Selenium错误`AssertionError:列表不同`

[英]Selenium error `AssertionError: Lists differ` in tearDown

I am a beginner to Python and my first task is to implement automated test scripts for my app build using PHP and Python. 我是Python的初学者,我的第一个任务是使用PHP和Python为我的应用程序构建实现自动化测试脚本。 For this I started using Selenium IDE and then import the code in Python and paste it into my editor. 为此,我开始使用Selenium IDE,然后以Python导入代码并将其粘贴到编辑器中。

But when I am trying to run that script from my editor it's throwing an error : 但是,当我尝试从编辑器运行该脚本时,会引发错误:

E
======================================================================
ERROR: test (__main__.dash)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\workspace\test\dash.py", line 70, in tearDown
    self.assertEqual([], self.verificationErrors)
AssertionError: Lists differ: [] != ['False is not True', 'False i...

Second list contains 2 additional elements.
First extra element 0:
False is not True

- []
+ ['False is not True', 'False is not True']

----------------------------------------------------------------------
Ran 1 test in 31.641s

FAILED (errors=1)

But I have no idea from where this error is coming. 但是我不知道该错误来自何处。

In your dash.py, you have the following line 在dash.py中,您有以下行

self.assertEqual([], self.verificationErrors) 

which means, that you check that our verificationErrors is empty. 也就是说,您要检查我们的VerificationErrors是否为空。

In your run, this list is not empty, it contains two entries : 在您的运行中,此列表不为空,它包含两个条目:

  • False is not True 假不是真
  • True is not False 真不是假

Basically, this means that your test, whatever it is, is not passing, now without more information, it will be hard to help you more. 基本上,这意味着您的测试(无论它是什么)都没有通过,现在如果没有更多信息,将很难为您提供更多帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM