WD
|
#include <command.h>
Public Member Functions | |
Command (const std::vector< std::string > &path_segments, const DictionaryValue *const parameters) | |
Command (const Command &other) | |
virtual | ~Command () |
virtual bool | DoesDelete () const |
virtual bool | DoesGet () const |
virtual bool | DoesPost () const |
virtual bool | Init (Response *const response) |
virtual void | Finish (Response *const response) |
virtual void | ExecuteDelete (Response *const response) |
virtual void | ExecuteGet (Response *const response) |
virtual void | ExecutePost (Response *const response) |
Protected Member Functions | |
std::string | GetPathVariable (const size_t i) const |
bool | HasParameter (const std::string &key) const |
bool | IsNullParameter (const std::string &key) const |
bool | GetStringParameter (const std::string &key, string16 *out) const |
bool | GetStringParameter (const std::string &key, std::string *out) const |
bool | GetStringASCIIParameter (const std::string &key, std::string *out) const |
bool | GetBooleanParameter (const std::string &key, bool *out) const |
bool | GetIntegerParameter (const std::string &key, int *out) const |
bool | GetDoubleParameter (const std::string &key, double *out) const |
bool | GetDictionaryParameter (const std::string &key, const DictionaryValue **out) const |
bool | GetListParameter (const std::string &key, const ListValue **out) const |
Protected Attributes | |
const std::vector< std::string > | path_segments_ |
yasper::ptr< const DictionaryValue > | parameters_ |
Base class for a command mapped to a URL in the WebDriver REST API. Each URL may respond to commands sent with a DELETE, GET/HEAD, or POST HTTP request. For more information on the WebDriver REST API, see http://code.google.com/p/selenium/wiki/JsonWireProtocol
webdriver::Command::Command | ( | const std::vector< std::string > & | path_segments, |
const DictionaryValue *const | parameters | ||
) |
base constructor
path_segments | vector of segments of path of url |
parameters | container of parsed JSON input |
webdriver::Command::Command | ( | const Command & | other | ) |
|
virtual |
|
virtual |
Indicates if this command URL responds to DELETE method.
Reimplemented in webdriver::SessionStorageKeyCommand, webdriver::SessionStorageCommand, webdriver::WindowCommand, webdriver::NamedCookieCommand, webdriver::LocalStorageKeyCommand, webdriver::SessionWithID, webdriver::CookieCommand, and webdriver::LocalStorageCommand.
|
virtual |
Indicates if this command URL responds to GET method.
Reimplemented in webdriver::ElementScreenshotCommand, webdriver::ElementTextCommand, webdriver::ElementSizeCommand, webdriver::ElementSelectedCommand, webdriver::ElementNameCommand, webdriver::ElementLocationInViewCommand, webdriver::ElementLocationCommand, webdriver::ElementEqualsCommand, webdriver::SessionStorageSizeCommand, webdriver::ElementEnabledCommand, webdriver::SessionStorageKeyCommand, webdriver::ElementDisplayedCommand, webdriver::CISCO_PlaybackSpeedCommand, webdriver::SessionStorageCommand, webdriver::ElementCssCommand, webdriver::CISCO_MuteCommand, webdriver::LocalStorageSizeCommand, webdriver::CISCO_SeekCommand, webdriver::ElementAttributeCommand, webdriver::VisualizerShowPointCommand, webdriver::LocalStorageKeyCommand, webdriver::WindowHandlesCommand, webdriver::URLCommand, webdriver::CISCO_StateCommand, webdriver::GlobalLogCommand, webdriver::WindowPositionCommand, webdriver::LogTypesCommand, webdriver::VisualizerSourceCommand, webdriver::Sessions, webdriver::CookieCommand, webdriver::SessionWithID, webdriver::WindowHandleCommand, webdriver::OrientationCommand, webdriver::CISCO_VolumeCommand, webdriver::StatusCommand, webdriver::ScreenshotCommand, webdriver::SourceCommand, webdriver::AlertTextCommand, webdriver::AppCacheStatusCommand, webdriver::HTML5LocationCommand, webdriver::LocalStorageCommand, webdriver::WindowSizeCommand, webdriver::TitleCommand, and webdriver::BrowserConnectionCommand.
|
virtual |
Indicates if this command URL responds to POST method.
Reimplemented in webdriver::ElementValueCommand, webdriver::ElementSubmitCommand, webdriver::ElementSelectedCommand, webdriver::ActiveElementCommand, webdriver::CISCO_PlaybackSpeedCommand, webdriver::SessionStorageCommand, webdriver::SwitchFrameCommand, webdriver::CISCO_MuteCommand, webdriver::ElementClearCommand, webdriver::AdvancedMouseCommand, webdriver::CISCO_SeekCommand, webdriver::WindowCommand, webdriver::WindowMaximizeCommand, webdriver::DismissAlertCommand, webdriver::RefreshCommand, webdriver::URLCommand, webdriver::CISCO_StateCommand, webdriver::HoverCommand, webdriver::AcceptAlertCommand, webdriver::TouchCommand, webdriver::WindowPositionCommand, webdriver::BackCommand, webdriver::XDRPCCommand, webdriver::CookieCommand, webdriver::CreateSession, webdriver::SetTimeoutCommand, webdriver::ExecuteAsyncScriptCommand, webdriver::OrientationCommand, webdriver::CISCO_VolumeCommand, webdriver::MoveAndClickCommand, webdriver::AlertTextCommand, webdriver::ExecuteCommand, webdriver::KeysCommand, webdriver::HTML5LocationCommand, webdriver::LocalStorageCommand, webdriver::WindowSizeCommand, webdriver::LogCommand, webdriver::FindElementCommand, webdriver::ForwardCommand, and webdriver::BrowserConnectionCommand.
|
inlinevirtual |
Executes the corresponding variant of this command URL. Always called after Init() and called from the Execute function. Any failure is handled as a return code found in Response.
response | pointer to response object |
Reimplemented in webdriver::SessionStorageKeyCommand, webdriver::SessionStorageCommand, webdriver::WindowCommand, webdriver::NamedCookieCommand, webdriver::LocalStorageKeyCommand, webdriver::LocalStorageCommand, webdriver::CookieCommand, and webdriver::SessionWithID.
|
inlinevirtual |
Executes the corresponding variant of this command URL. Always called after Init() and called from the Execute function. Any failure is handled as a return code found in Response.
response | pointer to response object |
Reimplemented in webdriver::ElementScreenshotCommand, webdriver::ElementTextCommand, webdriver::ElementSizeCommand, webdriver::ElementSelectedCommand, webdriver::ElementNameCommand, webdriver::ElementLocationInViewCommand, webdriver::ElementLocationCommand, webdriver::ElementEqualsCommand, webdriver::SessionStorageSizeCommand, webdriver::ElementEnabledCommand, webdriver::SessionStorageKeyCommand, webdriver::ElementDisplayedCommand, webdriver::CISCO_PlaybackSpeedCommand, webdriver::SessionStorageCommand, webdriver::ElementCssCommand, webdriver::CISCO_MuteCommand, webdriver::LocalStorageSizeCommand, webdriver::CISCO_SeekCommand, webdriver::ElementAttributeCommand, webdriver::LocalStorageKeyCommand, webdriver::VisualizerShowPointCommand, webdriver::URLCommand, webdriver::CISCO_StateCommand, webdriver::GlobalLogCommand, webdriver::WindowHandlesCommand, webdriver::WindowPositionCommand, webdriver::LogTypesCommand, webdriver::VisualizerSourceCommand, webdriver::Sessions, webdriver::CookieCommand, webdriver::SessionWithID, webdriver::OrientationCommand, webdriver::LocalStorageCommand, webdriver::StatusCommand, webdriver::WindowHandleCommand, webdriver::CISCO_VolumeCommand, webdriver::HTML5LocationCommand, webdriver::AlertTextCommand, webdriver::AppCacheStatusCommand, webdriver::ScreenshotCommand, webdriver::SourceCommand, webdriver::WindowSizeCommand, webdriver::TitleCommand, and webdriver::BrowserConnectionCommand.
|
inlinevirtual |
Executes the corresponding variant of this command URL. Always called after Init() and called from the Execute function. Any failure is handled as a return code found in Response.
response | pointer to response object |
Reimplemented in webdriver::ElementValueCommand, webdriver::ElementSubmitCommand, webdriver::ElementSelectedCommand, webdriver::TouchPinchZoomCommand, webdriver::WheelCommand, webdriver::TouchPinchRotateCommand, webdriver::DoubleClickCommand, webdriver::TouchFlickCommand, webdriver::ButtonUpCommand, webdriver::TouchLongClickCommand, webdriver::TouchScrollCommand, webdriver::ButtonDownCommand, webdriver::TouchMoveCommand, webdriver::ClickCommand, webdriver::ActiveElementCommand, webdriver::TouchDoubleClickCommand, webdriver::CISCO_PlaybackSpeedCommand, webdriver::SessionStorageCommand, webdriver::SwitchFrameCommand, webdriver::TouchUpCommand, webdriver::MoveToCommand, webdriver::CISCO_MuteCommand, webdriver::TouchDownCommand, webdriver::ElementClearCommand, webdriver::CISCO_SeekCommand, webdriver::WindowCommand, webdriver::WindowMaximizeCommand, webdriver::DismissAlertCommand, webdriver::TouchClickCommand, webdriver::RefreshCommand, webdriver::URLCommand, webdriver::CISCO_StateCommand, webdriver::HoverCommand, webdriver::WindowPositionCommand, webdriver::AcceptAlertCommand, webdriver::BackCommand, webdriver::XDRPCCommand, webdriver::CookieCommand, webdriver::LocalStorageCommand, webdriver::CreateSession, webdriver::HTML5LocationCommand, webdriver::OrientationCommand, webdriver::SetTimeoutCommand, webdriver::ExecuteAsyncScriptCommand, webdriver::CISCO_VolumeCommand, webdriver::AlertTextCommand, webdriver::MoveAndClickCommand, webdriver::ExecuteCommand, webdriver::KeysCommand, webdriver::WindowSizeCommand, webdriver::LogCommand, webdriver::FindElementCommand, webdriver::ForwardCommand, and webdriver::BrowserConnectionCommand.
|
virtual |
Called after this command is executed. This is only called if Init() is successful and regardless of whether the execution results in a Error.
response | pointer to response object |
Reimplemented in webdriver::WebDriverCommand.
|
protected |
Provides the command parameter with the given |key| as a boolean. Returns false if there is no such parameter, or if it is not a boolean.
|
protected |
Provides the command parameter with the given |key| as a Dictionary. Returns false if there is no such parameter, or if it is not a Dictionary.
|
protected |
Provides the command parameter with the given |key| as a double. Returns false if there is no such parameter, or if it is not a dobule.
|
protected |
Provides the command parameter with the given |key| as a int. Returns false if there is no such parameter, or if it is not a int.
|
protected |
Provides the command parameter with the given |key| as a list. Returns false if there is no such parameter, or if it is not a list.
|
protected |
Returns the path variable encoded at the |i|th index (0-based) in the request URL for this command. If the index is out of bounds, an empty string will be returned.
|
protected |
Provides the command parameter with the given |key| as a ASCII string. Returns true on success.
|
protected |
Returns the command parameter with the given |key| as a UTF-16 string. Returns true on success.
|
protected |
Provides the command parameter with the given |key| as a UTF-8 string. Returns true on success.
|
protected |
Returns whether the command has a parameter with the given |key|.
|
virtual |
Initializes this command for execution. If initialization fails, will return false and populate the response with the necessary information to return to the client.
response | pointer to response object |
Reimplemented in webdriver::WheelCommand, webdriver::ClickCommand, webdriver::MoveToCommand, webdriver::ViewCommand, webdriver::NamedCookieCommand, webdriver::WebDriverCommand, and webdriver::ElementCommand.
|
protected |
Returns true if the command parameter with the given |key| exists and is a null value.
|
protected |
|
protected |