From 35a369575ad34881580ed0724f8c0304f7342c20 Mon Sep 17 00:00:00 2001 From: "jmikhail@google.com" Date: Thu, 19 Aug 2010 00:57:51 +0000 Subject: 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 --- chrome/test/webdriver/commands/create_session.h | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 chrome/test/webdriver/commands/create_session.h (limited to 'chrome/test/webdriver/commands/create_session.h') 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 +#include + +#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& 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_ + -- cgit v1.1