//Awaits an element to be clickable By locator, //clicks the element and than asserts By a following locator that the click action was initiated and performed correctly. public void ClickAssert(By locator, By assertLocator, string description, int waitTime = 120) { log.Debug("ClickAssert start."); SharedServiceClass.ClickAssert(Driver, locator, assertLocator, waitTime); log.Debug("ClickAssert finished."); log.Info(description + " - ClickAssert performed. '" + locator.ToString() + "' has been clicked. and '" + assertLocator.ToString() + "' asserted."); }
//Awaits an element to be clickable By locator, //clicks the element and than asserts By a following locator that the click action was initiated and performed correctly. //public void ClickAssert(By locator, By assertLocator, string description, int waitTime = 120) { // log.Debug("ClickAssert start."); // SharedServiceClass.ClickAssert(Driver, locator, assertLocator, waitTime); // log.Debug("ClickAssert finished."); // log.Info(description + " - ClickAssert performed. '" + locator.ToString() + "' has been clicked. and '" + assertLocator.ToString() + "' asserted."); //} //Awaits an element to be visible By locator, then sends keys string the element. public void JQuerySendKeys(string locator, string keys, string description, int waitTime = 120, bool isClear = true) { SharedServiceClass.JqueryElementReady(Driver, locator, waitTime); if (isClear) { SharedServiceClass.JquerySendKeys(Driver, locator, ""); } SharedServiceClass.JquerySendKeys(Driver, locator, keys); log.Info(description + " - '" + locator.ToString() + "' - SendKeys: '" + keys + "'."); }
//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 + "'."); }
//Awaits an element to be clickable By locator, then clicks the element. public void Click(By locator, string description, int waitTime = 120) { SharedServiceClass.ElementIsClickable(Driver, locator, waitTime).Click(); log.Info(description + " - '" + locator.ToString() + "' - Click."); }
//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."); }
public void JQueryClick(string locator, string description, int waitTime = 120) { SharedServiceClass.JqueryElementReady(Driver, locator, waitTime); SharedServiceClass.JqueryClick(Driver, locator); log.Info(description + " - '" + locator.ToString() + "' - Click."); }
//Switches Driver's focus to the windowIndexes's opened browser instance. public void SwitchToWindow(int windowIndex, string description) { Driver.SwitchTo().Window(SharedServiceClass.LastWindowName(Driver, windowIndex)); log.Info("Moving focust to window: " + description + "."); }
//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 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 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 + "'."); }