Skip to content

Commit

Permalink
Added web element extension for getting the inner HTML of an element
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmcroft committed Sep 25, 2021
1 parent e3bc97a commit 7d459bb
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Legerity.Web/Extensions/IWebElementExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
namespace Legerity.Web.Extensions
{
using OpenQA.Selenium;

/// <summary>
/// Defines a collection of extensions for the <see cref="By"/> class.
/// </summary>
public static class IWebElementExtensions
{
/// <summary>
/// Retrieves the inner HTML of the specified <see cref="IWebElement"/>.
/// </summary>
/// <param name="element">The <see cref="IWebElement"/> to retrieve the inner HTML from.</param>
/// <returns>A string representing the inner HTML.</returns>
public static string GetInnerHtml(this IWebElement element)
{
return element.GetAttribute("innerHTML");
}
}
}

0 comments on commit 7d459bb

Please sign in to comment.