public static Step ConvertFromPageObject(this Step step, SiteMap.Models.SiteMap sitemap)
        {
            foreach (var property in step.GetType().GetProperties())
            {
                if (property.PropertyType == typeof(string))
                {
                    string value = property.GetValue(step, null)?.ToString();

                    if (value != null && value.StartsWith("#"))
                    {
                        string[] pathElements    = value.Substring(1).Split('.');
                        var      pageKey         = pathElements[0];
                        string   propertyPath    = value.Substring(1 + 1 + pageKey.Length);
                        var      page            = sitemap.GetPage(pageKey);
                        var      pageProperties  = page.GetType().GetProperties();
                        var      stepProperties  = step.GetType().GetProperties();
                        var      currentProperty = stepProperties.FirstOrDefault(p => p.Name == propertyPath);
                        var      selectorValue   = ExpandoHelper.GetDynamicMember(page, propertyPath);
                        if (selectorValue is string)
                        {
                            step.Param = (string)selectorValue;
                        }
                        if (selectorValue is Selector)
                        {
                            step.Selector = (Selector)selectorValue;
                        }
                    }
                }
            }
            return(step);
        }
 public static Test ConvertFromPageObject(this Test test, SiteMap.Models.SiteMap sitemap)
 {
     foreach (var step in test.Steps)
     {
         step.ConvertFromPageObject(sitemap);
     }
     return(test);
 }