Beispiel #1
0
 /// <summary>
 /// Waits for page to load by validating that a Ranorex.WebElement exists.
 /// </summary>
 /// <param name="webElement">The Ranorex.Webelement to validate</param></param>
 protected void WaitForLoad(WebElement webElement)
 {
     try
     {
         Validate.Exists(webElement);
     }
     catch (Ranorex.ValidationException e)
     {
         throw new Exception(String.Format("Failed to wait for page to load since failed to validate existence of {0}.", webElement.GetPath().ToString()), e);
     }
 }
        /// Method to refresh element
        /// </summary>
        /// <param name="element"></param>
        /// <returns></returns>
        public static WebElement RefreshElement(WebElement element)
        {
            string     ElementPath      = element.GetPath().ToString();
            WebElement RefreshedElement = null;

            try
            {
                RefreshedElement = GetElement(ElementPath);
            }
            catch
            {
                char[]   Delimiters   = new char[] { '/' };
                String[] PathSplit    = ElementPath.Split(Delimiters, StringSplitOptions.RemoveEmptyEntries);
                string   Relativepath = PathSplit[PathSplit.Length - 1];
                RefreshedElement = GetElement(".//" + Relativepath, 200);
            }
            return(RefreshedElement);
        }
Beispiel #3
0
 /// <summary>
 /// Waits for page to load by validating that a Ranorex.WebElement exists.
 /// </summary>
 /// <param name="webElement">The Ranorex.Webelement to validate</param></param>
 protected void WaitForLoad(WebElement webElement)
 {
     try
     {
         Validate.Exists(webElement);
     }
     catch (Ranorex.ValidationException e)
     {
         throw new Exception(String.Format("Failed to wait for page to load since failed to validate existence of {0}.", webElement.GetPath().ToString()), e);
     }
 }