public static String GetFeatureNameForScreenshot(this FeatureContext featureContext) { String featureName = featureContext.GetFeatureNameForLogging(); featureName = String.Join("", featureName.Split(Path.GetInvalidFileNameChars())); // Remove other characters that are valid for a path but not a screenshot name (/ and : for example) featureName = featureName.Replace("/", ""); featureName = featureName.Replace(":", ""); return(featureName); }