私はSeleniumでPythonスクリプトを作成しています。ページが読み込まれたときにテキストボックスのデフォルトテキストをチェックする特定のテストを実行したい。以下は私のコードである.......ここAssertionError - Selenium/Python
try:
self.assertEqual("Search by template name or category..", sel.get_text("//table[@id='pluginToolbarButton_forms']/tbody/tr[2]/td[2]/em"))
logging.info(' PASS: text box text is correct')
except Exception:
logging.exception(' FAIL: text box text is incorrect')
は私の誤りである......
self.assertEqual("Search by template name or category..", sel.get_text("//table[@id='pluginToolbarButton_forms']/tbody/tr[2]/td[2]/em"))
File "C:\Python27\lib\unittest\case.py", line 509, in assertEqual
assertion_func(first, second, msg=msg)
File "C:\Python27\lib\unittest\case.py", line 502, in _baseAssertEqual
raise self.failureException(msg)
AssertionError: 'Search by template name or category..' != u'Submitter Requests'
私が間違っている機能を使用していますか?あなたは(それがあなたの最初のコード例ではself.assertEqual(...)
をだ)しようとしたアサーションが失敗したことを