Package de.bmiag.tapir.selenium.service
Class DefaultBrowserInteractionService
- java.lang.Object
-
- de.bmiag.tapir.selenium.service.DefaultBrowserInteractionService
-
- All Implemented Interfaces:
BrowserInteractionService
@Component("tapirBrowserInteractionService") public class DefaultBrowserInteractionService extends java.lang.Object implements BrowserInteractionService
Default implementation ofBrowserInteractionService
.- Since:
- 2.0.0
- Author:
- Oliver Libutzki <[email protected]>
-
-
Constructor Summary
Constructors Constructor Description DefaultBrowserInteractionService()
-
Method Summary
All Methods Instance Methods Concrete 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
public void openURL(java.lang.String url)
Description copied from interface:BrowserInteractionService
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)
.- Specified by:
openURL
in interfaceBrowserInteractionService
- Parameters:
url
- The URL to load. It is best to use a fully qualified URL
-
getTitle
public java.lang.String getTitle()
Description copied from interface:BrowserInteractionService
Returns the title of the current page.- Specified by:
getTitle
in interfaceBrowserInteractionService
- Returns:
- The title of the current page, with leading and trailing whitespace stripped, or null if one is not already set
-
switchToFrame
public void switchToFrame(java.lang.String frameNameOrId)
Description copied from interface:BrowserInteractionService
Select a frame by its name or ID. Frames located by matching name attributes are always given precedence over those matched by ID.- Specified by:
switchToFrame
in interfaceBrowserInteractionService
- Parameters:
frameNameOrId
- the name of the frame window, the id of the <frame> or <iframe> element, or the (zero-based) index
-
refresh
public void refresh()
Description copied from interface:BrowserInteractionService
Refresh the current page- Specified by:
refresh
in interfaceBrowserInteractionService
-
deleteAllCookies
public void deleteAllCookies()
Description copied from interface:BrowserInteractionService
Delete all the cookies for the current domain.- Specified by:
deleteAllCookies
in interfaceBrowserInteractionService
-
-