FilePath Incomplete

Hi Everyone,

I have a test step with the following property which shows up fine in test plan editor just fine (using 9.11 .1+53284f62) but when I select where I want the file to be saved, the string doesn’t have the path but rather a bunch of “…” Maybe this is a basic Windows thing but I printed to the log and it confirms that the path is not right.

[Display(Group: “Calibration Settings”, Name: “Output Files”, Order: 4.2)]
[FilePath(FilePathAttribute.BehaviorChoice.Save, “csv”)]
public string CorrectionFilePath { get; set; }

public override void Run()
{
Log.Info(“Correction File Path is {0}”, CorrectionFilePath);
}

Log says:
11:59:16.811 TestStep Correction File Path is …\Desktop\test.csv

I haven’t tried using this path to actually save because it’s puzzling to me that the string itself isn’t complete.

Thanks!
Andy

3 Likes

Here is a screenshot. When I pasted in the post, it didn’t show up right.

1 Like

@andy_owen this is intentional. What you are seeing is the full path being converted to a relative path based on your install directory. If you want the full path, you can use something like this:

       private string  path;
       public string FilePath
       {
           get
           {
               return path;
          }
           set
           {
               if (String.IsNullOrWhiteSpace(value) == false)
               {
                   path = Path.GetFullPath(value);
               }
           }
       }
2 Likes

Perfect. I figured it had to be an easy change to get what I wanted. Thanks @brennen_direnzo!

2 Likes