Exemplo n.º 1
0
        public bool SearchFor(string item)
        {
            SendKeys(item);

            string       sel           = "//div[@class='numbers' and contains(text(),'" + item + "')]";
            BRBaseWidget searchResults = new BRBaseWidget(sel, LocatorTypes.XPATH, "searchresults", "Search Results");

            try
            {
                searchResults.WaitTilIsVisible(5);
                SendEnter();
                return(true);
            }
            catch (Exception)
            {
                sel           = "//div[@class='displayname' and contains(text(),'" + item + "')]";
                searchResults = new BRBaseWidget(sel, LocatorTypes.XPATH, "searchresults", "Search Results");
                try
                {
                    searchResults.WaitTilIsVisible(1);
                    SendEnter();
                }
                catch (Exception)
                {
                    sel           = "//div[@class='select2-result-label' and contains(text(),'" + item + "')]";
                    searchResults = new BRBaseWidget(sel, LocatorTypes.XPATH, "searchresults", "Search Results");
                    searchResults.WaitTilIsVisible(1);
                    SendEnter();
                }
                return(true);
            }
            //return false;
        }
Exemplo n.º 2
0
        public bool SelectItem(string item)
        {
            bool WasSelected = false;

            Open.Click();  //open the dropdown

            BRBaseWidget m_dropDownList = DropDownList;

            m_dropDownList.WaitTilIsVisible();

            string       sel       = "//li/div[contains(@class, 'select2-result-label')][contains(text(),'" + item + "')]";
            BRBaseWidget m_theItem = new BRBaseObjects.BRBaseWidget(sel, LocatorTypes.XPATH, "dropdownItem", item);

            m_theItem.WaitTilIsVisible();
            m_theItem.Click();
            WasSelected = true;

            return(WasSelected);
        }
Exemplo n.º 3
0
        public bool SelectItem(string item)
        {
            SendKeys(item);
            string sel = "//li/a/b[contains(text(),'" + item + "')]";

            BRBaseWidget m_item = new BRBaseWidget(sel, LocatorTypes.XPATH, "dropdownmenuitem", "Drop Down Menu Item");

            try
            {
                m_item.WaitTilIsVisible();
                m_item.Click();
            }
            catch (Exception)
            {
                sel    = "//li/a[contains(text(),'" + item + "')]";
                m_item = new BRBaseWidget(sel, LocatorTypes.XPATH, "dropdownmenuitem", "Drop Down Menu Item");
                m_item.WaitTilIsVisible();
                m_item.Click();
            }

            return(true);
        }