Exemplo n.º 1
0
 /// <summary>
 /// Construct a TestPage controller for TestPage.html
 /// </summary>
 /// <param name="driver"></param>
 /// <param name="nonExistentBlock"></param>
 /// <param name="tableBlock"></param>
 public TestPage(IWebDriver driver,
                 NonExistentBlock nonExistentBlock,
                 TableBlock tableBlock) : base(driver)
 {
     this.NonExistentBlock = nonExistentBlock;
     this.TableBlock       = tableBlock;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Test timeout duration by waiting for the non existent block to load.
        /// </summary>
        /// <param name="useLongWait"></param>
        /// <param name="useBy"></param>
        /// <exception cref="Exception"></exception>
        public IWebElement TimeoutFailingToFindNonExistentElement(bool useLongWait, bool useBy)
        {
            DateTime start = DateTime.Now;

            try
            {
                return(NonExistentBlock.FindNonExistentElement(useLongWait, useBy));
            }
            catch (Exception ex)
            {
                TestContext.WriteLine($"Wait timed out after {DateTime.Now.Subtract(start).TotalSeconds} seconds");
                throw ex;
            }
        }