public BRBaseWidget(string locator, LocatorTypes locatorType, string controlType, string displayName) { Locator = locator; ControlType = controlType; DisplayName = displayName; LocatorType = locatorType; By m_By = GetFindBy(); FindBy = m_By; }
protected By GetFindBy(LocatorTypes LocatorType, params string[] locator) { if (locator.Length != 1) { Locator = locator[0]; } By by = null; try { switch (LocatorType) { case LocatorTypes.ID: by = By.Id(Locator); break; case LocatorTypes.TAGNAME: by = By.TagName(Locator); break; case LocatorTypes.LINKTEXT: by = By.LinkText(Locator); break; case LocatorTypes.CLASS: by = By.ClassName(Locator); break; case LocatorTypes.CSS: by = By.CssSelector(Locator); break; case LocatorTypes.NAME: by = By.Name(Locator); break; case LocatorTypes.XPATH: by = By.XPath(Locator); break; } } catch (Exception e) { } return(by); }
public BRTextBox(string locator, LocatorTypes locatorType, string controlType, string displayName) : base(locator, locatorType, controlType, displayName) { }
public BRTextBox(string locator, LocatorTypes locatorType, string displayName) : base(locator, locatorType, "TextBox", displayName) { }
public BRLink(string locator, LocatorTypes locatorType, string displayName) : base(locator, locatorType, "Link", displayName) { }
public BRCard(string locator, LocatorTypes locatorType, string displayName) : base(locator, locatorType, "CARD", displayName) { ; }
public BRTabularData(string locator, LocatorTypes locatorType, string displayName) : base(locator, locatorType, "TabularData", displayName) { }
public BRDatePicker(string locator, LocatorTypes locatorType, string displayName) : base(locator, locatorType, "DatePicker", displayName) { }
public BRFilter(string locator, LocatorTypes locatorType, string displayName) : base(locator, locatorType, "Filter", displayName) { }
public BRDropDownList(string locator, LocatorTypes locatorType, string displayName) : base(locator, locatorType, "DropDownList", displayName) { }
public BRFieldSet(string Locator, LocatorTypes locatorType, string DisplayName) : base(Locator, locatorType, "fieldset", DisplayName) { }
public static By GetByLocator(LocatorTypes type, string path) { return((By)typeof(By).GetMethod(type.ToString()).Invoke(null, new object[] { path })); }
public BRSelect(string locator, LocatorTypes locatorType, string displayName) : base(locator, locatorType, "Select", displayName) { }
public BRCheckbox(string locator, LocatorTypes locatorType, string displayName) : base(locator, locatorType, "Checkbox", displayName) { }
public BRTable(string locator, LocatorTypes locatorType, string displayName) : base(locator, locatorType, "Table", displayName) { }
public BRMenu(string locator, LocatorTypes locatorType, string displayName) : base(locator, locatorType, "Menu", displayName) { }
public BRAutoCompleteFilter(string locator, LocatorTypes locatorType, string displayName) : base(locator, locatorType, "AutoCompleteFilter", displayName) { }
//the grid public BRGrid(string locator, LocatorTypes locatorTypes, string displayName) : base(locator, locatorTypes, "Grid", displayName) { }
public BRImage(string locator, LocatorTypes locatorType, string displayName) : base(locator, locatorType, "Image", displayName) { }
public BRRadioButton(string locator, LocatorTypes locatorType, string displayName) : base(locator, locatorType, "Radio Button", displayName) { }
// public BRToggleButton(string locator, LocatorTypes locatorType, string displayName) : base(locator, locatorType,"Button", displayName) { } public BRToggleButton(string locator, LocatorTypes locatorType, string displayName) : base(locator, locatorType, "Button", displayName) { }