Esempio n. 1
0
 /// <summary>
 /// Seaching from page
 /// </summary>
 /// <param name="Anything"> what you searching for</param>
 public void Search(string Anything)
 {
     SearchTxt.Clear();
     SearchTxt.SendKeys(Anything);
     Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible);
     SearchBtn.Click();
     Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible);
 }
Esempio n. 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"
        /// </summary>
        /// <param name="tblBody">The tbody element in your table</param>
        /// <param name="searchText">What you want to search for</param>
        public void Search(By tblBody, string searchText)
        {
            SearchTxt.SendKeys(searchText);

            SearchTxt.SendKeys(Keys.Enter);

            Thread.Sleep(0400);
            Browser.WaitForElement(tblBody, TimeSpan.FromSeconds(240), ElementCriteria.AttributeValueNot("class", "loading"));
            Thread.Sleep(1000);
        }
        /// <summary>
        /// Enters text into the top left hand Search field, clicks Go, then waits for the Search Results page to load
        /// </summary>
        /// <param name="textToEnter">The text you want to enter into the Search field</param>
        /// <returns></returns>
        public SearchResultsPage Search(string textToEnter)
        {
            SearchTxt.Clear();
            SearchTxt.SendKeys(textToEnter);
            SearchBtn.Click();

            SearchResultsPage page = new SearchResultsPage(Browser);

            page.WaitForInitialize();
            return(page);
        }
Esempio n. 4
0
        /// <summary>
        /// Selecting a value from the Status dropdown, Entering text in the name text box and clicking search
        /// </summary>
        /// <param name="UserStatus">Select user status from dropdown</param>
        /// <param name="UserName">passing username</param>
        public void SearchForUserByStatusAndName(String UserStatus, String UserName)
        {
            Browser.WaitForElement(Bys.AMAPage.LoadIcon, TimeSpan.FromSeconds(180), ElementCriteria.IsNotVisible);
            StatusSelElem.SelectByValue(UserStatus);
            SearchTxt.Clear();
            SearchTxt.SendKeys(UserName);
            Browser.WaitForElement(Bys.AMAPage.SearchBtn, TimeSpan.FromSeconds(180), ElementCriteria.IsEnabled, ElementCriteria.IsVisible);
            try
            {
                Thread.Sleep(0500);
                SearchBtn.Click();
            }
            catch (InvalidOperationException)
            {
                SearchTxt.SendKeys(Keys.Enter);
                SearchTxt.SendKeys(Keys.Enter);
            }

            // StatusSelElem.SelectByValue(UserStatus);
            Browser.WaitForElement(Bys.AMAPage.LoadIcon, ElementCriteria.IsNotVisible);
        }