I have this code that I need to check whether partialExpectedTitle
is included in documentTitle
. But I get an error afterwards that we have an assertion error. Does in
and not in
only work in a list? Or do I make it work in a string?
documentTitle = context.mailTrapPage.getExcelTitle().text.strip()
excelTitle = download_path + "/" + documentTitle
excelWorkbook = o.load_workbook(excelTitle)
print("partialExpectedTitle is " + partialExpectedTitle)
print("documentTitle is " + documentTitle)
assert partialExpectedTitle in documentTitle is True
Error:
assert partialExpectedTitle in documentTitle is True
AssertionError
Captured stdout:
['1 - AAAAAA qlgmdfol']
partialExpectedTitle is courses20220913_1110
documentTitle is courses20220913_111050.xlsx