Exemplo n.º 1
0
        public void Gets_location_for_correct_window_scope()
        {
            Driver.Click(Link("Open pop up window"));
            var popUp = new DriverScope(DefaultSessionConfiguration, new WindowFinder(Driver, "Pop Up Window", Root, DefaultOptions), Driver, null, null, null, DisambiguationStrategy);

            Assert.That(Driver.Location(popUp).AbsoluteUri, Is.StringEnding("src/Coypu.Drivers.Tests/html/popup.htm"));
        }
Exemplo n.º 2
0
 protected internal HasXPathQuery(Driver driver, DriverScope scope, string xpath, Options options)
     : base(scope, options)
 {
     this.driver = driver;
     this.driver = driver;
     this.xpath  = xpath;
 }
Exemplo n.º 3
0
        public void Finds_clear_scope_back_to_the_whole_window()
        {
            var iframeOne = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe one", Root), Driver,null,null,null);
            Driver.FindButton("scoped button", iframeOne).Id.should_be("iframe1ButtonId");

            Driver.FindButton("scoped button", Root).Id.should_be("scope1ButtonId");
        }
Exemplo n.º 4
0
        public void Can_scope_inside_an_iframe()
        {
            var iframeOne  = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe one", Root), Driver, null, null, null);
            var iframeForm = new DriverScope(new SessionConfiguration(), new CssFinder(Driver, "form", iframeOne), Driver, null, null, null);

            Driver.FindField("text input in iframe", iframeForm);
        }
Exemplo n.º 5
0
 private static DriverScope GetSelectScope(string locator)
 {
     var select = new DriverScope(DefaultSessionConfiguration,
                                  new SelectFinder(Driver, locator, Root, DefaultOptions), Driver,
                                  null, null, null, DisambiguationStrategy);
     return @select;
 }
Exemplo n.º 6
0
 protected static Element Css(string locator,
                              string text,
                              DriverScope scope = null,
                              Options options   = null)
 {
     return(FindSingle(new CssFinder(Driver, locator, scope ?? Root, options ?? DefaultOptions, text)));
 }
Exemplo n.º 7
0
        public void Gets_location_for_correct_window_scope()
        {
            Driver.Click(Driver.FindLink("Open pop up window", Root));
            var popUp = new DriverScope(new SessionConfiguration(), new WindowFinder(Driver, "Pop Up Window", Root), Driver, null, null, null);

            Assert.That(Driver.Location(popUp).AbsoluteUri, Is.StringEnding("src/Coypu.Drivers.Tests/html/popup.htm"));
        }
Exemplo n.º 8
0
 internal Select(Driver driver, DriverScope scope, string locator, string option, Options timingOptions)
     : base(driver, timingOptions)
 {
     this.scope = scope;
     this.locator = locator;
     this.option = option;
 }
Exemplo n.º 9
0
 internal DriverScopeQuery(DriverScope driverScope, Options options)
 {
     Options       = options;
     DriverScope   = driverScope;
     Timeout       = options.Timeout;
     RetryInterval = options.RetryInterval;
 }
Exemplo n.º 10
0
 protected ElementFinder(Driver driver, string locator, DriverScope scope, Options options)
 {
     Driver = driver;
     this.locator = locator;
     Scope = scope;
     this.options = options;
 }
Exemplo n.º 11
0
 internal Select(Driver driver, DriverScope scope, string locator, string option, Options timingOptions)
     : base(driver, timingOptions)
 {
     this.scope   = scope;
     this.locator = locator;
     this.option  = option;
 }
Exemplo n.º 12
0
 protected ElementFinder(IDriver driver, string locator, DriverScope scope, Options options)
 {
     Driver  = driver;
     Locator = locator;
     Scope   = scope;
     Options = options;
 }
Exemplo n.º 13
0
 internal FillIn(Driver driver, DriverScope scope, string locator, string value, Options options)
     : base(driver, options)
 {
     this.locator = locator;
     this.scope   = scope;
     this.value   = value;
 }
Exemplo n.º 14
0
        public void Can_fill_in_a_text_input_within_an_iframe()
        {
            var iframeOne = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe one", Root), Driver, null, null, null);
            Driver.Set(Driver.FindField("text input in iframe", iframeOne), "filled in");

            Assert.That(Driver.FindField("text input in iframe", iframeOne).Value, Is.EqualTo("filled in"));
        }
