Package de.bmiag.tapir.selenium.service
Interface BrowserInteractionService
-
- All Known Implementing Classes:
DefaultBrowserInteractionService
public interface BrowserInteractionService
Convenience methods to interact with the browser. This service encapsulates theWebDriver
API.- Since:
- 2.0.0
- Author:
- Oliver Libutzki <[email protected]>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
deleteAllCookies()
Delete all the cookies for the current domain.java.lang.String
getTitle()
Returns the title of the current page.void
openURL(java.lang.String url)
Load a new web page in the current browser window.void
refresh()
Refresh the current pagevoid
switchToFrame(java.lang.String frameNameOrId)
Select a frame by its name or ID.
-
-
-
Method Detail
-
openURL
void openURL(java.lang.String url)
Load a new web page in the current browser window. This is done using an HTTP GET operation, and the method will block until the load is complete. This will follow redirects issued either by the server or as a meta-redirect from within the returned HTML. Should a meta-redirect "rest" for any duration of time, it is best to wait until this timeout is over, since should the underlying page change whilst your test is executing the results of future calls against this interface will be against the freshly loaded page. Synonym forWebDriver.Navigation.to(String)
.- Parameters:
url
- The URL to load. It is best to use a fully qualified URL- Since:
- 2.0.0
-
getTitle
java.lang.String getTitle()
Returns the title of the current page.- Returns:
- The title of the current page, with leading and trailing whitespace stripped, or null if one is not already set
- Since:
- 2.0.0
-
switchToFrame
void switchToFrame(java.lang.String frameNameOrId)
Select a frame by its name or ID. Frames located by matching name attributes are always given precedence over those matched by ID.- Parameters:
frameNameOrId
- the name of the frame window, the id of the <frame> or <iframe> element, or the (zero-based) index- Throws:
org.openqa.selenium.NoSuchFrameException
- If the frame cannot be found- Since:
- 2.0.0
-
refresh
void refresh()
Refresh the current page- Since:
- 2.0.0
-
deleteAllCookies
void deleteAllCookies()
Delete all the cookies for the current domain.- Since:
- 2.0.0
-
-