public WebBaseElement(By byLocator = null, IWebElement webElement = null, List <IWebElement> webElements = null) { Invoker = new ActionInvoker(this); GetElementClass = new GetElementClass(this); Actions = new ElementsActions(this); WebAvatar = new GetElementModule(this, byLocator) { WebElement = webElement, WebElements = webElements }; }
public WebBaseElement(By byLocator = null, IWebElement webElement = null) { Invoker = new ActionInvoker(this); GetElementClass = new GetElementClass(this); Actions = new ElementsActions(this); _webElement = webElement; Avatar = new GetElementModule { Element = this, ByLocator = byLocator }; }
public void Fill(Dictionary <string, string> map) { this.GetFields(typeof(ISetValue)).ForEach(element => { var fieldValue = map.FirstOrDefault(pair => GetElementClass.NamesEqual(pair.Key, NameAttribute.GetElementName(element))).Value; if (fieldValue == null) { return; } var setValueElement = (ISetValue)element.GetValue(this); DoActionRule(fieldValue, val => SetFieldValueAction(this, val, setValueElement)); }); }
public WebBaseElement(By byLocator = null, IWebElement webElement = null, List <IWebElement> webElements = null, WebBaseElement element = null) { Invoker = new ActionInvoker(this); GetElementClass = new GetElementClass(this); Actions = new ElementsActions(this); WebAvatar = new GetElementModule(this, byLocator) { WebElement = webElement, WebElements = webElements }; if (element != null) { WebAvatar.DriverName = element.WebAvatar.DriverName; Parent = element.Parent; } }
public IList <string> Verify(Dictionary <string, string> objStrings) { var compareFalse = new List <string>(); this.GetFields(typeof(IHasValue)).ForEach(field => { var fieldValue = objStrings.FirstOrDefault(pair => GetElementClass.NamesEqual(pair.Key, NameAttribute.GetElementName(field))).Value; if (fieldValue == null) { return; } var valueField = (IHasValue)field.GetValue(this); DoActionRule(fieldValue, expected => { var actual = GetFieldValueAction(this, valueField).Trim(); if (actual.Equals(expected)) { return; } compareFalse.Add($"Field '{field.Name}' (Actual: '{actual}' <> Expected: '{expected}')"); }); }); return(compareFalse); }
public Popup() { GetTextAction = p => GetElementClass.GetTextElement().Text; }
public void Close() { GetElementClass.GetButton(Functions.Close).Click(); }
public void Cancel() { GetElementClass.GetButton(Functions.Cancel).Click(); }
public void Ok() { GetElementClass.GetButton(Functions.Ok).Click(); }
public void Submit(string text, string buttonName) { SetText(text); GetElementClass.GetButton(buttonName).Click(); }
public void Submit(string text) { SetText(text); GetElementClass.GetButton("Submit").Click(); }
public void Submit(Dictionary <string, string> objStrings) { Fill(objStrings); GetElementClass.GetButton("Submit").Click(); }
public void Submit(T entity, string buttonName) { Fill(entity.ToSetValue()); GetElementClass.GetButton(buttonName).Click(); }
public void Submit(T entity, Enum buttonName) { Fill(entity.ToSetValue()); GetElementClass.GetButton(buttonName.ToString().ToLower()).Click(); }