How to use the splinter.driver.webdriver.__init__.Window function in splinter

To help you get started, we’ve selected a few splinter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cobrateam / splinter / splinter / driver / webdriver / __init__.py View on Github external
def __getitem__(self, key):
        window_handles = self._browser.driver.window_handles
        try:
            return Window(self._browser, window_handles[key])
        except TypeError:
            if key not in window_handles:
                raise KeyError(key)
            return Window(self._browser, key)
github cobrateam / splinter / splinter / driver / webdriver / __init__.py View on Github external
def next(self):
        """ Return the next window """
        next_index = (self.index + 1) % len(self._browser.driver.window_handles)
        next_handle = self._browser.driver.window_handles[next_index]
        return Window(self._browser, next_handle)
github cobrateam / splinter / splinter / driver / webdriver / __init__.py View on Github external
def __repr__(self):
        return str(
            [
                Window(self._browser, handle)
                for handle in self._browser.driver.window_handles
            ]
github cobrateam / splinter / splinter / driver / webdriver / __init__.py View on Github external
def prev(self):
        """ Return the previous window """
        prev_index = self.index - 1
        prev_handle = self._browser.driver.window_handles[prev_index]
        return Window(self._browser, prev_handle)
github cobrateam / splinter / splinter / driver / webdriver / __init__.py View on Github external
def fget(self):
            current_handle = self._browser.driver.current_window_handle
            return Window(self._browser, current_handle) if current_handle else None
github cobrateam / splinter / splinter / driver / webdriver / __init__.py View on Github external
def __getitem__(self, key):
        window_handles = self._browser.driver.window_handles
        try:
            return Window(self._browser, window_handles[key])
        except TypeError:
            if key not in window_handles:
                raise KeyError(key)
            return Window(self._browser, key)