Exemplo n.º 15
0
        public void Gets_location_for_correct_window_scope()
        {
            Driver.Click(Link("Open pop up window"));
            var popUp = new DriverScope(DefaultSessionConfiguration, new WindowFinder(Driver, "Pop Up Window", Root, DefaultOptions), Driver, null, null, null, DisambiguationStrategy);

            Assert.That(Driver.Location(popUp).AbsoluteUri, Is.StringEnding("src/Coypu.Drivers.Tests/html/popup.htm"));
        }
Exemplo n.º 16
0
        public void Can_scope_inside_an_iframe()
        {
            var iframeOne = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe one", Root), Driver, null, null, null);
            var iframeForm = new DriverScope(new SessionConfiguration(), new CssFinder(Driver, "form", iframeOne), Driver, null, null, null);

            Driver.FindField("text input in iframe", iframeForm);
        }
Exemplo n.º 17
0
        public void Gets_location_for_correct_window_scope()
        {
            Driver.Click(Driver.FindLink("Open pop up window", Root));
            var popUp = new DriverScope(new SessionConfiguration(), new WindowFinder(Driver, "Pop Up Window", Root), Driver, null, null, null);

            Assert.That(Driver.Location(popUp).AbsoluteUri, Is.StringEnding("src/Coypu.Drivers.Tests/html/popup.htm"));
        }
Exemplo n.º 18
0
 internal FillIn(Driver driver, DriverScope scope, string locator, string value, Options options)
     : base(driver,options)
 {
     this.locator = locator;
     this.scope = scope;
     this.value = value;
 }
Exemplo n.º 19
0
 public void Can_fill_in_a_text_input_within_an_iframe()
 {
     var iframeOne = new DriverScope(DefaultSessionConfiguration, new FrameFinder(Driver, "I am iframe one", Root, DefaultOptions), Driver, null, null, null, DisambiguationStrategy);
     Driver.Set(FindField("text input in iframe", iframeOne), "filled in");
     
     Assert.That(FindField("text input in iframe", iframeOne).Value, Is.EqualTo("filled in"));
 }
Exemplo n.º 20
0
        public void Finds_clear_scope_back_to_the_whole_window()
        {
            var iframeOne = new DriverScope(DefaultSessionConfiguration, new FrameFinder(Driver, "I am iframe one", Root, DefaultOptions), Driver,null,null,null,DisambiguationStrategy);
            Button("scoped button", iframeOne, DefaultOptions).Id.should_be("iframe1ButtonId");

            Button("scoped button", Root, Options.PreferExact).Id.should_be("scope1ButtonId");
        }
Exemplo n.º 21
0
        public void Finds_elements_among_multiple_scopes()
        {
            var iframeOne = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe one", Root), Driver, null, null, null);
            var iframeTwo = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe two", Root), Driver, null, null, null);

            Driver.FindButton("scoped button", iframeOne).Id.should_be("iframe1ButtonId");
            Driver.FindButton("scoped button", iframeTwo).Id.should_be("iframe2ButtonId");
        }
Exemplo n.º 22
0
 internal Select(Driver driver, DriverScope scope, string locator, string optionToSelect, DisambiguationStrategy disambiguationStrategy, Options options)
     : base(driver, scope, options)
 {
     this.locator                = locator;
     this.optionToSelect         = optionToSelect;
     this.options                = options;
     this.disambiguationStrategy = disambiguationStrategy;
 }
Exemplo n.º 23
0
        public void Errors_on_window_closed()
        {
            Driver.Click(Driver.FindLink("Open pop up window", Root));
            var popUp = new DriverScope(new SessionConfiguration(), new WindowFinder(Driver, "Pop Up Window", Root), Driver, null, null, null);

            Driver.ExecuteScript("self.close();", popUp);
            Assert.Throws<MissingWindowException>(() => Driver.FindWindow("Open pop up window", Root));
        }
        public void Finds_elements_among_multiple_scopes()
        {
            var iframeOne = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe one", Root), Driver,null,null,null);
            var iframeTwo = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe two", Root), Driver,null,null,null);

            Driver.FindButton("scoped button", iframeOne).Id.should_be("iframe1ButtonId");
            Driver.FindButton("scoped button", iframeTwo).Id.should_be("iframe2ButtonId");
        }
