Exemplo n.º 1
0
        private static void SignOut(HtmlDocument page)
        {
            // Click the "Sign-out" Hyperlink
            HtmlHyperlink signOutHyperLink = new HtmlHyperlink(page);

            signOutHyperLink.SearchProperties[HtmlHyperlink.PropertyNames.Id] = "logoutLink";
            if (signOutHyperLink.Exists)
            {
                signOutHyperLink.EnsureClickable();
                Mouse.Click(signOutHyperLink);
            }
        }
Exemplo n.º 2
0
        private static HtmlDocument ClickSignInHyperLink(BrowserWindow browser, HtmlDocument page)
        {
            // Click the "Sign-In" Hyperlink
            HtmlHyperlink signInHyperLink = new HtmlHyperlink(page);

            signInHyperLink.SearchProperties[HtmlHyperlink.PropertyNames.Id] = "loginLink";

            signInHyperLink.EnsureClickable();
            Mouse.Click(signInHyperLink);

            // Get the new page
            page = new HtmlDocument(browser);
            return(page);
        }
        private void NavigateToSearch()
        {
            HtmlHyperlink link = GetHtmlHyperlink("search-nav-button");

            ExpandNavMenu();

            try
            {
                Mouse.Click(link);
            }
            catch (FailedToPerformActionOnHiddenControlException)
            {
                ExpandNavMenu();

                link.EnsureClickable();

                Mouse.Click(link);
            }
        }