我正在用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'
我使用了錯誤的功能?