Exemplo n.º 25
0
        private static void Finds_elements_among_multiple_scopes(ElementFinder elementFinder1, ElementFinder elementFinder2)
        {
            var iframeOne = new DriverScope(DefaultSessionConfiguration, elementFinder1, Driver, null, null, null, DisambiguationStrategy);
            var iframeTwo = new DriverScope(DefaultSessionConfiguration, elementFinder2, Driver, null, null, null, DisambiguationStrategy);

            Button("scoped button", iframeOne, DefaultOptions).Id.should_be("iframe1ButtonId");
            Button("scoped button", iframeTwo, DefaultOptions).Id.should_be("iframe2ButtonId");
        }
Exemplo n.º 26
0
        public void Can_fill_in_a_text_input_within_an_iframe()
        {
            var iframeOne = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe one", Root), Driver, null, null, null);

            Driver.Set(Driver.FindField("text input in iframe", iframeOne), "filled in", false);

            Assert.That(Driver.FindField("text input in iframe", iframeOne).Value, Is.EqualTo("filled in"));
        }
Exemplo n.º 27
0
        public void Errors_on_window_closed()
        {
            Driver.Click(Driver.FindLink("Open pop up window", Root));
            var popUp = new DriverScope(new SessionConfiguration(), new WindowFinder(Driver, "Pop Up Window", Root), Driver, null, null, null);

            Driver.ExecuteScript("self.close();", popUp);
            Assert.Throws <MissingWindowException>(() => Driver.FindWindow("Open pop up window", Root));
        }
Exemplo n.º 28
0
        public void Finds_clears_scope_back_to_the_whole_window()
        {
            var iframeOne = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe one", Root), Driver, null, null, null);

            Driver.FindButton("scoped button", iframeOne).Id.should_be("iframe1ButtonId");

            Driver.FindButton("scoped button", Root).Id.should_be("scope1ButtonId");
        }
Exemplo n.º 29
0
        public void Can_fill_in_a_text_input_within_an_iframe()
        {
            var iframeOne = new DriverScope(DefaultSessionConfiguration, new FrameFinder(Driver, "I am iframe one", Root, DefaultOptions), Driver, null, null, null, DisambiguationStrategy);

            Driver.Set(FindField("text input in iframe", iframeOne), "filled in");

            Assert.That(FindField("text input in iframe", iframeOne).Value, Is.EqualTo("filled in"));
        }
Exemplo n.º 30
0
        private static void Finds_elements_among_multiple_scopes(ElementFinder elementFinder1, ElementFinder elementFinder2)
        {
            var iframeOne = new DriverScope(DefaultSessionConfiguration, elementFinder1, Driver, null, null, null, DisambiguationStrategy);
            var iframeTwo = new DriverScope(DefaultSessionConfiguration, elementFinder2, Driver, null, null, null, DisambiguationStrategy);

            Button("scoped button", iframeOne, DefaultOptions).Id.should_be("iframe1ButtonId");
            Button("scoped button", iframeTwo, DefaultOptions).Id.should_be("iframe2ButtonId");
        }
Exemplo n.º 31
0
        public void Finds_clear_scope_back_to_the_whole_window()
        {
            var iframeOne = new DriverScope(DefaultSessionConfiguration, new FrameFinder(Driver, "I am iframe one", Root, DefaultOptions), Driver, null, null, null, DisambiguationStrategy);

            Button("scoped button", iframeOne, DefaultOptions).Id.should_be("iframe1ButtonId");

            Button("scoped button", Root, Options.PreferExact).Id.should_be("scope1ButtonId");
        }
Exemplo n.º 32
0
 internal ActionSatisfiesPredicateQuery(BrowserAction tryThis, PredicateQuery until, Options options, TimingStrategy timingStrategy)
 {
     this.tryThis        = tryThis;
     this.until          = until;
     this.timingStrategy = timingStrategy;
     Options             = options;
     Scope = tryThis.Scope;
 }
Exemplo n.º 33
0
 internal FillInWith(string locator, Driver driver, RobustWrapper robustWrapper, DriverScope scope, Options options)
 {
     this.locator = locator;
     this.driver = driver;
     this.robustWrapper = robustWrapper;
     this.scope = scope;
     this.options = options;
 }
