示例#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 + "'.");
        }
示例#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.");
 }
示例#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 + "'.");
 }
示例#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 + "'.");
 }
示例#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 + "'.");
 }