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, @Nullable SelenideProxyServer selenideProxy) SelenideDriver
(Config config, org.openqa.selenium.WebDriver webDriver, @Nullable 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> @Nullable T
executeAsyncJavaScript
(String jsCode, Object... arguments) <T> @Nullable 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()
@Nullable SelenideElement
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>
PageObjectClassfinal <PageObjectClass>
PageObjectClasspage
(PageObjectClass... reified) <PageObjectClass,
T extends PageObjectClass>
PageObjectClasspage
(T pageObject) void
refresh()
@Nullable String
screenshot
(String fileName) Take a screenshot of the current page and save to file "fileName.png" (and optionally, "fileName.html")<T> @Nullable T
screenshot
(org.openqa.selenium.OutputType<T> outputType) Take a screenshot of the current page@Nullable String
source()
switchTo()
@Nullable String
title()
void
updateHash
(String hash) url()
Wait()
Conditional<org.openqa.selenium.WebDriver>
void
zoom
(double factor)
-
Constructor Details
-
SelenideDriver
-
SelenideDriver
-
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
-
page
- 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
-
browser
-
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
-
executeAsyncJavaScript
-
getFocusedElement
-
getSelectedText
Returns selected text or empty string if no text is selected.- Returns:
- selected text
-
copy
Copy selected text or empty string if no text is selected to clipboard.- Returns:
- the copied text
- See Also:
-
Wait
-
zoom
public void zoom(double factor) -
title
-
$
-
$
-
find
-
$x
-
$
-
$
-
$
-
find
-
find
-
$$
-
$$
-
$$x
-
findAll
-
findAll
-
$$
-
getSelectedRadio
-
modal
-
getWebDriverLogs
-
clearBrowserLocalStorage
public void clearBrowserLocalStorage() -
atBottom
public boolean atBottom() -
switchTo
-
url
-
source
-
getCurrentFrameUrl
-
getUserAgent
-
getSessionId
public org.openqa.selenium.remote.SessionId getSessionId() -
screenshot
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
- Throws:
URISyntaxException
-
download
- Throws:
URISyntaxException
-
download
-
download
-
getLocalStorage
-
getSessionStorage
-
getClipboard
-
webdriver
-