Visual Studio 2017 (Windows 10): "Unrecognized Escape Sequence" errors when building a solution imported from HipTest SpecFlow


I am creating scenarios in HipTest and then generating automated tests by downloading them from the Automation area of my project in the SpecFlow format.

Then I am unzipping the file and placing the unzipped files in my Visual Studio 2017 solution.

When I attempt to build the solution I get an “Unrecognized Escape Sequence” error for each line that contains a “Given” statement in the StepDefinitions.cs file.

I can fix the issue by changing all instances of “.$” to use a double slash instead: “\.$” but I need to do this every time my scenarios are updated and a new StepDefinitions.cs file is generated.

I had two screenshots to upload, but the system only let me upload one because I am “new”.


Here is the other screen shot.



The problem is that your action words contains a dot . in the end of their names. To solve the issue, you have to remove the dot. Visual studio considers .$ as a Regexp so it automatically adds \ so the build fails.

I hope that it helps!


Ok, so it sounds like I shouldn’t be using a period at the end of my sentence. (Or a full stop as it’s called in other places :slight_smile: )


Exactly, Happy testing!