The Following snippet is most of the time used while working on Automation using WinAppDriver
-Pankaj Dhapola
Let's Think on it
driver - RemoteWebDriver instanceSystem.Xml.XmlDocument doc = new System.Xml.XmlDocument();doc.LoadXml(driver.PageSource.ToString());System.Xml.XmlTextWriter writer = new System.Xml.XmlTextWriter(@"c:\App_To_XML.xml", new System.Text.UnicodeEncoding());writer.Formatting = System.Xml.Formatting.Indented;doc.WriteContentTo(writer);-Pankaj Dhapola
Let's Think on it