Beispiel #1
0
        public void DownloadSourceCode(string categoryName, string articleName)
        {
            _homePage.NavigateTo();
            _homePage.AssertFindHowText(categoryName);
            var findHowButton = _homePage.GetFindHowButtonByText(categoryName);

            findHowButton.Click();

            _categoryPage.AssertCategoryBackgroundWhenSelected(categoryName);
            var articleAnchor = default(IWebElement);

            do
            {
                try
                {
                    articleAnchor = _categoryPage.GetArticleAnchorByName(articleName);
                }
                catch (NoSuchElementException)
                {
                    _categoryPage.NavigateToNextPage();
                }
            }while (articleAnchor == null);
            articleAnchor.Click();

            _articlePage.DownloadFullSourceCode.Click();
        }
Beispiel #2
0
        protected override void PerformAct()
        {
            var articleAnchor = default(IWebElement);

            do
            {
                try
                {
                    articleAnchor = _categoryPage.GetArticleAnchorByName(_articleText);
                }
                catch (NoSuchElementException)
                {
                    _categoryPage.NavigateToNextPage();
                }
            }while(articleAnchor == null);
            articleAnchor.Click();
        }