public void UsingCustomByNotFound()
        {
            Expect.Once.On(mockDriver).Method("FindElement").With(new CustomBy("customCriteriaNotFound")).Will(Throw.Exception(new NoSuchElementException()));

            var page = new CustomByNotFoundPage();

            PageFactory.InitElements(mockDriver, page);
            Assert.Throws <NoSuchElementException>(page.customFoundElement.Clear);
        }
Exemple #2
0
        public void UsingCustomByNotFound()
        {
            mockDriver.Expects.One.Method(_ => _.FindElement(null)).With(new CustomBy("customCriteriaNotFound")).Will(Throw.Exception(new NoSuchElementException()));

            var page = new CustomByNotFoundPage();

            PageFactory.InitElements(mockDriver.MockObject, page);
            Assert.Throws <NoSuchElementException>(page.customFoundElement.Clear);
        }
        public void UsingCustomByNotFound()
        {
            mockDriver.Setup(_ => _.FindElement(It.Is <CustomBy>(x => x.Equals(new CustomBy("customCriteriaNotFound"))))).Throws <NoSuchElementException>();

            var page = new CustomByNotFoundPage();

            PageFactory.InitElements(mockDriver.Object, page);
            Assert.Throws <NoSuchElementException>(page.customFoundElement.Clear);
        }
Exemple #4
0
 public void UsingCustomByNotFound()
 {
     Expect.Once.On(mockDriver).Method("FindElement").With(new CustomBy("customCriteriaNotFound")).Will(Throw.Exception(new NoSuchElementException()));
     
     var page = new CustomByNotFoundPage();
     PageFactory.InitElements(mockDriver, page);
     Assert.Throws<NoSuchElementException>(page.customFoundElement.Clear);
 }