diff options
| author | jmikhail@google.com <jmikhail@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-19 00:57:51 +0000 |
|---|---|---|
| committer | jmikhail@google.com <jmikhail@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-19 00:57:51 +0000 |
| commit | 35a369575ad34881580ed0724f8c0304f7342c20 (patch) | |
| tree | dba8ec8d9ae4679a6dd571a2c65c7328e0e0a465 /chrome/test/webdriver/commands/create_session.h | |
| parent | bc073ca8358c8edd5b21f61d5194120a838e3530 (diff) | |
| download | chromium_src-35a369575ad34881580ed0724f8c0304f7342c20.zip chromium_src-35a369575ad34881580ed0724f8c0304f7342c20.tar.gz chromium_src-35a369575ad34881580ed0724f8c0304f7342c20.tar.bz2 | |
Base implementation of WebDriver for Chrome.
WebDriver is a tool for automating testing web applications, and in particular
to verify that they work as expected. It aims to provide a friendly API that's
easy to explore and understand, which will help make your tests easier to read
and maintain. It's not tied to any particular test framework, so it can be used
equally well with JUnit, TestNG or from a plain old "main" method. This checkin
includes all that it necessary to implement the JSON over HTTP protocol for
WebDriver along with the /session and /session/sessionID URLs. Each URL is
added under the webdriver/command directory.
To run simply run execute webdriver command, on linux you may need to add the
path to chrome to your enviroment settings. A port can be specified with the
--port option, by default webdriver will listen in on port 8080.
Note: A total refactor of my original code was done by Jason Leyba (jleyba).
All of his changes are included in this checkin
For further reference on the WebDriver remote protocol see:
http://code.google.com/p/selenium/wiki/JsonWireProtocol
BUG=none
TEST=Start webdriver then run the file webdriver_tests.py
Review URL: http://codereview.chromium.org/3064012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56626 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/webdriver/commands/create_session.h')
| -rw-r--r-- | chrome/test/webdriver/commands/create_session.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/chrome/test/webdriver/commands/create_session.h b/chrome/test/webdriver/commands/create_session.h new file mode 100644 index 0000000..2e5fa6d --- /dev/null +++ b/chrome/test/webdriver/commands/create_session.h @@ -0,0 +1,37 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_TEST_WEBDRIVER_COMMANDS_CREATE_SESSION_H_ +#define CHROME_TEST_WEBDRIVER_COMMANDS_CREATE_SESSION_H_ + +#include <string> +#include <vector> + +#include "chrome/test/webdriver/commands/command.h" +#include "chrome/test/webdriver/commands/webdriver_command.h" + +namespace webdriver { + +// Create a new session which is a new instance of the chrome browser with no +// page loaded. A new session ID is passed back to the user which is used for +// all future commands that are sent to control this new instance. The +// desired capabilities should be specified in a JSON object with the +// following properties: +// http://code.google.com/p/selenium/wiki/JsonWireProtocol#/session +class CreateSession : public Command { + public: + inline CreateSession(const std::vector<std::string>& path_segments, + const DictionaryValue* const parameters) + : Command(path_segments, parameters) {} + virtual ~CreateSession() {} + + virtual bool DoesPost() { return true; } + virtual void ExecutePost(Response* const response); + + private: + DISALLOW_COPY_AND_ASSIGN(CreateSession); +}; +} // namespace webdriver +#endif // CHROME_TEST_WEBDRIVER_COMMANDS_CREATE_SESSION_H_ + |
