コード例 #1
0
        /// <summary>
        /// sets the values of name and description properties
        /// </summary>
        public void setMarksheetProperties(string name, string description)
        {
            //WebDriverWait waiter = new WebDriverWait(WebContext.WebDriver, TimeSpan.FromSeconds(MarksheetConstants.Timeout));
            //waiter.Until(ExpectedConditions.ElementExists(MarksheetConstants.MarksheetName));
            //waiter.Until(ExpectedConditions.ElementExists(MarksheetConstants.MarksheetDescription));
            //WebContext.WebDriver.FindElement(MarksheetConstants.MarksheetName).SendKeys(name);
            //WebContext.WebDriver.FindElement(MarksheetConstants.MarksheetDescription).SendKeys(description);

            IWebElement MarksheetName = ElementRetriever.GetOnceLoaded(MarksheetConstants.MarksheetName);

            MarksheetName.WaitUntilState(ElementState.Displayed);
            MarksheetName.SendKeys(name);

            IWebElement MarksheetDescription = ElementRetriever.GetOnceLoaded(MarksheetConstants.MarksheetDescription);

            MarksheetDescription.WaitUntilState(ElementState.Displayed);
            MarksheetDescription.SendKeys(description);
        }
コード例 #2
0
 /// <summary>
 /// Au: Logigear
 /// Des: Enter a string into TextBox, TextArea... controls
 /// </summary>
 /// <param name="element"></param>
 /// <param name="value"></param>
 public static void EnterForDropDown(this IWebElement element, string value)
 {
     try
     {
         element.SendKeys(Keys.Enter);
         WaitForAjaxReady(By.CssSelector(".locking-mask"));
         //IWebElement inputElement = FindElement(SimsBy.CssSelector("#select2-drop input.select2-input"));
         var inputElement = ElementRetriever.GetOnceLoaded(SeSugar.Automation.SimsBy.CssSelector("#select2-drop input.select2-input"));
         inputElement.WaitUntilState(ElementState.Displayed);
         inputElement.SendKeys(value);
         Thread.Sleep(2000);
         inputElement.SendKeys(Keys.Enter);
     }
     catch (Exception ex)
     {
         Console.WriteLine("Have an exception happens when enter date for drop down: " + ex.ToString());
     }
 }