def saveProperties
      properties = {}
      for property in propertiesToSave
        value = instance_variable_get("@" + property.to_s)
        properties[property] = value
      end
      propertiesFileName = relative_path(self.class.propertiesFileName(@baseFileName))
      #puts "Saving properties #{properties.inspect} to #{propertiesFileName}"
      ensureDirectoryExists(File.dirname(propertiesFileName))
      File.open(propertiesFileName,"w") do |f|
        f.write(JSON.pretty_generate(properties))
      end
    end
def saveProperties
      properties = {}
      for property in propertiesToSave
        value = instance_variable_get("@" + property.to_s)
        properties[property] = value
      end
      propertiesFileName = relative_path(self.class.propertiesFileName(@baseFileName))
      #puts "Saving properties #{properties.inspect} to #{propertiesFileName}"
      ensureDirectoryExists(File.dirname(propertiesFileName))
      File.open(propertiesFileName,"w") do |f|
        f.write(JSON.pretty_generate(properties))
      end
    end
Save some of the page object's instance variable values to a file as JSON
 This method depends on the following defined in the actual page object class:
 * propertiesToSave instance method, to return an array of symbols
 * propertiesFileName class method, to return name of properties file as a function of the web page source file name
  (propertiesFileName is a class method, because it needs to be invoked by other code that _reads_ the properties
   file when the page object itself does not exist)
 Example of useage: an index file for a blog needs to read properties of each blog page,
 where the blog page objects have saved their details into the individual property files.