Class SelenideDriver

java.lang.Object
com.codeborne.selenide.SelenideDriver

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)
    • 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

      public Config config()
    • driver

      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

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

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

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

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

      public <PageObjectClass> PageObjectClass page(Class<PageObjectClass> pageObjectClass)
    • page

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

      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

      public Browser browser()
    • getProxy

      public SelenideProxyServer getProxy()
    • hasWebDriverStarted

      public boolean hasWebDriverStarted()
    • getWebDriver

      public org.openqa.selenium.WebDriver getWebDriver()
    • getAndCheckWebDriver

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

      public void clearCookies()
    • close

      public void close()
    • executeJavaScript

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

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

      public SelenideElement getFocusedElement()
    • getSelectedText

      public String getSelectedText()
      Returns selected text or empty string if no text is selected.
      Returns:
      selected text
    • copy

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

      public SelenideWait Wait()
    • zoom

      public void zoom(double factor)
    • title

      public @Nullable String title()
    • $

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

      public SelenideElement $(String cssSelector)
    • find

      public SelenideElement find(String cssSelector)
    • $x

      public SelenideElement $x(String xpathExpression)
    • $

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

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

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

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

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

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

      public ElementsCollection $$(String cssSelector)
    • $$x

      public ElementsCollection $$x(String xpathExpression)
    • findAll

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

      public ElementsCollection findAll(String cssSelector)
    • $$

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

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

      public Modal modal()
    • getWebDriverLogs

      public WebDriverLogs getWebDriverLogs()
    • clearBrowserLocalStorage

      public void clearBrowserLocalStorage()
    • atBottom

      public boolean atBottom()
    • switchTo

      public SelenideTargetLocator switchTo()
    • url

      public String url()
    • source

      public @Nullable String source()
    • getCurrentFrameUrl

      public String getCurrentFrameUrl()
    • getUserAgent

      public String getUserAgent()
    • getSessionId

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

      public @Nullable String screenshot(String fileName)
      Take a screenshot of the current page and save to file "fileName.png" (and optionally, "fileName.html")
      Parameters:
      fileName - Name of file (without extension) to save PNG (and HTML) to
      Returns:
      URL of the screenshot taken, or null if failed to create screenshot
    • screenshot

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

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

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

      public File download(URI url)
    • download

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

      public LocalStorage getLocalStorage()
    • getSessionStorage

      public SessionStorage getSessionStorage()
    • getClipboard

      public Clipboard getClipboard()
    • webdriver

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