Package com.codeborne.selenide
Class SelenideDriver
java.lang.Object
com.codeborne.selenide.SelenideDriver
"Selenide driver" is a container for WebDriver + proxy server + settings
-
Constructor Summary
ConstructorDescriptionSelenideDriver
(Config config) SelenideDriver
(Config config, Driver driver) SelenideDriver
(Config config, List<org.openqa.selenium.support.events.WebDriverListener> listeners) SelenideDriver
(Config config, org.openqa.selenium.WebDriver webDriver, SelenideProxyServer selenideProxy) SelenideDriver
(Config config, org.openqa.selenium.WebDriver webDriver, SelenideProxyServer selenideProxy, DownloadsFolder browserDownloadsFolder) -
Method Summary
Modifier and TypeMethodDescription$
(org.openqa.selenium.By seleniumSelector) $
(org.openqa.selenium.By seleniumSelector, int index) $
(org.openqa.selenium.WebElement webElement) $$
(Collection<? extends org.openqa.selenium.WebElement> elements) $$
(org.openqa.selenium.By criteria) boolean
atBottom()
void
back()
browser()
void
void
void
close()
config()
copy()
Copy selected text or empty string if no text is selected to clipboard.driver()
<T> T
executeAsyncJavaScript
(String jsCode, Object... arguments) <T> T
executeJavaScript
(String jsCode, Object... arguments) find
(org.openqa.selenium.By criteria) find
(org.openqa.selenium.By criteria, int index) findAll
(org.openqa.selenium.By seleniumSelector) void
forward()
org.openqa.selenium.WebDriver
getProxy()
getSelectedRadio
(org.openqa.selenium.By radioField) Returns selected text or empty string if no text is selected.org.openqa.selenium.remote.SessionId
org.openqa.selenium.WebDriver
boolean
modal()
void
open()
void
void
open
(String relativeOrAbsoluteUrl, AuthenticationType authenticationType, Credentials credentials) <PageObjectClass>
PageObjectClassvoid
<PageObjectClass>
PageObjectClassopen
(String relativeOrAbsoluteUrl, String domain, String login, String password, Class<PageObjectClass> pageObjectClassClass) void
<PageObjectClass>
PageObjectClassvoid
<PageObjectClass>
PageObjectClassopen
(URL absoluteUrl, String domain, String login, String password, Class<PageObjectClass> pageObjectClassClass) <PageObjectClass>
PageObjectClass<PageObjectClass>
PageObjectClasspage
(PageObjectClass... reified) <PageObjectClass,
T extends PageObjectClass>
PageObjectClasspage
(T pageObject) void
refresh()
screenshot
(String fileName) Take a screenshot of the current page<T> T
screenshot
(org.openqa.selenium.OutputType<T> outputType) Take a screenshot of the current pagesource()
switchTo()
title()
void
updateHash
(String hash) url()
Wait()
Conditional<org.openqa.selenium.WebDriver>
void
zoom
(double factor)
-
Constructor Details
-
SelenideDriver
-
SelenideDriver
public SelenideDriver(Config config, List<org.openqa.selenium.support.events.WebDriverListener> listeners) - Since:
- 6.0.0
-
SelenideDriver
-
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
-
driver
-
open
public void open() -
open
-
open
-
open
-
open
public void open(String relativeOrAbsoluteUrl, AuthenticationType authenticationType, Credentials credentials) -
open
-
open
-
open
-
open
-
open
-
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
-
browser
-
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
-
executeAsyncJavaScript
-
getFocusedElement
-
getSelectedText
Returns selected text or empty string if no text is selected.- Returns:
- selected text
- Since:
- 6.11.0
-
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
-
zoom
public void zoom(double factor) -
title
-
$
-
$
-
find
-
$x
-
$
-
$
@CheckReturnValue @Nonnull public SelenideElement $(org.openqa.selenium.By seleniumSelector, int index) -
$
-
find
-
find
-
$$
@CheckReturnValue @Nonnull public ElementsCollection $$(Collection<? extends org.openqa.selenium.WebElement> elements) -
$$
-
$$x
-
findAll
@CheckReturnValue @Nonnull public ElementsCollection findAll(org.openqa.selenium.By seleniumSelector) -
findAll
-
$$
-
getSelectedRadio
@CheckReturnValue @Nullable public SelenideElement getSelectedRadio(org.openqa.selenium.By radioField) -
modal
-
getWebDriverLogs
-
clearBrowserLocalStorage
public void clearBrowserLocalStorage() -
atBottom
public boolean atBottom() -
switchTo
-
url
-
source
-
getCurrentFrameUrl
-
getUserAgent
-
getSessionId
@CheckReturnValue @Nonnull public org.openqa.selenium.remote.SessionId getSessionId() -
screenshot
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
- Throws:
URISyntaxException
-
download
- Throws:
URISyntaxException
-
download
-
download
-
getLocalStorage
-
getSessionStorage
-
getClipboard
-
webdriver
-