Example #1
0
        /// <summary>
        /// Clicks on any participant within the participant table, then waits for the Participant page to load
        /// </summary>
        /// <param name="browser">The driver instance</param>
        /// <param name="particpantName">The exact text of the link for the participant that you want to click on from the participants table</param>
        internal ParticipantsPage ClickParticpantAndWait(IWebDriver browser, string particpantName)
        {
            ElemSet.Grid_ClickButtonOrLinkWithinRow(browser, AllParticpantsTblBody, Bys.SearchPage.AllParticpantsTblBodyRow,
                                                    particpantName, "a", particpantName, "a");

            ParticipantsPage page = new ParticipantsPage(browser);

            page.WaitForInitialize();
            return(page);
        }
Example #2
0
        /// <summary>
        /// For any table within LS, this method enters text in the search box, then either clicks Go or hits Enter and waits for table to
        /// get returned by waiting for the the tbody element's "class" attribute to not have a value of "loading". Then it will click on
        /// a site, particpant, etc. and wait for the cooresponding table to appear
        /// </summary>
        /// <param name="tblBody">The tbody element in your table</param>
        /// <param name="searchResults"><see cref="LSConstants.SearchResults"/> for a list of criteria that you can search for. For example, if you are on the Sites table, then you would obviously pass Sites as your search result</param>
        /// <param name="recordName">The exact text of the link for the site/participant/program/activity that you want to click on inside the table</param>
        internal dynamic SearchAndSelect(By tblBody, LSConstants.SearchResults searchResults, string recordName)
        {
            Search(tblBody, recordName);

            switch (searchResults)
            {
            case LSConstants.SearchResults.Sites:
                ClickSiteAndWait(Browser, recordName);
                return(null);

                break;

            case LSConstants.SearchResults.Participants:
                ParticipantsPage page = ClickParticpantAndWait(Browser, recordName);
                page.WaitForInitialize();
                return(page);

                break;
            }

            return(null);
        }