How do I get the current DOM with Selenium Java 2.8? How do I get the current DOM with Selenium Java 2.8? selenium selenium

How do I get the current DOM with Selenium Java 2.8?


I have the same question really but the only way I've found to do it is ExecuteScript:

/// <summary>        /// Gets the parentElement/Node of a particular element        /// </summary>        /// <param name="driver"></param>        /// <param name="element"></param>        /// <returns></returns>        public static IWebElement GetElementParent(IWebDriver driver,IWebElement element)        {            return (IWebElement) ((IJavaScriptExecutor)driver).ExecuteScript("return arguments[0].parentNode", element);        }

why the By doesnt support By.DOM with a function I don't really know...I suspect its due to the need for a webdriver for multiple browsers etc