public static WebElementViewModel CreateModelFromInfo(WebElementInfo info) { WebElementViewModel model = null; if (info is WebContext webContext) { model = new WebContextViewModel(); model.FillFromInfo(webContext); } else if (info is DropDownElementInfo dropDown) { model = new DropDownElementViewModel(); model.FillFromInfo(dropDown); } else if (info is RadioGroupElementInfo radioGroup) { model = new RadioGroupViewModel(); model.FillFromInfo(radioGroup); } else if (info is CombinedWebElementInfo combined) { model = new CombinedElementViewModel(); model.FillFromInfo(combined); } else { model = new WebElementViewModel(); model.FillFromInfo(info); } return(model); }
public static WebContextViewModel CreateWebContextModel() { var model = new WebContextViewModel(); model.ElementType = WebElementTypes.Context; CreateCombinedElementModel(model); model.Name += " Page"; return(model); }