Permalink
Browse files

added a method to get hidden field value

  • Loading branch information...
shashankshetty committed Jun 14, 2013
1 parent a5bc5b5 commit 5c07d65c6d9154376c080186dd37a2e89a277eb6
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/FluentBrowserAutomation/BrowserContext.cs
@@ -63,6 +63,7 @@ public interface IBrowserContext
TextBoxWrapper TextBoxWithId([NotNull] string id);
TextBoxWrapper TextBoxWithLabel([NotNull] string label);
IEnumerable<TextBoxWrapper> TextBoxes();
+ string GetHiddenValueWithId([NotNull] string id);
IBrowserContext WaitUntil([NotNull] Func<IBrowserContext, bool> func, int secondsToWait = 10);
}
@@ -215,6 +216,12 @@ public TextBoxWrapper HiddenWithId(string id)
return new TextBoxWrapper(hidden, String.Format(howFound, id), this);
}
+ public string GetHiddenValueWithId(string id)
+ {
+ var hidden = TryGetElementByIdAndInputType(id, "hidden");
+ return hidden.GetAttribute("value");
+ }
+
public IEnumerable<TextBoxWrapper> Hiddens()
{
const string howFound = "type 'hidden'";

0 comments on commit 5c07d65

Please sign in to comment.