I am testing an app in French where I grab the text from screen using Seetest and store it in a Python variable. The method I am using is GetAllValues , I then compare it with the expected text that is stored in an xml which i parse using lxml parser.
I basically compare the text and spit out the differences using set operations. It works fine in english/german too but French has issues.
I tried converting every string into unicode and compare, it still doesn't work. Any suggestions?
def converting_to_unicode(list_of_strs,unicode_string=[]):
unicode_string=[]
for string in list_of_strs:
#print string
if isinstance(string,unicode):
unicode_string.append(unicode(string.encode('latin1'),encoding='latin1'))
else:
unicode_string.append(unicode(string,encoding='latin1'))
return unicode_string
And Reading the text from screen and xml
actual_text_screen = converting_to_unicode(var1)
expected_text_from_xml= converting_to_unicode(el_list)
mutually_exclusive = list(set(actual_text_screen)^set(expected_text_from_xml))
TIA