public void AddAndDeleteNewCityCorrectly()
        {
            DeleteCityElement.Click();
            Thread.Sleep(3000);
            Assert.AreEqual(NotificationElement.Text, "Successfully deleted!");

            AddNewCityTextElement.Clear();
            AddNewCityTextElement.SendKeys("Kharkiv");
            AddNewCityElement.Click();
            Thread.Sleep(3000);
            Assert.AreEqual(NotificationElement.Text, "Successfully saved!");
        }
Exemple #2
0
        private static void gotoNextPage()
        {
            string selector = "»";

            wait.Until(ExpectedConditions.ElementExists(By.LinkText(selector)));
            RemoteWebElement rweLink = (RemoteWebElement)driver.FindElement(By.LinkText(selector));
            var scroller             = rweLink.LocationOnScreenOnceScrolledIntoView;

            rweLink.Click();
        }
Exemple #3
0
        public void Select(string value)
        {
            PrepareRadios();
            RemoteWebElement webElement = null;

            if (_Radios.TryGetValue(value, out webElement))
            {
                webElement.Click();
            }
        }
Exemple #4
0
        /*-------------------------------------------------------------------*/

        protected override void Execute(IWebDriver webDriver)
        {
            var webElement = _element?.AsWebElement() ?? webDriver.FindElementBySelector(_selector);

            if (webElement != null)
            {
                RemoteWebElement element = (RemoteWebElement)webElement;
                var viewPosition         = element.LocationOnScreenOnceScrolledIntoView;

                element.Click();
            }
        }
Exemple #5
0
        public new void Click()
        {
            // Letting the driver know about the current action.
            int left   = webElement_.Location.X;
            int top    = webElement_.Location.Y;
            int width  = 0;
            int height = 0;

            try
            {
                // Width cannot be extracted on all platforms so computing the offset may fail.
                width  = webElement_.Size.Width;
                height = webElement_.Size.Height;
            }
            catch
            {
            }

            if (left < 0)
            {
                width = Math.Max(0, width + left);
                left  = 0;
            }

            if (top < 0)
            {
                height = Math.Max(0, height + top);
                top    = 0;
            }

            int offsetX = width / 2;
            int offsetY = height / 2;

            var control = new Rectangle(left, top, width, height);
            var offset  = new Point(offsetX, offsetY);

            eyesDriver_.UserActionsEyes.AddMouseTrigger(MouseAction.Click, this, offset);

            Logger.Verbose("Click({0} {1})", control, offset);

            webElement_.Click();
        }
        public void AssertThat_QuickNavigationHyperlinks_ScrollPageTo_ProperSections()
        {
            foreach (IWebElement navigationHyperlink in this.QuickNavigationHyperlinks)
            {
                RemoteWebElement hyperlink = (RemoteWebElement)navigationHyperlink;

                this.ScrollQuickNavigationHyperlink(hyperlink);

                string           navigationHyperlinkHref = hyperlink.GetAttribute("href");
                string           sectionID      = navigationHyperlinkHref.Substring(navigationHyperlinkHref.IndexOf('#') + 1);
                IWebElement      articleSection = this.ArticleSection(sectionID);
                RemoteWebElement section        = (RemoteWebElement)articleSection;

                hyperlink.Click();
                this.ScrollQuickNavigationHyperlink(hyperlink);

                Assert.That(section.Displayed);
                Assert.AreEqual(hyperlink.Text, section.Text);
                Assert.That(hTags.Contains(section.TagName));
            }
        }
 public void SearchWeatherByCityTestCase()
 {
     SearchByCityElement.Click();
     Thread.Sleep(3000);
     CheckWeatherFields();
 }
Exemple #8
0
 public void Click()
 {
     DecoratedWebElement.Click();
 }