From 7d459bbbe586bc87c6511ac5dad51cd0d5771f7f Mon Sep 17 00:00:00 2001 From: James Croft Date: Sat, 25 Sep 2021 14:41:49 +0100 Subject: [PATCH] Added web element extension for getting the inner HTML of an element --- .../Extensions/IWebElementExtensions.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/Legerity.Web/Extensions/IWebElementExtensions.cs diff --git a/src/Legerity.Web/Extensions/IWebElementExtensions.cs b/src/Legerity.Web/Extensions/IWebElementExtensions.cs new file mode 100644 index 00000000..1f424dc8 --- /dev/null +++ b/src/Legerity.Web/Extensions/IWebElementExtensions.cs @@ -0,0 +1,20 @@ +namespace Legerity.Web.Extensions +{ + using OpenQA.Selenium; + + /// + /// Defines a collection of extensions for the class. + /// + public static class IWebElementExtensions + { + /// + /// Retrieves the inner HTML of the specified . + /// + /// The to retrieve the inner HTML from. + /// A string representing the inner HTML. + public static string GetInnerHtml(this IWebElement element) + { + return element.GetAttribute("innerHTML"); + } + } +}