Browse files

added a method get all checkboxes of same name

  • Loading branch information...
1 parent 405c1bc commit a83dd57d84d0cfcb645dd68195980e18d3aa8d0b @shashankshetty shashankshetty committed May 13, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/FluentBrowserAutomation/BrowserContext.cs
View
8 src/FluentBrowserAutomation/BrowserContext.cs
@@ -26,6 +26,7 @@ public interface IBrowserContext
CheckBoxWrapper CheckBoxWithId([NotNull] string id);
CheckBoxWrapper CheckBoxWithLabel([NotNull] string id);
IEnumerable<CheckBoxWrapper> CheckBoxes();
+ IEnumerable<CheckBoxWrapper> CheckBoxesWithName([NotNull] string name);
void CloseBrowser();
ContainerWrapper ContainerWithId([NotNull] string id);
DialogHandlerWrapper Dialog([NotNull] Action action);
@@ -133,6 +134,13 @@ public IEnumerable<CheckBoxWrapper> CheckBoxes()
return checkBoxes.Select(x => new CheckBoxWrapper(x, howFound, this));
}
+ public IEnumerable<CheckBoxWrapper> CheckBoxesWithName(string name)
+ {
+ const string howFound = "type 'checkbox'";
+ var checkBoxes = GetInputs().Where(x => x.GetAttribute("type") == "checkbox" && x.GetAttribute("name") == name);
+ return checkBoxes.Select(x => new CheckBoxWrapper(x, howFound, this));
+ }
+
public void CloseBrowser()
{
_browserManager.Close();

0 comments on commit a83dd57

Please sign in to comment.