Forum Discussion

alexhdz2007's avatar
alexhdz2007
Occasional Contributor
5 years ago
Solved

Setting Baseline File as a Parameter

I want to know if it is possible to set a parameter for a stored baseline file in a File Checkpoint within a keyword test. I am able to set the file that is to be checked as a parameter, but I cannot...
  • tristaanogre's avatar
    5 years ago

    Short answer:

     

    No.  The reason being is that the way File Checkpoints work in Keyword tests is that baselines for File Checkpoints are objects in the "Files" stores.  If you convert a file checkpoint to Script, it looks like this.

     

    function fileCheckpointTest()
    {
      //Compares the Description1 Stores item with the 'C:\Temp\Description.xml' file.
      Files.Description1.Check("C:\\Temp\\Description.xml");
    }

    So, you see, the baseline isn't even a parameter here, only the file to be compared.

     

    To do what you're asking, you need to build your checkpoint in Keyword tests differently.  Instead of using the File Checkpoint as it is, you would do a Test Action as "Call Object Method" and the object would be the "Files" object.  From there, call the "Compare" method which allows for two parameters of file names... baseline and test file which you can then pass in as parameters to the keyword test itself.