type Element = | E of IWebElement let byId s (Element e) = e.GetElementById s let byCss c (Element e) = e.SelectElements c let interaction = Element -> unit let click (Element e) = e.Click() val bindPM<'a> : Element -> 'a type Item { Title of string } type Blog = { Items of Item list } with static member from (Element e) = .. type HomePage = { Blog : Blog ClickOnTheHeaderBar : interaction } with static member from (Element e) = { Blog = Blog.from e ClickOnTheMiddleWrapper = (fun () -> byId "middleWrapper" e |> click) }