Exemplo n.º 34
0
 internal WaitThenClick(Driver driver, DriverScope scope, Options options, Waiter waiter, ElementFinder elementFinder, DisambiguationStrategy disambiguationStrategy)
     : base(driver, scope, options)
 {
     waitBeforeClick             = options.WaitBeforeClick;
     this.waiter                 = waiter;
     this.elementFinder          = elementFinder;
     this.disambiguationStrategy = disambiguationStrategy;
 }
Exemplo n.º 35
0
 internal Select(Driver driver, DriverScope scope, string locator, string optionToSelect, DisambiguationStrategy disambiguationStrategy, Options options)
     : base(driver, scope, options)
 {
     this.locator = locator;
     this.optionToSelect = optionToSelect;
     this.options = options;
     this.disambiguationStrategy = disambiguationStrategy;
 }
Exemplo n.º 36
0
 internal SelectFrom(string option, Driver driver, RobustWrapper robustWrapper, DriverScope scope, Options options)
 {
     this.option = option;
     this.driver = driver;
     this.robustWrapper = robustWrapper;
     this.scope = scope;
     this.options = options;
 }
Exemplo n.º 37
0
 public BaseView(DriverScope browserScope)
 {
     if (browserScope == null)
     {
         throw new ArgumentNullException("driver");
     }
     _browserScope = browserScope;
 }
Exemplo n.º 38
0
        private static DriverScope GetSelectScope(string locator)
        {
            var select = new DriverScope(DefaultSessionConfiguration,
                                         new SelectFinder(Driver, locator, Root, DefaultOptions), Driver,
                                         null, null, null, DisambiguationStrategy);

            return(@select);
        }
Exemplo n.º 39
0
 internal WaitThenClick(Driver driver, DriverScope scope, Options options, Waiter waiter, ElementFinder elementFinder, DisambiguationStrategy disambiguationStrategy)
     : base(driver, scope, options)
 {
     waitBeforeClick = options.WaitBeforeClick;
     this.waiter = waiter;
     this.elementFinder = elementFinder;
     this.disambiguationStrategy = disambiguationStrategy;
 }
Exemplo n.º 40
0
 internal FillInWith(Element element, Driver driver, RobustWrapper robustWrapper, DriverScope scope, Options options)
 {
     this.element = element;
     this.driver = driver;
     this.robustWrapper = robustWrapper;
     this.scope = scope;
     this.options = options;
 }
Exemplo n.º 41
0
 private void GetValue <T>(DriverScope scope, Options options)
 {
     Assert.That(scope.OuterScope, Is.SameAs(browserSession));
     Assert.That(scope.ElementFinder, Is.TypeOf <T>());
     Assert.That(scope.ElementFinder.Driver, Is.EqualTo(driver));
     Assert.That(scope.ElementFinder.Locator, Is.EqualTo("Some locator"));
     Assert.That(scope.ElementFinder.Options, Is.EqualTo(Options.Merge(options, sessionConfiguration)));
 }
Exemplo n.º 42
0
        public void Finds_scoped_by_window()
        {
            Driver.Click(Driver.FindLink("Open pop up window", Root));

            var popUp = new DriverScope(new SessionConfiguration(), new WindowFinder(Driver, "Pop Up Window", Root), Driver, null, null, null);

            Assert.That(Driver.HasContent("I am a pop up window", popUp), Is.True);
            Assert.That(Driver.HasContent("I am a pop up window", Root), Is.False);
        }
Exemplo n.º 43
0
 internal FillIn(Driver driver, DriverScope scope, string locator, Element element, string value, bool forceAllEvents, Options options)
     : base(driver, options)
 {
     this.locator        = locator;
     this.element        = element;
     this.scope          = scope;
     this.value          = value;
     this.forceAllEvents = forceAllEvents;
 }
Exemplo n.º 44
0
 internal FillIn(Driver driver, DriverScope scope, string locator, ElementFound element, string value, bool forceAllEvents, Options options)
     : base(driver,options)
 {
     this.locator = locator;
     this.element = element;
     this.scope = scope;
     this.value = value;
     this.forceAllEvents = forceAllEvents;
 }
Exemplo n.º 45
0
 internal SelectFrom(string option, Driver driver, TimingStrategy timingStrategy, DriverScope scope, Options options, DisambiguationStrategy disambiguationStrategy)
 {
     this.option = option;
     this.driver = driver;
     this.timingStrategy = timingStrategy;
     this.scope = scope;
     this.options = options;
     this.disambiguationStrategy = disambiguationStrategy;
 }
