public static void FormFor <TModel>(this PageElement page, string id, Action <PageElement <TModel> > action) { var formId = page.Nav.Naming.Id(typeof(TModel)); var by = id.NotEmpty() ? By.Id(id) : By.CssSelector($"[data-for='{formId}']"); page.Nav.Logger.LogDebug($"Form {by}"); page.Within(by, action); }