Search code examples
python-3.xunicodeutf-8robotframeworkdecode

Getting UnicodeDecodeError: 'utf-8' when robot framework testcases are run in command prompt


Whenever I am trying to run testcases in Robot framework through cmd, i am getting the below error:

Parsing <filename with path> failed UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 31: invalid start byte

The above error thrown for some files and below error for some files

Parsing <filename with path> failed UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 47: invalid start byte

And then my test fails saying there is no such tag in the suite I am referring to, but I have the tag in my file.

Initally I thought it was because of some setting in the editor(STS) I am using and changed the settings under Window-> preferences -> General -> Workspace -> text file encoding option to 'Other' and selected utf-8, gave workspace rebuild, restarted the STS, but still no luck.

Been searching for a solution since weeks. Can someone help me on this?


Solution

  • Checking each and every Testcases by removing and adding them in new file and also by removing all the special characters used in keyword definition as well in testcase definition in the robot files resolved the issue