コード例 #1
0
ファイル: Browser.cs プロジェクト: arnonax/TestEssentials
        /// <summary>
        /// Initializes the instance of the object using the specified description and <see cref="IWebDriver"/>
        /// </summary>
        /// <param name="description">The description of the browser. This is used for logging</param>
        /// <param name="webDriver">The WebDriver instance that is used to communicate with the browser</param>
        /// <exception cref="ArgumentNullException">one of the arguments are null</exception>
        public Browser(string description, IWebDriver webDriver)
            : base(description)
        {
            if (description == null)
                throw new ArgumentNullException("description");

            if (webDriver == null)
                throw new ArgumentNullException("webDriver");

            WebDriver = webDriver;
            var mainWindowHandle = WebDriver.CurrentWindowHandle;
            MainWindow = new BrowserWindow(this, mainWindowHandle, "Main window");
            ActiveDOM = MainWindow;
        }
コード例 #2
0
        /// <summary>
        /// Initializes the instance of the object using the specified description and <see cref="IWebDriver"/>
        /// </summary>
        /// <param name="description">The description of the browser. This is used for logging</param>
        /// <param name="webDriver">The WebDriver instance that is used to communicate with the browser</param>
        /// <exception cref="ArgumentNullException">one of the arguments are null</exception>
        public Browser(string description, IWebDriver webDriver) : base(description)
        {
            if (description == null)
            {
                throw new ArgumentNullException("description");
            }

            if (webDriver == null)
            {
                throw new ArgumentNullException("webDriver");
            }

            WebDriver = webDriver;
            var mainWindowHandle = WebDriver.CurrentWindowHandle;

            MainWindow = new BrowserWindow(this, mainWindowHandle, "Main window");
            ActiveDOM  = MainWindow;
        }
コード例 #3
0
ファイル: Browser.cs プロジェクト: peterrexj/TestEssentials
        /// <summary>
        /// Initializes the instance of the object using the specified description and <see cref="IWebDriver"/>
        /// </summary>
        /// <param name="description">The description of the browser. This is used for logging</param>
        /// <param name="webDriver">The WebDriver instance that is used to communicate with the browser</param>
        /// <param name="testExecutionScopesManager">The test execution scope manager of your tests (See remarks)</param>
        /// <exception cref="ArgumentNullException">one of the arguments are null</exception>
        /// <remarks>
        /// The <paramref name="testExecutionScopesManager"/> is used to automatically close any windows that
        /// are opened using <see cref="OpenWindow(System.Action,string)"/>, at the end of the current test or active scope.
        /// <br/>
        /// If you're using TestAutomationEssentials.MSTest or TestAutomationEssentials.MSTestV2, simply pass
        /// <see cref="TestExecutionScopesManager"/>. Otherwise, create an instance of <see cref="TestExecutionScopesManager"/>
        /// and pass it.
        /// </remarks>
        public Browser(string description, IWebDriver webDriver, TestExecutionScopesManager testExecutionScopesManager)
            : base(description)
        {
            if (webDriver == null)
            {
                throw new ArgumentNullException("webDriver");
            }
            if (testExecutionScopesManager == null)
            {
                throw new ArgumentNullException("testExecutionScopesManager");
            }

            WebDriver = webDriver;
            var mainWindowHandle = WebDriver.CurrentWindowHandle;

            _mainWindow = new BrowserWindow(this, mainWindowHandle, "Main window");
            ActiveDOM   = MainWindow;
            _testExecutionScopesManager = testExecutionScopesManager;
        }
コード例 #4
0
 private BrowserElement(IDOMRoot domRoot, Func<IWebElement> getWebElement, string description)
     : base(description)
 {
     _domRoot = domRoot;
     _getWebElement = getWebElement;
 }
コード例 #5
0
 internal /*private */ BrowserElement(IDOMRoot domRoot, Func <IWebElement> getWebElement, string description)
     : base(description)
 {
     _domRoot       = domRoot;
     _getWebElement = getWebElement;
 }