Beispiel #1
0
        //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 + "'.");
        }
Beispiel #2
0
 //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.");
 }
Beispiel #3
0
 //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 + "'.");
 }
Beispiel #4
0
 //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 + "'.");
 }
Beispiel #5
0
 //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 + "'.");
 }