public static By AsContainer(this By containerBy, By childBy) { string childCss = childBy.ToString(); if (!childCss.Contains("Css")) { throw new ArgumentException($"{childCss} is not a CSS Selector."); } childCss = childCss.Substring(childCss.IndexOf(':') + 1).TrimStart(); return(containerBy.AsContainer(childCss)); }