Exemplo n.º 46
0
        public void Can_scope_around_an_iframe()
        {
            var body = new DriverScope(new SessionConfiguration(), new CssFinder(Driver, "body", Root), Driver, null, null, null);
            var iframeOne = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe one", body), Driver, null, null, null);

            Driver.FindButton("scoped button", iframeOne).Id.should_be("iframe1ButtonId");

            Driver.FindButton("scoped button", body).Id.should_be("scope1ButtonId");
        }
Exemplo n.º 47
0
        public void Finds_scoped_by_window()
        {
            Driver.Click(Driver.FindLink("Open pop up window", Root));

            var popUp = new DriverScope(new SessionConfiguration(), new WindowFinder(Driver, "Pop Up Window", Root), Driver, null, null, null);

            Assert.That(Driver.HasContent("I am a pop up window", popUp), Is.True);
            Assert.That(Driver.HasContent("I am a pop up window", Root), Is.False);
        }
Exemplo n.º 48
0
        public void Can_scope_around_an_iframe()
        {
            var body      = new DriverScope(new SessionConfiguration(), new CssFinder(Driver, "body", Root), Driver, null, null, null);
            var iframeOne = new DriverScope(new SessionConfiguration(), new FrameFinder(Driver, "I am iframe one", body), Driver, null, null, null);

            Driver.FindButton("scoped button", iframeOne).Id.should_be("iframe1ButtonId");

            Driver.FindButton("scoped button", body).Id.should_be("scope1ButtonId");
        }
Exemplo n.º 49
0
        private static void RefreshCausesScopeToReload(DriverScope driverScope)
        {
            var tickBeforeRefresh = Int64.Parse(Driver.ExecuteScript("return window.SpecData.CurrentTick;", driverScope));

            Driver.Refresh(driverScope);

            var tickAfterRefresh = Int64.Parse(Driver.ExecuteScript("return window.SpecData.CurrentTick;", driverScope));

            Assert.That(tickAfterRefresh, Is.GreaterThan(tickBeforeRefresh));
        }
Exemplo n.º 50
0
 internal Select(IDriver driver,
                 DriverScope scope,
                 string locator,
                 string optionToSelect,
                 DisambiguationStrategy disambiguationStrategy,
                 Options options,
                 Options fromOptions) : this(driver, scope, locator, optionToSelect, disambiguationStrategy, options)
 {
     _fromOptions = fromOptions;
 }
Exemplo n.º 51
0
        private static void RefreshCausesScopeToReload(DriverScope driverScope)
        {
            var tickBeforeRefresh = Int64.Parse(Driver.ExecuteScript("return window.SpecData.CurrentTick;", driverScope));

            Driver.Refresh(driverScope);

            var tickAfterRefresh = Int64.Parse(Driver.ExecuteScript("return window.SpecData.CurrentTick;", driverScope));

            Assert.That(tickAfterRefresh, Is.GreaterThan(tickBeforeRefresh));
        }
Exemplo n.º 52
0
        public void Can_scope_around_an_iframe()
        {
            var body = new DriverScope(DefaultSessionConfiguration, new CssFinder(Driver, "body", Root, DefaultOptions), Driver, null, null, null, DisambiguationStrategy);

            var iframeOne = new DriverScope(DefaultSessionConfiguration, new FrameFinder(Driver, "I am iframe one", body,DefaultOptions), Driver, null, null, null, DisambiguationStrategy);

            Button("scoped button", iframeOne, DefaultOptions).Id.should_be("iframe1ButtonId");

            Button("scoped button", body, Options.PreferExact).Id.should_be("scope1ButtonId");
        }
Exemplo n.º 53
0
        private static void Finds_elements_among_multiple_scopes(ElementFinder elementFinder1, ElementFinder elementFinder2)
        {
            var iframeOne = new DriverScope(new SessionConfiguration(), elementFinder1, Driver,
                                            null, null, null);
            var iframeTwo = new DriverScope(new SessionConfiguration(), elementFinder2, Driver,
                                            null, null, null);

            Driver.FindButton("scoped button", iframeOne).Id.should_be("iframe1ButtonId");
            Driver.FindButton("scoped button", iframeTwo).Id.should_be("iframe2ButtonId");
        }
