Class SelenideDriver

java.lang.Object
com.codeborne.selenide.SelenideDriver
Direct Known Subclasses:
ThreadLocalSelenideDriver

@ParametersAreNonnullByDefault public class SelenideDriver extends Object
"Selenide driver" is a container for WebDriver + proxy server + settings
  • Constructor Details

    • SelenideDriver

      public SelenideDriver(Config config)
    • SelenideDriver

      public SelenideDriver(Config config, List<org.openqa.selenium.support.events.WebDriverListener> listeners)
      Since:
      6.0.0
    • SelenideDriver

      public SelenideDriver(Config config, Driver driver)
    • SelenideDriver

      public SelenideDriver(Config config, org.openqa.selenium.WebDriver webDriver, @Nullable SelenideProxyServer selenideProxy)
    • SelenideDriver

      public SelenideDriver(Config config, org.openqa.selenium.WebDriver webDriver, @Nullable SelenideProxyServer selenideProxy, DownloadsFolder browserDownloadsFolder)
  • Method Details

    • config

      @CheckReturnValue @Nonnull public Config config()
    • driver

      @CheckReturnValue @Nonnull public Driver driver()
    • open

      public void open()
    • open

      public void open(String relativeOrAbsoluteUrl)
    • open

      public void open(URL absoluteUrl)
    • open

      public void open(String relativeOrAbsoluteUrl, String domain, String login, String password)
    • open

      public void open(String relativeOrAbsoluteUrl, AuthenticationType authenticationType, Credentials credentials)
    • open

      public void open(URL absoluteUrl, String domain, String login, String password)
    • open

      @CheckReturnValue @Nonnull public <PageObjectClass> PageObjectClass open(String relativeOrAbsoluteUrl, Class<PageObjectClass> pageObjectClassClass)
    • open

      @CheckReturnValue @Nonnull public <PageObjectClass> PageObjectClass open(URL absoluteUrl, Class<PageObjectClass> pageObjectClassClass)
    • open

      @CheckReturnValue @Nonnull public <PageObjectClass> PageObjectClass open(String relativeOrAbsoluteUrl, String domain, String login, String password, Class<PageObjectClass> pageObjectClassClass)
    • open

      @CheckReturnValue @Nonnull public <PageObjectClass> PageObjectClass open(URL absoluteUrl, String domain, String login, String password, Class<PageObjectClass> pageObjectClassClass)
    • page

      @CheckReturnValue @Nonnull public <PageObjectClass> PageObjectClass page(Class<PageObjectClass> pageObjectClass)
    • page

      @CheckReturnValue @Nonnull public <PageObjectClass> PageObjectClass page(PageObjectClass... reified)
      Parameters:
      reified - Don't pass any values here. It's Java Magic :)
      Since:
      6.8.0
    • page

      @CheckReturnValue @Nonnull public <PageObjectClass, T extends PageObjectClass> PageObjectClass page(T pageObject)
    • refresh

      public void refresh()
    • back

      public void back()
    • forward

      public void forward()
    • updateHash

      public void updateHash(String hash)
    • browser

      @CheckReturnValue @Nonnull public Browser browser()
    • getProxy

      @CheckReturnValue @Nonnull public SelenideProxyServer getProxy()
    • hasWebDriverStarted

      public boolean hasWebDriverStarted()
    • getWebDriver

      @CheckReturnValue @Nonnull public org.openqa.selenium.WebDriver getWebDriver()
    • getAndCheckWebDriver

      @Nonnull public org.openqa.selenium.WebDriver getAndCheckWebDriver()
    • clearCookies

      public void clearCookies()
    • close

      public void close()
    • executeJavaScript

      public <T> T executeJavaScript(String jsCode, Object... arguments)
    • executeAsyncJavaScript

      public <T> T executeAsyncJavaScript(String jsCode, Object... arguments)
    • getFocusedElement

      @CheckReturnValue public SelenideElement getFocusedElement()
    • getSelectedText

      @CheckReturnValue @Nonnull public String getSelectedText()
      Returns selected text or empty string if no text is selected.
      Returns:
      selected text
      Since:
      6.11.0
    • copy

      public String copy()
      Copy selected text or empty string if no text is selected to clipboard.
      Returns:
      the copied text
      Since:
      6.11.0
      See Also:
    • Wait

      @CheckReturnValue @Nonnull public SelenideWait Wait()
    • zoom

      public void zoom(double factor)
    • title

      @Nullable public String title()
    • $

      @CheckReturnValue @Nonnull public SelenideElement $(org.openqa.selenium.WebElement webElement)
    • $

      @CheckReturnValue @Nonnull public SelenideElement $(String cssSelector)
    • find

      @CheckReturnValue @Nonnull public SelenideElement find(String cssSelector)
    • $x

      @CheckReturnValue @Nonnull public SelenideElement $x(String xpathExpression)
    • $

      @CheckReturnValue @Nonnull public SelenideElement $(org.openqa.selenium.By seleniumSelector)
    • $

      @CheckReturnValue @Nonnull public SelenideElement $(org.openqa.selenium.By seleniumSelector, int index)
    • $

      @CheckReturnValue @Nonnull public SelenideElement $(String cssSelector, int index)
    • find

      @CheckReturnValue @Nonnull public SelenideElement find(org.openqa.selenium.By criteria)
    • find

      @CheckReturnValue @Nonnull public SelenideElement find(org.openqa.selenium.By criteria, int index)
    • $$

      @CheckReturnValue @Nonnull public ElementsCollection $$(Collection<? extends org.openqa.selenium.WebElement> elements)
    • $$

      @CheckReturnValue @Nonnull public ElementsCollection $$(String cssSelector)
    • $$x

      @CheckReturnValue @Nonnull public ElementsCollection $$x(String xpathExpression)
    • findAll

      @CheckReturnValue @Nonnull public ElementsCollection findAll(org.openqa.selenium.By seleniumSelector)
    • findAll

      @CheckReturnValue @Nonnull public ElementsCollection findAll(String cssSelector)
    • $$

      @CheckReturnValue @Nonnull public ElementsCollection $$(org.openqa.selenium.By criteria)
    • getSelectedRadio

      @CheckReturnValue @Nullable public SelenideElement getSelectedRadio(org.openqa.selenium.By radioField)
    • modal

      @CheckReturnValue @Nonnull public Modal modal()
    • getWebDriverLogs

      @CheckReturnValue @Nonnull public WebDriverLogs getWebDriverLogs()
    • clearBrowserLocalStorage

      public void clearBrowserLocalStorage()
    • atBottom

      public boolean atBottom()
    • switchTo

      @Nonnull public SelenideTargetLocator switchTo()
    • url

      @CheckReturnValue @Nonnull public String url()
    • source

      @CheckReturnValue @Nullable public String source()
    • getCurrentFrameUrl

      @CheckReturnValue @Nonnull public String getCurrentFrameUrl()
    • getUserAgent

      @CheckReturnValue @Nonnull public String getUserAgent()
    • getSessionId

      @CheckReturnValue @Nonnull public org.openqa.selenium.remote.SessionId getSessionId()
    • screenshot

      @CheckReturnValue @Nullable public String screenshot(String fileName)
      Take a screenshot of the current page
      Returns:
      absolute path of the screenshot taken or null if failed to create screenshot
      Since:
      5.14.0
    • screenshot

      @CheckReturnValue @Nullable public <T> T screenshot(org.openqa.selenium.OutputType<T> outputType)
      Take a screenshot of the current page
      Returns:
      The screenshot (as bytes, base64 or temporary file)
      Since:
      5.14.0
    • download

      @Nonnull public File download(String url) throws URISyntaxException
      Throws:
      URISyntaxException
    • download

      @Nonnull public File download(String url, long timeoutMs) throws URISyntaxException
      Throws:
      URISyntaxException
    • download

      @Nonnull public File download(URI url)
    • download

      @Nonnull public File download(URI url, long timeoutMs)
    • getLocalStorage

      @CheckReturnValue @Nonnull public LocalStorage getLocalStorage()
    • getSessionStorage

      @CheckReturnValue @Nonnull public SessionStorage getSessionStorage()
    • getClipboard

      @CheckReturnValue @Nonnull public Clipboard getClipboard()
    • webdriver

      public Conditional<org.openqa.selenium.WebDriver> webdriver()