Esempio n. 1
0
        /// <summary>
        /// Gets the text of pop-up as string and parses it into a new list.
        /// </summary>
        /// <returns></returns>
        public IList <string> GetPopUpText()
        {
            IList <string> list      = new List <string>();
            IWebElement    paragraph = PopUpDiv.FindElement(By.TagName("p"));

            string[] arr = paragraph.Text.Split(new[] { "\r\n" }, StringSplitOptions.None);
            for (int i = 0; i < arr.Length; i++)
            {
                list.Add(arr[i]);
            }
            return(list);
        }
Esempio n. 2
0
        /// <summary>
        /// Return IWebElement from the pop-up.
        /// </summary>
        /// <param name="buttonName"></param>
        /// <returns></returns>
        public IWebElement GetPopUpButton(string buttonName)
        {
            IWebElement element = null;

            switch (buttonName)
            {
            case "OK":
                element = PopUpDiv.FindElement(By.ClassName("review__pop-up_button-submit"));
                break;

            case "CANCEL":
                element = PopUpDiv.FindElement(By.ClassName("review__pop-up_button-cancel"));
                break;

            default:
                break;
            }

            return(element);
        }