Exemplo n.º 54
0
        public void Can_scope_around_an_iframe()
        {
            var body = new DriverScope(DefaultSessionConfiguration, new CssFinder(Driver, "body", Root, DefaultOptions), Driver, null, null, null, DisambiguationStrategy);

            var iframeOne = new DriverScope(DefaultSessionConfiguration, new FrameFinder(Driver, "I am iframe one", body, DefaultOptions), Driver, null, null, null, DisambiguationStrategy);

            Button("scoped button", iframeOne, DefaultOptions).Id.should_be("iframe1ButtonId");

            Button("scoped button", body, Options.PreferExact).Id.should_be("scope1ButtonId");
        }
Exemplo n.º 55
0
        private static void AssertMaximisesWindow(DriverScope driverScope)
        {
            var availWidth  = float.Parse(Driver.ExecuteScript("return window.screen.availWidth;", driverScope));
            var initalWidth = float.Parse(Driver.ExecuteScript("return window.outerWidth;", driverScope));

            Assert.That(initalWidth, Is.LessThan(availWidth));

            Driver.MaximiseWindow(driverScope);

            Assert.That(float.Parse(Driver.ExecuteScript("return window.outerWidth;", driverScope)), Is.GreaterThanOrEqualTo(availWidth));
        }
Exemplo n.º 56
0
        private static void AssertMaximisesWindow(DriverScope driverScope)
        {
            var availWidth = float.Parse(Driver.ExecuteScript("return window.screen.availWidth;", driverScope));
            var initalWidth = float.Parse(Driver.ExecuteScript("return window.outerWidth;", driverScope));

            Assert.That(initalWidth, Is.LessThan(availWidth));

            Driver.MaximiseWindow(driverScope);

            Assert.That(float.Parse(Driver.ExecuteScript("return window.outerWidth;", driverScope)), Is.GreaterThanOrEqualTo(availWidth));
        }
Exemplo n.º 57
0
        private static void AssertResizesWindow(DriverScope driverScope)
        {
            var availWidth = float.Parse(Driver.ExecuteScript("return window.screen.availWidth;", driverScope));
            var initalWidth = float.Parse(Driver.ExecuteScript("return window.outerWidth;", driverScope));

            Assert.That(initalWidth, Is.LessThan(availWidth));

            Driver.ResizeTo(new Size(768, 500), driverScope);

            Assert.That(float.Parse(Driver.ExecuteScript("return window.outerWidth;", driverScope)), Is.EqualTo(768));
            Assert.That(float.Parse(Driver.ExecuteScript("return window.outerHeight;", driverScope)), Is.EqualTo(500));
        }
Exemplo n.º 58
0
        public void Stale_window_closed()
        {
            Driver.Click(Driver.FindLink("Open pop up window", Root));

            var popUpScope = new DriverScope(new SessionConfiguration(), new WindowFinder(Driver, "Pop Up Window", Root), Driver, null, null, null);

            var popUpWindow = popUpScope.Now();
            popUpWindow.Stale(new Options()).should_be_false();

            Driver.Click(Driver.FindButton("close", popUpScope));

            popUpWindow.Stale(new Options()).should_be_true();
        }
Exemplo n.º 59
0
        public void Stale_window_closed()
        {
            Driver.Click(Link("Open pop up window"));

            var popUpScope = new DriverScope(DefaultSessionConfiguration, new WindowFinder(Driver, "Pop Up Window", Root, DefaultOptions), Driver, null, null, null, DisambiguationStrategy );

            var popUpWindow = popUpScope.Now();
            popUpWindow.Stale(new Options()).should_be_false();

            Driver.Click(Button("close", popUpScope, DefaultOptions));

            popUpWindow.Stale(new Options()).should_be_true();
        }
Exemplo n.º 60
0
        public void RefreshesCorrectWindowScope()
        {
            Driver.Click(Link("Open pop up window"));
            var popUp = new DriverScope(DefaultSessionConfiguration, new WindowFinder(Driver,"Pop Up Window",Root,DefaultOptions), Driver, null, null, null, DisambiguationStrategy);

            try
            {
                RefreshCausesScopeToReload(popUp);
            }
            finally
            {
                Driver.ExecuteScript("return self.close();", popUp);
            }
        }