WebDriver

This is a JavaScript wrapper for RemoteWebDriver of Selenium .NET library.

Action Summary

Action Description
Actions Gets Actions object.
ClearSessions Deletes active sessions on Selenium grid.
Close Close the Browser and Dispose of WebDriver.
Cookies Gets Cookies object.
CreateDriver This will create a WebDriver for currently selected Browser profile.
CreateDriverForSession Connects to active Selenium session with given URL and Id.
Dispose Dispose of WebDriver.
DumpSessions Prints information about active Appium sessions to output.
ExecuteScript Executes JavaScript in the context of the currently selected frame or window.
FindElementByClassName Finds the first element in the page that matches the CSS Class supplied.
FindElementByCssSelector Finds the first element matching the specified CSS selector.
FindElementById Finds the first element in the page that matches the ID supplied.
FindElementByLinkText Finds the first of elements that match the link text supplied.
FindElementByName Finds the first of elements that match the name supplied.
FindElementByPartialLinkText Finds the first of elements that match the part of the link text supplied.
FindElementByTagName Finds the first of elements that match the DOM Tag supplied.
FindElementByXPath Finds the first of elements that match the XPath supplied.
FindElementsByClassName Finds a list of elements that match the class name supplied.
FindElementsByCssSelector Finds all elements matching the specified CSS selector.
FindElementsById Finds the first element in the page that matches the ID supplied.
FindElementsByLinkText Finds a list of elements that match the link text supplied.
FindElementsByName Finds a list of elements that match the name supplied.
FindElementsByPartialLinkText Finds a list of elements that match the part of the link text supplied.
FindElementsByTagName Finds a list of elements that match the DOM Tag supplied.
FindElementsByXPath Finds a list of elements that match the XPath supplied.
GetAddressOfRemoteServer
GetCurrentWindowHandle Gets the current window handle, which is an opaque handle to this window that uniquely identifies it within this driver instance.
GetPageSource Gets the source of the page last loaded by the browser.
GetProfileCapability
GetScreenshot Gets the screenshot of the page.
GetScreenshotIW
GetSessionId
GetTitle Gets the title of the current browser window.
GetUrl Gets the URL the browser is currently displaying.
GetWindowHandles Gets the window handles of open browser windows.
Quit Disconnects from the Browser.
ReconnectSession Reads session information produced by SaveSession and connects to the mobile target.
SaveSession Saves session information for use by ReconnectSession.
SetBrowserSize Sets size of a browser window.
SetUrl Sets the URL the browser is currently displaying.
SwitchToAlert Switches to the currently active modal dialog for this particular driver instance.
SwitchToDefaultContent Change the active frame to the default.
SwitchToFrame Move to different frame using its element.
SwitchToLastWindow Switch to last browser window.
SwitchToParentFrame Select the parent frame of the currently selected frame.
SwitchToWindow Switch to window specified by handle.
Window Gets Window object.

Action Detail

Actions

Gets Actions object.

Actions() 

ClearSessions

Deletes active sessions on Selenium grid.

ClearSessions() 

Close

Close the Browser and Dispose of WebDriver.

Close() 

Cookies

Gets Cookies object.

Cookies() 

CreateDriver

This will create a WebDriver for currently selected Browser profile.

CreateDriver(nonProfileCapsJson) 

Parameters:

Name Type Description
nonProfileCapsJson object JSON object with capabilities not available in a Browser profile.

Returns:

WebDriver object.

CreateDriverForSession

Connects to active Selenium session with given URL and Id.

CreateDriverForSession(addressOfRemoteServer, sessionId) 

Parameters:

Name Type Description
addressOfRemoteServer Selenium server URL.
sessionId Id of the session to connect.

Returns:

true if successful, false otherwise.

Dispose

Dispose of WebDriver.

Dispose() 

DumpSessions

Prints information about active Appium sessions to output.

DumpSessions() 

ExecuteScript

Executes JavaScript in the context of the currently selected frame or window.

ExecuteScript(script, args) 

Parameters:

Name Type Description
script string The JavaScript code to execute.
args array The arguments to the script.

Returns:

Null, string or element depending on the script.

FindElementByClassName

Finds the first element in the page that matches the CSS Class supplied.

FindElementByClassName(className) 

Parameters:

Name Type Description
className string CSS class name of the element.

Returns:

element or null.

FindElementByCssSelector

Finds the first element matching the specified CSS selector.

FindElementByCssSelector(cssSelector) 

Parameters:

Name Type Description
cssSelector string The CSS selector to match.

Returns:

element ot null.

FindElementById

Finds the first element in the page that matches the ID supplied.

FindElementById(id) 

Parameters:

Name Type Description
id string ID of the element.

Returns:

element or null.

FindElementByLinkText

Finds the first of elements that match the link text supplied.

FindElementByLinkText(linkText) 

Parameters:

Name Type Description
linkText string Link text of element.

