셀레늄으로 파이썬 스크립트를 만들고 있습니다. 페이지가로드 될 때 텍스트 상자의 기본 텍스트를 검사하는 특정 테스트를 실행하려고합니다. 다음은 AssertionError - Selenium/Python
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'
내가 잘못된 기능을 사용하고 있습니까
다음
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(...)
을의) 시도 선언이 실패한 것을