//Awaits an element to be visible By locator, then sends keys string the element. public void SendKeys(By locator, string keys, string description, int waitTime = 120, bool isClear = true) { IWebElement element = SharedServiceClass.ElementIsVisible(Driver, locator, waitTime); if (isClear) { element.Clear(); } element.SendKeys(keys); log.Info(description + " - '" + locator.ToString() + "' - SendKeys: '" + keys + "'."); }
//Moves focus to element selected by locator. public void MoveToElement(By locator) { log.Debug("Moving focus to element " + locator.ToString()); new Actions(Driver).MoveToElement(SharedServiceClass.ElementIsVisible(Driver, locator)).Build().Perform(); log.Debug("Focus to element was set."); }
//Awaits a select element to be visible By locator, then selects by value. public void SelectByValue(By locator, string value, string description, int waitTime = 120) { new SelectElement(SharedServiceClass.ElementIsVisible(Driver, locator, waitTime)).SelectByValue(value); log.Info(description + " - '" + locator.ToString() + "' - SelectByValue: '" + value + "'."); }
//Awaits a select element to be visible By locator, then selects by text. public void SelectByText(By locator, string text, string description, int waitTime = 120) { new SelectElement(SharedServiceClass.ElementIsVisible(Driver, locator, waitTime)).SelectByText(text); log.Info(description + " - '" + locator.ToString() + "' - SelectByText: '" + text + "'."); }
//Awaits a select element to be visible By locator, then selects by index. public void SelectByIndex(By locator, int index, string description, int waitTime = 120) { new SelectElement(SharedServiceClass.ElementIsVisible(Driver, locator, waitTime)).SelectByIndex(index); log.Info(description + " - '" + locator.ToString() + "' - SelectByIndex: '" + index + "'."); }