Returns:

element or null.

FindElementByName

Finds the first of elements that match the name supplied.

FindElementByName(name) 

Parameters:

Name Type Description
name string Name of the element on the page.

Returns:

element or null.

FindElementByPartialLinkText

Finds the first of elements that match the part of the link text supplied.

FindElementByPartialLinkText(partialLinkText) 

Parameters:

Name Type Description
partialLinkText string Part of the link text.

Returns:

element or null.

FindElementByTagName

Finds the first of elements that match the DOM Tag supplied.

FindElementByTagName(tagName) 

Parameters:

Name Type Description
tagName string DOM tag Name of the element being searched.

Returns:

element or null.

FindElementByXPath

Finds the first of elements that match the XPath supplied.

FindElementByXPath(xpath) 

Parameters:

Name Type Description
xpath string xpath to the element.

Returns:

element or null.

FindElementsByClassName

Finds a list of elements that match the class name supplied.

FindElementsByClassName(className) 

Parameters:

Name Type Description
className string className of the element.

Returns:

array of elements.

FindElementsByCssSelector

Finds all elements matching the specified CSS selector.

FindElementsByCssSelector(cssSelector) 

Parameters:

Name Type Description
cssSelector string The CSS selector to match.

Returns:

array of elements.

FindElementsById

Finds the first element in the page that matches the ID supplied.

FindElementsById(id) 

Parameters:

Name Type Description
id string ID of the element.

Returns:

array of elements.

FindElementsByLinkText

Finds a list of elements that match the link text supplied.

FindElementsByLinkText(linkText) 

Parameters:

Name Type Description
linkText Link text of element.

Returns:

array of elements.

FindElementsByName

Finds a list of elements that match the name supplied.

FindElementsByName(name) 

Parameters:

Name Type Description
name string Name of the element on the page.

Returns:

array of elements.

FindElementsByPartialLinkText

Finds a list of elements that match the part of the link text supplied.

FindElementsByPartialLinkText(partialLinkText) 

Parameters:

Name Type Description
partialLinkText string Part of the link text.

Returns:

array of elements.

FindElementsByTagName

Finds a list of elements that match the DOM Tag supplied.

FindElementsByTagName(tagName) 

Parameters:

Name Type Description
tagName string DOM tag Name of the element being searched.

Returns:

array of elements.

FindElementsByXPath

Finds a list of elements that match the XPath supplied.

FindElementsByXPath(xpath) 

Parameters:

Name Type Description
xpath string xpath to the element.

Returns:

array of elements.

GetAddressOfRemoteServer

GetAddressOfRemoteServer() 

Returns:

URL of the remote Selenium server.

GetCurrentWindowHandle

Gets the current window handle, which is an opaque handle to this window that uniquely identifies it within this driver instance.

GetCurrentWindowHandle() 

GetPageSource

Gets the source of the page last loaded by the browser.

GetPageSource() 

GetProfileCapability

GetProfileCapability(name) 

Parameters:

Name Type Description
name

GetScreenshot

Gets the screenshot of the page.

GetScreenshot() 

GetScreenshotIW

GetScreenshotIW() 

GetSessionId

GetSessionId() 

Returns:

Id of the current session.

GetTitle

Gets the title of the current browser window.

GetTitle() 

GetUrl

Gets the URL the browser is currently displaying.

GetUrl() 

GetWindowHandles

Gets the window handles of open browser windows.

GetWindowHandles() 

Quit

Disconnects from the Browser.

Quit() 

ReconnectSession

Reads session information produced by SaveSession and connects to the mobile target.

ReconnectSession(autoCreate) 

Parameters:

Name Type Description
autoCreate boolean 'true' to automatically create a new session if there is no saved session or saved session is not available anymore.
Optional, Default: false.

SaveSession

Saves session information for use by ReconnectSession.

SaveSession() 

SetBrowserSize

Sets size of a browser window.

SetBrowserSize(width, height) 

Parameters:

Name Type Description
width number Window width to set
height number Window height to set

SetUrl

Sets the URL the browser is currently displaying.

SetUrl(url) 

Parameters:

Name Type Description
url string The URL to display

SwitchToAlert

Switches to the currently active modal dialog for this particular driver instance.

SwitchToAlert() 

SwitchToDefaultContent

Change the active frame to the default.

SwitchToDefaultContent() 

SwitchToFrame

Move to different frame using its element.

SwitchToFrame(el) 

Parameters:

Name Type Description
el WebElementWrapper Element of the frame.

SwitchToLastWindow

Switch to last browser window.

SwitchToLastWindow() 

SwitchToParentFrame

Select the parent frame of the currently selected frame.

SwitchToParentFrame() 

SwitchToWindow

Switch to window specified by handle.

SwitchToWindow(windowHandle) 

Parameters:

Name Type Description
windowHandle

Window

Gets Window object.

Window()