diff --git a/src/FluentBrowserAutomation/Controls/BasicInfoWrapper.cs b/src/FluentBrowserAutomation/Controls/BasicInfoWrapper.cs index c7460d2..9c3704d 100644 --- a/src/FluentBrowserAutomation/Controls/BasicInfoWrapper.cs +++ b/src/FluentBrowserAutomation/Controls/BasicInfoWrapper.cs @@ -22,6 +22,16 @@ public string Id return Element.GetAttribute("id"); } } + + public string Name + { + get + { + this.Exists().ShouldBeTrue(); + return Element.GetAttribute("name"); + } + } + public string HowFound { get; private set; } } } \ No newline at end of file diff --git a/src/FluentBrowserAutomation/Controls/ButtonWrapper.cs b/src/FluentBrowserAutomation/Controls/ButtonWrapper.cs index 58eac32..a093b8f 100644 --- a/src/FluentBrowserAutomation/Controls/ButtonWrapper.cs +++ b/src/FluentBrowserAutomation/Controls/ButtonWrapper.cs @@ -1,3 +1,4 @@ +using FluentBrowserAutomation.Accessors; using OpenQA.Selenium; namespace FluentBrowserAutomation.Controls @@ -8,5 +9,10 @@ public ButtonWrapper(IWebElement button, string howFound, IBrowserContext browse : base(button, howFound, browser) { } + + public string Text + { + get { return new ReadOnlyText("value of " + HowFound, Element.GetAttribute("value")); } + } } } \ No newline at end of file diff --git a/src/FluentBrowserAutomation/Controls/INavigationControl.cs b/src/FluentBrowserAutomation/Controls/INavigationControl.cs index 9e6be3f..5e85922 100644 --- a/src/FluentBrowserAutomation/Controls/INavigationControl.cs +++ b/src/FluentBrowserAutomation/Controls/INavigationControl.cs @@ -1,6 +1,9 @@ +using FluentBrowserAutomation.Accessors; + namespace FluentBrowserAutomation.Controls { public interface INavigationControl : ICanBeClicked, IAmVisualElement, ICouldBeDisabled { + string Text { get; } } } \ No newline at end of file diff --git a/src/FluentBrowserAutomation/Controls/ImageWrapper.cs b/src/FluentBrowserAutomation/Controls/ImageWrapper.cs index 8fdc904..2747c67 100644 --- a/src/FluentBrowserAutomation/Controls/ImageWrapper.cs +++ b/src/FluentBrowserAutomation/Controls/ImageWrapper.cs @@ -1,3 +1,4 @@ +using FluentBrowserAutomation.Accessors; using OpenQA.Selenium; namespace FluentBrowserAutomation.Controls @@ -8,5 +9,10 @@ public ImageWrapper(IWebElement webElement, string howFound, IBrowserContext bro : base(webElement, howFound, browser) { } + + public string Text + { + get { return new ReadOnlyText("alt of " + HowFound, Element.GetAttribute("alt")); } + } } } \ No newline at end of file diff --git a/src/FluentBrowserAutomation/Controls/LinkWrapper.cs b/src/FluentBrowserAutomation/Controls/LinkWrapper.cs index 9e98a4d..30c8bd3 100644 --- a/src/FluentBrowserAutomation/Controls/LinkWrapper.cs +++ b/src/FluentBrowserAutomation/Controls/LinkWrapper.cs @@ -1,3 +1,4 @@ +using FluentBrowserAutomation.Accessors; using OpenQA.Selenium; namespace FluentBrowserAutomation.Controls @@ -8,5 +9,10 @@ public LinkWrapper(IWebElement link, string howFound, IBrowserContext browserCon : base(link, howFound, browserContext) { } + + public string Text + { + get { return new ReadOnlyText("text of " + HowFound, Element.GetAttribute("text")); } + } } } \ No newline at end of file diff --git a/src/FluentBrowserAutomation/Controls/Properties/IHaveBasicInfo.cs b/src/FluentBrowserAutomation/Controls/Properties/IHaveBasicInfo.cs index 911aaee..fd6422c 100644 --- a/src/FluentBrowserAutomation/Controls/Properties/IHaveBasicInfo.cs +++ b/src/FluentBrowserAutomation/Controls/Properties/IHaveBasicInfo.cs @@ -18,6 +18,7 @@ public interface IHaveBasicInfo IWebElement Element { get; } string HowFound { get; } string Id { get; } + string Name { get; } } public static class IBasicInfoExtensions