Пример #1
0
        public string getHintsAfterClickSubmitButton()
        {
            element = new ManyElementsPage(Driver);
            string text = element.TextAfterSubmitData.Text;

            return(text);
        }
Пример #2
0
 public void SetUp()
 {
     driver = new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
     driver.Manage().Window.Maximize();
     driver.Navigate().GoToUrl("https://www.ultimateqa.com/complicated-page/");
     wait             = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
     manyElementsPage = new ManyElementsPage(driver);
 }
Пример #3
0
        public string SolveFirstTask()
        {
            element = new ManyElementsPage(Driver);

            string[] getNumber  = element.FirstTask.Text.Split(" + ");
            int      addNumber  = int.Parse(getNumber[0]) + int.Parse(getNumber[1]);
            string   solvedTask = addNumber.ToString();

            return(solvedTask);
        }
Пример #4
0
        public void VerifyFacebookLinksIfLoadOnePage()
        {
            element = new ManyElementsPage(Driver);

            for (int i = 0; i < FacebookFollowLinks.Count(); i++)
            {
                string      expectedTitle = "Ultimate QA - Home | Facebook";
                IWebElement link          = FacebookFollowLinks[i];
                link.Click();
                string actualTitle = Driver.Title;
                Driver.Navigate().Back();

                Assert.AreEqual(expectedTitle, actualTitle);
            }
        }
Пример #5
0
        public bool getHintsForEmptyFields()
        {
            element = new ManyElementsPage(Driver);
            bool isEqual = false;

            IList <IWebElement> getFieldsThatShouldBeFill = Driver.FindElements(By.XPath(@"//div[@id=""et_pb_contact_form_0""]/div/ul/li"));

            string nameField    = element.Name.GetAttribute("value");
            string emailField   = element.EmailAddress.GetAttribute("value");
            string messageField = element.Message.GetAttribute("value");
            string captchaField = element.FirstCaptcha.GetAttribute("value");

            List <string> expectedHints = new List <string>();
            List <string> actualHints   = new List <string>();

            if (nameField == string.Empty)
            {
                expectedHints.Add("Name");
            }

            if (emailField == string.Empty)
            {
                expectedHints.Add("Email Address");
            }

            if (messageField == string.Empty)
            {
                expectedHints.Add("Message");
            }

            if (captchaField == string.Empty)
            {
                expectedHints.Add("Captcha");
            }

            for (int i = 0; i < getFieldsThatShouldBeFill.Count; i++)
            {
                actualHints.Add(getFieldsThatShouldBeFill[i].Text);
            }

            if (expectedHints.SequenceEqual(actualHints))
            {
                isEqual = true;
            }

            return(isEqual);
        }