Selenium WebDriver
All WebDriver methods available when using the Selenium driver.
Access via runtime.driver (or runtime.webDriver) after launching a Selenium runtime.
How these methods work over HTTP
Every method below is a remote call. The SDK translates it into a structured step sent to a single endpoint:
The call field maps directly to the method name. args is a JSON array of the method’s arguments.
Navigation
get(url)
Navigate to a URL.
getCurrentUrl()
Get the current page URL.
Returns string
getTitle()
Get the current page title.
Returns string
getPageSource()
Get the full HTML source of the current page.
Returns string
navigate()
Access the navigation interface for back/forward/refresh.
Returns Navigation — object with to(), back(), forward(), refresh() methods.
Queries
findElement(locator)
Find a single element on the page.
Returns RemoteWebElement
findElements(locator)
Find all matching elements on the page.
Returns RemoteWebElement[]
Evaluation
executeScript(script, …args)
Execute synchronous JavaScript in the browser.
Returns any
executeAsyncScript(script, …args)
Execute asynchronous JavaScript. The last argument to the script is a callback.
Returns any
Screenshots
takeScreenshot()
Take a screenshot of the current page.
Returns string — base64-encoded PNG.
Cookies
manage().getCookies()
Get all cookies.
manage().getCookie(name)
Get a specific cookie by name.
manage().addCookie(cookie)
Add a cookie.
manage().deleteCookie(name)
Delete a specific cookie.
manage().deleteAllCookies()
Delete all cookies.
Window Management
getWindowHandle()
Get the current window handle.
Returns string
getAllWindowHandles()
Get all window handles.
Returns string[]
manage().window().getRect()
Get the window’s position and size.
manage().window().setRect(rect)
Set the window’s position and size.
manage().window().maximize()
Maximize the window.
manage().window().minimize()
Minimize the window.
manage().window().fullscreen()
Enter fullscreen mode.
Frame & Window Switching
switchTo().window(handle)
Switch to a different window or tab.
switchTo().frame(indexOrElement)
Switch into a frame by index or element.
switchTo().parentFrame()
Switch to the parent frame.
switchTo().defaultContent()
Switch back to the main document.
switchTo().activeElement()
Get the currently focused element.
Returns RemoteWebElement
switchTo().alert()
Switch to an alert dialog. Returns an alert object with accept(), dismiss(), getText(), sendKeys().
Lifecycle
close()
Close the current window.
quit()
Quit the driver and close all windows.

