diff --git a/.hgignore b/.gitignore similarity index 71% rename from .hgignore rename to .gitignore index 22a97db7e..f192e873f 100644 --- a/.hgignore +++ b/.gitignore @@ -1,10 +1,12 @@ -syntax:glob -.project -.pydevproject -test/results -*.pyc -*.orig -MANIFEST - -dist -build +.project +.pydevproject +test/results +*.pyc +*.orig +MANIFEST +doc/*.html +*.egg-info +*.egg + +dist +build diff --git a/BUILD.rst b/BUILD.rst new file mode 100644 index 000000000..545beb6d3 --- /dev/null +++ b/BUILD.rst @@ -0,0 +1,189 @@ +Selenium2Library Developer Information +====================================== + + +Directory Layout +---------------- + +MANIFEST.in + File that controls what gets included in a distribution + +setup.py + Setup script (uses setuptools) + +demo/ + Demo web app, acceptance tests, and scripts + +doc/ + Scripts to build keyword and readme documentation + +src/ + Library source code + +test/ + Unit and acceptance tests for Selenium2Library + + +Unit and Acceptance Tests +------------------------- + +The test directory contains everything needed to run Selenium2Library +tests with Robot Framework. This includes: + +- Unit tests under `unit` directory. +- Acceptance tests written with Robot Framework under `acceptance` + directory +- A very simple httpserver.py which is used to serve the html for tests in + `resources/testserver` +- A collection of simple html files under 'resources/html' directory +- Start-up scripts for executing the tests + +To run unit and acceptance tests, run:: + + python test/run_tests.py python|jython ff|ie|chrome [options] + +The first argument to the script defines the interpreter to be used +to run Robot. The second argument defines the browser to be used, +using the same browser tokens that you would use in your Robot +tests. + +Due to the structure of the tests, the directory containg the test +case files (`acceptance`) is always given to Robot as test data path. +To run only a subset of test cases, Robot command line arguments +--test, --suite, --include and --exclude may be used. + +Examples:: + + # Run all tests with Python and Firefox + python test/run_tests.py python ff + # Run only test suite `javascript` with Jython and Internet Explorer + python test/run_tests.py jython ie -s javascript + +To run just the unit tests, run:: + + python test/run_unit_tests.py + + +Pushing Code to GitHub +---------------------- + +Assuming the remote has been setup and named `origin` (it is +setup and named `origin` automatically if you cloned the existing +GitHub repo), run:: + + git push origin master + + +Building a Distribution +----------------------- + +To build a distribution, run:: + + python build_dist.py + +This script will: + +- Generate source distribution packages in .tar.gz and .zip formats +- Generate Python eggs for Python 2.6 and 2.7 +- Generate binary installers for Windows x86 and x64 (if run on Windows) +- Generate a demo distribution package in .zip format. +- Re-generate keyword documentation in doc folder + +Note: The Windows installers will only be built if the script is run on +a Windows machine. If the rest of the distribution has been built on +a non-Windows machine and you want to build just the Windows installers, +use the --winonly flag:: + + python build_dist.py --winonly + + +Publishing a New Release +------------------------ + +Build the distribution, this time with the --release flag:: + + python build_dist.py --release + +In addition to building the distribution, this will: + +- Register the release/version with PyPI +- Upload the binaries to PyPI for the new release/version + +After building and releasing to PyPI: + +- Upload dist packages to the `downloads section on GitHub`_ (all dist packages except the eggs) +- Publish the keyword documentation (see `Pushing Keyword Documentation`_) +- Tag the release (see `Tagging a Release`_) + +Note: To publish a release, you will need to: + +- Register an account on PyPI_ and be given rights to the package by a package owner +- Setup your `.pypirc file`_ (goes in the root of your home directory) + + +Tagging a Release +----------------- + +It's our policy to tag each release. To do so, run:: + + git tag -a v -m " release" + git push --tags + +E.g.:: + + git tag -a v1.0.0 -m "1.0.0 release" + git push --tags + + +Pushing Keyword Documentation +----------------------------- + +The keyword documentation is hosted using GitHub Pages. There is a branch +in the repo called `gh-pages` that contains nothing but the keyword documentation. + +First, switch to the `gh-pages` branch:: + + git checkout gh-pages + +If you get an error like "pathspec 'gh-pages' did not match any file(s) known to git", +run the following to setup the upstream configuration for the gh-pages branch:: + + git checkout -t origin/gh-pages + +Next, pull the keyword documentation you generated in the master branch and commit it:: + + git checkout master doc/Selenium2Library.html + git add doc/Selenium2Library.html + git commit + +Then, push it to the remote:: + + git push origin gh-pages + +Last, you probably want to switch back to the master branch:: + + git checkout master + + +Building Keyword Documentation +------------------------------ + +The keyword documentation will get built automatically by build_dist.py, +but if you need to generate it apart from a distribution build, run:: + + python doc/generate.py + + +Building Readme Files +--------------------- + +The readme files get distributed in reStructuredText format (.rst), +so there isn't any reason to build them except to verify how they +are parsed by the reStructuredText parser. To build them, run:: + + python doc/generate_readmes.py + + +.. _downloads section on GitHub: https://github.com/rtomac/robotframework-selenium2library/downloads +.. _PyPI: http://pypi.python.org +.. _.pypirc file: http://docs.python.org/distutils/packageindex.html#the-pypirc-file diff --git a/CHANGES.rst b/CHANGES.rst new file mode 100644 index 000000000..ab61c8cbc --- /dev/null +++ b/CHANGES.rst @@ -0,0 +1,24 @@ +Release Notes +============= + +1.1 (unreleased) +---------------- +- Added iframe support by removing strict filtering for only elements. + [emanlove] + +- Added the 'get text' keyword to be backwards compatible with the original + Selenium Library. + [jouk0] + +- Added drag and drop support with two functions `drag and drop source + target` and `drag and drop by offset source xoffset yoffset` + [mamathanag] and [j1z0] + +- Added HTMLUnit and HTMLUnitWithJS support. Just use a line like: + `Open Browser [initial page url] remote_url=[the selenium-server url] browser=htmlunit` + [SoCalLongboard] + +1.0.1 +----- +- Support for Robot Framework 2.7 +- Improvements to distribution build script and improved documentation diff --git a/INSTALL.rst b/INSTALL.rst new file mode 100644 index 000000000..a118c288d --- /dev/null +++ b/INSTALL.rst @@ -0,0 +1,64 @@ +Selenium2Library Installation +============================= + + +Preconditions +------------- + +Selenium2Library supports all Python and Jython interpreters supported by the +Robot Framework and the `Selenium Python Bindings`_. The Selenium Python Bindings +are the most restrictive, and as of now require Python 2.6 or Python 2.7. + +Selenium2Library depends on a few other Python libraries, including +of course Robot Framework and Selenium. All dependencies are declared +in setup.py. If you use pip or easy_install to install this library, the +dependencies will be installed for you (this is recommended). + + +Installing from PyPI (recommended) +---------------------------------- + +Selenium2Library is available in the Python Package Index (PyPI_). To install, +you need to have `pip`_ installed. Then run:: + + pip install robotframework-selenium2library + +Or alternately, if you only have `easy_install`_,:: + + easy_install robotframework-selenium2library + + +Installing from source +---------------------- + +The source code can be retrieved either as a source distribution or as a clone +of the main source repository. The installer requires Python version 2.4 or +newer. Install by running:: + + python setup.py install + +Or, if you'd like to automatically install dependencies, run:: + + python setup.py develop + +Note: In most linux systems, you need to have root privileges for installation. + +Uninstallation is achieved by deleting the installation directory and its +contents from the file system. The default installation directory is +`[PythonLibraries]/site-packages/Selenium2Library`. + + +Using Windows installer +----------------------- + +Currently, Windows installer is the only available binary installer. Just +double-click the installer and follow the instructions. + +Selenium2Library can be uninstalled using the Programs and Features utility from +Control Panel (Add/Remove Programs on older versions of Windows). + + +.. _Selenium Python Bindings: http://code.google.com/p/selenium/wiki/PythonBindings +.. _PyPI: http://code.google.com/p/selenium/wiki/PythonBindings +.. _pip: http://www.pip-installer.org +.. _easy_install: http://pypi.python.org/pypi/setuptools \ No newline at end of file diff --git a/INSTALL.txt b/INSTALL.txt deleted file mode 100644 index 2f225b5ed..000000000 --- a/INSTALL.txt +++ /dev/null @@ -1,39 +0,0 @@ -Selenium2Library Installation -============================= - -The Selenium2Library distribution contains the Selenium2Library -keywords/code, as well as the Selenium 2 (WebDriver) code -that it depends on. - - -Preconditions -------------- - -Selenium2Library itself supports all Python and Jython interpreters that are -supported by Robot Framework. - - -Installing from source ----------------------- - -The source code can be got either as a source distribution or as a checkout -from our version control system. The installer requires Python version 2.4 or -newer. Selenium Library is installed from source by typing following command:: - - python setup.py install - -In most linux systems, you need to have root privileges for installation. - -Uninstallation is achieved by deleting the installation directory and its -contents from the file system. The default installation directory is -`[PythonLibraries]/site-packages/Selenium2Library`. - - -Using Windows installer ------------------------ - -Currently, Windows installer is the only available binary installer. It is -enough to double-click the installer and follow the instructions. - -Selenium2Library can be uninstalled using the Programs and Features utility from -Control Panel (Add/Remove Programs on older versions of Windows). diff --git a/MANIFEST.in b/MANIFEST.in index df81f0a90..69b58e50b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,16 +1,17 @@ include MANIFEST.in include *.txt -exclude */*.txt # limit previous command to include *.txt files in root folder +include *.rst +exclude */*.txt # limit previous command to include only *.txt files in root folder +exclude */*.rst # limit previous command to include only *.rst files in root folder include selenium.bmp -recursive-include demo *.txt *.py *.sh *.bat *.html *.css *.js +recursive-include demo *.txt *.rst *.py *.sh *.bat *.html *.css *.js prune demo/reports prune demo/selenium_log.txt prune demo/output.xml -recursive-include doc *.txt *.html +include doc/Selenium2Library.html -recursive-include src/Selenium2Library *.py -graft src/Selenium2Library/lib +recursive-include src *.py graft src/Selenium2Library/resources recursive-exclude src *.pyc diff --git a/README.txt b/README similarity index 53% rename from README.txt rename to README index 97e091e64..30c850715 100644 --- a/README.txt +++ b/README @@ -6,12 +6,29 @@ Introduction ------------ Selenium2Library is a web testing library for Robot Framework -that leverage the `Selenium 2 (WebDriver)`_ libraries from the +that leverages the `Selenium 2 (WebDriver)`_ libraries from the Selenium_ project. It is modeled after (and forked from) the SeleniumLibrary_ library, but re-implemented to use Selenium 2 and WebDriver technologies. +- More information about this library can be found on the Wiki_ and in the `Keyword Documentation`_. +- Installation information is found in the `INSTALL.rst` file. +- Developer information is found in `BUILD.rst` file. + + +Directory Layout +---------------- + +demo/ + A simple demonstration, with an application running on localhost + +doc/ + Keyword documentation + +src/ + Python source code + Usage ----- @@ -21,29 +38,22 @@ Selenium2Library must be imported into your Robot test suite. See `Robot Framework User Guide`_ for more information. -Installation ------------- - -See INSTALL.txt for installation and uninstallation instructions. - - -Directory Layout ------------------ +Running the Demo +---------------- -demo/ - A simple demonstration, with an application running on localhost. +The demo directory contains an easily executable demo for Robot Framework +using Selenium2Library. To run the demo, run:: -doc/ - Keyword documentation. + python demo/rundemo.py -src/ - Python source code. - -test/ - Unit tests and acceptance tests for Selenium2Library source code. +E.g.:: + python demo/rundemo.py demo/login_tests + .. _Selenium: http://selenium.openqa.org .. _Selenium 2 (WebDriver): http://seleniumhq.org/docs/03_webdriver.html .. _SeleniumLibrary: http://code.google.com/p/robotframework-seleniumlibrary/ -.. _Robot Framework User Guide: http://code.google.com/p/robotframework/wiki/UserGuide \ No newline at end of file +.. _Wiki: https://github.com/rtomac/robotframework-selenium2library/wiki +.. _Keyword Documentation: http://rtomac.github.com/robotframework-selenium2library/doc/Selenium2Library.html +.. _Robot Framework User Guide: http://code.google.com/p/robotframework/wiki/UserGuide diff --git a/README.rst b/README.rst new file mode 100644 index 000000000..30c850715 --- /dev/null +++ b/README.rst @@ -0,0 +1,59 @@ +Selenium 2 (WebDriver) library for Robot Framework +================================================== + + +Introduction +------------ + +Selenium2Library is a web testing library for Robot Framework +that leverages the `Selenium 2 (WebDriver)`_ libraries from the +Selenium_ project. + +It is modeled after (and forked from) the SeleniumLibrary_ library, +but re-implemented to use Selenium 2 and WebDriver technologies. + +- More information about this library can be found on the Wiki_ and in the `Keyword Documentation`_. +- Installation information is found in the `INSTALL.rst` file. +- Developer information is found in `BUILD.rst` file. + + +Directory Layout +---------------- + +demo/ + A simple demonstration, with an application running on localhost + +doc/ + Keyword documentation + +src/ + Python source code + + +Usage +----- + +To write tests with Robot Framework and Selenium2Library, +Selenium2Library must be imported into your Robot test suite. +See `Robot Framework User Guide`_ for more information. + + +Running the Demo +---------------- + +The demo directory contains an easily executable demo for Robot Framework +using Selenium2Library. To run the demo, run:: + + python demo/rundemo.py + +E.g.:: + + python demo/rundemo.py demo/login_tests + + +.. _Selenium: http://selenium.openqa.org +.. _Selenium 2 (WebDriver): http://seleniumhq.org/docs/03_webdriver.html +.. _SeleniumLibrary: http://code.google.com/p/robotframework-seleniumlibrary/ +.. _Wiki: https://github.com/rtomac/robotframework-selenium2library/wiki +.. _Keyword Documentation: http://rtomac.github.com/robotframework-selenium2library/doc/Selenium2Library.html +.. _Robot Framework User Guide: http://code.google.com/p/robotframework/wiki/UserGuide diff --git a/build_dist.py b/build_dist.py index 210c07e18..6b5dd3530 100644 --- a/build_dist.py +++ b/build_dist.py @@ -1,21 +1,30 @@ #!/usr/bin/env python -import os, sys, shutil -import subprocess +import os, sys, shutil, subprocess, argparse THIS_DIR = os.path.dirname(os.path.abspath(__file__)) DIST_DIR = os.path.join(THIS_DIR, "dist") sys.path.append(os.path.join(THIS_DIR, "src", "Selenium2Library")) - -from distutils.core import setup -import metadata +sys.path.append(os.path.join(THIS_DIR, "doc")) +sys.path.append(os.path.join(THIS_DIR, "demo")) def main(): + parser = argparse.ArgumentParser(description="Builds a Se2Lib distribution") + parser.add_argument('py_26_path', action='store', help='Python 2.6 executbale file path') + parser.add_argument('py_27_path', action='store', help='Python 2.7 executbale file path') + parser.add_argument('--release', action='store_true') + parser.add_argument('--winonly', action='store_true') + args = parser.parse_args() + + if args.winonly: + run_builds(args) + return + clear_dist_folder() - run_doc_gen() - run_sdist() - run_win_bdist() + run_register(args) + run_builds(args) run_demo_packaging() + run_doc_gen() def clear_dist_folder(): if os.path.exists(DIST_DIR): @@ -23,23 +32,46 @@ def clear_dist_folder(): os.mkdir(DIST_DIR) def run_doc_gen(): - sys.path.append(os.path.join(THIS_DIR, "doc")) import generate + print generate.main() -def run_sdist(): - subprocess.call(["python", os.path.join(THIS_DIR, "setup.py"), "sdist", "--formats=gztar,zip"]) +def run_register(args): + if args.release: + _run_setup(args.py_27_path, "register", [], False) -def run_win_bdist(): +def run_builds(args): + print + if not args.winonly: + _run_setup(args.py_27_path, "sdist", [ "--formats=gztar,zip" ], args.release) + _run_setup(args.py_26_path, "bdist_egg", [], args.release) + _run_setup(args.py_27_path, "bdist_egg", [], args.release) if os.name == 'nt': - subprocess.call(["python", os.path.join(THIS_DIR, "setup.py"), "bdist", "--formats=wininst", "--plat-name=win32"]) - subprocess.call(["python", os.path.join(THIS_DIR, "setup.py"), "bdist", "--formats=wininst", "--plat-name=win-amd64"]) + _run_setup(args.py_27_path, "bdist_wininst", [ "--plat-name=win32" ], args.release) + _run_setup(args.py_27_path, "bdist_wininst", [ "--plat-name=win-amd64" ], args.release) + else: + print + print("Windows binary installers cannot be built on this platform!") def run_demo_packaging(): - sys.path.append(os.path.join(THIS_DIR, "demo")) import package + print package.main() +def _run_setup(py_path, type, params, upload): + setup_args = [py_path, os.path.join(THIS_DIR, "setup.py")] + #setup_args.append("--quiet") + setup_args.append(type) + setup_args.extend(params) + if upload: + setup_args.append("upload") + + print + print("Running: %s" % ' '.join(setup_args)) + returncode = subprocess.call(setup_args) + if returncode != 0: + print("Error running setup.py") + sys.exit(1) if __name__ == '__main__': main() diff --git a/demo/README.txt b/demo/README.txt deleted file mode 100644 index ede49f03c..000000000 --- a/demo/README.txt +++ /dev/null @@ -1,6 +0,0 @@ -Robot Framework Selenium2Library Demo -===================================== - -This directory contains an easily executable demo for Robot Framework -using Selenium2Library. The tests can be executed using the `rundemo.py` -script. diff --git a/demo/package.py b/demo/package.py index 5b09ab8b2..e02a706e7 100755 --- a/demo/package.py +++ b/demo/package.py @@ -5,12 +5,10 @@ from zipfile import ZipFile, ZIP_DEFLATED THIS_DIR = os.path.dirname(os.path.abspath(__file__)) -sys.path.append(os.path.join(THIS_DIR, "..", "src", "Selenium2Library")) - -import metadata +execfile(os.path.join(THIS_DIR, '..', 'src', 'Selenium2Library', 'version.py')) FILES = { - '': ['rundemo.py', 'README.txt'], + '': ['rundemo.py'], 'login_tests': ['valid_login.txt', 'invalid_login.txt', 'resource.txt'], 'demoapp': ['server.py'], 'demoapp/html': ['index.html', 'welcome.html', 'error.html', 'demo.css'] @@ -20,7 +18,7 @@ def main(): cwd = os.getcwd() try: os.chdir(THIS_DIR) - name = 'robotframework-selenium2library-%s-demo' % metadata.VERSION + name = 'robotframework-selenium2library-%s-demo' % VERSION zipname = '%s.zip' % name if os.path.exists(zipname): os.remove(zipname) diff --git a/doc/INSTALL.html b/doc/INSTALL.html deleted file mode 100644 index b760d495d..000000000 --- a/doc/INSTALL.html +++ /dev/null @@ -1,350 +0,0 @@ - - - - - - -Selenium2Library Installation - - - -
-

Selenium2Library Installation

- -

The Selenium2Library distribution contains the Selenium2Library -keywords/code, as well as the Selenium 2 (WebDriver) code -that it depends on.

-
-

Preconditions

-

Selenium2Library itself supports all Python and Jython interpreters that are -supported by Robot Framework.

-
-
-

Installing from source

-

The source code can be got either as a source distribution or as a checkout -from our version control system. The installer requires Python version 2.4 or -newer. Selenium Library is installed from source by typing following command:

-
-python setup.py install
-
-

In most linux systems, you need to have root privileges for installation.

-

Uninstallation is achieved by deleting the installation directory and its -contents from the file system. The default installation directory is -[PythonLibraries]/site-packages/Selenium2Library.

-
-
-

Using Windows installer

-

Currently, Windows installer is the only available binary installer. It is -enough to double-click the installer and follow the instructions.

-

Selenium2Library can be uninstalled using the Programs and Features utility from -Control Panel (Add/Remove Programs on older versions of Windows).

-
-
- - diff --git a/doc/README.html b/doc/README.html deleted file mode 100644 index 1122d4bce..000000000 --- a/doc/README.html +++ /dev/null @@ -1,353 +0,0 @@ - - - - - - -Selenium 2 (WebDriver) library for Robot Framework - - - -
-

Selenium 2 (WebDriver) library for Robot Framework

- -
-

Introduction

-

Selenium2Library is a web testing library for Robot Framework -that leverage the Selenium 2 (WebDriver) libraries from the -Selenium project.

-

It is modeled after (and forked from) the SeleniumLibrary library, -but re-implemented to use Selenium 2 and WebDriver technologies.

-
-
-

Usage

-

To write tests with Robot Framework and Selenium2Library, -Selenium2Library must be imported into your Robot test suite. -See Robot Framework User Guide for more information.

-
-
-

Installation

-

See INSTALL.txt for installation and uninstallation instructions.

-
-
-

Directory Layout

-
-
demo/
-
A simple demonstration, with an application running on localhost.
-
doc/
-
Keyword documentation.
-
src/
-
Python source code.
-
test/
-
Unit tests and acceptance tests for Selenium2Library source code.
-
-
-
- - diff --git a/doc/Selenium2Library.html b/doc/Selenium2Library.html index 8d65838c5..5de40bf06 100644 --- a/doc/Selenium2Library.html +++ b/doc/Selenium2Library.html @@ -1,1739 +1,270 @@ -Selenium2Library + + + + + + + + + -

Selenium2Library

-Version: 0.5
-Scope: global
-Named arguments: -supported - -

Introduction

-
Selenium2Library is a web testing library for Robot Framework. - -It uses the Selenium 2 (WebDriver) libraries internally to control a web browser. See http://seleniumhq.org/docs/03_webdriver.html for more information on Selenium 2 and WebDriver. - -Selenium2Library runs tests in a real browser instance. It should work in most modern browsers and can be used with both Python and Jython interpreters. - -Before running tests - -Prior to running test cases using Selenium2Library, Selenium2Library must be imported into your Robot test suite (see importing section), and the Open Browser keyword must be used to open a browser to the desired location. - -Locating elements - -All keywords in Selenium2Library that need to find an element on the page take an argument, locator. By default, when a locator value is provided, it is matched against the key attributes of the particular element type. For example, id and name are key attributes to all elements, and locating elements is easy using just the id as a locator. For example:: - -Click Element my_element - -It is also possible to specify the approach Selenium2Library should take to find an element by specifying a lookup strategy with a locator prefix. Supported strategies are: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
StrategyExampleDescription
identifierClick Element | identifier=my_elementMatches by @id or @name attribute
idClick Element | id=my_elementMatches by @id attribute
nameClick Element | name=my_elementMatches by @name attribute
xpathClick Element | xpath=//div[@id='my_element']Matches with arbitrary XPath expression
linkClick Element | link=My LinkMatches anchor elements by their link text
cssClick Element | css=div.my_classMatches by CSS selector
tagClick Element | tag=divMatches by HTML tag name
-Table related keywords, such as Table Should Contain, work differently. By default, when a table locator value is provided, it will search for a table with the specified id attribute. For example: - -Table Should Contain my_table text - -More complex table lookup strategies are also supported: - - - - - - - - - - - - - - - - - -
StrategyExampleDescription
cssTable Should Contain | css=table.my_class | textMatches by @id or @name attribute
xpathTable Should Contain | xpath=//table/[@name="my_table"] | textMatches by @id or @name attribute
-Timeouts - -There are several Wait ... keywords that take timeout as an argument. All of these timeout arguments are optional. The timeout used by all of them can be set globally using the Set Selenium Timeout keyword. - -All timeouts can be given as numbers considered seconds (e.g. 0.5 or 42) or in Robot Framework's time syntax (e.g. '1.5 seconds' or '1 min 30 s'). For more information about the time syntax see: http://robotframework.googlecode.com/svn/trunk/doc/userguide/RobotFrameworkUserGuide.html#time-format.
- -

Importing

- - - - - - - - - -
ArgumentsDocumentation
timeout=5.0, run_on_failure=Capture Page ScreenshotSelenium2Library can be imported with optional arguments. -timeout is the default timeout used to wait for all waiting actions. It can be later set with Set Selenium Timeout. - -run_on_failure specifies the name of a keyword (from any available libraries) to execute when a Selenium2Library keyword fails. By default Capture Page Screenshot will be used to take a screenshot of the current page. Using the value "Nothing" will disable this feature altogether. See Register Keyword To Run On Failure keyword for more information about this functionality. - -Examples: - - - - - - - - - - - - - -
Library | Selenium2Library | 15# Sets default timeout to 15 seconds
Library | Selenium2Library | 5 | Log Source# Sets default timeout to 5 seconds and runs Log Source on failure
Library | Selenium2Library | timeout=10 | run_on_failure=Nothing# Sets default timeout to 10 seconds and does nothing on failure
- -

Shortcuts

-
-Alert Should Be Present - ·  -Assign Id To Element - ·  -Capture Page Screenshot - ·  -Checkbox Should Be Selected - ·  -Checkbox Should Not Be Selected - ·  -Choose Cancel On Next Confirmation - ·  -Choose File - ·  -Choose Ok On Next Confirmation - ·  -Click Button - ·  -Click Element - ·  -Click Image - ·  -Click Link - ·  -Close All Browsers - ·  -Close Browser - ·  -Close Window - ·  -Confirm Action - ·  -Current Frame Contains - ·  -Delete All Cookies - ·  -Delete Cookie - ·  -Double Click Element - ·  -Element Should Be Disabled - ·  -Element Should Be Enabled - ·  -Element Should Be Visible - ·  -Element Should Contain - ·  -Element Should Not Be Visible - ·  -Element Text Should Be - ·  -Execute Javascript - ·  -Frame Should Contain - ·  -Get Alert Message - ·  -Get All Links - ·  -Get Cookie Value - ·  -Get Cookies - ·  -Get Element Attribute - ·  -Get Horizontal Position - ·  -Get List Items - ·  -Get Matching Xpath Count - ·  -Get Selected List Label - ·  -Get Selected List Labels - ·  -Get Selected List Value - ·  -Get Selected List Values - ·  -Get Selenium Speed - ·  -Get Selenium Timeout - ·  -Get Source - ·  -Get Table Cell - ·  -Get Title - ·  -Get Url - ·  -Get Value - ·  -Get Vertical Position - ·  -Get Window Identifiers - ·  -Go Back - ·  -Go To - ·  -Input Password - ·  -Input Text - ·  -List Selection Should Be - ·  -List Should Have No Selections - ·  -Location Should Be - ·  -Location Should Contain - ·  -Log Source - ·  -Log Title - ·  -Log Url - ·  -Maximize Browser Window - ·  -Mouse Down - ·  -Mouse Down On Image - ·  -Mouse Down On Link - ·  -Mouse Out - ·  -Mouse Over - ·  -Mouse Up - ·  -Open Browser - ·  -Open Context Menu - ·  -Page Should Contain - ·  -Page Should Contain Button - ·  -Page Should Contain Checkbox - ·  -Page Should Contain Element - ·  -Page Should Contain Image - ·  -Page Should Contain Link - ·  -Page Should Contain List - ·  -Page Should Contain Radio Button - ·  -Page Should Contain Textfield - ·  -Page Should Not Contain - ·  -Page Should Not Contain Button - ·  -Page Should Not Contain Checkbox - ·  -Page Should Not Contain Element - ·  -Page Should Not Contain Image - ·  -Page Should Not Contain Link - ·  -Page Should Not Contain List - ·  -Page Should Not Contain Radio Button - ·  -Page Should Not Contain Textfield - ·  -Press Key - ·  -Radio Button Should Be Set To - ·  -Radio Button Should Not Be Selected - ·  -Register Keyword To Run On Failure - ·  -Reload Page - ·  -Select All From List - ·  -Select Checkbox - ·  -Select Frame - ·  -Select From List - ·  -Select Radio Button - ·  -Select Window - ·  -Set Selenium Speed - ·  -Set Selenium Timeout - ·  -Submit Form - ·  -Switch Browser - ·  -Table Cell Should Contain - ·  -Table Column Should Contain - ·  -Table Footer Should Contain - ·  -Table Header Should Contain - ·  -Table Row Should Contain - ·  -Table Should Contain - ·  -Textfield Should Contain - ·  -Textfield Value Should Be - ·  -Title Should Be - ·  -Unselect Checkbox - ·  -Unselect Frame - ·  -Unselect From List - ·  -Wait For Condition - ·  -Wait Until Page Contains - ·  -Wait Until Page Contains Element - ·  -Xpath Should Match X Times +
+

Opening library documentation failed

+
    +
  • Verify that you have JavaScript enabled in your browser.
  • +
  • Make sure you are using a modern enough browser. Firefox 3.5, IE 8, or equivalent is required, newer browsers are recommended.
  • +
  • Check are there messages in your browser's JavaScript error log. Please report the problem if you suspect you have encountered a bug.
  • +
-

Keywords

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
KeywordArgumentsDocumentation
Alert Should Be Presenttext=Verifies an alert is present and dismisses it. - -If text is a non-empty string, then it is also verified that the message of the alert equals to text. - -Will fail if no alert is present. Note that following keywords will fail unless the alert is dismissed by this keyword or another like Get Alert Message.
Assign Id To Elementlocator, idAssigns a temporary identifier to element specified by locator. - -This is mainly useful if the locator is complicated/slow XPath expression. Identifier expires when the page is reloaded. - -Example: - - - - - - - - - - - -
Assign ID to Elementxpath=//div[@id="first_div"]my id
Page Should Contain Elementmy id
Capture Page Screenshotfilename=NoneTakes a screenshot of the current page and embeds it into the log. - -filename argument specifies the name of the file to write the screenshot into. If no filename is given, the screenshot is saved into file selenium-screenshot-<counter>.png under the directory where the Robot Framework log file is written into. The filename is also considered relative to the same directory, if it is not given in absolute format. - -css can be used to modify how the screenshot is taken. By default the bakground color is changed to avoid possible problems with background leaking when the page layout is somehow broken.
Checkbox Should Be SelectedlocatorVerifies checkbox identified by locator is selected/checked. - -Key attributes for checkboxes are id and name. See introduction for details about locating elements.
Checkbox Should Not Be SelectedlocatorVerifies checkbox identified by locator is not selected/checked. - -Key attributes for checkboxes are id and name. See introduction for details about locating elements.
Choose Cancel On Next ConfirmationCancel will be selected the next time Confirm Action is used.
Choose Filelocator, file_pathInputs the file_path into file input field found by identifier. - -This keyword is most often used to input files into upload forms. The file specified with file_path must be available on the same host where the Selenium Server is running. - -Example: - - - - - - -
Choose Filemy_upload_field/home/user/files/trades.csv
Choose Ok On Next ConfirmationUndo the effect of using keywords Choose Cancel On Next Confirmation. Note that Selenium's overridden window.confirm() function will normally automatically return true, as if the user had manually clicked OK, so you shouldn't need to use this command unless for some reason you need to change your mind prior to the next confirmation. After any confirmation, Selenium will resume using the default behavior for future confirmations, automatically returning true (OK) unless/until you explicitly use Choose Cancel On Next Confirmation for each confirmation. - -Note that every time a confirmation comes up, you must consume it by using a keywords such as Get Alert Message, or else the following selenium operations will fail.
Click ButtonlocatorClicks a button identified by locator. - -Key attributes for buttons are id, name and value. See introduction for details about locating elements.
Click ElementlocatorClick element identified by locator. - -Key attributes for arbitrary elements are id and name. See introduction for details about locating elements.
Click ImagelocatorClicks an image found by locator. - -Key attributes for images are id, src and alt. See introduction for details about locating elements.
Click LinklocatorClicks a link identified by locator. - -Key attributes for links are id, name, href and link text. See introduction for details about locating elements.
Close All BrowsersCloses all open browsers and resets the browser cache. - -After this keyword new indexes returned from Open Browser keyword are reset to 1. - -This keyword should be used in test or suite teardown to make sure all browsers are closed.
Close BrowserCloses the current browser.
Close WindowCloses currently opened pop-up window.
Confirm ActionDismisses currently shown confirmation dialog and returns it's message. - -By default, this keyword chooses 'OK' option from the dialog. If 'Cancel' needs to be chosen, keyword Choose Cancel On Next Confirmation must be called before the action that causes the confirmation dialog to be shown. - -Examples: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Click ButtonSend# Shows a confirmation dialog
${message}=Confirm Action# Chooses Ok
Should Be Equal${message}Are your sure?
Choose Cancel On Next Confirmation
Click ButtonSend# Shows a confirmation dialog
Confirm Action# Chooses Cancel
Current Frame Containstext, logLevel=INFOVerifies that current frame contains text. - -See Page Should Contain for explanation about loglevel argument.
Delete All CookiesDeletes all cookies.
Delete CookienameDeletes cookie matching name. - -If the cookie is not found, nothing happens.
Double Click ElementlocatorDouble click element identified by locator. - -Key attributes for arbitrary elements are id and name. See introduction for details about locating elements.
Element Should Be DisabledlocatorVerifies that element identified with locator is disabled. - -Key attributes for arbitrary elements are id and name. See introduction for details about locating elements.
Element Should Be EnabledlocatorVerifies that element identified with locator is enabled. - -Key attributes for arbitrary elements are id and name. See introduction for details about locating elements.
Element Should Be Visiblelocator, message=Verifies that the element identified by locator is visible. - -Herein, visible means that the element is logically visible, not optically visible in the current browser viewport. For example, an element that carries display:none is not logically visible, so using this keyword on that element would fail. - -message can be used to override the default error message. - -Key attributes for arbitrary elements are id and name. See introduction for details about locating elements.
Element Should Containlocator, expected, message=Verifies element identified by locator contains text expected. - -If you wish to assert an exact (not a substring) match on the text of the element, use Element Text Should Be. - -message can be used to override the default error message. - -Key attributes for arbitrary elements are id and name. See introduction for details about locating elements.
Element Should Not Be Visiblelocator, message=Verifies that the element identified by locator is NOT visible. - -This is the opposite of Element Should Be Visible. - -message can be used to override the default error message. - -Key attributes for arbitrary elements are id and name. See introduction for details about locating elements.
Element Text Should Belocator, expected, message=Verifies element identified by locator exactly contains text expected. - -In contrast to Element Should Contain, this keyword does not try a substring match but an exact match on the element identified by locator. - -message can be used to override the default error message. - -Key attributes for arbitrary elements are id and name. See introduction for details about locating elements.
Execute Javascript*codeExecutes the given JavaScript code. - -code may contain multiple lines of code but must contain a return statement (with the value to be returned) at the end. - -code may be divided into multiple cells in the test data. In that case, the parts are catenated together without adding spaces. - -If code is an absolute path to an existing file, the JavaScript to execute will be read from that file. Forward slashes work as a path separator on all operating systems. - -Note that, by default, the code will be executed in the context of the Selenium object itself, so this will refer to the Selenium object. Use window to refer to the window of your application, e.g. window.document.getElementById('foo'). - -Example: - - - - - - - - - -
Execute JavaScriptwindow.my_js_function('arg1', 'arg2')
Execute JavaScript${CURDIR}/js_to_execute.js
Frame Should Containlocator, text, loglevel=INFOVerifies frame identified by locator contains text. - -See Page Should Contain for explanation about loglevel argument. - -Key attributes for frames are id and name. See introduction for details about locating elements.
Get Alert MessageReturns the text of current JavaScript alert. - -This keyword will fail if no alert is present. Note that following keywords will fail unless the alert is dismissed by this keyword or another like Get Alert Message.
Get All LinksReturns a list containing ids of all links found in current page. - -If a link has no id, an empty string will be in the list instead.
Get Cookie ValuenameReturns value of cookie found with name. - -If no cookie is found with name, this keyword fails.
Get CookiesReturns all cookies of the current page.
Get Element Attributeattribute_locatorReturn value of element attribute. - -attribute_locator consists of element locator followed by an @ sign and attribute name, for example "element_id@class".
Get Horizontal PositionlocatorReturns horizontal position of element identified by locator. - -The position is returned in pixels off the left side of the page, as an integer. Fails if a matching element is not found. - -See also Get Vertical Position.
Get List ItemslocatorReturns the values in the select list identified by locator. - -Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements.
Get Matching Xpath CountxpathReturns number of elements matching xpath - -If you wish to assert the number of matching elements, use Xpath Should Match X Times.
Get Selected List LabellocatorReturns the visible label of the selected element from the select list identified by locator. - -Fails if there are zero or more than one selection. - -Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements.
Get Selected List LabelslocatorReturns the visible labels of selected elements (as a list) from the select list identified by locator. - -Fails if there is no selection. - -Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements.
Get Selected List ValuelocatorReturns the value of the selected element from the select list identified by locator. - -Return value is read from value attribute of the selected element. Fails if there are zero or more than one selection. - -Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements.
Get Selected List ValueslocatorReturns the values of selected elements (as a list) from the select list identified by locator. - -Fails if there is no selection. - -Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements.
Get Selenium SpeedGets the delay in seconds that is waited after each Selenium command. - -See Set Selenium Speed for an explanation.
Get Selenium TimeoutGets the timeout in seconds that is used by various keywords. - -See Set Selenium Timeout for an explanation.
Get SourceReturns the entire html source of the current page or frame.
Get Table Celltable_locator, row, column, loglevel=INFOReturns the content from a table cell. - -Row and column number start from 1. Header and footer rows are included in the count. This means that also cell content from header or footer rows can be obtained with this keyword. To understand how tables are identified, please take a look at the introduction.
Get TitleReturns title of current page.
Get UrlReturns URL of current page.
Get ValuelocatorReturns the value attribute of element identified by locator. - -See introduction for details about locating elements.
Get Vertical PositionlocatorReturns vertical position of element identified by locator. - -The position is returned in pixels off the top of the page, as an integer. Fails if a matching element is not found. - -See also Get Horizontal Position.
Get Window IdentifiersReturns handle identifiers for all windows known to the browser.
Go BackSimulates the user clicking the "back" button on their browser.
Go TourlNavigates the active browser instance to the provided URL.
Input Passwordlocator, textTypes the given password into text field identified by locator. - -Difference between this keyword and Input Text is that this keyword does not log the given password. See introduction for details about locating elements.
Input Textlocator, textTypes the given text into text field identified by locator. - -See introduction for details about locating elements.
List Selection Should Belocator, *itemsVerifies the selection of select list identified by locator is exactly *items. - -If you want to test that no option is selected, simply give no items. - -Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements.
List Should Have No SelectionslocatorVerifies select list identified by locator has no selections. - -Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements.
Location Should BeurlVerifies that current URL is exactly url.
Location Should ContainexpectedVerifies that current URL contains expected.
Log Sourceloglevel=INFOLogs and returns the entire html source of the current page or frame. - -The loglevel argument defines the used log level. Valid log levels are WARN, INFO (default), DEBUG, TRACE and NONE (no logging).
Log TitleLogs and returns the title of current page.
Log UrlLogs and returns the URL of current page.
Maximize Browser WindowMaximizes current browser window.
Mouse DownlocatorSimulates pressing the left mouse button on the element specified by locator. - -The element is pressed without releasing the mouse button. - -Key attributes for arbitrary elements are id and name. See introduction for details about locating elements. - -See also the more specific keywords Mouse Down On Image and Mouse Down On Link.
Mouse Down On ImagelocatorSimulates a mouse down event on an image. - -Key attributes for images are id, src and alt. See introduction for details about locating elements.
Mouse Down On LinklocatorSimulates a mouse down event on a link. - -Key attributes for links are id, name, href and link text. See introduction for details about locating elements.
Mouse OutlocatorSimulates moving mouse away from the element specified by locator. - -Key attributes for arbitrary elements are id and name. See introduction for details about locating elements.
Mouse OverlocatorSimulates hovering mouse over the element specified by locator. - -Key attributes for arbitrary elements are id and name. See introduction for details about locating elements.
Mouse UplocatorSimulates releasing the left mouse button on the element specified by locator. - -Key attributes for arbitrary elements are id and name. See introduction for details about locating elements.
Open Browserurl, browser=firefox, alias=NoneOpens a new browser instance to given URL. - -Returns the index of this browser instance which can be used later to switch back to it. Index starts from 1 and is reset back to it when Close All Browsers keyword is used. See Switch Browser for example. - -Optional alias is an alias for the browser instance and it can be used for switching between browsers (just as index can be used). See Switch Browser for more details. - -Possible values for browser are as follows: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
firefoxFireFox
ffFireFox
internetexplorerInternet Explorer
ieInternet Explorer
googlechromeGoogle Chrome
gcGoogle Chrome
chromeGoogle Chrome
-Note, that you will encounter strange behavior, if you open multiple Internet Explorer browser instances. That is also why Switch Browser only works with one IE browser at most. For more information see: http://selenium-grid.seleniumhq.org/faq.html#i_get_some_strange_errors_when_i_run_multiple_internet_explorer_instances_on_the_same_machine
Open Context MenulocatorOpens context menu on element identified by locator.
Page Should Containtext, loglevel=INFOVerifies that current page contains text. - -If this keyword fails, it automatically logs the page source using the log level specified with the optional loglevel argument. Giving NONE as level disables logging.
Page Should Contain Buttonlocator, message=, loglevel=INFOVerifies button identified by locator is found from current page. - -This keyword searches for buttons created with either input or button tag. - -See Page Should Contain Element for explanation about message and loglevel arguments. - -Key attributes for buttons are id, name and value. See introduction for details about locating elements.
Page Should Contain Checkboxlocator, message=, loglevel=INFOVerifies checkbox identified by locator is found from current page. - -See Page Should Contain Element for explanation about message and loglevel arguments. - -Key attributes for checkboxes are id and name. See introduction for details about locating elements.
Page Should Contain Elementlocator, message=, loglevel=INFOVerifies element identified by locator is found on the current page. - -message can be used to override default error message. - -See Page Should Contain for explanation about loglevel argument. - -Key attributes for arbitrary elements are id and name. See introduction for details about locating elements.
Page Should Contain Imagelocator, message=, loglevel=INFOVerifies image identified by locator is found from current page. - -See Page Should Contain Element for explanation about message and loglevel arguments. - -Key attributes for images are id, src and alt. See introduction for details about locating elements.
Page Should Contain Linklocator, message=, loglevel=INFOVerifies link identified by locator is found from current page. - -See Page Should Contain Element for explanation about message and loglevel arguments. - -Key attributes for links are id, name, href and link text. See introduction for details about locating elements.
Page Should Contain Listlocator, message=, loglevel=INFOVerifies select list identified by locator is found from current page. - -See Page Should Contain Element for explanation about message and loglevel arguments. - -Key attributes for lists are id and name. See introduction for details about locating elements.
Page Should Contain Radio Buttonlocator, message=, loglevel=INFOVerifies radio button identified by locator is found from current page. - -See Page Should Contain Element for explanation about message and loglevel arguments. - -Key attributes for radio buttons are id, name and value. See introduction for details about locating elements.
Page Should Contain Textfieldlocator, message=, loglevel=INFOVerifies text field identified by locator is found from current page. - -See Page Should Contain Element for explanation about message and loglevel arguments. - -Key attributes for text fields are id and name. See introduction for details about locating elements.
Page Should Not Containtext, loglevel=INFOVerifies the current page does not contain text. - -See Page Should Contain for explanation about loglevel argument.
Page Should Not Contain Buttonlocator, message=, loglevel=INFOVerifies button identified by locator is not found from current page. - -This keyword searches for buttons created with either input or button tag. - -See Page Should Contain Element for explanation about message and loglevel arguments. - -Key attributes for buttons are id, name and value. See introduction for details about locating elements.
Page Should Not Contain Checkboxlocator, message=, loglevel=INFOVerifies checkbox identified by locator is not found from current page. - -See Page Should Contain Element for explanation about message and loglevel arguments. - -Key attributes for checkboxes are id and name. See introduction for details about locating elements.
Page Should Not Contain Elementlocator, message=, loglevel=INFOVerifies element identified by locator is not found on the current page. - -message can be used to override the default error message. - -See Page Should Contain for explanation about loglevel argument. - -Key attributes for arbitrary elements are id and name. See introduction for details about locating elements.
Page Should Not Contain Imagelocator, message=, loglevel=INFOVerifies image identified by locator is found from current page. - -See Page Should Contain Element for explanation about message and loglevel arguments. - -Key attributes for images are id, src and alt. See introduction for details about locating elements.
Page Should Not Contain Linklocator, message=, loglevel=INFOVerifies image identified by locator is not found from current page. - -See Page Should Contain Element for explanation about message and loglevel arguments. - -Key attributes for images are id, src and alt. See introduction for details about locating elements.
Page Should Not Contain Listlocator, message=, loglevel=INFOVerifies select list identified by locator is not found from current page. - -See Page Should Contain Element for explanation about message and loglevel arguments. - -Key attributes for lists are id and name. See introduction for details about locating elements.
Page Should Not Contain Radio Buttonlocator, message=, loglevel=INFOVerifies radio button identified by locator is not found from current page. - -See Page Should Contain Element for explanation about message and loglevel arguments. - -Key attributes for radio buttons are id, name and value. See introduction for details about locating elements.
Page Should Not Contain Textfieldlocator, message=, loglevel=INFOVerifies text field identified by locator is not found from current page. - -See Page Should Contain Element for explanation about message and loglevel arguments. - -Key attributes for text fields are id and name. See introduction for details about locating elements.
Press Keylocator, keySimulates user pressing key on element identified by locator. - -key is either a single character, or a numerical ASCII code of the key lead by '\'. - -Examples: - - - - - - - - - - - - - -
Press Keytext_fieldq
Press Keylogin_button\13# ASCII code for enter key
Radio Button Should Be Set Togroup_name, valueVerifies radio button group identified by group_name has its selection set to value. - -See Select Radio Button for information about how radio buttons are located.
Radio Button Should Not Be Selectedgroup_nameVerifies radio button group identified by group_name has no selection. - -See Select Radio Button for information about how radio buttons are located.
Register Keyword To Run On FailurekeywordSets the keyword to execute when a Selenium2Library keyword fails. - -keyword_name is the name of a keyword (from any available libraries) that will be executed if a Selenium2Library keyword fails. It is not possible to use a keyword that requires arguments. Using the value "Nothing" will disable this feature altogether. - -The initial keyword to use is set in importing, and the keyword that is used by default is Capture Page Screenshot. Taking a screenshot when something failed is a very useful feature, but notice that it can slow down the execution. - -This keyword returns the name of the previously registered failure keyword. It can be used to restore the original value later. - -Example: - - - - - - - - - - - - - - - - - - - -
Register Keyword To Run On FailureLog Source# Run Log Source on failure.
${previous kw}=Register Keyword To Run On FailureNothing# Disables run-on-failure functionality and stores the previous kw name in a variable.
Register Keyword To Run On Failure${previous kw}# Restore to the previous keyword.
-This run-on-failure functionality only works when running tests on Python/Jython 2.4 or newer and it does not work on IronPython at all.
Reload PageSimulates user reloading page.
Select All From ListlocatorSelects all values from multi-select list identified by id. - -Key attributes for lists are id and name. See introduction for details about locating elements.
Select CheckboxlocatorSelects checkbox identified by locator. - -Does nothing if checkbox is already selected. Key attributes for checkboxes are id and name. See introduction for details about locating elements.
Select FramelocatorSets frame identified by locator as current frame. - -Key attributes for frames are id and name. See introduction for details about locating elements.
Select From Listlocator, *itemsSelects *items from list identified by locator - -If more than one value is given for a single-selection list, the last value will be selected. If the target list is a multi-selection list, and *items is an empty list, all values of the list will be selected. - -Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements.
Select Radio Buttongroup_name, valueSets selection of radio button group identified by group_name to value. - -The radio button to be selected is located by two arguments: -- group_name is used as the name of the radio input -- value is used for the value attribute or for the id attribute - -The XPath used to locate the correct radio button then looks like this: //input[@type='radio' and @name='group_name' and (@value='value' or @id='value')] - -Examples: - - - - - - - - - - - - - -
Select Radio ButtonsizeXL# Matches HTML like <input type="radio" name="size" value="XL">XL</input>
Select Radio ButtonsizesizeXL# Matches HTML like <input type="radio" name="size" value="XL" id="sizeXL">XL</input>
Select Windowlocator=NoneSelects the window found with locator as the context of actions. - -If the window is found, all subsequent commands use that window, until this keyword is used again. If the window is not found, this keyword fails. - -By default, when a locator value is provided, it is matched against the title of the window and the handle/identifier of the window. If multiple windows with same identifier are found, the first one is selected. - -Special locator main (default) can be used to select the main window. - -It is also possible to specify the approach Selenium2Library should take to find a window by specifying a locator strategy: - - - - - - - - - - - - - - - - - - - - - - -
StrategyExampleDescription
titleSelect Window | title=My DocumentMatches by window title
nameSelect Window | name=${id}Matches by window handle/identifier, see Get Window Identifiers
urlSelect Window | url=http://google.comMatches by window's current URL
-Example: - - - - - - - - - - - - - - - - - - - - - - - - - -
Click Linkpopup_link# opens new window
Select WindowpopupName
Title Should BePopup Title
Select Window# Chooses the main window again
Set Selenium SpeedsecondsSets the delay in seconds that is waited after each Selenium command. - -This is useful mainly in slowing down the test execution to be able to view the execution. seconds may be given in Robot Framework time format. Returns the previous speed value. - -Example: - - - - - -
Set Selenium Speed.5 seconds
Set Selenium TimeoutsecondsSets the timeout in seconds used by various keywords. - -There are several Wait ... keywords that take timeout as an argument. All of these timeout arguments are optional. The timeout used by all of them can be set globally using this keyword. See introduction for more information about timeouts. - -The previous timeout value is returned by this keyword and can be used to set the old value back later. The default timeout is 5 seconds, but it can be altered in importing. - -Example: - - - - - - - - - - - - - - - - -
${orig timeout} =Set Selenium Timeout15 seconds
Open page that loads slowly
Set Selenium Timeout${orig timeout}
Submit Formlocator=NoneSubmits a form identified by locator. - -If locator is empty, first form in the page will be submitted. Key attributes for forms are id and name. See introduction for details about locating elements.
Switch Browserindex_or_aliasSwitches between active browsers using index or alias. - -Index is returned from Open Browser and alias can be given to it. - -Example: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Open Browserhttp://google.comff
Location Should Behttp://google.com
Open Browserhttp://yahoo.comie2nd conn
Location Should Behttp://yahoo.com
Switch Browser1# index
Page Should ContainI'm feeling lucky
Switch Browser2nd conn# alias
Page Should ContainMore Yahoo!
Close All Browsers
-Above example expects that there was no other open browsers when opening the first one because it used index '1' when switching to it later. If you aren't sure about that you can store the index into a variable as below. - - - - - - - - - - - - - - - - - - - - -
${id} =Open Browserhttp://google.com*firefox
# Do something ...
Switch Browser${id}
Table Cell Should Containtable_locator, row, column, expected, loglevel=INFOVerifies that a certain cell in a table contains expected. - -Row and column number start from 1. This keyword passes if the specified cell contains the given content. If you want to test that the cell content matches exactly, or that it e.g. starts with some text, use Get Table Cell keyword in combination with built-in keywords such as Should Be Equal or Should Start With. - -To understand how tables are identified, please take a look at the introduction.
Table Column Should Containtable_locator, col, expected, loglevel=INFOVerifies that a specific column contains expected. - -The first leftmost column is column number 1. If the table contains cells that span multiple columns, those merged cells count as a single column. For example both tests below work, if in one row columns A and B are merged with colspan="2", and the logical third column contains "C". - -Example: - - - - - - - - - - - - - -
Table Column Should ContaintableId3C
Table Column Should ContaintableId2C
-To understand how tables are identified, please take a look at the introduction. - -See Page Should Contain Element for explanation about loglevel argument.
Table Footer Should Containtable_locator, expected, loglevel=INFOVerifies that the table footer contains expected. - -With table footer can be described as any <td>-element that is child of a <tfoot>-element. To understand how tables are identified, please take a look at the introduction. - -See Page Should Contain Element for explanation about loglevel argument.
Table Header Should Containtable_locator, expected, loglevel=INFOVerifies that the table header, i.e. any <th>...</th> element, contains expected. - -To understand how tables are identified, please take a look at the introduction. - -See Page Should Contain Element for explanation about loglevel argument.
Table Row Should Containtable_locator, row, expected, loglevel=INFOVerifies that a specific table row contains expected. - -The uppermost row is row number 1. For tables that are structured with thead, tbody and tfoot, only the tbody section is searched. Please use Table Header Should Contain or Table Footer Should Contain for tests against the header or footer content. - -If the table contains cells that span multiple rows, a match only occurs for the uppermost row of those merged cells. To understand how tables are identified, please take a look at the introduction. - -See Page Should Contain Element for explanation about loglevel argument.
Table Should Containtable_locator, expected, loglevel=INFOVerifies that expected can be found somewhere in the table. - -To understand how tables are identified, please take a look at the introduction. - -See Page Should Contain Element for explanation about loglevel argument.
Textfield Should Containlocator, expected, message=Verifies text field identified by locator contains text expected. - -message can be used to override default error message. - -Key attributes for text fields are id and name. See introduction for details about locating elements.
Textfield Value Should Belocator, expected, message=Verifies the value in text field identified by locator is exactly expected. - -message can be used to override default error message. - -Key attributes for text fields are id and name. See introduction for details about locating elements.
Title Should BetitleVerifies that current page title equals title.
Unselect CheckboxlocatorRemoves selection of checkbox identified by locator. - -Does nothing if the checkbox is not checked. Key attributes for checkboxes are id and name. See introduction for details about locating elements.
Unselect FrameSets the top frame as the current frame.
Unselect From Listlocator, *itemsUnselects given values from select list identified by locator. - -As a special case, giving empty list as *items will remove all selections. - -Select list keywords work on both lists and combo boxes. Key attributes for select lists are id and name. See introduction for details about locating elements.
Wait For Conditioncondition, timeout=None, error=NoneWaits until the given condition is true or timeout expires. - -code may contain multiple lines of code but must contain a return statement (with the value to be returned) at the end - -The condition can be arbitrary JavaScript expression but must contain a return statement (with the value to be returned) at the end. See Execute JavaScript for information about accessing the actual contents of the window through JavaScript. - -error can be used to override the default error message. - -See introduction for more information about timeout and its default value. - -See also Wait Until Page Contains, Wait Until Page Contains Element and BuiltIn keyword Wait Until Keyword Succeeds.
Wait Until Page Containstext, timeout=None, error=NoneWaits until text appears on current page. - -Fails if timeout expires before the text appears. See introduction for more information about timeout and its default value. - -error can be used to override the default error message. - -See also Wait Until Page Contains Element, Wait For Condition and BuiltIn keyword Wait Until Keyword Succeeds.
Wait Until Page Contains Elementlocator, timeout=None, error=NoneWaits until element specified with locator appears on current page. - -Fails if timeout expires before the element appears. See introduction for more information about timeout and its default value. - -error can be used to override the default error message. - -See also Wait Until Page Contains, Wait For Condition and BuiltIn keyword Wait Until Keyword Succeeds.
Xpath Should Match X Timesxpath, expected_xpath_count, message=, loglevel=INFOVerifies that the page contains the given number of elements located by the given xpath. + + + + + + + + + + + + -See Page Should Contain Element for explanation about message and loglevel arguments.
- diff --git a/doc/generate.py b/doc/generate.py index 8d078048a..08ca44889 100755 --- a/doc/generate.py +++ b/doc/generate.py @@ -1,49 +1,14 @@ #!/usr/bin/env python - -import os, shutil -from libdoc import LibraryDoc, create_html_doc -from buildhtml import Builder - -THIS_DIR = os.path.dirname(os.path.abspath(__file__)) -ROOT_DIR = os.path.join(THIS_DIR, "..") -SRC_DIR = os.path.join(ROOT_DIR, "src") -LIB_DIR = os.path.join(SRC_DIR, "Selenium2Library") - -README_FILES = [ - "README.txt", - "INSTALL.txt", - "test/README.txt" -] - -def main(): - build_lib_docs() - build_readmes() - -def build_lib_docs(): - outpath = os.path.join(THIS_DIR, 'Selenium2Library.html') - lib = LibraryDoc(LIB_DIR) - create_html_doc(lib, outpath) - print lib.name, lib.version - print outpath - -def build_readmes(): - try: - import docutils - except: - print "Readme files will not be built into HTML, docutils not installed" - return - for readme_relative_path in README_FILES: - readme_abs_path = os.path.join(ROOT_DIR, readme_relative_path.replace('/', os.sep)) - readme_path_parts = os.path.split(readme_abs_path) - Builder().process_txt(readme_path_parts[0], readme_path_parts[1]) - readme_html_path = os.path.splitext(readme_abs_path)[0] + '.html' - target_html_name = os.path.splitext(readme_relative_path.replace('/', '-'))[0] + '.html' - target_html_path = os.path.join(THIS_DIR, target_html_name) - if os.path.exists(target_html_path): - os.remove(target_html_path) - os.rename(readme_html_path, target_html_path) - print " ::: Saved: %s" % target_html_name +from os.path import join, dirname +try: + from robot.libdoc import libdoc +except: + def main(): + print """Robot Framework 2.7 or later required for generating documentation""" +else: + def main(): + libdoc(join(dirname(__file__),'..','src','Selenium2Library'), join(dirname(__file__),'Selenium2Library.html')) if __name__ == '__main__': - main() + main() \ No newline at end of file diff --git a/doc/generate_readmes.py b/doc/generate_readmes.py new file mode 100644 index 000000000..be6828b74 --- /dev/null +++ b/doc/generate_readmes.py @@ -0,0 +1,63 @@ +#!/usr/bin/env python + +import os, shutil +from buildhtml import Builder + +THIS_DIR = os.path.dirname(os.path.abspath(__file__)) +ROOT_DIR = os.path.join(THIS_DIR, "..") +SRC_DIR = os.path.join(ROOT_DIR, "src") +LIB_DIR = os.path.join(SRC_DIR, "Selenium2Library") + +README_FILES = [ + "README.rst", + "INSTALL.rst", + "BUILD.rst", + "CHANGES.rst" +] + +def main(): + try: + import docutils + except: + print "Readme files will not be built into HTML, docutils not installed" + return + for readme_relative_path in README_FILES: + (readme_dir, readme_name) = _parse_readme_path(readme_relative_path) + readme_txt_name = _make_txt_file(readme_dir, readme_name) + Builder().process_txt(readme_dir, readme_txt_name) + _cleanup_txt_file(readme_dir, readme_txt_name) + + readme_html_name = os.path.splitext(readme_name)[0] + '.html' + readme_html_path = os.path.join(readme_dir, readme_html_name) + target_readme_html_name = os.path.splitext(readme_relative_path.replace('/', '-'))[0] + '.html' + target_readme_html_path = os.path.join(THIS_DIR, target_readme_html_name) + + if os.path.exists(target_readme_html_path): + os.remove(target_readme_html_path) + os.rename(readme_html_path, target_readme_html_path) + + print " ::: Saved: %s" % target_readme_html_name + +def _parse_readme_path(readme_relative_path): + readme_abs_path = os.path.join(ROOT_DIR, readme_relative_path.replace('/', os.sep)) + readme_path_parts = os.path.split(readme_abs_path) + readme_dir = readme_path_parts[0] + readme_name = readme_path_parts[1] + return (readme_dir, readme_name) + +def _make_txt_file(readme_dir, readme_name): + readme_txt_name = os.path.splitext(readme_name)[0] + '.txt' + _cleanup_txt_file(readme_dir, readme_txt_name) + shutil.copyfile( + os.path.join(readme_dir, readme_name), + os.path.join(readme_dir, readme_txt_name)) + return readme_txt_name + +def _cleanup_txt_file(readme_dir, readme_txt_name): + readme_txt_abs_path = os.path.join(readme_dir, readme_txt_name) + if os.path.exists(readme_txt_abs_path): + os.remove(readme_txt_abs_path) + + +if __name__ == '__main__': + main() diff --git a/doc/libdoc.py b/doc/libdoc.py deleted file mode 100755 index 2a2660358..000000000 --- a/doc/libdoc.py +++ /dev/null @@ -1,719 +0,0 @@ - -#!/usr/bin/env python - -# Copyright 2008-2011 Nokia Siemens Networks Oyj -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Robot Framework Library and Resource File Documentation Generator - -Usage: libdoc.py [options] library_or_resource - -This script can generate keyword documentation in HTML and XML formats. The -former is suitable for humans and the latter for RIDE, RFDoc, and other tools. -This script can also upload XML documentation to RFDoc system. - -Documentation can be created for both test libraries and resource files. All -library and resource file types are supported, and also earlier generated -documentation in XML format can be used as input. - -Options: - -a --argument value * Possible arguments that a library needs. - -f --format HTML|XML Specifies whether to generate HTML or XML output. - The default value is got from the output file - extension and if the output is not specified the - default is HTML. - -o --output path Where to write the generated documentation. Can be - either a directory or a file, or a URL pointing to - RFDoc system's upload page. The default value is the - directory where the script is executed from. If - a URL is given, it must start with 'http://'. - -N --name newname Sets the name of the documented library or resource. - -V --version newversion Sets the version of the documented library or - resource. - -T --title title Sets the title of the generated HTML documentation. - Underscores in the given title are automatically - converted to spaces. - -S --styles styles Overrides the default styles. If the given 'styles' - is a path to an existing files, styles will be read - from it. If it is string a 'NONE', no styles will be - used. Otherwise the given text is used as-is. - -P --pythonpath path * Additional path(s) to insert into PYTHONPATH. - -E --escape what:with * Escapes characters which are problematic in console. - 'what' is the name of the character to escape and - 'with' is the string to escape it with. - <-------------------ESCAPES------------------------> - -h --help Print this help. - -For more information see either the tool's wiki page at -http://code.google.com/p/robotframework/wiki/LibraryDocumentationTool -or tools/libdoc/doc/libdoc.html file inside source distributions. -""" - -from __future__ import with_statement -import sys -import os -import re -import tempfile -from httplib import HTTPConnection -from HTMLParser import HTMLParser - -from robot.running import TestLibrary, UserLibrary -try: - from robot.utils.templating import Template, Namespace -except ImportError: # Support for 2.5.x - from robot.serializing.templating import Template, Namespace -from robot.errors import DataError, Information -from robot.parsing import populators -from robot import utils - - -populators.PROCESS_CURDIR = False - - -def _uploading(output): - return output.startswith('http://') - - -def create_html_doc(lib, outpath, title=None, styles=None): - if title: - title = title.replace('_', ' ') - else: - title = lib.name - generated = utils.get_timestamp(daysep='-', millissep=None) - namespace = Namespace(LIB=lib, TITLE=title, STYLES=_get_styles(styles), - GENERATED=generated) - doc = Template(template=HTML_TEMPLATE).generate(namespace) + '\n' - with open(outpath, 'w') as outfile: - outfile.write(doc.encode('UTF-8')) - -def _get_styles(styles): - if not styles: - return DEFAULT_STYLES - if styles.upper() == 'NONE': - return '' - if os.path.isfile(styles): - with open(styles) as f: - return f.read() - return styles - - -def create_xml_doc(lib, outpath): - writer = utils.XmlWriter(outpath) - writer.start('keywordspec', {'name': lib.name, 'type': lib.type, - 'generated': utils.get_timestamp(millissep=None)}) - writer.element('version', lib.version) - writer.element('scope', lib.scope) - writer.element('namedargs', 'yes' if lib.supports_named_arguments else 'no') - writer.element('doc', lib.doc) - _write_keywords_to_xml(writer, 'init', lib.inits) - _write_keywords_to_xml(writer, 'kw', lib.keywords) - writer.end('keywordspec') - writer.close() - -def _write_keywords_to_xml(writer, kwtype, keywords): - for kw in keywords: - writer.start(kwtype, {'name': kw.name} if kwtype == 'kw' else {}) - writer.element('doc', kw.doc) - writer.start('arguments') - for arg in kw.args: - writer.element('arg', arg) - writer.end('arguments') - writer.end(kwtype) - - -def upload_xml_doc(outpath, uploadurl): - RFDocUploader().upload(outpath, uploadurl) - - -def LibraryDoc(libname, arguments=None, name=None, version=None): - libdoc = _import_library(libname, arguments) - if name: - libdoc.name = name - if version: - libdoc.version = version - return libdoc - -def _import_library(name, arguments): - ext = os.path.splitext(name)[1].lower()[1:] - if ext in ('html', 'htm', 'xhtml', 'tsv', 'txt', 'rst', 'rest'): - return ResourceDoc(name) - elif ext == 'xml': - return XmlLibraryDoc(name) - elif ext == 'java': - return JavaLibraryDoc(name) - else: - return PythonLibraryDoc(name, arguments) - - -class _DocHelper: - _name_regexp = re.compile("`(.+?)`") - _list_or_table_regexp = re.compile('^(\d+\.|[-*|]|\[\d+\]) .') - - @property - def htmldoc(self): - return self._get_htmldoc(self.doc) - - @property - def htmlshortdoc(self): - return utils.html_attr_escape(self.shortdoc) - - @property - def htmlname(self): - return utils.html_attr_escape(self.name) - - def _process_doc(self, doc): - ret = [''] - for line in doc.splitlines(): - line = line.strip() - ret.append(self._get_doc_line_separator(line, ret[-1])) - ret.append(line) - return ''.join(ret) - - def _get_doc_line_separator(self, line, prev): - if prev == '': - return '' - if line == '': - return '\n\n' - if self._list_or_table_regexp.search(line): - return '\n' - if prev.startswith('| ') and prev.endswith(' |'): - return '\n' - if self.type == 'resource': - return '\n\n' - return ' ' - - def _get_htmldoc(self, doc): - doc = utils.html_format(doc) - return self._name_regexp.sub(self._link_keywords, doc) - - def _link_keywords(self, res): - name = res.group(1) - lib = self.lib if hasattr(self, 'lib') else self - for kw in lib.keywords: - if utils.eq(name, kw.name): - return '%s' % (kw.name, name) - if utils.eq_any(name, ['introduction', 'library introduction']): - return '%s' % name - if utils.eq_any(name, ['importing', 'library importing']): - return '%s' % name - return '%s' % name - - -class PythonLibraryDoc(_DocHelper): - type = 'library' - - def __init__(self, name, arguments=None): - lib = self._import(name, arguments) - self.supports_named_arguments = lib.supports_named_arguments - self.name = lib.name - self.version = utils.html_escape(getattr(lib, 'version', '')) - self.scope = self._get_scope(lib) - self.doc = self._process_doc(self._get_doc(lib)) - self.inits = self._get_initializers(lib) - self.keywords = sorted(KeywordDoc(handler, self) - for handler in lib.handlers.values()) - - def _import(self, name, args): - return TestLibrary(name, args) - - def _get_scope(self, lib): - if hasattr(lib, 'scope'): - return {'TESTCASE': 'test case', 'TESTSUITE': 'test suite', - 'GLOBAL': 'global'}[lib.scope] - return '' - - def _get_doc(self, lib): - return lib.doc or "Documentation for test library `%s`." % self.name - - def _get_initializers(self, lib): - if lib.init.arguments.maxargs == 0: - return [] - return [KeywordDoc(lib.init, self)] - - -class ResourceDoc(PythonLibraryDoc): - type = 'resource' - supports_named_arguments = True - - def _import(self, path, arguments): - return UserLibrary(self._find_resource_file(path)) - - def _find_resource_file(self, path): - if os.path.isfile(path): - return path - for dire in [item for item in sys.path if os.path.isdir(item)]: - if os.path.isfile(os.path.join(dire, path)): - return os.path.join(dire, path) - raise DataError("Resource file '%s' doesn't exist." % path) - - def _get_doc(self, resource): - doc = getattr(resource, 'doc', '') # doc available only in 2.1+ - if not doc: - doc = "Documentation for resource file `%s`." % self.name - return utils.unescape(doc) - - def _get_initializers(self, lib): - return [] - - -class XmlLibraryDoc(_DocHelper): - - def __init__(self, path): - dom = utils.DomWrapper(path) - self.name = dom.get_attr('name') - self.type = dom.get_attr('type') - self.version = dom.get_node('version').text - self.scope = dom.get_node('scope').text - self.supports_named_arguments = self._supports_named_args(dom) - self.doc = dom.get_node('doc').text - self.inits = [XmlKeywordDoc(node, self) - for node in dom.get_nodes('init')] - self.keywords = [XmlKeywordDoc(node, self) - for node in dom.get_nodes('kw')] - - def _supports_named_args(self, dom): - try: - node = dom.get_node('namedargs') - except AttributeError: # Backwards compatiblity with RF < 2.6.2 - return False - else: - return node.text == 'yes' - - -class _BaseKeywordDoc(_DocHelper): - - def __init__(self, library): - self.lib = library - self.type = library.type - - def __cmp__(self, other): - return cmp(self.name.lower(), other.name.lower()) - - @property - def argstr(self): - return ', '.join(self.args) - - @property - def shortdoc(self): - return self.doc.splitlines()[0] if self.doc else '' - - def __repr__(self): - return "'Keyword %s from library %s'" % (self.name, self.lib.name) - - -class KeywordDoc(_BaseKeywordDoc): - - def __init__(self, handler, library): - _BaseKeywordDoc.__init__(self, library) - self.name = handler.name - self.args = self._get_args(handler) - self.doc = self._process_doc(handler.doc) - self.shortdoc = handler.shortdoc - - def _get_args(self, handler): - required, defaults, varargs = self._parse_args(handler) - args = required + ['%s=%s' % item for item in defaults] - if varargs: - args.append('*%s' % varargs) - return args - - def _parse_args(self, handler): - args = [self._normalize_arg(arg, handler.type == 'user') - for arg in handler.arguments.names] - default_count = len(handler.arguments.defaults) - if default_count == 0: - required = args[:] - defaults = [] - else: - required = args[:-default_count] - defaults = zip(args[-default_count:], - list(handler.arguments.defaults)) - varargs = self._normalize_arg(handler.arguments.varargs, - handler.type == 'user') - return required, defaults, varargs - - def _normalize_arg(self, arg, userkeyword=False): - if arg is None: - return arg - arg = arg.rstrip('_') - if userkeyword: # strip ${} to make args look consistent - arg = arg[2:-1] - return arg - - -class XmlKeywordDoc(_BaseKeywordDoc): - - def __init__(self, node, library): - _BaseKeywordDoc.__init__(self, library) - self.name = node.get_attr('name', '') - self.args = [arg.text for arg in node.get_nodes('arguments/arg')] - self.doc = node.get_node('doc').text - - -if not utils.is_jython: - - def JavaLibraryDoc(path): - raise DataError('Documenting Java test libraries requires Jython.') - -else: - - class JavaLibraryDoc(_DocHelper): - type = 'library' - supports_named_arguments = False - - def __init__(self, path): - cls = self._get_class(path) - self.name = cls.qualifiedName() - self.version = self._get_version(cls) - self.scope = self._get_scope(cls) - self.doc = self._process_doc(cls.getRawCommentText()) - self.keywords = sorted(JavaKeywordDoc(method, self) - for method in cls.methods()) - self.inits = [JavaKeywordDoc(init, self) - for init in cls.constructors()] - if len(self.inits) == 1 and not self.inits[0].args: - self.inits = [] - - def _get_class(self, path): - """Processes the given Java source file and returns ClassDoc. - - Processing is done using com.sun.tools.javadoc APIs. The usage has - been figured out from sources at - http://www.java2s.com/Open-Source/Java-Document/JDK-Modules-com.sun/tools/com.sun.tools.javadoc.htm - - Returned object implements com.sun.javadoc.ClassDoc interface, see - http://java.sun.com/j2se/1.4.2/docs/tooldocs/javadoc/doclet/ - """ - try: - from com.sun.tools.javadoc import JavadocTool, Messager, ModifierFilter - from com.sun.tools.javac.util import List, Context - from com.sun.tools.javac.code.Flags import PUBLIC - except ImportError: - raise DataError("Creating documentation from Java source files " - "requires 'tools.jar' to be in CLASSPATH.") - context = Context() - Messager.preRegister(context, 'libdoc.py') - jdoctool = JavadocTool.make0(context) - filter = ModifierFilter(PUBLIC) - java_names = List.of(path) - root = jdoctool.getRootDocImpl('en', 'utf-8', filter, java_names, - List.nil(), False, List.nil(), - List.nil(), False, False, True) - return root.classes()[0] - - def _get_version(self, cls): - version = self._get_attr(cls, 'VERSION', '') - return utils.html_escape(version) - - def _get_scope(self, cls): - scope = self._get_attr(cls, 'SCOPE', 'TEST CASE') - return scope.replace('_', ' ').lower() - - def _get_attr(self, cls, name, default): - for field in cls.fields(): - if field.name() == 'ROBOT_LIBRARY_' + name \ - and field.isPublic() and field.constantValue(): - return field.constantValue() - return default - - - class JavaKeywordDoc(_BaseKeywordDoc): - # TODO: handle keyword default values and varargs. - def __init__(self, method, library): - _BaseKeywordDoc.__init__(self, library) - self.name = utils.printable_name(method.name(), True) - self.args = [param.name() for param in method.parameters()] - self.doc = self._process_doc(method.getRawCommentText()) - - -class RFDocUploader(object): - - def upload(self, file_path, host): - if host.startswith('http://'): - host = host[len('http://'):] - xml_file = open(file_path, 'rb') - conn = HTTPConnection(host) - try: - resp = self._post_multipart(conn, xml_file) - self._validate_success(resp) - finally: - xml_file.close() - conn.close() - - def _post_multipart(self, conn, xml_file): - conn.connect() - content_type, body = self._encode_multipart_formdata(xml_file) - headers = {'User-Agent': 'libdoc.py', 'Content-Type': content_type} - conn.request('POST', '/upload/', body, headers) - return conn.getresponse() - - def _encode_multipart_formdata(self, xml_file): - boundary = '----------ThIs_Is_tHe_bouNdaRY_$' - body = """--%(boundary)s -Content-Disposition: form-data; name="override" - -on ---%(boundary)s -Content-Disposition: form-data; name="file"; filename="%(filename)s" -Content-Type: text/xml - -%(content)s ---%(boundary)s-- -""" % {'boundary': boundary, 'filename': xml_file.name, 'content': xml_file.read()} - content_type = 'multipart/form-data; boundary=%s' % boundary - return content_type, body.replace('\n', '\r\n') - - def _validate_success(self, resp): - html = resp.read() - if resp.status != 200: - raise DataError(resp.reason.strip()) - if 'Successfully uploaded library' not in html: - raise DataError('\n'.join(_ErrorParser(html).errors)) - - -class _ErrorParser(HTMLParser): - - def __init__(self, html): - HTMLParser.__init__(self) - self._inside_errors = False - self.errors = [] - self.feed(html) - self.close() - - def handle_starttag(self, tag, attributes): - if ('class', 'errorlist') in attributes: - self._inside_errors = True - - def handle_endtag(self, tag): - if tag == 'ul': - self._inside_errors = False - - def handle_data(self, data): - if self._inside_errors and data.strip(): - self.errors.append(data) - - -DEFAULT_STYLES = ''' - - -'''.strip() - - -HTML_TEMPLATE = ''' - - -${TITLE} - -${STYLES} - - -

${TITLE}

- -Version: ${LIB.version}
- - -Scope: ${LIB.scope}
- -Named arguments: - -supported - -not supported - - -

Introduction

-
${LIB.htmldoc}
- - -

Importing

- - - - - - - - - - - -
ArgumentsDocumentation
${init.argstr}${init.htmldoc}
- - -

Shortcuts

- - -

Keywords

- - - - - - - - - - - - - -
KeywordArgumentsDocumentation
${kw.htmlname}${kw.argstr}${kw.htmldoc}
- - - -''' - -if __name__ == '__main__': - - def get_format(format, output): - if format: - return format.upper() - if os.path.splitext(output)[1].upper() == '.XML': - return 'XML' - return 'HTML' - - def get_unique_path(base, ext, index=0): - if index == 0: - path = '%s.%s' % (base, ext) - else: - path = '%s-%d.%s' % (base, index, ext) - if os.path.exists(path): - return get_unique_path(base, ext, index+1) - return path - - - try: - argparser = utils.ArgumentParser(__doc__) - opts, args = argparser.parse_args(sys.argv[1:], pythonpath='pythonpath', - help='help', unescape='escape', - check_args=True) - libname = args[0] - library = LibraryDoc(libname, opts['argument'], opts['name'], - opts['version']) - output = opts['output'] or '.' - if _uploading(output): - file_path = os.path.join(tempfile.gettempdir(), 'libdoc_upload.xml') - create_xml_doc(library, file_path) - upload_xml_doc(file_path, output) - os.remove(file_path) - else: - format = get_format(opts['format'], output) - if os.path.isdir(output): - output = get_unique_path(os.path.join(output, library.name), - format.lower()) - output = os.path.abspath(output) - if format == 'HTML': - create_html_doc(library, output, opts['title'], opts['styles']) - else: - create_xml_doc(library, output) - except Information, msg: - print msg - except DataError, err: - print err, '\n\nTry --help for usage information.' - except Exception, err: - print err - else: - print '%s -> %s' % (library.name, output) diff --git a/doc/test-README.html b/doc/test-README.html deleted file mode 100644 index 3605f836f..000000000 --- a/doc/test-README.html +++ /dev/null @@ -1,368 +0,0 @@ - - - - - - -Selenium2Library Tests - - - -
-

Selenium2Library Tests

- -
-

Introduction

-

This directory contains everything needed to run Selenium2Library -tests with Robot Framework. This includes:

-
    -
  • Unit tests under unit directory.
  • -
  • Acceptance tests written with Robot Framework under acceptance -directory
  • -
  • A very simple httpserver.py which is used to serve the html for tests in -resources/testserver
  • -
  • A collection of simple html files under 'resources/html' directory
  • -
  • Start-up scripts for executing the tests
  • -
-
-
-

Running Tests

-

There is a python script for running the tests. It can be -used as follows:

-
-python run_tests.py python|jython ff|ie|chrome [options]
-
-

The first argument to the script defines the interpreter to be used -to run Robot. The second argument defines the browser to be used, -using the same browser tokens that you would use in your Robot -tests.

-

Due to the structure of the tests, the directory containg the test -case files (acceptance) is always given to Robot as test data path. -To run only a subset of test cases, Robot command line arguments ---test, --suite, --include and --exclude may be used.

-

Examples:

-
-# Run all tests with Python and Firefox
-test/run_tests.py python ff
-# Run only test suite `javascript` with Jython and Internet Explorer
-test/run_tests.py jython ie -s javascript
-
-
-
-

Failing Tests

-

When the tests are executed, a number of test cases can be seen to -fail in the console output. This is because these test cases are -designed to test error messages of Selenium2Library. The script -'teststatuschecker.py' is used to check that these test cases failed -with expected error message. After that, report and log files are -generated and these files show the correct status of the test run.

-
-
- - diff --git a/setup.py b/setup.py index 3a179a2f6..c9b6b0074 100755 --- a/setup.py +++ b/setup.py @@ -1,31 +1,46 @@ #!/usr/bin/env python -import os, sys +import sys +from os.path import join, dirname -THIS_DIR = os.path.dirname(os.path.abspath(__file__)) -sys.path.append(os.path.join(THIS_DIR, "src", "Selenium2Library")) +sys.path.append(join(dirname(__file__), 'src')) +from ez_setup import use_setuptools +use_setuptools() +from setuptools import setup -from distutils.core import setup -import metadata +execfile(join(dirname(__file__), 'src', 'Selenium2Library', 'version.py')) -def main(): - setup( - name = metadata.NAME, - version = metadata.VERSION, - description = metadata.SHORT_DESCRIPTION, - long_description = metadata.LONG_DESCRIPTION, - author = metadata.AUTHOR, - author_email = metadata.AUTHOR_EMAIL, - url = metadata.PROJECT_URL, - license = metadata.LICENSE, - keywords = metadata.KEYWORDS, - platforms = metadata.PLATFORMS, - classifiers = metadata.TROVE_CLASSIFIERS, - package_dir = {'' : 'src'}, - packages = metadata.get_all_packages(), - package_data = metadata.get_all_package_data(), - ) +DESCRIPTION = """ +Selenium2Library is a web testing library for Robot Framework +that leverages the Selenium 2 (WebDriver) libraries. +"""[1:-1] - -if __name__ == '__main__': - main() +setup(name = 'robotframework-selenium2library', + version = VERSION, + description = 'Web testing library for Robot Framework', + long_description = DESCRIPTION, + author = 'Ryan Tomac , Ed Manlove , Jeremy Johnson', + author_email = ' , , ', + url = 'https://github.com/rtomac/robotframework-selenium2library', + license = 'Apache License 2.0', + keywords = 'robotframework testing testautomation selenium selenium2 webdriver web', + platforms = 'any', + classifiers = [ + "Development Status :: 5 - Production/Stable", + "License :: OSI Approved :: Apache Software License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Topic :: Software Development :: Testing" + ], + install_requires = [ + 'decorator >= 3.3.2', + 'selenium >= 2.8.1', + 'robotframework >= 2.6.0', + 'docutils >= 0.8.1' + ], + py_modules=['ez_setup'], + package_dir = {'' : 'src'}, + packages = ['Selenium2Library','Selenium2Library.keywords','Selenium2Library.locators', + 'Selenium2Library.utils'], + include_package_data = True, + ) diff --git a/src/Selenium2Library/__init__.py b/src/Selenium2Library/__init__.py index 75207edf8..96bd3c3b0 100644 --- a/src/Selenium2Library/__init__.py +++ b/src/Selenium2Library/__init__.py @@ -1,12 +1,8 @@ import os -import sys - -ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) -sys.path.insert(0, os.path.join(ROOT_DIR, "lib", "selenium-2.8.1", "py")) -sys.path.insert(0, os.path.join(ROOT_DIR, "lib", "decorator-3.3.2")) - from keywords import * -from metadata import VERSION + +THIS_DIR = os.path.dirname(os.path.abspath(__file__)) +execfile(os.path.join(THIS_DIR, 'version.py')) __version__ = VERSION @@ -57,6 +53,7 @@ class Selenium2Library( | id | Click Element `|` id=my_element | Matches by @id attribute | | name | Click Element `|` name=my_element | Matches by @name attribute | | xpath | Click Element `|` xpath=//div[@id='my_element'] | Matches with arbitrary XPath expression | + | dom | Click Element `|` dom=document.images[56] | Matches with arbitrary DOM express | | link | Click Element `|` link=My Link | Matches anchor elements by their link text | | css | Click Element `|` css=div.my_class | Matches by CSS selector | | tag | Click Element `|` tag=div | Matches by HTML tag name | @@ -89,12 +86,16 @@ class Selenium2Library( ROBOT_LIBRARY_SCOPE = 'GLOBAL' ROBOT_LIBRARY_VERSION = VERSION - def __init__(self, timeout=5.0, run_on_failure='Capture Page Screenshot'): + def __init__(self, timeout=5.0, implicit_wait=0.0, run_on_failure='Capture Page Screenshot'): """Selenium2Library can be imported with optional arguments. `timeout` is the default timeout used to wait for all waiting actions. It can be later set with `Set Selenium Timeout`. + 'implicit_wait' is the implicit timeout that Selenium waits when + looking for elements. + It can be later set with 'Set Selenium Implicit Wait'. + `run_on_failure` specifies the name of a keyword (from any available libraries) to execute when a Selenium2Library keyword fails. By default `Capture Page Screenshot` will be used to take a screenshot of the current page. @@ -110,4 +111,5 @@ def __init__(self, timeout=5.0, run_on_failure='Capture Page Screenshot'): for base in Selenium2Library.__bases__: base.__init__(self) self.set_selenium_timeout(timeout) + self.set_selenium_implicit_wait(implicit_wait) self.register_keyword_to_run_on_failure(run_on_failure) diff --git a/src/Selenium2Library/keywords/__init__.py b/src/Selenium2Library/keywords/__init__.py index 831d307a0..4ebc4407a 100644 --- a/src/Selenium2Library/keywords/__init__.py +++ b/src/Selenium2Library/keywords/__init__.py @@ -1,25 +1,25 @@ -from _logging import _LoggingKeywords -from _runonfailure import _RunOnFailureKeywords -from _browsermanagement import _BrowserManagementKeywords -from _element import _ElementKeywords -from _tableelement import _TableElementKeywords -from _formelement import _FormElementKeywords -from _selectelement import _SelectElementKeywords -from _javascript import _JavaScriptKeywords -from _cookie import _CookieKeywords -from _screenshot import _ScreenshotKeywords -from _waiting import _WaitingKeywords - -__all__ = [ - "_LoggingKeywords", - "_RunOnFailureKeywords", - "_BrowserManagementKeywords", - "_ElementKeywords", - "_TableElementKeywords", - "_FormElementKeywords", - "_SelectElementKeywords", - "_JavaScriptKeywords", - "_CookieKeywords", - "_ScreenshotKeywords", - "_WaitingKeywords" -] +from _logging import _LoggingKeywords +from _runonfailure import _RunOnFailureKeywords +from _browsermanagement import _BrowserManagementKeywords +from _element import _ElementKeywords +from _tableelement import _TableElementKeywords +from _formelement import _FormElementKeywords +from _selectelement import _SelectElementKeywords +from _javascript import _JavaScriptKeywords +from _cookie import _CookieKeywords +from _screenshot import _ScreenshotKeywords +from _waiting import _WaitingKeywords + +__all__ = [ + "_LoggingKeywords", + "_RunOnFailureKeywords", + "_BrowserManagementKeywords", + "_ElementKeywords", + "_TableElementKeywords", + "_FormElementKeywords", + "_SelectElementKeywords", + "_JavaScriptKeywords", + "_CookieKeywords", + "_ScreenshotKeywords", + "_WaitingKeywords" +] diff --git a/src/Selenium2Library/keywords/_browsermanagement.py b/src/Selenium2Library/keywords/_browsermanagement.py index 7b2ffbc18..5919f1f9d 100644 --- a/src/Selenium2Library/keywords/_browsermanagement.py +++ b/src/Selenium2Library/keywords/_browsermanagement.py @@ -9,13 +9,16 @@ ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "..")) FIREFOX_PROFILE_DIR = os.path.join(ROOT_DIR, 'resources', 'firefoxprofile') -BROWSER_NAMES = {'ff': '*firefox', - 'firefox': '*firefox', - 'ie': '*iexplore', - 'internetexplorer': '*iexplore', - 'googlechrome': '*googlechrome', - 'gc': '*googlechrome', - 'chrome': '*googlechrome' +BROWSER_NAMES = {'ff': "_make_ff", + 'firefox': "_make_ff", + 'ie': "_make_ie", + 'internetexplorer': "_make_ie", + 'googlechrome': "_make_chrome", + 'gc': "_make_chrome", + 'chrome': "_make_chrome", + 'opera' : "_make_opera", + 'htmlunit' : "_make_htmlunit", + 'htmlunitwithjs' : "_make_htmlunitwithjs" } class _BrowserManagementKeywords(KeywordGroup): @@ -25,6 +28,7 @@ def __init__(self): self._window_manager = WindowManager() self._speed_in_secs = float(0) self._timeout_in_secs = float(5) + self._implicit_wait_in_secs = float(0) # Public, open and close @@ -47,7 +51,8 @@ def close_browser(self): % self._cache.current.session_id) self._cache.close() - def open_browser(self, url, browser='firefox', alias=None): + def open_browser(self, url, browser='firefox', alias=None,remote_url=False, + desired_capabilities=None,ff_profile_dir=None): """Opens a new browser instance to given URL. Returns the index of this browser instance which can be used later to @@ -68,16 +73,35 @@ def open_browser(self, url, browser='firefox', alias=None): | googlechrome | Google Chrome | | gc | Google Chrome | | chrome | Google Chrome | + | opera | Opera | + | htmlunit | HTMLUnit | + | htmlunitwithjs | HTMLUnit with Javascipt support | + Note, that you will encounter strange behavior, if you open multiple Internet Explorer browser instances. That is also why `Switch Browser` only works with one IE browser at most. For more information see: http://selenium-grid.seleniumhq.org/faq.html#i_get_some_strange_errors_when_i_run_multiple_internet_explorer_instances_on_the_same_machine + + Optional 'remote_url' is the url for a remote selenium server for example + http://127.0.0.1/wd/hub. If you specify a value for remote you can + also specify 'desired_capabilities' which is a string in the form + key1:val1,key2:val2 that will be used to specify desired_capabilities + to the remote server. This is useful for doing things like specify a + proxy server for internet explorer or for specify browser and os if your + using saucelabs.com. + + Optional 'ff_profile_dir' is the path to the firefox profile dir if you + wish to overwrite the default. """ - self._info("Opening browser '%s' to base url '%s'" % (browser, url)) + if remote_url: + self._info("Opening browser '%s' to base url '%s' through remote server at '%s'" + % (browser, url, remote_url)) + else: + self._info("Opening browser '%s' to base url '%s'" % (browser, url)) browser_name = browser - browser = self._make_browser(browser_name) + browser = self._make_browser(browser_name,desired_capabilities,ff_profile_dir,remote_url) browser.get(url) self._debug('Opened browser with session id %s' % browser.session_id) @@ -123,13 +147,27 @@ def close_window(self): self._current_browser().close() def get_window_identifiers(self): - """Returns handle identifiers for all windows known to the browser.""" - return self._window_manager.get_window_handles(self._current_browser()) + """Returns and logs id attributes of all windows known to the browser.""" + return self._log_list(self._window_manager.get_window_ids(self._current_browser())) + + def get_window_names(self): + """Returns and logs names of all windows known to the browser.""" + values = self._window_manager.get_window_names(self._current_browser()) + + # for backward compatibility, since Selenium 1 would always + # return this constant value for the main window + if len(values) and values[0] == 'undefined': + values[0] = 'selenium_main_app_window' + + return self._log_list(values) + + def get_window_titles(self): + """Returns and logs titles of all windows known to the browser.""" + return self._log_list(self._window_manager.get_window_titles(self._current_browser())) def maximize_browser_window(self): """Maximizes current browser window.""" - self._current_browser().execute_script( - "if (window.screen) { window.moveTo(0, 0); window.resizeTo(window.screen.availWidth, window.screen.availHeight); }") + self._current_browser().maximize_window() def select_frame(self, locator): """Sets frame identified by `locator` as current frame. @@ -138,7 +176,7 @@ def select_frame(self, locator): details about locating elements. """ self._info("Selecting frame '%s'." % locator) - element = self._element_find(locator, True, True, tag='frame') + element = self._element_find(locator, True, True) self._current_browser().switch_to_frame(element) def select_window(self, locator=None): @@ -149,7 +187,7 @@ def select_window(self, locator=None): By default, when a locator value is provided, it is matched against the title of the window and the - handle/identifier of the window. If multiple windows with + javascript name of the window. If multiple windows with same identifier are found, the first one is selected. Special locator `main` (default) can be used to select the main window. @@ -159,7 +197,7 @@ def select_window(self, locator=None): | *Strategy* | *Example* | *Description* | | title | Select Window `|` title=My Document | Matches by window title | - | name | Select Window `|` name=${id} | Matches by window handle/identifier, see `Get Window Identifiers` | + | name | Select Window `|` name=${name} | Matches by window javascript name | | url | Select Window `|` url=http://google.com | Matches by window's current URL | Example: @@ -176,6 +214,10 @@ def unselect_frame(self): # Public, browser/current page properties + def get_location(self): + """Returns the current location.""" + return self._current_browser().get_current_url() + def get_source(self): """Returns the entire html source of the current page or frame.""" return self._current_browser().get_page_source() @@ -184,13 +226,9 @@ def get_title(self): """Returns title of current page.""" return self._current_browser().get_title() - def get_url(self): - """Returns URL of current page.""" - return self._current_browser().get_current_url() - def location_should_be(self, url): """Verifies that current URL is exactly `url`.""" - actual = self.get_url() + actual = self.get_location() if actual != url: raise AssertionError("Location should have been '%s' but was '%s'" % (url, actual)) @@ -198,12 +236,18 @@ def location_should_be(self, url): def location_should_contain(self, expected): """Verifies that current URL contains `expected`.""" - actual = self.get_url() + actual = self.get_location() if not expected in actual: raise AssertionError("Location should have contained '%s' " "but it was '%s'." % (expected, actual)) self._info("Current location contains '%s'." % expected) + def log_location(self): + """Logs and returns the current location.""" + url = self.get_location() + self._info(url) + return url + def log_source(self, loglevel='INFO'): """Logs and returns the entire html source of the current page or frame. @@ -220,12 +264,6 @@ def log_title(self): self._info(title) return title - def log_url(self): - """Logs and returns the URL of current page.""" - url = self.get_url() - self._info(url) - return url - def title_should_be(self, title): """Verifies that current page title equals `title`.""" actual = self.get_title() @@ -263,6 +301,12 @@ def get_selenium_timeout(self): See `Set Selenium Timeout` for an explanation.""" return robot.utils.secs_to_timestr(self._timeout_in_secs) + def get_selenium_implicit_wait(self): + """Gets the wait in seconds that is waited by Selenium. + + See `Set Selenium Implicit Wait` for an explanation.""" + return robot.utils.secs_to_timestr(self._implicit_wait_in_secs) + def set_selenium_speed(self, seconds): """Sets the delay in seconds that is waited after each Selenium command. @@ -298,8 +342,45 @@ def set_selenium_timeout(self, seconds): """ old_timeout = self.get_selenium_timeout() self._timeout_in_secs = robot.utils.timestr_to_secs(seconds) + for browser in self._cache.browsers: + browser.set_script_timeout(self._timeout_in_secs) return old_timeout + def set_selenium_implicit_wait(self, seconds): + """Sets Selenium 2's default implicit wait in seconds and + sets the implicit wait for all open browsers. + + From selenium 2 function 'Sets a sticky timeout to implicitly + wait for an element to be found, or a command to complete. + This method only needs to be called one time per session.' + + Example: + | ${orig wait} = | Set Selenium Implicit Wait | 10 seconds | + | Perform AJAX call that is slow | + | Set Selenium Implicit Wait | ${orig wait} | + """ + old_wait = self.get_selenium_implicit_wait() + self._implicit_wait_in_secs = robot.utils.timestr_to_secs(seconds) + for browser in self._cache.get_open_browsers(): + browser.implicitly_wait(self._implicit_wait_in_secs) + return old_wait + + + def set_browser_implicit_wait(self, seconds): + """Sets current browser's implicit wait in seconds. + + From selenium 2 function 'Sets a sticky timeout to implicitly + wait for an element to be found, or a command to complete. + This method only needs to be called one time per session.' + + Example: + | Set Browser Implicit Wait | 10 seconds | + + See also `Set Selenium Implicit Wait`. + """ + implicit_wait_in_secs = robot.utils.timestr_to_secs(seconds) + self._current_browser().implicitly_wait(implicit_wait_in_secs) + # Private def _current_browser(self): @@ -310,21 +391,80 @@ def _current_browser(self): def _get_browser_token(self, browser_name): return BROWSER_NAMES.get(browser_name.lower().replace(' ', ''), browser_name) - def _make_browser(self, browser_name): - browser_token = self._get_browser_token(browser_name) - browser = None - if browser_token == '*firefox': - browser = webdriver.Firefox(webdriver.FirefoxProfile(FIREFOX_PROFILE_DIR)) - elif browser_token == '*googlechrome': - browser = webdriver.Chrome() - elif browser_token == '*iexplore': - browser = webdriver.Ie() + + def _get_browser_creation_function(self,browser_name): + return BROWSER_NAMES.get(browser_name.lower().replace(' ', ''), browser_name) + + def _make_browser(self , browser_name , desired_capabilities=None , profile_dir=None, + remote=None): + + creation_func = self._get_browser_creation_function(browser_name) + browser = getattr(self,creation_func)(remote , desired_capabilities , profile_dir) if browser is None: raise ValueError(browser_name + " is not a supported browser.") browser.set_speed(self._speed_in_secs) browser.set_script_timeout(self._timeout_in_secs) + browser.implicitly_wait(self._implicit_wait_in_secs) return browser + + def _make_ff(self , remote , desired_capabilites , profile_dir): + + if not profile_dir: profile_dir = FIREFOX_PROFILE_DIR + profile = webdriver.FirefoxProfile(profile_dir) + if remote: + browser = self._create_remote_web_driver(webdriver.DesiredCapabilities.FIREFOX , + remote , desired_capabilites , profile) + else: + browser = webdriver.Firefox(firefox_profile=profile) + return browser + + def _make_ie(self , remote , desired_capabilities , profile_dir): + return self._generic_make_browser(webdriver.Ie, + webdriver.DesiredCapabilities.INTERNETEXPLORER, remote, desired_capabilities) + + def _make_chrome(self , remote , desired_capabilities , profile_dir): + return self._generic_make_browser(webdriver.Chrome, + webdriver.DesiredCapabilities.CHROME, remote, desired_capabilities) + + def _make_opera(self , remote , desired_capabilities , profile_dir): + return self._generic_make_browser(webdriver.Opera, + webdriver.DesiredCapabilities.OPERA, remote, desired_capabilities) + + def _make_htmlunit(self , remote , desired_capabilities , profile_dir): + return self._generic_make_browser(webdriver.Remote, + webdriver.DesiredCapabilities.HTMLUNIT, remote, desired_capabilities) + + def _make_htmlunitwithjs(self , remote , desired_capabilities , profile_dir): + return self._generic_make_browser(webdriver.Remote, + webdriver.DesiredCapabilities.HTMLUNITWITHJS, remote, desired_capabilities) + + + def _generic_make_browser(self, webdriver_type , desired_cap_type, remote_url, desired_caps): + '''most of the make browser functions just call this function which creates the + appropriate web-driver''' + if not remote_url: + browser = webdriver_type() + else: + browser = self._create_remote_web_driver(desired_cap_type,remote_url , desired_caps) + return browser + + + def _create_remote_web_driver(self , capabilities_type , remote_url , desired_capabilities=None , profile=None): + '''parses the string based desired_capabilities which should be in the form + key1:val1,key2:val2 and creates the associated remote web driver''' + desired_cap = self._create_desired_capabilities(capabilities_type , desired_capabilities) + return webdriver.Remote(desired_capabilities=desired_cap , command_executor=str(remote_url) , browser_profile=profile) + + + def _create_desired_capabilities(self, capabilities_type, capabilities_string): + desired_capabilities = capabilities_type + if capabilities_string: + for cap in capabilities_string.split(","): + (key, value) = cap.split(":") + desired_capabilities[key.strip()] = value.strip() + return desired_capabilities + diff --git a/src/Selenium2Library/keywords/_element.py b/src/Selenium2Library/keywords/_element.py index 5ec38e968..5f5d7d797 100644 --- a/src/Selenium2Library/keywords/_element.py +++ b/src/Selenium2Library/keywords/_element.py @@ -11,7 +11,7 @@ def __init__(self): # Public, element lookups - def current_frame_contains(self, text, logLevel='INFO'): + def current_frame_contains(self, text, loglevel='INFO'): """Verifies that current frame contains `text`. See `Page Should Contain ` for explanation about `loglevel` argument. @@ -228,6 +228,27 @@ def get_value(self, locator): See `introduction` for details about locating elements. """ return self._get_value(locator) + + def get_text(self, locator): + """Returns the text value of element identified by `locator`. + + See `introduction` for details about locating elements. + """ + return self._get_text(locator) + + def get_text(self, locator): + """Returns the text value of element identified by `locator`. + + See `introduction` for details about locating elements. + """ + return self._get_text(locator) + + def get_text(self, locator): + """Returns the text of element identified by `locator`. + + See `introduction` for details about locating elements. + """ + return self._get_text(locator) def get_vertical_position(self, locator): """Returns vertical position of element identified by `locator`. @@ -263,6 +284,40 @@ def double_click_element(self, locator): element = self._element_find(locator, True, True) ActionChains(self._current_browser()).double_click(element).perform() + def focus(self, locator): + """Sets focus to element identified by `locator`.""" + element = self._element_find(locator, True, True) + self._current_browser().execute_script("arguments[0].focus();", element) + + def drag_and_drop(self, source, target): + """Drags element identified with `source` which is a locator. + + Element can be moved on top of another element with `target` + argument. + + `target` is a locator of the element where the dragged object is + dropped. + + Examples: + | Drag And Drop | elem1 | elem2 | # Move elem1 over elem2. | + """ + src_elem = self._element_find(source,True,True) + trg_elem = self._element_find(target,True,True) + ActionChains(self._current_browser()).drag_and_drop(src_elem, trg_elem).perform() + + + def drag_and_drop_by_offset(self, source, xoffset, yoffset): + """Drags element identified with `source` which is a locator. + + Element will be moved by xoffset and yoffset. each of which is a + negative or positive number specify the offset. + + Examples: + | Drag And Drop | myElem | 50 | -35 | # Move myElem 50px right and 35px down. | + """ + src_elem = self._element_find(source, True, True) + ActionChains(self._current_browser()).drag_and_drop_by_offset(src_elem, xoffset, yoffset).perform() + def mouse_down(self, locator): """Simulates pressing the left mouse button on the element specified by `locator`. @@ -324,6 +379,27 @@ def open_context_menu(self, locator): element = self._element_find(locator, True, True) ActionChains(self._current_browser()).context_click(element).perform() + def simulate(self, locator, event): + """Simulates `event` on element identified by `locator`. + + This keyword is useful if element has OnEvent handler that needs to be + explicitly invoked. + + See `introduction` for details about locating elements. + """ + element = self._element_find(locator, True, True) + script = """ +element = arguments[0]; +eventName = arguments[1]; +if (document.createEventObject) { // IE + return element.fireEvent('on' + eventName, document.createEventObject()); +} +var evt = document.createEvent("HTMLEvents"); +evt.initEvent(eventName, true, true); +return !element.dispatchEvent(evt); + """ + self._current_browser().execute_script(script, element, event) + def press_key(self, locator, key): """Simulates user pressing key on element identified by `locator`. @@ -336,9 +412,10 @@ def press_key(self, locator, key): """ if key.startswith('\\') and len(key) > 1: key = self._map_ascii_key_code_to_key(int(key[1:])) - if len(key) > 1: - raise ValueError("Key value '%s' is invalid.", key) + #if len(key) > 1: + # raise ValueError("Key value '%s' is invalid.", key) element = self._element_find(locator, True, True) + #select it element.send_keys(key) # Public, links @@ -481,7 +558,7 @@ def _element_find(self, locator, first_only, required, tag=None): def _frame_contains(self, locator, text): browser = self._current_browser() - element = self._element_find(locator, True, True, 'frame') + element = self._element_find(locator, True, True) browser.switch_to_frame(element) self._info("Searching for text from frame '%s'." % locator) found = self._is_text_present(text) @@ -545,11 +622,11 @@ def _map_ascii_key_code_to_key(self, key_code): return key def _parse_attribute_locator(self, attribute_locator): - parts = attribute_locator.partition('@') + parts = attribute_locator.rpartition('@') if len(parts[0]) == 0: - raise ValueError("Attribute locator '%s' does not contain an element locator." % (locator)) + raise ValueError("Attribute locator '%s' does not contain an element locator." % (attribute_locator)) if len(parts[2]) == 0: - raise ValueError("Attribute locator '%s' does not contain an attribute name." % (locator)) + raise ValueError("Attribute locator '%s' does not contain an attribute name." % (attribute_locator)) return (parts[0], parts[2]) def _is_element_present(self, locator, tag=None): @@ -562,7 +639,7 @@ def _page_contains(self, text): if self._is_text_present(text): return True - subframes = self._element_find("tag=frame", False, False, 'frame') + subframes = self._element_find("xpath=//frame|//iframe", False, False) self._debug('Current frame has %d subframes' % len(subframes)) for frame in subframes: browser.switch_to_frame(frame) diff --git a/src/Selenium2Library/keywords/_javascript.py b/src/Selenium2Library/keywords/_javascript.py index 975fe488a..d9824ec5f 100644 --- a/src/Selenium2Library/keywords/_javascript.py +++ b/src/Selenium2Library/keywords/_javascript.py @@ -91,6 +91,32 @@ def execute_javascript(self, *code): self._info("Executing JavaScript:\n%s" % js) return self._current_browser().execute_script(js) + def execute_async_javascript(self, *code): + """Executes asynchronous JavaScript code. + + `code` may contain multiple lines of code but must contain a + return statement (with the value to be returned) at the end. + + `code` may be divided into multiple cells in the test data. In that + case, the parts are catenated together without adding spaces. + + If `code` is an absolute path to an existing file, the JavaScript + to execute will be read from that file. Forward slashes work as + a path separator on all operating systems. + + Note that, by default, the code will be executed in the context of the + Selenium object itself, so `this` will refer to the Selenium object. + Use `window` to refer to the window of your application, e.g. + `window.document.getElementById('foo')`. + + Example: + | Execute Async JavaScript | window.my_js_function('arg1', 'arg2') | + | Execute Async JavaScript | ${CURDIR}/js_to_execute.js | + """ + js = self._get_javascript_to_execute(''.join(code)) + self._info("Executing Asynchronous JavaScript:\n%s" % js) + return self._current_browser().execute_async_script(js) + def get_alert_message(self): """Returns the text of current JavaScript alert. diff --git a/src/Selenium2Library/keywords/_logging.py b/src/Selenium2Library/keywords/_logging.py index 24a59cc74..bea494247 100644 --- a/src/Selenium2Library/keywords/_logging.py +++ b/src/Selenium2Library/keywords/_logging.py @@ -30,5 +30,12 @@ def _log(self, message, level='INFO'): elif (level == 'WARN'): self._warn(message) elif (level == 'HTML'): self._html(message) + def _log_list(self, items, what='item'): + msg = ['Altogether %d %s%s.' % (len(items), what, ['s',''][len(items)==1])] + for index, item in enumerate(items): + msg.append('%d: %s' % (index+1, item)) + self._info('\n'.join(msg)) + return items + def _warn(self, message): logger.warn(message) \ No newline at end of file diff --git a/src/Selenium2Library/keywords/_selectelement.py b/src/Selenium2Library/keywords/_selectelement.py index f5869f924..df6405211 100644 --- a/src/Selenium2Library/keywords/_selectelement.py +++ b/src/Selenium2Library/keywords/_selectelement.py @@ -1,4 +1,5 @@ from selenium.webdriver.remote.webelement import WebElement +from selenium.webdriver.support.ui import Select from keywordgroup import KeywordGroup class _SelectElementKeywords(KeywordGroup): @@ -134,7 +135,7 @@ def page_should_not_contain_list(self, locator, message='', loglevel='INFO'): Key attributes for lists are `id` and `name`. See `introduction` for details about locating elements. """ - self._page_should_not_contain_element(locator, 'list', message, loglevel) + self._page_should_not_contain_element(locator, 'list', message, loglevel) def select_all_from_list(self, locator): """Selects all values from multi-select list identified by `id`. @@ -262,8 +263,9 @@ def _select_option_from_multi_select_list(self, select, options, index): options[index].click() def _select_option_from_single_select_list(self, select, options, index): - select.click() - options[index].click() + sel = Select(select) + sel.select_by_index(index) + def _unselect_all_options_from_multi_select_list(self, select): self._current_browser().execute_script("arguments[0].selectedIndex = -1;", select) diff --git a/src/Selenium2Library/lib/decorator-3.3.2/decorator.py b/src/Selenium2Library/lib/decorator-3.3.2/decorator.py deleted file mode 100644 index 5daf10be1..000000000 --- a/src/Selenium2Library/lib/decorator-3.3.2/decorator.py +++ /dev/null @@ -1,210 +0,0 @@ -########################## LICENCE ############################### -## -## Copyright (c) 2005-2011, Michele Simionato -## All rights reserved. -## -## Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## Redistributions in bytecode form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in -## the documentation and/or other materials provided with the -## distribution. - -## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -## "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -## LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -## A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -## HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -## INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, -## BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS -## OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR -## TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE -## USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH -## DAMAGE. - -""" -Decorator module, see http://pypi.python.org/pypi/decorator -for the documentation. -""" - -__version__ = '3.3.2' - -__all__ = ["decorator", "FunctionMaker", "partial"] - -import sys, re, inspect - -try: - from functools import partial -except ImportError: # for Python version < 2.5 - class partial(object): - "A simple replacement of functools.partial" - def __init__(self, func, *args, **kw): - self.func = func - self.args = args - self.keywords = kw - def __call__(self, *otherargs, **otherkw): - kw = self.keywords.copy() - kw.update(otherkw) - return self.func(*(self.args + otherargs), **kw) - -if sys.version >= '3': - from inspect import getfullargspec -else: - class getfullargspec(object): - "A quick and dirty replacement for getfullargspec for Python 2.X" - def __init__(self, f): - self.args, self.varargs, self.varkw, self.defaults = \ - inspect.getargspec(f) - self.kwonlyargs = [] - self.kwonlydefaults = None - self.annotations = getattr(f, '__annotations__', {}) - def __iter__(self): - yield self.args - yield self.varargs - yield self.varkw - yield self.defaults - -DEF = re.compile('\s*def\s*([_\w][_\w\d]*)\s*\(') - -# basic functionality -class FunctionMaker(object): - """ - An object with the ability to create functions with a given signature. - It has attributes name, doc, module, signature, defaults, dict and - methods update and make. - """ - def __init__(self, func=None, name=None, signature=None, - defaults=None, doc=None, module=None, funcdict=None): - self.shortsignature = signature - if func: - # func can be a class or a callable, but not an instance method - self.name = func.__name__ - if self.name == '': # small hack for lambda functions - self.name = '_lambda_' - self.doc = func.__doc__ - self.module = func.__module__ - if inspect.isfunction(func): - argspec = getfullargspec(func) - for a in ('args', 'varargs', 'varkw', 'defaults', 'kwonlyargs', - 'kwonlydefaults', 'annotations'): - setattr(self, a, getattr(argspec, a)) - for i, arg in enumerate(self.args): - setattr(self, 'arg%d' % i, arg) - self.signature = inspect.formatargspec( - formatvalue=lambda val: "", *argspec)[1:-1] - allargs = list(self.args) - if self.varargs: - allargs.append('*' + self.varargs) - if self.varkw: - allargs.append('**' + self.varkw) - try: - self.shortsignature = ', '.join(allargs) - except TypeError: # exotic signature, valid only in Python 2.X - self.shortsignature = self.signature - self.dict = func.__dict__.copy() - # func=None happens when decorating a caller - if name: - self.name = name - if signature is not None: - self.signature = signature - if defaults: - self.defaults = defaults - if doc: - self.doc = doc - if module: - self.module = module - if funcdict: - self.dict = funcdict - # check existence required attributes - assert hasattr(self, 'name') - if not hasattr(self, 'signature'): - raise TypeError('You are decorating a non function: %s' % func) - - def update(self, func, **kw): - "Update the signature of func with the data in self" - func.__name__ = self.name - func.__doc__ = getattr(self, 'doc', None) - func.__dict__ = getattr(self, 'dict', {}) - func.func_defaults = getattr(self, 'defaults', ()) - func.__kwdefaults__ = getattr(self, 'kwonlydefaults', None) - callermodule = sys._getframe(3).f_globals.get('__name__', '?') - func.__module__ = getattr(self, 'module', callermodule) - func.__dict__.update(kw) - - def make(self, src_templ, evaldict=None, addsource=False, **attrs): - "Make a new function from a given template and update the signature" - src = src_templ % vars(self) # expand name and signature - evaldict = evaldict or {} - mo = DEF.match(src) - if mo is None: - raise SyntaxError('not a valid function template\n%s' % src) - name = mo.group(1) # extract the function name - names = set([name] + [arg.strip(' *') for arg in - self.shortsignature.split(',')]) - for n in names: - if n in ('_func_', '_call_'): - raise NameError('%s is overridden in\n%s' % (n, src)) - if not src.endswith('\n'): # add a newline just for safety - src += '\n' # this is needed in old versions of Python - try: - code = compile(src, '', 'single') - # print >> sys.stderr, 'Compiling %s' % src - exec code in evaldict - except: - print >> sys.stderr, 'Error in generated code:' - print >> sys.stderr, src - raise - func = evaldict[name] - if addsource: - attrs['__source__'] = src - self.update(func, **attrs) - return func - - @classmethod - def create(cls, obj, body, evaldict, defaults=None, - doc=None, module=None, addsource=True, **attrs): - """ - Create a function from the strings name, signature and body. - evaldict is the evaluation dictionary. If addsource is true an attribute - __source__ is added to the result. The attributes attrs are added, - if any. - """ - if isinstance(obj, str): # "name(signature)" - name, rest = obj.strip().split('(', 1) - signature = rest[:-1] #strip a right parens - func = None - else: # a function - name = None - signature = None - func = obj - self = cls(func, name, signature, defaults, doc, module) - ibody = '\n'.join(' ' + line for line in body.splitlines()) - return self.make('def %(name)s(%(signature)s):\n' + ibody, - evaldict, addsource, **attrs) - -def decorator(caller, func=None): - """ - decorator(caller) converts a caller function into a decorator; - decorator(caller, func) decorates a function using a caller. - """ - if func is not None: # returns a decorated function - evaldict = func.func_globals.copy() - evaldict['_call_'] = caller - evaldict['_func_'] = func - return FunctionMaker.create( - func, "return _call_(_func_, %(shortsignature)s)", - evaldict, undecorated=func, __wrapped__=func) - else: # returns a decorator - if isinstance(caller, partial): - return partial(decorator, caller) - # otherwise assume caller is a function - first = inspect.getargspec(caller)[0][0] # first arg - evaldict = caller.func_globals.copy() - evaldict['_call_'] = caller - evaldict['decorator'] = decorator - return FunctionMaker.create( - '%s(%s)' % (caller.__name__, first), - 'return decorator(_call_, %s)' % first, - evaldict, undecorated=caller, __wrapped__=caller, - doc=caller.__doc__, module=caller.__module__) diff --git a/src/Selenium2Library/lib/selenium-2.8.1/.classpath b/src/Selenium2Library/lib/selenium-2.8.1/.classpath deleted file mode 100644 index a73a35756..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/.classpath +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Selenium2Library/lib/selenium-2.8.1/.git-fixfiles b/src/Selenium2Library/lib/selenium-2.8.1/.git-fixfiles deleted file mode 100644 index 8493e7a30..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/.git-fixfiles +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -git update-index --assume-unchanged cpp/prebuilt/**/*.so -git update-index --assume-unchanged cpp/IEDriver/Generated/atoms.h diff --git a/src/Selenium2Library/lib/selenium-2.8.1/.gitignore b/src/Selenium2Library/lib/selenium-2.8.1/.gitignore deleted file mode 100644 index 069561db7..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/.gitignore +++ /dev/null @@ -1,47 +0,0 @@ -projectFilesBackup/ -*.iws -.DS_Store -.svn -mockpiframe.log -mockpiframe.log.lck -junitvmwatcher*.properties -test-output/ -.*.swp -common/build -firefox/build -htmlunit/build -jobbie/build -selenium/build -support/build -iphone/lib/buildtime-src/cocoahttpserver/build/CocoaHTTPServerLibrary.build/Release-iphonesimulator/CocoaHTTPServer.build -iphone/lib/buildtime-src/build/ -iphone/build/ -/build/ -android/client/bin/ -android/server/bin/ -cpp/IEDriver/IEReturnTypes.h -java/org/openqa/selenium/ie/IeReturnTypes.java -java/client/src/org/openqa/selenium/ie/IeReturnTypes.java -.idea/vcs.xml -.idea/misc.xml -.idea/workspace.xml -.idea/projectCodeStyle.xml -.idea/* -out -cpp/IEDriver/sizzle.h -third_party/gecko-2/linux -third_party/gecko-2/linux64 -third_party/gecko-2/win32 -third_party/gecko-1.9.2/linux -third_party/gecko-1.9.2/win32 -third_party/gecko-5/linux -third_party/gecko-5/linux64 -third_party/gecko-5/win32 -third_party/gecko-6 -cpp/IEDriver/Generated/atoms.h -chromedriver.log -*.rbc -android/libs -android/bin -android/local.properties -android/proguard.cfg diff --git a/src/Selenium2Library/lib/selenium-2.8.1/COPYING b/src/Selenium2Library/lib/selenium-2.8.1/COPYING deleted file mode 100644 index 80a476243..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/COPYING +++ /dev/null @@ -1,204 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2007-2009 Google Inc. - Copyright 2007-2009 WebDriver committers - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/src/Selenium2Library/lib/selenium-2.8.1/CREDITS.txt b/src/Selenium2Library/lib/selenium-2.8.1/CREDITS.txt deleted file mode 100644 index 62bf87bb6..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/CREDITS.txt +++ /dev/null @@ -1,40 +0,0 @@ -Credits -======= - -The following people have offered help, support and/or code to -WebDriver. If you feel that you should be on this list but aren't, -then please feel free to raise a ticket on the project site -(http://webdriver.googlecode.com) or send an email directly to one of -the project's maintainers. - -Cast -==== - -Joe Walnes -Vyvyan Codd -Zoltar - Knower of All -Carlos Villela -Michael Tamm -James Cooper -Malcolm Rowe -Mirko Nasato -Marc Guillemot -Alexis Vuillemin -Noel Gordon -David Wang -Amitabh Saikia -Julian Harty -Philippe Hanrigou -Jon Spalding -James Strachen -Aslak Hellesoy -Rune Flobakk -Dan Fabulich -Michele Sama -Kenneth Leftin -Darrell Deboer -Muthu Kannan -Terence Haddock -Jean-Francois Roche -Godefroid Chapelle -Kristian Rosenvold diff --git a/src/Selenium2Library/lib/selenium-2.8.1/MANIFEST.in b/src/Selenium2Library/lib/selenium-2.8.1/MANIFEST.in deleted file mode 100644 index 8fef4fc11..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/MANIFEST.in +++ /dev/null @@ -1,17 +0,0 @@ -prune * -recursive-include py/selenium/webdriver *.py -recursive-include py/selenium/webdriver/common *.py -recursive-include py/selenium/common *.py -recursive-include py/selenium/webdriver/chrome *.py -recursive-include py/selenium/webdriver/firefox *.py *.xpi -recursive-include py/selenium/webdriver/ie *.py -recursive-include py/selenium/webdriver/ie/win32 *.dll -recursive-include py/selenium/webdriver/ie/x64 *.dll -recursive-include py/selenium/webdriver/remote *.py -recursive-include py/selenium/webdriver/support *.py -include py/selenium/selenium.py -include py/selenium/__init__.py -include docs/api/py/index.rst -include py/CHANGES -recursive-include selenium.egg-info * - diff --git a/src/Selenium2Library/lib/selenium-2.8.1/PKG-INFO b/src/Selenium2Library/lib/selenium-2.8.1/PKG-INFO deleted file mode 100644 index d287b7864..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/PKG-INFO +++ /dev/null @@ -1,78 +0,0 @@ -Metadata-Version: 1.0 -Name: selenium -Version: 2.8.1 -Summary: Python bindings for Selenium -Home-page: http://code.google.com/p/selenium/ -Author: UNKNOWN -Author-email: UNKNOWN -License: UNKNOWN -Description: ============ - Introduction - ============ - :Author: David Burns - - Selenium Python Client Driver is a Python language binding for Selenium Remote - Control (version 1.0 and 2.0). - - Currently the remote protocol, Firefox and Chrome for Selenium 2.0 are - supported, as well as the Selenium 1.0 bindings. As work will progresses we'll - add more "native" drivers. - - See here_ for more information. - - .. _here: http://code.google.com/p/selenium/ - - Installing - ========== - - Python Client - ------------- - :: - - pip install -U selenium - - Java Server - ----------- - - Download the server from http://selenium.googlecode.com/files/selenium-server-standalone-2.8.0.jar - :: - - java -jar selenium-server-standalone-2.8.0.jar - - Example - ======= - :: - - from selenium import webdriver - from selenium.common.exceptions import NoSuchElementException - from selenium.webdriver.common.keys import Keys - import time - - browser = webdriver.Firefox() # Get local session of firefox - browser.get("http://www.yahoo.com") # Load page - assert "Yahoo!" in browser.title - elem = browser.find_element_by_name("p") # Find the query box - elem.send_keys("seleniumhq" + Keys.RETURN) - time.sleep(0.2) # Let the page load, will be added to the API - try: - browser.find_element_by_xpath("//a[contains(@href,'http://seleniumhq.org')]") - except NoSuchElementException: - assert 0, "can't find seleniumhq" - browser.close() - - Documentation - ============= - Coming soon, in the meantime - `"Use the source Luke"`_ - - .. _"Use the source Luke": http://code.google.com/p/selenium/source/browse/trunk/py/selenium/webdriver/remote/webdriver.py - -Platform: UNKNOWN -Classifier: Development Status :: 5 - Production/Stable -Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: Apache Software License -Classifier: Operating System :: POSIX -Classifier: Operating System :: Microsoft :: Windows -Classifier: Operating System :: MacOS :: MacOS X -Classifier: Topic :: Software Development :: Testing -Classifier: Topic :: Software Development :: Libraries -Classifier: Programming Language :: Python diff --git a/src/Selenium2Library/lib/selenium-2.8.1/README.md b/src/Selenium2Library/lib/selenium-2.8.1/README.md deleted file mode 100644 index e0394c86a..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/README.md +++ /dev/null @@ -1,141 +0,0 @@ -Selenium 2.0 builds with its own build technology that's good for Windows, Linux and Mac. - -# Quick intro - -In the same directory as this file, do ... - - ./go - -The order of building modules is determined by the 'go' system itself. If you want to -build an individual module (assuming all dependent modules have previously been build) -try something like ... - - ./go //javascript/atoms:test:run - -In this case, javascript/atoms is the module directory, and "test" is a target -in that directory's build.desc file - -As you see 'build targets' scroll past in the log, you may want to run them individually. -'Go' can run them individually, by target name as long as ":run" is appended (see above). - -# Requirements - -* Java 6 JDK -* "java" and "jar" on the PATH - -Although the build system is based on rake it's **strongly advised** to rely on the version of JRuby in third_party/ that is invoked by "go". The only developer type who would want to deviate from this is the "build maintainer" who's experimenting with a JRuby upgrade. - -## Optional Requirements - -* Python 2.6.x to 2.7 (without this, Python tests will be skipped) - -## Internet Explorer Driver - -If you plan to compile the IE driver you also need: - -* Visual Studio 2008 -* 32 and 64 bit cross compilers - -The build will work on any platform, but the tests for IE will be skipped silently, if you are not building on Windows. - -# Common Tasks - -For an express build of the binaries we release run the following from the directory containing the Rakefile: - - ./go clean release - -All build output is placed under the "build" directory. The output can be found under "build/dist". If an error occurs while running this task complaining about a missing Albacore gem, the chances are you're using rvm. If this is the case, switch to the system ruby: - - rvm system - -Of course, building the entire project can take too long. If you just want to build a single driver, then you can run one of these targets: - - ./go chrome - ./go firefox - ./go htmlunit - ./go ie - -As the build progresses, you'll see it report where the build outputs are being placed. Of course, just building isn't enough. We should really be able to run the tests too. Try: - - ./go test_chrome - ./go test_firefox - ./go test_htmlunit - ./go test_ie - -Note that the "test_chrome" target requires that you have the separate chrome driver binary available on your PATH. - -If you are interested in a single language binding, try one of: - - ./go test_java - ./go test_dotnet - ./go test_rb - ./go test_javascript - -To run all the tests just run: - - ./go test - -This will detect your OS and run all the tests that are known to be stable for every browser that's appropriate to use for all language bindings. This can take a healthy amount of time to run. - -To run the minimal logical Selenium build: - - ./go test_javascript test_java - -To get a list of tasks you could build, do: - - ./go -T - -As a side note, none of the developers run tests using cygwin. It is very unlikely that the build will work as expected if you try and use cygwin. - -# Tour - -The code base is generally segmented around the languages used to write the component. Selenium makes extensive use of Javascript, so let's start there. Working on the javascript is easy. First of all, start the development server: - - ./go debug-server - -Now navigate to [http://localhost:2310/javascript](http://localhost:2310/javascript) You'll find the contents of the javascript directory being shown. We use the Closure Library for developing much of the javascript, so now navigate to [http://localhost:2310/javascript/atoms/test](http://localhost:2310/javascript/atoms/test) - -The tests in this directory are normal HTML files with names ending with "_test.html". Click on one to load the page and run the test. You can run all the javascript tests using: - - ./go test_javascript - -# Maven POM files - -Ignore the Maven POM file present in the same directory. It is only used for releasing to jars to Maven Repository (public or local), and is not considered the main build mechanism. - -# Build Output - -"./go" only makes a top-level "build" directory. Outputs are placed under that relative to the target name. Which is probably best described with an example. For the target: - - //java/client/src/org/openqa/selenium:selenium-api - -The output is found under: - - build/java/client/src/org/openqa/selenium/selenium-api.jar - -If you watch the build, each step should print where its output is going. Java test outputs appear in one of two places: either under build/test_logs for junit or in build/build_log.xml for TestNG tests. If you'd like the build to be chattier, just append "log=true" to the build command line. - -# Help with 'Go' - -More general, but basic, help for 'go' ... - - ./go --help - -Remember, "go" is just a wrapper around "rake", so you can use the standard rake commands such as "rake -T" to get more information about available targets. - -# Maven per se - -If it is not clear already, Selenium is not built with Maven, it is built with 'Crazy Fun' though that is invoked with 'go' as outlined above so you do not really have to learn too much about that. - -That said, it is possible to relatively quickly build selenium pieces for Maven to use. You are only really going to want to do this when you are testing the cutting-edge of Selenium development (which we welcome) against your application. Here is the quickest way to build and deploy into you local maven repository, while skipping Selenium's own tests. - - ./go release - cd maven - mvn clean install - -This sequence will push some seven or so jars into you local Maven repository with something like 'selenium-server-2.0-SNAPSHOT.jar' as the name. - -# Last word on building the bits and pieces of Selenium - -Refer [Building Web Driver wiki page](http://code.google.com/p/selenium/wiki/BuildingWebDriver) - diff --git a/src/Selenium2Library/lib/selenium-2.8.1/Rakefile b/src/Selenium2Library/lib/selenium-2.8.1/Rakefile deleted file mode 100644 index 5b45f3ba1..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/Rakefile +++ /dev/null @@ -1,647 +0,0 @@ -$LOAD_PATH.unshift File.expand_path(".") - -require 'rake' -require 'rake-tasks/files' -require 'net/telnet' - -include Rake::DSL if defined?(Rake::DSL) - -Rake.application.instance_variable_set "@name", "go" -verbose false - -# The CrazyFun build grammar. There's no magic here, just ruby -require 'rake-tasks/crazy_fun' -require 'rake-tasks/crazy_fun/mappings/android' -require 'rake-tasks/crazy_fun/mappings/gcc' -require 'rake-tasks/crazy_fun/mappings/java' -require 'rake-tasks/crazy_fun/mappings/javascript' -require 'rake-tasks/crazy_fun/mappings/mozilla' -require 'rake-tasks/crazy_fun/mappings/rake' -require 'rake-tasks/crazy_fun/mappings/ruby' -require 'rake-tasks/crazy_fun/mappings/visualstudio' - -# The original build rules -require 'rake-tasks/task-gen' -require 'rake-tasks/checks' -require 'rake-tasks/dotnet' -require 'rake-tasks/zip' -require 'rake-tasks/c' -require 'rake-tasks/java' -require 'rake-tasks/iphone' -require 'rake-tasks/selenium' -require 'rake-tasks/se-ide' -require 'rake-tasks/ie_code_generator' - -require 'rake-tasks/gecko_sdks' - -def version - "2.8.0" -end -ide_version = "1.0.12" - -# The build system used by webdriver is layered on top of rake, and we call it -# "crazy fun" for no readily apparent reason. - -# First off, create a new CrazyFun object. -crazy_fun = CrazyFun.new - -# Secondly, we add the handlers, which are responsible for turning a build -# rule into a (series of) rake tasks. For example if we're looking at a file -# in subdirectory "subdir" contains the line: -# -# java_library(:name => "example", :srcs => ["foo.java"]) -# -# we would generate a rake target of "//subdir:example" which would generate -# a Java JAR at "build/subdir/example.jar". -# -# If crazy fun doesn't know how to handle a particular output type ("java_library" -# in the example above) then it will throw an exception, stopping the build -AndroidMappings.new.add_all(crazy_fun) -GccMappings.new.add_all(crazy_fun) -JavaMappings.new.add_all(crazy_fun) -JavascriptMappings.new.add_all(crazy_fun) -MozillaMappings.new.add_all(crazy_fun) -RakeMappings.new.add_all(crazy_fun) -RubyMappings.new.add_all(crazy_fun) -VisualStudioMappings.new.add_all(crazy_fun) - -# Not every platform supports building every binary needed, so we sometimes -# need to fall back to prebuilt binaries. The prebuilt binaries are stored in -# a directory structure identical to that used in the "build" folder, but -# rooted at one of the following locations: -["android/app/prebuilt", "cpp/prebuilt", "ide/main/prebuilt", "javascript/firefox-driver/prebuilt"].each do |pre| - crazy_fun.prebuilt_roots << pre -end - -# Finally, find every file named "build.desc" in the project, and generate -# rake tasks from them. These tasks are normal rake tasks, and can be invoked -# from rake. -crazy_fun.create_tasks(Dir["**/build.desc"]) - -# Notice that because we're using rake, anything you can do in a normal rake -# build can also be done here. For example, here we set the default task -task :default => [:test] - - -task :all => [:'selenium-java', :'android'] -task :all_zip => [:'selenium-java_zip'] -task :chrome => [ "//java/client/src/org/openqa/selenium/chrome" ] -task :common_core => [ "//common:core" ] -task :grid => [ "//java/server/src/org/openqa/grid/selenium" ] -task :htmlunit => [ "//java/client/src/org/openqa/selenium/htmlunit" ] -task :ie => [ "//java/client/src/org/openqa/selenium/ie" ] -task :firefox => [ "//java/client/src/org/openqa/selenium/firefox" ] -task :'debug-server' => "//java/client/test/org/openqa/selenium/environment/webserver:webserver:run" -task :remote => [:remote_common, :remote_server, :remote_client] -task :remote_common => ["//java/client/src/org/openqa/selenium/remote:common"] -task :remote_client => ["//java/client/src/org/openqa/selenium/remote"] -task :remote_server => ["//java/server/src/org/openqa/selenium/remote/server"] -task :server_lite => ["//java/server/src/org/openqa/selenium/server:server_lite"] -task :selenium => [ "//java/client/src/org/openqa/selenium" ] -task :support => [ - "//java/client/src/org/openqa/selenium/lift", - "//java/client/src/org/openqa/selenium/support", -] -task :iphone_client => ['//java/client/src/org/openqa/selenium/iphone'] -task :iphone => [:iphone_server, :iphone_client] - -desc 'Build the standalone server' -task 'selenium-server-standalone' => '//java/server/src/org/openqa/grid/selenium:selenium:uber' - -task :test_single => "//java/client/test/org/openqa/selenium:single:run" - -task :ide => [ "//ide:selenium-ide-multi" ] -task :ide_proxy_setup => [ "//javascript/selenium-atoms", "se_ide:setup_proxy" ] -task :ide_proxy_remove => [ "se_ide:remove_proxy" ] -task :ide_bamboo => ["se_ide:assemble_ide_in_bamboo"] - -task :test_javascript => [ - '//javascript/atoms:test:run', - '//javascript/webdriver-atoms:test:run', - '//javascript/selenium-atoms:test:run', - '//javascript/selenium-core:test:run'] -task :test_android => ["//java/client/test/org/openqa/selenium/android:android-test:run"] -task :test_chrome => [ "//java/client/test/org/openqa/selenium/chrome:test:run" ] -task :test_chrome_atoms => [ - '//javascript/atoms:test_chrome:run', - '//javascript/chrome-driver:test:run', - '//javascript/webdriver-atoms:test_chrome:run'] -task :test_htmlunit => [ "//java/client/test/org/openqa/selenium/htmlunit:test:run" ] -task :test_grid => [ - "//java/server/test/org/openqa/grid/common:test:run", - "//java/server/test/org/openqa/grid:test:run", - "//java/server/test/org/openqa/grid/e2e:test:run" -] -task :test_ie => [ "//java/client/test/org/openqa/selenium/ie:test:run" ] -task :test_jobbie => [ :test_ie ] -task :test_firefox => [ "//java/client/test/org/openqa/selenium/firefox:test:run", "//java/client/test/org/openqa/selenium/firefox:test_native:run" ] -task :test_opera => [ "//java/client/test/org/openqa/selenium/opera:test:run" ] -task :test_remote => [ - '//java/client/test/org/openqa/selenium/remote:client-tests:run', - '//java/server/test/org/openqa/selenium/remote/server:test:run' -] -task :test_support => [ - "//java/client/test/org/openqa/selenium/lift:test:run", - "//java/client/test/org/openqa/selenium/support:SmallTests:run", - "//java/client/test/org/openqa/selenium/support:LargeTests:run" -] -task :test_iphone_client => [:'webdriver-iphone-client-test'] -task :test_iphone => [:test_iphone_server, :test_iphone_client] -task :android => [:android_client, :android_server] -task :android_client => ['//java/client/src/org/openqa/selenium/android'] -task :android_server => ['//android/app:android-server'] - -# TODO(simon): test-core should go first, but it's changing the least for now. -task :test_selenium => [ :'test-rc', :'test-v1-emulation', :'test-selenium-backed-webdriver', :'test-core'] - -task :'test-selenium-backed-webdriver' => ['//java/client/test/org/openqa/selenium/v1:selenium-backed-webdriver-test:run'] -task :'test-v1-emulation' => [ '//java/client/test/com/thoughtworks/selenium:firefox-emulation-test:run' ] -task :'test-rc' => [ '//java/client/test/com/thoughtworks/selenium:firefox-rc-test:run' ] -task :'test-core' => [:'test-core-firefox'] - -if (windows?) - task :'test-v1-emulation' => ['//java/client/test/com/thoughtworks/selenium:ie-emulation-test:run'] - task :'test-rc' => ['//java/client/test/com/thoughtworks/selenium:ie-rc-test:run'] - task :'test-core' => [:'test-core-ie'] -#elsif (mac?) -# task :'test-rc' => ['//java/client/test/com/thoughtworks/selenium:safari-rc-test:run'] -# task :'test-core' => [:'test-core-safari'] -end - -task :test_java_webdriver => [ - "//java/client/test/org/openqa/selenium/htmlunit:test:run", - "//java/client/test/org/openqa/selenium/firefox:test:run", - "//java/client/test/org/openqa/selenium/ie:test:run", - "//java/server/test/org/openqa/selenium/remote/server:test:run", -] -if (present?("chromedriver")) - task :test_java_webdriver => [:test_chrome] -end -if (opera?) - task :test_java_webdriver => [:test_opera] -end - - -task :test_java => [ - "//java/client/test/org/openqa/selenium/atoms:test:run", - "//java/client/test/org/openqa/selenium:SmallTests:run", - :test_support, - :test_java_webdriver, - :test_selenium, - "test_grid", - # Android should be installed and the tests should be ran - # before commits. - :test_android -] - -task :test_rb => [ - "//rb:unit-test", - "//rb:rc-client-unit-test", - "//rb:firefox-test", - "//rb:remote-test", - "//rb:rc-client-integration-test", - ("//rb:ie-test" if windows?), - "//rb:chrome-test" -].compact - -task :test_py => [ - "test_firefox_py" -] - -task :test_dotnet => [ - "//dotnet/test:firefox:run" -] - -task :test => [ :test_javascript, :test_java, :test_rb ] -if (msbuild_installed?) - task :test => [ :test_dotnet ] -end -if (python?) - task :test => [ :test_py ] -end - - -task :build => [:all, :iphone, :remote, :selenium] - -desc 'Clean build artifacts.' -task :clean do - rm_rf 'build/' - rm_rf 'iphone/build/' - rm_rf 'android/app/bin/' - rm_rf 'android/app/build/' - rm_rf 'android/app/libs/' - rm_rf 'android/client/bin/' - Android::Clean.new() -end - -task :dotnet => [ "//dotnet", "//dotnet:support", "//dotnet:core", "//dotnet:webdriverbackedselenium" ] - -# Generate a C++ Header file for mapping between magic numbers and #defines -# in the C++ code. -ie_generate_type_mapping(:name => "ie_result_type_cpp", - :src => "cpp/IEDriver/result_types.txt", - :type => "cpp", - :out => "cpp/IEDriver/IEReturnTypes.h") - -# Generate a Java class for mapping between magic numbers and Java static -# class members describing them. -ie_generate_type_mapping(:name => "ie_result_type_java", - :src => "cpp/IEDriver/result_types.txt", - :type => "java", - :out => "java/client/src/org/openqa/selenium/ie/IeReturnTypes.java") - - -GeckoSDKs.new do |sdks| - sdks.add 'third_party/gecko-1.9.2/linux', - 'http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/3.6.22/sdk/xulrunner-3.6.22.en-US.linux-i686.sdk.tar.bz2', - '6c1c3a990495baacc2bb40aef3b54025' - - sdks.add 'third_party/gecko-2/linux', - 'http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/2.0-candidates/build3/sdk/xulrunner-2.0.en-US.linux-i686.sdk.tar.bz2', - '1ec6039ee99596551845f27d4bc83436' - - sdks.add 'third_party/gecko-2/linux64', - 'http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/2.0-candidates/build3/sdk/xulrunner-2.0.en-US.linux-x86_64.sdk.tar.bz2', - '101eb57d3f76f77e9c94d3cb25a8d56c' - - sdks.add 'third_party/gecko-2/mac', - 'http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/2.0-candidates/build3/sdk/xulrunner-2.0.en-US.mac-x86_64.sdk.tar.bz2', - 'ac2ddb114107680fe75ee712cddf1ab4' - - sdks.add 'third_party/gecko-2/win32', - 'http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/2.0-candidates/build3/sdk/xulrunner-2.0.en-US.win32.sdk.zip', - '5cfa95a2d46334ce6283a772eff19382' - - sdks.add 'third_party/gecko-5/linux', - 'http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/5.0-candidates/build1/sdk/xulrunner-5.0.en-US.linux-i686.sdk.tar.bz2', - '1c980270364eedea841b471578ebe4d8' - - sdks.add 'third_party/gecko-5/linux64', - 'http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/5.0-candidates/build1/sdk/xulrunner-5.0.en-US.linux-x86_64.sdk.tar.bz2', - 'fd193614e8dbe8f574e36c9f24eedf7a' - - sdks.add 'third_party/gecko-5/mac', - 'http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/5.0-candidates/build1/sdk/xulrunner-5.0.en-US.mac-x86_64.sdk.tar.bz2', - 'adcfee3407988f0b4d9aaa1a7d099f88' - - sdks.add 'third_party/gecko-5/win32', - 'http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/5.0-candidates/build1/sdk/xulrunner-5.0.en-US.win32.sdk.zip', - '8894612028e1e28e428d748d50e9bc70' - - sdks.add 'third_party/gecko-6/linux', - 'http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/6.0.2/sdk/xulrunner-6.0.2.en-US.linux-i686.sdk.tar.bz2', - 'a277fd040a9f3eb1b28e3f5ccda94e15' - - sdks.add 'third_party/gecko-6/linux64', - 'http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/6.0.2/sdk/xulrunner-6.0.2.en-US.linux-x86_64.sdk.tar.bz2', - '8aa0d7798b58c78cdc3ffa15533c61b6' - - sdks.add 'third_party/gecko-6/win32', - 'http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/6.0.2/sdk/xulrunner-6.0.2.en-US.win32.sdk.zip', - '0505cfcc6316fadc3d35f196711e7624' - - sdks.add 'third_party/gecko-7/linux', - 'http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/7.0.1/sdk/xulrunner-7.0.1.en-US.linux-i686.sdk.tar.bz2', - 'fbcbb1d2958eca9cd9b458468ddd7526' - - sdks.add 'third_party/gecko-7/linux64', - 'http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/7.0.1/sdk/xulrunner-7.0.1.en-US.linux-x86_64.sdk.tar.bz2', - '6c4f4283650fe5d998f6450a5bd1817b' - - sdks.add 'third_party/gecko-7/win32', - 'http://releases.mozilla.org/pub/mozilla.org/xulrunner/releases/7.0/sdk/xulrunner-7.0.en-US.win32.sdk.zip', - 'd9c366d3dd54e020e372841053806f5d' - -end - -task :'selenium-server_zip' do - temp = "build/selenium-server_zip" - mkdir_p temp - sh "cd #{temp} && jar xf ../selenium-server.zip" - rm_f "build/selenium-server.zip" - Dir["#{temp}/webdriver-*.jar"].each { |file| rm_rf file } - mv "#{temp}/selenium-server.jar", "#{temp}/selenium-server-#{version}.jar" - sh "cd #{temp} && jar cMf ../selenium-server.zip *" -end - -{"firefox" => "*chrome", - "ie" => "*iexploreproxy", - "opera" => "*opera", - "safari" => "*safari"}.each_pair do |k,v| - selenium_test(:name => "test-core-#{k}", - :srcs => [ "common/test/js/core/*.js" ], - :deps => [ - "//java/server/test/org/openqa/selenium:server-with-tests:uber", - ], - :browser => v ) -end - -task :javadocs => [:common, :firefox, :htmlunit, :ie, :remote, :support, :chrome, :selenium] do - mkdir_p "build/javadoc" - sourcepath = "" - classpath = '.' - Dir["third_party/java/*/*.jar"].each do |jar| - classpath << ":" + jar - end - [File.join(%w(java client src))].each do |m| - sourcepath += File::PATH_SEPARATOR + m - end - p sourcepath - cmd = "javadoc -notimestamp -d build/javadoc -sourcepath #{sourcepath} -classpath #{classpath} -subpackages org.openqa.selenium -subpackages com.thoughtworks " - cmd << " -exclude org.openqa.selenium.internal.selenesedriver:org.openqa.selenium.internal.seleniumemulation:org.openqa.selenium.remote.internal" - - if (windows?) - cmd = cmd.gsub(/\//, "\\").gsub(/:/, ";") - end - sh cmd -end - -# Installs the webdriver python bindings using virtualenv for testing. -task :webdriver_py do - if python? then - pip_pkg = "pip install simplejson pytest==2.0.3 rdflib" - virtualenv = "virtualenv --no-site-packages build/python" - pip_install = 'build/python/bin/' + pip_pkg - if (windows?) then - virtualenv = "virtualenv build\\python" - pip_install = "build\\python\\Scripts\\" + pip_pkg - end - - sh virtualenv, :verbose => true do |ok, res| - if ! ok - puts "" - puts "PYTHON DEPENDENCY ERROR: Virtualenv not found." - puts "Please run '[sudo] pip install virtualenv'" - puts "" - end - end - - sh pip_install, :verbose => true - end -end - -task :test_ie_py => :webdriver_py do - win = windows? - if win != nil then - if python? then - win32 = "py\\selenium\\webdriver\\ie\\win32\\" - x64 = "py\\selenium\\webdriver\\ie\\x64\\" - mkdir_p win32 unless File.exists?(win32) - mkdir_p x64 unless File.exists?(x64) - cp 'cpp\\prebuilt\\Win32\\Release\\IEDriver.dll', win32, :verbose => true - cp 'cpp\\prebuilt\\x64\\Release\\IEDriver.dll', x64, :verbose => true - - sh "build\\python\\Scripts\\python setup.py build", :verbose => true - - if File.exists?('build\\python\\Scripts\\py.test.exe') - py_test = 'build\\python\\Scripts\\py.test.exe' - else - py_test = 'py.test.exe' - end - - test_dir = Dir.glob('build/lib**/selenium/test/selenium/webdriver/ie').first - sh py_test, test_dir, :verbose => true - rm_rf win32 - rm_rf x64 - end - end -end - -task :test_chrome_py => [:webdriver_py, :chrome] do - if python? then - py_test_path = 'build/python/bin/py.test' - py_setup = "build/python/bin/python " + 'setup.py build' - if (windows?) then - py_test_path = 'build\\python\\Scripts\\py.test.exe' - py_setup = 'build\\python\\Scripts\\python ' + 'setup.py build' - end - - sh py_setup , :verbose => true - - if File.exists?(py_test_path) - py_test = py_test_path - else - py_test = 'py.test' - end - test_dir = Dir.glob('build/lib**/selenium/test/selenium/webdriver/chrome').first - sh py_test, test_dir, "-k -ignore_chrome", :verbose => true - end -end - -task :test_firefox_py => [:webdriver_py, :firefox, "//javascript/firefox-driver:webdriver"] do - if python? then - xpi_zip_build = 'build/javascript/firefox-driver/webdriver.xpi' - firefox_py_home = "py/selenium/webdriver/firefox/" - py_test_path = 'build/python/bin/py.test' - py_setup = "build/python/bin/python " + 'setup.py build' - if (windows?) then - xpi_zip_build = xpi_zip_build.gsub(/\//, "\\") - firefox_py_home = firefox_py_home .gsub(/\//, "\\") - py_test_path = 'build\\python\\Scripts\\py.test.exe' - py_setup = 'build\\python\\Scripts\\python ' + 'setup.py build' - end - - cp xpi_zip_build , firefox_py_home, :verbose => true - - sh py_setup , :verbose => true - - - if File.exists?(py_test_path) - py_test = py_test_path - else - py_test = 'py.test' - end - test_dir = Dir.glob('build/lib**/selenium/test/selenium/webdriver/firefox').first - sh py_test, test_dir, :verbose => true - webdriver_zip = firefox_py_home + 'webdriver.xpi' - rm webdriver_zip , :verbose => true - end -end - -task :test_remote_py => [:webdriver_py, :remote_client, :'selenium-server-standalone', - '//java/server/test/org/openqa/selenium/remote/server/auth:server:uber'] do - if python? then - py_setup = "build/python/bin/python " + 'setup.py build' - py_test_path = 'build/python/bin/py.test' - - if (windows?) then - py_test_path = 'build\\python\\Scripts\\py.test.exe' - py_setup = 'build\\python\\Scripts\\python ' + 'setup.py build' - end - - sh py_setup , :verbose => true - - if File.exists?(py_test_path) - py_test = py_test_path - else - py_test = 'py.test' - end - test_dir = Dir.glob('build/lib**/selenium/test/selenium/webdriver/remote').first - sh py_test, test_dir, :verbose => true - end -end - -task :py_prep_for_install_release => ["//javascript/firefox-driver:webdriver", :chrome] do - if python? then - - firefox_py_home = "py/selenium/webdriver/firefox/" - xpi_zip_build = 'build/javascript/firefox-driver/webdriver.xpi' - - ie_driver_32 = 'cpp/prebuilt/Win32/Release/IEDriver.dll' - ie_driver_64 = 'cpp/prebuilt/x64/Release/IEDriver.dll' - ie_py_home = "py/selenium/webdriver/ie/" - if (windows?) then - xpi_zip_build = xpi_zip_build.gsub(/\//, "\\") - firefox_py_home = firefox_py_home .gsub(/\//, "\\") - ie_driver_32 = ie_driver_32.gsub(/\//, "\\") - ie_driver_64 = ie_driver_64.gsub(/\//, "\\") - ie_py_home = ie_py_home.gsub(/\//, "\\") - end - - mkdir_p ie_py_home + "win32" unless File.exists?(ie_py_home + "win32") - mkdir_p ie_py_home + "x64" unless File.exists?(ie_py_home + "x64") - cp xpi_zip_build , firefox_py_home, :verbose => true - cp ie_driver_32, ie_py_home + "win32", :verbose => true - cp ie_driver_64, ie_py_home + "x64", :verbose => true - end -end - -task :py_install => :py_prep_for_install_release do - sh "python setup.py install" -end - -task :py_release => :py_prep_for_install_release do - sh "python setup.py sdist upload" -end - - -task :test_selenium_py => [:'selenium-core', :'selenium-server-standalone'] do - if python? then - sh "python2.6 selenium/test/py/runtests.py", :verbose => true - end -end - - -iphone_test(:name => "webdriver-iphone-client-test", - :srcs => [ "java/client/test/org/openqa/selenium/iphone/**/*.java" ], - :deps => [ - "//java/client/test/org/openqa/selenium:tests", - "//third_party/java/junit", - :iphone_server, - :iphone_client - ]) - - -#### iPhone #### -task :iphone_server do - sdk = iPhoneSDK? - if sdk != nil then - puts "Building iWebDriver iphone app." - sh "cd iphone && xcodebuild -sdk #{sdk} ARCHS=i386 -target iWebDriver", :verbose => false - else - puts "XCode not found. Not building the iphone driver." - end -end - -# This does not depend on :iphone_server because the dependancy is specified in xcode -task :test_iphone_server do - sdk = iPhoneSDK? - if sdk != nil then - sh "cd iphone && xcodebuild -sdk #{sdk} ARCHS=i386 -target Tests" - else - puts "XCode and/or iPhoneSDK not found. Not testing iphone_server." - end -end - -file "iphone/src/objc/atoms.h" => ["//iphone:atoms"] do |task| - puts "Writing: #{task}" - cp "build/iphone/atoms.h", "iphone/src/objc/atoms.h" -end -task :iphone_atoms => ["iphone/src/objc/atoms.h"] - -file "cpp/IEDriver/sizzle.h" => [ "//third_party/js/sizzle:sizzle:header" ] do - cp "build/third_party/js/sizzle/sizzle.h", "cpp/IEDriver/sizzle.h" -end -task :sizzle_header => [ "cpp/IEDriver/sizzle.h" ] - -file "javascript/deps.js" => FileList[ - "third_party/closure/goog/**/*.js", - "javascript/*-atom*/*.js", - "javascript/chrome-driver/*.js" ] do - our_cmd = "java -jar third_party/py/jython.jar third_party/closure/bin/calcdeps.py " - our_cmd << "--output_mode=deps --path=javascript " - our_cmd << "--dep=third_party/closure/goog" - - # Generate the deps. The file paths will be as they appear on the filesystem, - # but for our tests, the WebDriverJS source files are served from /js/src and - # the Closure Library source is under /third_party/closure/goog, so we need - # to modify the generated paths to match that scheme. - output = "" - io = IO.popen(our_cmd) - io.each do |line| - line = line.gsub("\\\\", "/") - output << line.gsub(/common\/(.*)\/js/, 'js/\1') - end - File.open("javascript/deps.js", "w") do |f| f.write(output); end -end - -desc "Calculate dependencies required for testing the automation atoms" -task :calcdeps => "javascript/deps.js" - -task :release => [ - '//java/server/src/org/openqa/selenium/server:server:zip', - '//java/server/src/org/openqa/grid/selenium:selenium:zip', - '//java/client/src/org/openqa/selenium:client-combined:zip' - ] do |t| - # Unzip each of the deps and rename the pieces that need renaming - renames = { - "client-combined-nodeps-srcs.jar" => "selenium-java-#{version}-srcs.jar", - "client-combined-nodeps.jar" => "selenium-java-#{version}.jar", - "selenium-nodeps-srcs.jar" => "selenium-server-#{version}-srcs.jar", - "selenium-nodeps.jar" => "selenium-server-#{version}.jar", - "selenium-standalone.jar" => "selenium-server-standalone-#{version}.jar", - } - - t.prerequisites.each do |pre| - zip = Rake::Task[pre].out - - next unless zip =~ /\.zip$/ - - temp = zip + "rename" - rm_rf temp - deep = File.join(temp, "/selenium-#{version}") - mkdir_p deep - - sh "cd #{deep} && jar xf ../../#{File.basename(zip)}" - renames.each do |from, to| - src = File.join(deep, from) - next unless File.exists?(src) - - mv src, File.join(deep, to) - end - rm_f File.join(deep, "client-combined-standalone.jar") - rm zip - sh "cd #{temp} && jar cMf ../#{File.basename(zip)} *" - - rm_rf temp - end - - mkdir_p "build/dist" - cp "build/java/server/src/org/openqa/grid/selenium/selenium-standalone.jar", "build/dist/selenium-server-standalone-#{version}.jar" - cp "build/java/server/src/org/openqa/grid/selenium/selenium.zip", "build/dist/selenium-server-#{version}.zip" - cp "build/java/client/src/org/openqa/selenium/client-combined.zip", "build/dist/selenium-java-#{version}.zip" -end - -desc 'Build the selenium client jars' -task 'selenium-java' => '//java/client/src/org/openqa/selenium:client-combined:project' - -desc 'Build and package Selenium IDE' -task :release_ide => [:ide] do - cp 'build/ide/selenium-ide.xpi', "build/ide/selenium-ide-#{ide_version}.xpi" -end - -at_exit do - if File.exist?(".git") && !Platform.windows? - sh "sh .git-fixfiles" - end -end diff --git a/src/Selenium2Library/lib/selenium-2.8.1/WebDriver.sln b/src/Selenium2Library/lib/selenium-2.8.1/WebDriver.sln deleted file mode 100644 index fa9edafce..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/WebDriver.sln +++ /dev/null @@ -1,433 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "web", "common\src\web\", "{DB560F4B-1F41-4E8E-AC06-640D736E8A72}" - ProjectSection(WebsiteProperties) = preProject - TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" - Debug.AspNetCompiler.VirtualPath = "/web" - Debug.AspNetCompiler.PhysicalPath = "common\src\web\" - Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\web\" - Debug.AspNetCompiler.Updateable = "true" - Debug.AspNetCompiler.ForceOverwrite = "true" - Debug.AspNetCompiler.FixedNames = "false" - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.VirtualPath = "/web" - Release.AspNetCompiler.PhysicalPath = "common\src\web\" - Release.AspNetCompiler.TargetPath = "PrecompiledWeb\web\" - Release.AspNetCompiler.Updateable = "true" - Release.AspNetCompiler.ForceOverwrite = "true" - Release.AspNetCompiler.FixedNames = "false" - Release.AspNetCompiler.Debug = "False" - VWDPort = "2311" - VWDDynamicPort = "false" - VWDVirtualPath = "/common" - DefaultWebSiteLanguage = "Visual C#" - StartServerOnDebug = "false" - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "webdriver-interactions", "cpp\webdriver-interactions\webdriver-interactions.vcxproj", "{87FA39A1-958E-478A-8AB9-6D5E5AAA3886}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "webdriver-firefox", "cpp\webdriver-firefox\webdriver-firefox.vcxproj", "{A9D3BB2D-FD1E-43A2-80F6-F8320682323E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "webdriver-firefox-5", "cpp\webdriver-firefox\webdriver-firefox-5.vcxproj", "{FD15C665-943A-43A5-B93A-D16291706BE0}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IEDriver", "cpp\IEDriver\IEDriver.vcxproj", "{BB72383B-427F-4191-B692-E4345A30E33C}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "json-cpp", "third_party\json-cpp\json-cpp.vcxproj", "{320F3BBE-8223-4E7F-ABEE-18D3BD57B1FD}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mongoose", "third_party\mongoose\mongoose.vcxproj", "{9AEBD612-232D-40CB-BE2C-F2B911FD6228}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Selenium.Core", "dotnet\src\Selenium.Core\Selenium.Core.csproj", "{69F4FF0E-13DE-4AF6-B8AF-572A36239083}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Selenium.WebDriverBackedSelenium", "dotnet\src\Selenium.WebDriverBackedSelenium\Selenium.WebDriverBackedSelenium.csproj", "{0EAF6AA9-B712-464B-A11B-FA3CF7577D80}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebDriver.Support", "dotnet\src\WebDriver.Support\WebDriver.Support.csproj", "{A9779443-E254-47E9-B733-8AC6D3662CA6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebDriver.Common.Tests", "dotnet\test\WebDriver.Common.Tests\WebDriver.Common.Tests.csproj", "{1580564D-B6B8-4BD8-A120-001E3E8E5BE6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebDriver.Remote.Tests", "dotnet\test\WebDriver.Remote.Tests\WebDriver.Remote.Tests.csproj", "{1D3DF4DB-6C11-480D-9774-F489B2EF62D8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebDriver.Chrome.Tests", "dotnet\test\WebDriver.Chrome.Tests\WebDriver.Chrome.Tests.csproj", "{81D664AA-FC03-425E-98A8-B4EAF8236776}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebDriver.Firefox.Tests", "dotnet\test\WebDriver.Firefox.Tests\WebDriver.Firefox.Tests.csproj", "{630FC167-169E-4CFD-83ED-9BA4AA8A0FB4}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebDriver.IE.Tests", "dotnet\test\WebDriver.IE.Tests\WebDriver.IE.Tests.csproj", "{ECF3B49F-68B0-4A2A-8559-6D7FB906AA88}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebDriver.Support.Tests", "dotnet\test\WebDriver.Support.Tests\WebDriver.Support.Tests.csproj", "{1B70379B-5325-4243-8629-5C32802E9826}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Selenium.Core.Tests", "dotnet\test\Selenium.Core.Tests\Selenium.Core.Tests.csproj", "{42D1B587-9544-452F-8B76-4F2A65BC9BE5}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Selenium.WebDriverBackedSelenium.Tests", "dotnet\test\Selenium.WebDriverBackedSelenium.Tests\Selenium.WebDriverBackedSelenium.Tests.csproj", "{68CF4628-4148-4627-ACA1-D4C225365D3F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "imehandler", "cpp\imehandler\imehandler.vcxproj", "{37F9EF6B-F69C-4764-9687-C63C608C476B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebDriver.Android.Tests", "dotnet\test\WebDriver.Android.Tests\WebDriver.Android.Tests.csproj", "{3102A61F-3025-482C-9515-9FC239746658}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebDriver", "dotnet\src\WebDriver\WebDriver.csproj", "{83C13931-B27C-425C-AAF0-5F96EEA4F173}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "webdriver-server", "cpp\webdriver-server\webdriver-server.vcxproj", "{35A23A16-EF17-4CC3-8854-785025A304F3}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "webdriver-firefox-6", "cpp\webdriver-firefox\webdriver-firefox-6.vcxproj", "{705CA982-A18B-4BCA-80B7-1F6DE6883BE8}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "webdriver-firefox-7", "cpp\webdriver-firefox\webdriver-firefox-7.vcxproj", "{49D8D0ED-7FD9-4421-A6D1-B411152ECB5E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|.NET = Debug|.NET - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release|.NET = Release|.NET - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DB560F4B-1F41-4E8E-AC06-640D736E8A72}.Debug|.NET.ActiveCfg = Debug|.NET - {DB560F4B-1F41-4E8E-AC06-640D736E8A72}.Debug|Any CPU.ActiveCfg = Debug|.NET - {DB560F4B-1F41-4E8E-AC06-640D736E8A72}.Debug|Mixed Platforms.ActiveCfg = Debug|.NET - {DB560F4B-1F41-4E8E-AC06-640D736E8A72}.Debug|Win32.ActiveCfg = Debug|.NET - {DB560F4B-1F41-4E8E-AC06-640D736E8A72}.Debug|x64.ActiveCfg = Debug|.NET - {DB560F4B-1F41-4E8E-AC06-640D736E8A72}.Release|.NET.ActiveCfg = Debug|.NET - {DB560F4B-1F41-4E8E-AC06-640D736E8A72}.Release|Any CPU.ActiveCfg = Debug|.NET - {DB560F4B-1F41-4E8E-AC06-640D736E8A72}.Release|Mixed Platforms.ActiveCfg = Debug|.NET - {DB560F4B-1F41-4E8E-AC06-640D736E8A72}.Release|Win32.ActiveCfg = Debug|.NET - {DB560F4B-1F41-4E8E-AC06-640D736E8A72}.Release|x64.ActiveCfg = Debug|.NET - {87FA39A1-958E-478A-8AB9-6D5E5AAA3886}.Debug|.NET.ActiveCfg = Debug|Win32 - {87FA39A1-958E-478A-8AB9-6D5E5AAA3886}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {87FA39A1-958E-478A-8AB9-6D5E5AAA3886}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {87FA39A1-958E-478A-8AB9-6D5E5AAA3886}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {87FA39A1-958E-478A-8AB9-6D5E5AAA3886}.Debug|Win32.ActiveCfg = Debug|Win32 - {87FA39A1-958E-478A-8AB9-6D5E5AAA3886}.Debug|Win32.Build.0 = Debug|Win32 - {87FA39A1-958E-478A-8AB9-6D5E5AAA3886}.Debug|x64.ActiveCfg = Debug|x64 - {87FA39A1-958E-478A-8AB9-6D5E5AAA3886}.Debug|x64.Build.0 = Debug|x64 - {87FA39A1-958E-478A-8AB9-6D5E5AAA3886}.Release|.NET.ActiveCfg = Release|Win32 - {87FA39A1-958E-478A-8AB9-6D5E5AAA3886}.Release|Any CPU.ActiveCfg = Release|Win32 - {87FA39A1-958E-478A-8AB9-6D5E5AAA3886}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {87FA39A1-958E-478A-8AB9-6D5E5AAA3886}.Release|Mixed Platforms.Build.0 = Release|Win32 - {87FA39A1-958E-478A-8AB9-6D5E5AAA3886}.Release|Win32.ActiveCfg = Release|Win32 - {87FA39A1-958E-478A-8AB9-6D5E5AAA3886}.Release|Win32.Build.0 = Release|Win32 - {87FA39A1-958E-478A-8AB9-6D5E5AAA3886}.Release|x64.ActiveCfg = Release|x64 - {87FA39A1-958E-478A-8AB9-6D5E5AAA3886}.Release|x64.Build.0 = Release|x64 - {A9D3BB2D-FD1E-43A2-80F6-F8320682323E}.Debug|.NET.ActiveCfg = Debug|Win32 - {A9D3BB2D-FD1E-43A2-80F6-F8320682323E}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {A9D3BB2D-FD1E-43A2-80F6-F8320682323E}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {A9D3BB2D-FD1E-43A2-80F6-F8320682323E}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {A9D3BB2D-FD1E-43A2-80F6-F8320682323E}.Debug|Win32.ActiveCfg = Debug|Win32 - {A9D3BB2D-FD1E-43A2-80F6-F8320682323E}.Debug|Win32.Build.0 = Debug|Win32 - {A9D3BB2D-FD1E-43A2-80F6-F8320682323E}.Debug|x64.ActiveCfg = Debug|x64 - {A9D3BB2D-FD1E-43A2-80F6-F8320682323E}.Release|.NET.ActiveCfg = Release|Win32 - {A9D3BB2D-FD1E-43A2-80F6-F8320682323E}.Release|Any CPU.ActiveCfg = Release|Win32 - {A9D3BB2D-FD1E-43A2-80F6-F8320682323E}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {A9D3BB2D-FD1E-43A2-80F6-F8320682323E}.Release|Mixed Platforms.Build.0 = Release|Win32 - {A9D3BB2D-FD1E-43A2-80F6-F8320682323E}.Release|Win32.ActiveCfg = Release|Win32 - {A9D3BB2D-FD1E-43A2-80F6-F8320682323E}.Release|Win32.Build.0 = Release|Win32 - {A9D3BB2D-FD1E-43A2-80F6-F8320682323E}.Release|x64.ActiveCfg = Release|x64 - {FD15C665-943A-43A5-B93A-D16291706BE0}.Debug|.NET.ActiveCfg = Debug|x64 - {FD15C665-943A-43A5-B93A-D16291706BE0}.Debug|Any CPU.ActiveCfg = Debug|x64 - {FD15C665-943A-43A5-B93A-D16291706BE0}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 - {FD15C665-943A-43A5-B93A-D16291706BE0}.Debug|Win32.ActiveCfg = Debug|Win32 - {FD15C665-943A-43A5-B93A-D16291706BE0}.Debug|x64.ActiveCfg = Debug|x64 - {FD15C665-943A-43A5-B93A-D16291706BE0}.Release|.NET.ActiveCfg = Release|x64 - {FD15C665-943A-43A5-B93A-D16291706BE0}.Release|Any CPU.ActiveCfg = Release|x64 - {FD15C665-943A-43A5-B93A-D16291706BE0}.Release|Mixed Platforms.ActiveCfg = Release|x64 - {FD15C665-943A-43A5-B93A-D16291706BE0}.Release|Win32.ActiveCfg = Release|Win32 - {FD15C665-943A-43A5-B93A-D16291706BE0}.Release|x64.ActiveCfg = Release|x64 - {BB72383B-427F-4191-B692-E4345A30E33C}.Debug|.NET.ActiveCfg = Debug|x64 - {BB72383B-427F-4191-B692-E4345A30E33C}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {BB72383B-427F-4191-B692-E4345A30E33C}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {BB72383B-427F-4191-B692-E4345A30E33C}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {BB72383B-427F-4191-B692-E4345A30E33C}.Debug|Win32.ActiveCfg = Debug|Win32 - {BB72383B-427F-4191-B692-E4345A30E33C}.Debug|Win32.Build.0 = Debug|Win32 - {BB72383B-427F-4191-B692-E4345A30E33C}.Debug|x64.ActiveCfg = Debug|x64 - {BB72383B-427F-4191-B692-E4345A30E33C}.Debug|x64.Build.0 = Debug|x64 - {BB72383B-427F-4191-B692-E4345A30E33C}.Release|.NET.ActiveCfg = Release|x64 - {BB72383B-427F-4191-B692-E4345A30E33C}.Release|Any CPU.ActiveCfg = Release|Win32 - {BB72383B-427F-4191-B692-E4345A30E33C}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {BB72383B-427F-4191-B692-E4345A30E33C}.Release|Mixed Platforms.Build.0 = Release|Win32 - {BB72383B-427F-4191-B692-E4345A30E33C}.Release|Win32.ActiveCfg = Release|Win32 - {BB72383B-427F-4191-B692-E4345A30E33C}.Release|Win32.Build.0 = Release|Win32 - {BB72383B-427F-4191-B692-E4345A30E33C}.Release|x64.ActiveCfg = Release|x64 - {BB72383B-427F-4191-B692-E4345A30E33C}.Release|x64.Build.0 = Release|x64 - {320F3BBE-8223-4E7F-ABEE-18D3BD57B1FD}.Debug|.NET.ActiveCfg = Debug|x64 - {320F3BBE-8223-4E7F-ABEE-18D3BD57B1FD}.Debug|Any CPU.ActiveCfg = Debug|x64 - {320F3BBE-8223-4E7F-ABEE-18D3BD57B1FD}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {320F3BBE-8223-4E7F-ABEE-18D3BD57B1FD}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {320F3BBE-8223-4E7F-ABEE-18D3BD57B1FD}.Debug|Win32.ActiveCfg = Debug|Win32 - {320F3BBE-8223-4E7F-ABEE-18D3BD57B1FD}.Debug|Win32.Build.0 = Debug|Win32 - {320F3BBE-8223-4E7F-ABEE-18D3BD57B1FD}.Debug|x64.ActiveCfg = Debug|x64 - {320F3BBE-8223-4E7F-ABEE-18D3BD57B1FD}.Debug|x64.Build.0 = Debug|x64 - {320F3BBE-8223-4E7F-ABEE-18D3BD57B1FD}.Release|.NET.ActiveCfg = Release|x64 - {320F3BBE-8223-4E7F-ABEE-18D3BD57B1FD}.Release|Any CPU.ActiveCfg = Release|x64 - {320F3BBE-8223-4E7F-ABEE-18D3BD57B1FD}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {320F3BBE-8223-4E7F-ABEE-18D3BD57B1FD}.Release|Mixed Platforms.Build.0 = Release|Win32 - {320F3BBE-8223-4E7F-ABEE-18D3BD57B1FD}.Release|Win32.ActiveCfg = Release|Win32 - {320F3BBE-8223-4E7F-ABEE-18D3BD57B1FD}.Release|Win32.Build.0 = Release|Win32 - {320F3BBE-8223-4E7F-ABEE-18D3BD57B1FD}.Release|x64.ActiveCfg = Release|x64 - {320F3BBE-8223-4E7F-ABEE-18D3BD57B1FD}.Release|x64.Build.0 = Release|x64 - {9AEBD612-232D-40CB-BE2C-F2B911FD6228}.Debug|.NET.ActiveCfg = Debug|x64 - {9AEBD612-232D-40CB-BE2C-F2B911FD6228}.Debug|Any CPU.ActiveCfg = Debug|x64 - {9AEBD612-232D-40CB-BE2C-F2B911FD6228}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {9AEBD612-232D-40CB-BE2C-F2B911FD6228}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {9AEBD612-232D-40CB-BE2C-F2B911FD6228}.Debug|Win32.ActiveCfg = Debug|Win32 - {9AEBD612-232D-40CB-BE2C-F2B911FD6228}.Debug|Win32.Build.0 = Debug|Win32 - {9AEBD612-232D-40CB-BE2C-F2B911FD6228}.Debug|x64.ActiveCfg = Debug|x64 - {9AEBD612-232D-40CB-BE2C-F2B911FD6228}.Debug|x64.Build.0 = Debug|x64 - {9AEBD612-232D-40CB-BE2C-F2B911FD6228}.Release|.NET.ActiveCfg = Release|x64 - {9AEBD612-232D-40CB-BE2C-F2B911FD6228}.Release|Any CPU.ActiveCfg = Release|x64 - {9AEBD612-232D-40CB-BE2C-F2B911FD6228}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {9AEBD612-232D-40CB-BE2C-F2B911FD6228}.Release|Mixed Platforms.Build.0 = Release|Win32 - {9AEBD612-232D-40CB-BE2C-F2B911FD6228}.Release|Win32.ActiveCfg = Release|Win32 - {9AEBD612-232D-40CB-BE2C-F2B911FD6228}.Release|Win32.Build.0 = Release|Win32 - {9AEBD612-232D-40CB-BE2C-F2B911FD6228}.Release|x64.ActiveCfg = Release|x64 - {9AEBD612-232D-40CB-BE2C-F2B911FD6228}.Release|x64.Build.0 = Release|x64 - {69F4FF0E-13DE-4AF6-B8AF-572A36239083}.Debug|.NET.ActiveCfg = Debug|Any CPU - {69F4FF0E-13DE-4AF6-B8AF-572A36239083}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {69F4FF0E-13DE-4AF6-B8AF-572A36239083}.Debug|Any CPU.Build.0 = Debug|Any CPU - {69F4FF0E-13DE-4AF6-B8AF-572A36239083}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {69F4FF0E-13DE-4AF6-B8AF-572A36239083}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {69F4FF0E-13DE-4AF6-B8AF-572A36239083}.Debug|Win32.ActiveCfg = Debug|Any CPU - {69F4FF0E-13DE-4AF6-B8AF-572A36239083}.Debug|x64.ActiveCfg = Debug|Any CPU - {69F4FF0E-13DE-4AF6-B8AF-572A36239083}.Release|.NET.ActiveCfg = Debug|Any CPU - {69F4FF0E-13DE-4AF6-B8AF-572A36239083}.Release|Any CPU.ActiveCfg = Release|Any CPU - {69F4FF0E-13DE-4AF6-B8AF-572A36239083}.Release|Any CPU.Build.0 = Release|Any CPU - {69F4FF0E-13DE-4AF6-B8AF-572A36239083}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU - {69F4FF0E-13DE-4AF6-B8AF-572A36239083}.Release|Mixed Platforms.Build.0 = Debug|Any CPU - {69F4FF0E-13DE-4AF6-B8AF-572A36239083}.Release|Win32.ActiveCfg = Debug|Any CPU - {69F4FF0E-13DE-4AF6-B8AF-572A36239083}.Release|x64.ActiveCfg = Debug|Any CPU - {0EAF6AA9-B712-464B-A11B-FA3CF7577D80}.Debug|.NET.ActiveCfg = Debug|Any CPU - {0EAF6AA9-B712-464B-A11B-FA3CF7577D80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0EAF6AA9-B712-464B-A11B-FA3CF7577D80}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0EAF6AA9-B712-464B-A11B-FA3CF7577D80}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {0EAF6AA9-B712-464B-A11B-FA3CF7577D80}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {0EAF6AA9-B712-464B-A11B-FA3CF7577D80}.Debug|Win32.ActiveCfg = Debug|Any CPU - {0EAF6AA9-B712-464B-A11B-FA3CF7577D80}.Debug|x64.ActiveCfg = Debug|Any CPU - {0EAF6AA9-B712-464B-A11B-FA3CF7577D80}.Release|.NET.ActiveCfg = Release|Any CPU - {0EAF6AA9-B712-464B-A11B-FA3CF7577D80}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0EAF6AA9-B712-464B-A11B-FA3CF7577D80}.Release|Any CPU.Build.0 = Release|Any CPU - {0EAF6AA9-B712-464B-A11B-FA3CF7577D80}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {0EAF6AA9-B712-464B-A11B-FA3CF7577D80}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {0EAF6AA9-B712-464B-A11B-FA3CF7577D80}.Release|Win32.ActiveCfg = Release|Any CPU - {0EAF6AA9-B712-464B-A11B-FA3CF7577D80}.Release|x64.ActiveCfg = Release|Any CPU - {A9779443-E254-47E9-B733-8AC6D3662CA6}.Debug|.NET.ActiveCfg = Debug|Any CPU - {A9779443-E254-47E9-B733-8AC6D3662CA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A9779443-E254-47E9-B733-8AC6D3662CA6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A9779443-E254-47E9-B733-8AC6D3662CA6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {A9779443-E254-47E9-B733-8AC6D3662CA6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {A9779443-E254-47E9-B733-8AC6D3662CA6}.Debug|Win32.ActiveCfg = Debug|Any CPU - {A9779443-E254-47E9-B733-8AC6D3662CA6}.Debug|x64.ActiveCfg = Debug|Any CPU - {A9779443-E254-47E9-B733-8AC6D3662CA6}.Release|.NET.ActiveCfg = Release|Any CPU - {A9779443-E254-47E9-B733-8AC6D3662CA6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A9779443-E254-47E9-B733-8AC6D3662CA6}.Release|Any CPU.Build.0 = Release|Any CPU - {A9779443-E254-47E9-B733-8AC6D3662CA6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {A9779443-E254-47E9-B733-8AC6D3662CA6}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {A9779443-E254-47E9-B733-8AC6D3662CA6}.Release|Win32.ActiveCfg = Release|Any CPU - {A9779443-E254-47E9-B733-8AC6D3662CA6}.Release|x64.ActiveCfg = Release|Any CPU - {1580564D-B6B8-4BD8-A120-001E3E8E5BE6}.Debug|.NET.ActiveCfg = Debug|Any CPU - {1580564D-B6B8-4BD8-A120-001E3E8E5BE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1580564D-B6B8-4BD8-A120-001E3E8E5BE6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1580564D-B6B8-4BD8-A120-001E3E8E5BE6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {1580564D-B6B8-4BD8-A120-001E3E8E5BE6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {1580564D-B6B8-4BD8-A120-001E3E8E5BE6}.Debug|Win32.ActiveCfg = Debug|Any CPU - {1580564D-B6B8-4BD8-A120-001E3E8E5BE6}.Debug|x64.ActiveCfg = Debug|Any CPU - {1580564D-B6B8-4BD8-A120-001E3E8E5BE6}.Release|.NET.ActiveCfg = Release|Any CPU - {1580564D-B6B8-4BD8-A120-001E3E8E5BE6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1580564D-B6B8-4BD8-A120-001E3E8E5BE6}.Release|Any CPU.Build.0 = Release|Any CPU - {1580564D-B6B8-4BD8-A120-001E3E8E5BE6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {1580564D-B6B8-4BD8-A120-001E3E8E5BE6}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {1580564D-B6B8-4BD8-A120-001E3E8E5BE6}.Release|Win32.ActiveCfg = Release|Any CPU - {1580564D-B6B8-4BD8-A120-001E3E8E5BE6}.Release|x64.ActiveCfg = Release|Any CPU - {1D3DF4DB-6C11-480D-9774-F489B2EF62D8}.Debug|.NET.ActiveCfg = Debug|Any CPU - {1D3DF4DB-6C11-480D-9774-F489B2EF62D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1D3DF4DB-6C11-480D-9774-F489B2EF62D8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1D3DF4DB-6C11-480D-9774-F489B2EF62D8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {1D3DF4DB-6C11-480D-9774-F489B2EF62D8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {1D3DF4DB-6C11-480D-9774-F489B2EF62D8}.Debug|Win32.ActiveCfg = Debug|Any CPU - {1D3DF4DB-6C11-480D-9774-F489B2EF62D8}.Debug|x64.ActiveCfg = Debug|Any CPU - {1D3DF4DB-6C11-480D-9774-F489B2EF62D8}.Release|.NET.ActiveCfg = Release|Any CPU - {1D3DF4DB-6C11-480D-9774-F489B2EF62D8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1D3DF4DB-6C11-480D-9774-F489B2EF62D8}.Release|Any CPU.Build.0 = Release|Any CPU - {1D3DF4DB-6C11-480D-9774-F489B2EF62D8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {1D3DF4DB-6C11-480D-9774-F489B2EF62D8}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {1D3DF4DB-6C11-480D-9774-F489B2EF62D8}.Release|Win32.ActiveCfg = Release|Any CPU - {1D3DF4DB-6C11-480D-9774-F489B2EF62D8}.Release|x64.ActiveCfg = Release|Any CPU - {81D664AA-FC03-425E-98A8-B4EAF8236776}.Debug|.NET.ActiveCfg = Debug|Any CPU - {81D664AA-FC03-425E-98A8-B4EAF8236776}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {81D664AA-FC03-425E-98A8-B4EAF8236776}.Debug|Any CPU.Build.0 = Debug|Any CPU - {81D664AA-FC03-425E-98A8-B4EAF8236776}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {81D664AA-FC03-425E-98A8-B4EAF8236776}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {81D664AA-FC03-425E-98A8-B4EAF8236776}.Debug|Win32.ActiveCfg = Debug|Any CPU - {81D664AA-FC03-425E-98A8-B4EAF8236776}.Debug|x64.ActiveCfg = Debug|Any CPU - {81D664AA-FC03-425E-98A8-B4EAF8236776}.Release|.NET.ActiveCfg = Release|Any CPU - {81D664AA-FC03-425E-98A8-B4EAF8236776}.Release|Any CPU.ActiveCfg = Release|Any CPU - {81D664AA-FC03-425E-98A8-B4EAF8236776}.Release|Any CPU.Build.0 = Release|Any CPU - {81D664AA-FC03-425E-98A8-B4EAF8236776}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {81D664AA-FC03-425E-98A8-B4EAF8236776}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {81D664AA-FC03-425E-98A8-B4EAF8236776}.Release|Win32.ActiveCfg = Release|Any CPU - {81D664AA-FC03-425E-98A8-B4EAF8236776}.Release|x64.ActiveCfg = Release|Any CPU - {630FC167-169E-4CFD-83ED-9BA4AA8A0FB4}.Debug|.NET.ActiveCfg = Debug|Any CPU - {630FC167-169E-4CFD-83ED-9BA4AA8A0FB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {630FC167-169E-4CFD-83ED-9BA4AA8A0FB4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {630FC167-169E-4CFD-83ED-9BA4AA8A0FB4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {630FC167-169E-4CFD-83ED-9BA4AA8A0FB4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {630FC167-169E-4CFD-83ED-9BA4AA8A0FB4}.Debug|Win32.ActiveCfg = Debug|Any CPU - {630FC167-169E-4CFD-83ED-9BA4AA8A0FB4}.Debug|x64.ActiveCfg = Debug|Any CPU - {630FC167-169E-4CFD-83ED-9BA4AA8A0FB4}.Release|.NET.ActiveCfg = Release|Any CPU - {630FC167-169E-4CFD-83ED-9BA4AA8A0FB4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {630FC167-169E-4CFD-83ED-9BA4AA8A0FB4}.Release|Any CPU.Build.0 = Release|Any CPU - {630FC167-169E-4CFD-83ED-9BA4AA8A0FB4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {630FC167-169E-4CFD-83ED-9BA4AA8A0FB4}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {630FC167-169E-4CFD-83ED-9BA4AA8A0FB4}.Release|Win32.ActiveCfg = Release|Any CPU - {630FC167-169E-4CFD-83ED-9BA4AA8A0FB4}.Release|x64.ActiveCfg = Release|Any CPU - {ECF3B49F-68B0-4A2A-8559-6D7FB906AA88}.Debug|.NET.ActiveCfg = Debug|Any CPU - {ECF3B49F-68B0-4A2A-8559-6D7FB906AA88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ECF3B49F-68B0-4A2A-8559-6D7FB906AA88}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ECF3B49F-68B0-4A2A-8559-6D7FB906AA88}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {ECF3B49F-68B0-4A2A-8559-6D7FB906AA88}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {ECF3B49F-68B0-4A2A-8559-6D7FB906AA88}.Debug|Win32.ActiveCfg = Debug|Any CPU - {ECF3B49F-68B0-4A2A-8559-6D7FB906AA88}.Debug|x64.ActiveCfg = Debug|Any CPU - {ECF3B49F-68B0-4A2A-8559-6D7FB906AA88}.Release|.NET.ActiveCfg = Release|Any CPU - {ECF3B49F-68B0-4A2A-8559-6D7FB906AA88}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ECF3B49F-68B0-4A2A-8559-6D7FB906AA88}.Release|Any CPU.Build.0 = Release|Any CPU - {ECF3B49F-68B0-4A2A-8559-6D7FB906AA88}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {ECF3B49F-68B0-4A2A-8559-6D7FB906AA88}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {ECF3B49F-68B0-4A2A-8559-6D7FB906AA88}.Release|Win32.ActiveCfg = Release|Any CPU - {ECF3B49F-68B0-4A2A-8559-6D7FB906AA88}.Release|x64.ActiveCfg = Release|Any CPU - {1B70379B-5325-4243-8629-5C32802E9826}.Debug|.NET.ActiveCfg = Debug|Any CPU - {1B70379B-5325-4243-8629-5C32802E9826}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1B70379B-5325-4243-8629-5C32802E9826}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1B70379B-5325-4243-8629-5C32802E9826}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {1B70379B-5325-4243-8629-5C32802E9826}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {1B70379B-5325-4243-8629-5C32802E9826}.Debug|Win32.ActiveCfg = Debug|Any CPU - {1B70379B-5325-4243-8629-5C32802E9826}.Debug|x64.ActiveCfg = Debug|Any CPU - {1B70379B-5325-4243-8629-5C32802E9826}.Release|.NET.ActiveCfg = Release|Any CPU - {1B70379B-5325-4243-8629-5C32802E9826}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1B70379B-5325-4243-8629-5C32802E9826}.Release|Any CPU.Build.0 = Release|Any CPU - {1B70379B-5325-4243-8629-5C32802E9826}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {1B70379B-5325-4243-8629-5C32802E9826}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {1B70379B-5325-4243-8629-5C32802E9826}.Release|Win32.ActiveCfg = Release|Any CPU - {1B70379B-5325-4243-8629-5C32802E9826}.Release|x64.ActiveCfg = Release|Any CPU - {42D1B587-9544-452F-8B76-4F2A65BC9BE5}.Debug|.NET.ActiveCfg = Debug|Any CPU - {42D1B587-9544-452F-8B76-4F2A65BC9BE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {42D1B587-9544-452F-8B76-4F2A65BC9BE5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {42D1B587-9544-452F-8B76-4F2A65BC9BE5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {42D1B587-9544-452F-8B76-4F2A65BC9BE5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {42D1B587-9544-452F-8B76-4F2A65BC9BE5}.Debug|Win32.ActiveCfg = Debug|Any CPU - {42D1B587-9544-452F-8B76-4F2A65BC9BE5}.Debug|x64.ActiveCfg = Debug|Any CPU - {42D1B587-9544-452F-8B76-4F2A65BC9BE5}.Release|.NET.ActiveCfg = Release|Any CPU - {42D1B587-9544-452F-8B76-4F2A65BC9BE5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {42D1B587-9544-452F-8B76-4F2A65BC9BE5}.Release|Any CPU.Build.0 = Release|Any CPU - {42D1B587-9544-452F-8B76-4F2A65BC9BE5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {42D1B587-9544-452F-8B76-4F2A65BC9BE5}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {42D1B587-9544-452F-8B76-4F2A65BC9BE5}.Release|Win32.ActiveCfg = Release|Any CPU - {42D1B587-9544-452F-8B76-4F2A65BC9BE5}.Release|x64.ActiveCfg = Release|Any CPU - {68CF4628-4148-4627-ACA1-D4C225365D3F}.Debug|.NET.ActiveCfg = Debug|Any CPU - {68CF4628-4148-4627-ACA1-D4C225365D3F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {68CF4628-4148-4627-ACA1-D4C225365D3F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {68CF4628-4148-4627-ACA1-D4C225365D3F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {68CF4628-4148-4627-ACA1-D4C225365D3F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {68CF4628-4148-4627-ACA1-D4C225365D3F}.Debug|Win32.ActiveCfg = Debug|Any CPU - {68CF4628-4148-4627-ACA1-D4C225365D3F}.Debug|x64.ActiveCfg = Debug|Any CPU - {68CF4628-4148-4627-ACA1-D4C225365D3F}.Release|.NET.ActiveCfg = Release|Any CPU - {68CF4628-4148-4627-ACA1-D4C225365D3F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {68CF4628-4148-4627-ACA1-D4C225365D3F}.Release|Any CPU.Build.0 = Release|Any CPU - {68CF4628-4148-4627-ACA1-D4C225365D3F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {68CF4628-4148-4627-ACA1-D4C225365D3F}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {68CF4628-4148-4627-ACA1-D4C225365D3F}.Release|Win32.ActiveCfg = Release|Any CPU - {68CF4628-4148-4627-ACA1-D4C225365D3F}.Release|x64.ActiveCfg = Release|Any CPU - {37F9EF6B-F69C-4764-9687-C63C608C476B}.Debug|.NET.ActiveCfg = Debug|Win32 - {37F9EF6B-F69C-4764-9687-C63C608C476B}.Debug|Any CPU.ActiveCfg = Debug|Win32 - {37F9EF6B-F69C-4764-9687-C63C608C476B}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {37F9EF6B-F69C-4764-9687-C63C608C476B}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {37F9EF6B-F69C-4764-9687-C63C608C476B}.Debug|Win32.ActiveCfg = Debug|Win32 - {37F9EF6B-F69C-4764-9687-C63C608C476B}.Debug|Win32.Build.0 = Debug|Win32 - {37F9EF6B-F69C-4764-9687-C63C608C476B}.Debug|x64.ActiveCfg = Debug|Win32 - {37F9EF6B-F69C-4764-9687-C63C608C476B}.Release|.NET.ActiveCfg = Release|Win32 - {37F9EF6B-F69C-4764-9687-C63C608C476B}.Release|Any CPU.ActiveCfg = Release|Win32 - {37F9EF6B-F69C-4764-9687-C63C608C476B}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {37F9EF6B-F69C-4764-9687-C63C608C476B}.Release|Mixed Platforms.Build.0 = Release|Win32 - {37F9EF6B-F69C-4764-9687-C63C608C476B}.Release|Win32.ActiveCfg = Release|Win32 - {37F9EF6B-F69C-4764-9687-C63C608C476B}.Release|Win32.Build.0 = Release|Win32 - {37F9EF6B-F69C-4764-9687-C63C608C476B}.Release|x64.ActiveCfg = Release|Win32 - {3102A61F-3025-482C-9515-9FC239746658}.Debug|.NET.ActiveCfg = Debug|Any CPU - {3102A61F-3025-482C-9515-9FC239746658}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3102A61F-3025-482C-9515-9FC239746658}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3102A61F-3025-482C-9515-9FC239746658}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {3102A61F-3025-482C-9515-9FC239746658}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {3102A61F-3025-482C-9515-9FC239746658}.Debug|Win32.ActiveCfg = Debug|Any CPU - {3102A61F-3025-482C-9515-9FC239746658}.Debug|x64.ActiveCfg = Debug|Any CPU - {3102A61F-3025-482C-9515-9FC239746658}.Release|.NET.ActiveCfg = Release|Any CPU - {3102A61F-3025-482C-9515-9FC239746658}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3102A61F-3025-482C-9515-9FC239746658}.Release|Any CPU.Build.0 = Release|Any CPU - {3102A61F-3025-482C-9515-9FC239746658}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {3102A61F-3025-482C-9515-9FC239746658}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {3102A61F-3025-482C-9515-9FC239746658}.Release|Win32.ActiveCfg = Release|Any CPU - {3102A61F-3025-482C-9515-9FC239746658}.Release|x64.ActiveCfg = Release|Any CPU - {83C13931-B27C-425C-AAF0-5F96EEA4F173}.Debug|.NET.ActiveCfg = Debug|Any CPU - {83C13931-B27C-425C-AAF0-5F96EEA4F173}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {83C13931-B27C-425C-AAF0-5F96EEA4F173}.Debug|Any CPU.Build.0 = Debug|Any CPU - {83C13931-B27C-425C-AAF0-5F96EEA4F173}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {83C13931-B27C-425C-AAF0-5F96EEA4F173}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {83C13931-B27C-425C-AAF0-5F96EEA4F173}.Debug|Win32.ActiveCfg = Debug|Any CPU - {83C13931-B27C-425C-AAF0-5F96EEA4F173}.Debug|x64.ActiveCfg = Debug|Any CPU - {83C13931-B27C-425C-AAF0-5F96EEA4F173}.Release|.NET.ActiveCfg = Release|Any CPU - {83C13931-B27C-425C-AAF0-5F96EEA4F173}.Release|Any CPU.ActiveCfg = Release|Any CPU - {83C13931-B27C-425C-AAF0-5F96EEA4F173}.Release|Any CPU.Build.0 = Release|Any CPU - {83C13931-B27C-425C-AAF0-5F96EEA4F173}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {83C13931-B27C-425C-AAF0-5F96EEA4F173}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {83C13931-B27C-425C-AAF0-5F96EEA4F173}.Release|Win32.ActiveCfg = Release|Any CPU - {83C13931-B27C-425C-AAF0-5F96EEA4F173}.Release|x64.ActiveCfg = Release|Any CPU - {35A23A16-EF17-4CC3-8854-785025A304F3}.Debug|.NET.ActiveCfg = Debug|Win32 - {35A23A16-EF17-4CC3-8854-785025A304F3}.Debug|Any CPU.ActiveCfg = Debug|x64 - {35A23A16-EF17-4CC3-8854-785025A304F3}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 - {35A23A16-EF17-4CC3-8854-785025A304F3}.Debug|Mixed Platforms.Build.0 = Debug|Win32 - {35A23A16-EF17-4CC3-8854-785025A304F3}.Debug|Win32.ActiveCfg = Debug|Win32 - {35A23A16-EF17-4CC3-8854-785025A304F3}.Debug|Win32.Build.0 = Debug|Win32 - {35A23A16-EF17-4CC3-8854-785025A304F3}.Debug|x64.ActiveCfg = Debug|x64 - {35A23A16-EF17-4CC3-8854-785025A304F3}.Debug|x64.Build.0 = Debug|x64 - {35A23A16-EF17-4CC3-8854-785025A304F3}.Release|.NET.ActiveCfg = Release|Win32 - {35A23A16-EF17-4CC3-8854-785025A304F3}.Release|Any CPU.ActiveCfg = Release|Win32 - {35A23A16-EF17-4CC3-8854-785025A304F3}.Release|Mixed Platforms.ActiveCfg = Release|Win32 - {35A23A16-EF17-4CC3-8854-785025A304F3}.Release|Mixed Platforms.Build.0 = Release|Win32 - {35A23A16-EF17-4CC3-8854-785025A304F3}.Release|Win32.ActiveCfg = Release|Win32 - {35A23A16-EF17-4CC3-8854-785025A304F3}.Release|Win32.Build.0 = Release|Win32 - {35A23A16-EF17-4CC3-8854-785025A304F3}.Release|x64.ActiveCfg = Release|x64 - {35A23A16-EF17-4CC3-8854-785025A304F3}.Release|x64.Build.0 = Release|x64 - {705CA982-A18B-4BCA-80B7-1F6DE6883BE8}.Debug|.NET.ActiveCfg = Debug|x64 - {705CA982-A18B-4BCA-80B7-1F6DE6883BE8}.Debug|Any CPU.ActiveCfg = Debug|x64 - {705CA982-A18B-4BCA-80B7-1F6DE6883BE8}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 - {705CA982-A18B-4BCA-80B7-1F6DE6883BE8}.Debug|Mixed Platforms.Build.0 = Debug|x64 - {705CA982-A18B-4BCA-80B7-1F6DE6883BE8}.Debug|Win32.ActiveCfg = Debug|Win32 - {705CA982-A18B-4BCA-80B7-1F6DE6883BE8}.Debug|Win32.Build.0 = Debug|Win32 - {705CA982-A18B-4BCA-80B7-1F6DE6883BE8}.Debug|x64.ActiveCfg = Debug|x64 - {705CA982-A18B-4BCA-80B7-1F6DE6883BE8}.Debug|x64.Build.0 = Debug|x64 - {705CA982-A18B-4BCA-80B7-1F6DE6883BE8}.Release|.NET.ActiveCfg = Release|x64 - {705CA982-A18B-4BCA-80B7-1F6DE6883BE8}.Release|Any CPU.ActiveCfg = Release|x64 - {705CA982-A18B-4BCA-80B7-1F6DE6883BE8}.Release|Mixed Platforms.ActiveCfg = Release|x64 - {705CA982-A18B-4BCA-80B7-1F6DE6883BE8}.Release|Mixed Platforms.Build.0 = Release|x64 - {705CA982-A18B-4BCA-80B7-1F6DE6883BE8}.Release|Win32.ActiveCfg = Release|Win32 - {705CA982-A18B-4BCA-80B7-1F6DE6883BE8}.Release|Win32.Build.0 = Release|Win32 - {705CA982-A18B-4BCA-80B7-1F6DE6883BE8}.Release|x64.ActiveCfg = Release|x64 - {705CA982-A18B-4BCA-80B7-1F6DE6883BE8}.Release|x64.Build.0 = Release|x64 - {49D8D0ED-7FD9-4421-A6D1-B411152ECB5E}.Debug|.NET.ActiveCfg = Debug|x64 - {49D8D0ED-7FD9-4421-A6D1-B411152ECB5E}.Debug|Any CPU.ActiveCfg = Debug|x64 - {49D8D0ED-7FD9-4421-A6D1-B411152ECB5E}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 - {49D8D0ED-7FD9-4421-A6D1-B411152ECB5E}.Debug|Mixed Platforms.Build.0 = Debug|x64 - {49D8D0ED-7FD9-4421-A6D1-B411152ECB5E}.Debug|Win32.ActiveCfg = Debug|Win32 - {49D8D0ED-7FD9-4421-A6D1-B411152ECB5E}.Debug|Win32.Build.0 = Debug|Win32 - {49D8D0ED-7FD9-4421-A6D1-B411152ECB5E}.Debug|x64.ActiveCfg = Debug|x64 - {49D8D0ED-7FD9-4421-A6D1-B411152ECB5E}.Debug|x64.Build.0 = Debug|x64 - {49D8D0ED-7FD9-4421-A6D1-B411152ECB5E}.Release|.NET.ActiveCfg = Release|x64 - {49D8D0ED-7FD9-4421-A6D1-B411152ECB5E}.Release|Any CPU.ActiveCfg = Release|x64 - {49D8D0ED-7FD9-4421-A6D1-B411152ECB5E}.Release|Mixed Platforms.ActiveCfg = Release|x64 - {49D8D0ED-7FD9-4421-A6D1-B411152ECB5E}.Release|Mixed Platforms.Build.0 = Release|x64 - {49D8D0ED-7FD9-4421-A6D1-B411152ECB5E}.Release|Win32.ActiveCfg = Release|Win32 - {49D8D0ED-7FD9-4421-A6D1-B411152ECB5E}.Release|Win32.Build.0 = Release|Win32 - {49D8D0ED-7FD9-4421-A6D1-B411152ECB5E}.Release|x64.ActiveCfg = Release|x64 - {49D8D0ED-7FD9-4421-A6D1-B411152ECB5E}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Selenium2Library/lib/selenium-2.8.1/WebDriver.snk b/src/Selenium2Library/lib/selenium-2.8.1/WebDriver.snk deleted file mode 100644 index 216cfabf2..000000000 Binary files a/src/Selenium2Library/lib/selenium-2.8.1/WebDriver.snk and /dev/null differ diff --git a/src/Selenium2Library/lib/selenium-2.8.1/docs/api/py/index.rst b/src/Selenium2Library/lib/selenium-2.8.1/docs/api/py/index.rst deleted file mode 100644 index 67f3869b9..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/docs/api/py/index.rst +++ /dev/null @@ -1,59 +0,0 @@ -============ -Introduction -============ -:Author: David Burns - -Selenium Python Client Driver is a Python language binding for Selenium Remote -Control (version 1.0 and 2.0). - -Currently the remote protocol, Firefox and Chrome for Selenium 2.0 are -supported, as well as the Selenium 1.0 bindings. As work will progresses we'll -add more "native" drivers. - -See here_ for more information. - -.. _here: http://code.google.com/p/selenium/ - -Installing -========== - -Python Client -------------- -:: - - pip install -U selenium - -Java Server ------------ - -Download the server from http://selenium.googlecode.com/files/selenium-server-standalone-2.8.0.jar -:: - - java -jar selenium-server-standalone-2.8.0.jar - -Example -======= -:: - - from selenium import webdriver - from selenium.common.exceptions import NoSuchElementException - from selenium.webdriver.common.keys import Keys - import time - - browser = webdriver.Firefox() # Get local session of firefox - browser.get("http://www.yahoo.com") # Load page - assert "Yahoo!" in browser.title - elem = browser.find_element_by_name("p") # Find the query box - elem.send_keys("seleniumhq" + Keys.RETURN) - time.sleep(0.2) # Let the page load, will be added to the API - try: - browser.find_element_by_xpath("//a[contains(@href,'http://seleniumhq.org')]") - except NoSuchElementException: - assert 0, "can't find seleniumhq" - browser.close() - -Documentation -============= -Coming soon, in the meantime - `"Use the source Luke"`_ - -.. _"Use the source Luke": http://code.google.com/p/selenium/source/browse/trunk/py/selenium/webdriver/remote/webdriver.py diff --git a/src/Selenium2Library/lib/selenium-2.8.1/go b/src/Selenium2Library/lib/selenium-2.8.1/go deleted file mode 100644 index bd32fdfff..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/go +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -case `uname` in - Darwin) - JAVA_OPTS="-d32" - ;; - *) - JAVA_OPTS="-client" - ;; -esac - -java $JAVA_OPTS -jar third_party/jruby/jruby-complete.jar -X-C -S rake $* - diff --git a/src/Selenium2Library/lib/selenium-2.8.1/go.bat b/src/Selenium2Library/lib/selenium-2.8.1/go.bat deleted file mode 100644 index 058856d23..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/go.bat +++ /dev/null @@ -1,3 +0,0 @@ -@echo off - -java -client -jar third_party\jruby\jruby-complete.jar -X-C -S rake %* diff --git a/src/Selenium2Library/lib/selenium-2.8.1/properties.yml b/src/Selenium2Library/lib/selenium-2.8.1/properties.yml deleted file mode 100644 index cafc40723..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/properties.yml +++ /dev/null @@ -1,11 +0,0 @@ -default: - android: - # Path to the android sdk - androidsdkpath : "../android_sdk/" - # Target id. To get a list of all targets do "./android list targets". - # We want whatever matches android 2.2 (API level 8) - # Note: Android WebDriver will not work on Gingerbread (SDK 2.3) emulator because of - # an emulator bug. However it will work with Gingerbread (SDK 2.3) devices. - androidtarget : 13 - # Android platform. You can find supported platforms under androidsdkpath/platforms/ - androidplatform : "android-8" diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/CHANGES b/src/Selenium2Library/lib/selenium-2.8.1/py/CHANGES deleted file mode 100644 index 3e5fc8532..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/CHANGES +++ /dev/null @@ -1,73 +0,0 @@ -Selenium 2.8 -* Actions updates -* Bug Fixes - -Selenium 2.6 -* Documentation fixes - -Selenium 2.5 -* Fixed x64 IE Support -* Bug Fixes - -Selenium 2.4 -* Bug Fixes -* x64 IE Support -* Added WebDriverWait as a support package - -Selenium 2.3 -* Bug Fixes - -Selenium 2.2 -* Ability to get screenshots from Exceptions if they are given -* Access to Remote StackTrace on error - -Selenium 2.1 -* Bug Fixes - -Selenium 2 -* Removed toggle() and select() - -Selenium 2 RC 3 -* Added Opera to Desired Capabilities -* Removed deprecrated methods -* Deprecated toggle() and select() methods. This will be removed in the next release - -Selenium 2 Beta 4 -* Fix for using existing Firefox Profiles -* Alerts Support in IE -* Fix to dictionary returned from size -* Deprecated value property. Use the get_attribute("value") method -* Deprecated get_page_source method. Use page_source property -* Deprecated get_current_window_handle. Use current_window_handle property -* Deprecated get_window_handles. Use window_handles property -* Ability to install extensions into profiles -* Added Location to the WebElement -* ChromeDriver rewritten to use new built in mechanism -* Added Advanced User Interaction API. Only Available for HTMLUnit at the moment -* Profiles now delete their temp folders when driver.quit() is called - -Selenium 2 Beta 3 -* Accept Untrusted Certificates in Firefox -* Fixed Screenshots -* Added DesiredCapabilities to simplify choosing Drivers -* Fixed Firefox Profile creation -* Added Firefox 4 support -* DocStrings Improvements - -Selenium 2 Beta 2 - -* New bindings landed. Change webdriver namespace to "selenium.webdriver" -* Ability to move to default content -* Implicit Waits -* Change the API to use properties instead of get_x -* Changed the Element Finding to match other languages -* Added ability to execute asynchronous scripts from the driver -* Ability to get rendered element size -* Ability to get CSS Value on a webelement -* Corrected Element finding from the element -* Alert and Prompt handling -* Improved IEDriver -* Basic Authentication support for Selenium 2 -* Ability to have multiple Firefox instances - - diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/__init__.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/__init__.py deleted file mode 100644 index 32d5d9c13..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright 2008-2010 WebDriver committers -# Copyright 2008-2010 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from selenium import selenium - - -__version__ = "2.8.0" diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/common/__init__.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/common/__init__.py deleted file mode 100644 index af9602730..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/common/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2008-2010 WebDriver committers -# Copyright 2008-2010 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import exceptions \ No newline at end of file diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/common/exceptions.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/common/exceptions.py deleted file mode 100644 index 02b3cd81d..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/common/exceptions.py +++ /dev/null @@ -1,91 +0,0 @@ -# Copyright 2008-2009 WebDriver committers -# Copyright 2008-2009 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Exceptions that may happen in all the webdriver code.""" -class WebDriverException(Exception): - def __init__(self, msg=None, screen=None, stacktrace=None): - self.msg = msg - self.screen = screen - self.stacktrace = stacktrace - - def __str__(self): - exception_msg = "Message: %s " % repr(self.msg) - if self.screen is not None: - exception_msg = "%s; Screenshot: available via screen " \ - % exception_msg - if self.stacktrace is not None: - exception_msg = "%s; Stacktrace: %s " \ - % (exception_msg, str(self.stacktrace)) - return exception_msg - -class ErrorInResponseException(WebDriverException): - """An error has occurred on the server side. - - This may happen when communicating with the firefox extension - or the remote driver server.""" - def __init__(self, response, msg): - WebDriverException.__init__(self, msg) - self.response = response - -class InvalidSwitchToTargetException(WebDriverException): - """The frame or window target to be switched doesn't exist.""" - pass - -class NoSuchFrameException(InvalidSwitchToTargetException): - pass - -class NoSuchWindowException(InvalidSwitchToTargetException): - pass - -class NoSuchElementException(WebDriverException): - """find_element_by_* can't find the element.""" - pass - -class NoSuchAttributeException(WebDriverException): - """find_element_by_* can't find the element.""" - pass - -class StaleElementReferenceException(WebDriverException): - """Indicates that a reference to an element is now "stale" --- the - element no longer appears on the DOM of the page.""" - pass - -class InvalidElementStateException(WebDriverException): - pass - -class ElementNotVisibleException(InvalidElementStateException): - """Thrown to indicate that although an element is present on the - DOM, it is not visible, and so is not able to be interacted - with.""" - pass - -class ElementNotSelectableException(InvalidElementStateException): - pass - -class InvalidCookieDomainException(WebDriverException): - """Thrown when attempting to add a cookie under a different domain - than the current URL.""" - pass - -class UnableToSetCookieException(WebDriverException): - """Thrown when a driver fails to set a cookie.""" - pass - -class RemoteDriverServerException(WebDriverException): - pass - -class TimeoutException(WebDriverException): - """Thrown when a command does not complete in enough time.""" - pass diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/selenium.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/selenium.py deleted file mode 100644 index d06fe7f3e..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/selenium.py +++ /dev/null @@ -1,2097 +0,0 @@ - -""" -Copyright 2006 ThoughtWorks, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" -__docformat__ = "restructuredtext en" - -import httplib -import urllib - -class selenium(object): - """ - Defines an object that runs Selenium commands. - - Element Locators - ~~~~~~~~~~~~~~~~ - - Element Locators tell Selenium which HTML element a command refers to. - The format of a locator is: - - \ *locatorType*\ **=**\ \ *argument* - - - We support the following strategies for locating elements: - - - * \ **identifier**\ =\ *id*: - Select the element with the specified @id attribute. If no match is - found, select the first element whose @name attribute is \ *id*. - (This is normally the default; see below.) - * \ **id**\ =\ *id*: - Select the element with the specified @id attribute. - * \ **name**\ =\ *name*: - Select the first element with the specified @name attribute. - - * username - * name=username - - - The name may optionally be followed by one or more \ *element-filters*, separated from the name by whitespace. If the \ *filterType* is not specified, \ **value**\ is assumed. - - * name=flavour value=chocolate - - - * \ **dom**\ =\ *javascriptExpression*: - - Find an element by evaluating the specified string. This allows you to traverse the HTML Document Object - Model using JavaScript. Note that you must not return a value in this string; simply make it the last expression in the block. - - * dom=document.forms['myForm'].myDropdown - * dom=document.images[56] - * dom=function foo() { return document.links[1]; }; foo(); - - - * \ **xpath**\ =\ *xpathExpression*: - Locate an element using an XPath expression. - - * xpath=//img[@alt='The image alt text'] - * xpath=//table[@id='table1']//tr[4]/td[2] - * xpath=//a[contains(@href,'#id1')] - * xpath=//a[contains(@href,'#id1')]/@class - * xpath=(//table[@class='stylee'])//th[text()='theHeaderText']/../td - * xpath=//input[@name='name2' and @value='yes'] - * xpath=//\*[text()="right"] - - - * \ **link**\ =\ *textPattern*: - Select the link (anchor) element which contains text matching the - specified \ *pattern*. - - * link=The link text - - - * \ **css**\ =\ *cssSelectorSyntax*: - Select the element using css selectors. Please refer to CSS2 selectors, CSS3 selectors for more information. You can also check the TestCssLocators test in the selenium test suite for an example of usage, which is included in the downloaded selenium core package. - - * css=a[href="#id3"] - * css=span#firstChild + span - - - Currently the css selector locator supports all css1, css2 and css3 selectors except namespace in css3, some pseudo classes(:nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type, :only-of-type, :visited, :hover, :active, :focus, :indeterminate) and pseudo elements(::first-line, ::first-letter, ::selection, ::before, ::after). - - * \ **ui**\ =\ *uiSpecifierString*: - Locate an element by resolving the UI specifier string to another locator, and evaluating it. See the Selenium UI-Element Reference for more details. - - * ui=loginPages::loginButton() - * ui=settingsPages::toggle(label=Hide Email) - * ui=forumPages::postBody(index=2)//a[2] - - - - - - Without an explicit locator prefix, Selenium uses the following default - strategies: - - - * \ **dom**\ , for locators starting with "document." - * \ **xpath**\ , for locators starting with "//" - * \ **identifier**\ , otherwise - - Element Filters - ~~~~~~~~~~~~~~~ - - Element filters can be used with a locator to refine a list of candidate elements. They are currently used only in the 'name' element-locator. - - Filters look much like locators, ie. - - \ *filterType*\ **=**\ \ *argument* - - Supported element-filters are: - - \ **value=**\ \ *valuePattern* - - - Matches elements based on their values. This is particularly useful for refining a list of similarly-named toggle-buttons. - - \ **index=**\ \ *index* - - - Selects a single element based on its position in the list (offset from zero). - - String-match Patterns - ~~~~~~~~~~~~~~~~~~~~~ - - Various Pattern syntaxes are available for matching string values: - - - * \ **glob:**\ \ *pattern*: - Match a string against a "glob" (aka "wildmat") pattern. "Glob" is a - kind of limited regular-expression syntax typically used in command-line - shells. In a glob pattern, "\*" represents any sequence of characters, and "?" - represents any single character. Glob patterns match against the entire - string. - * \ **regexp:**\ \ *regexp*: - Match a string using a regular-expression. The full power of JavaScript - regular-expressions is available. - * \ **regexpi:**\ \ *regexpi*: - Match a string using a case-insensitive regular-expression. - * \ **exact:**\ \ *string*: - - Match a string exactly, verbatim, without any of that fancy wildcard - stuff. - - - - If no pattern prefix is specified, Selenium assumes that it's a "glob" - pattern. - - - - For commands that return multiple values (such as verifySelectOptions), - the string being matched is a comma-separated list of the return values, - where both commas and backslashes in the values are backslash-escaped. - When providing a pattern, the optional matching syntax (i.e. glob, - regexp, etc.) is specified once, as usual, at the beginning of the - pattern. - - - """ - -### This part is hard-coded in the XSL - def __init__(self, host, port, browserStartCommand, browserURL): - self.host = host - self.port = port - self.browserStartCommand = browserStartCommand - self.browserURL = browserURL - self.sessionId = None - self.extensionJs = "" - - def setExtensionJs(self, extensionJs): - self.extensionJs = extensionJs - - def start(self, browserConfigurationOptions=None): - start_args = [self.browserStartCommand, self.browserURL, self.extensionJs] - if browserConfigurationOptions: - start_args.append(browserConfigurationOptions) - result = self.get_string("getNewBrowserSession", start_args) - try: - self.sessionId = result - except ValueError: - raise Exception, result - - def stop(self): - self.do_command("testComplete", []) - self.sessionId = None - - def do_command(self, verb, args): - conn = httplib.HTTPConnection(self.host, self.port) - try: - body = u'cmd=' + urllib.quote_plus(unicode(verb).encode('utf-8')) - for i in range(len(args)): - body += '&' + unicode(i+1) + '=' + \ - urllib.quote_plus(unicode(args[i]).encode('utf-8')) - if (None != self.sessionId): - body += "&sessionId=" + unicode(self.sessionId) - headers = { - "Content-Type": - "application/x-www-form-urlencoded; charset=utf-8" - } - conn.request("POST", "/selenium-server/driver/", body, headers) - - response = conn.getresponse() - data = unicode(response.read(), "UTF-8") - if (not data.startswith('OK')): - raise Exception, data - return data - finally: - conn.close() - - def get_string(self, verb, args): - result = self.do_command(verb, args) - return result[3:] - - def get_string_array(self, verb, args): - csv = self.get_string(verb, args) - if not csv: - return [] - token = "" - tokens = [] - escape = False - for i in range(len(csv)): - letter = csv[i] - if (escape): - token = token + letter - escape = False - continue - if (letter == '\\'): - escape = True - elif (letter == ','): - tokens.append(token) - token = "" - else: - token = token + letter - tokens.append(token) - return tokens - - def get_number(self, verb, args): - return int(self.get_string(verb, args)) - - def get_number_array(self, verb, args): - string_array = self.get_string_array(verb, args) - num_array = [] - for i in string_array: - num_array.append(int(i)) - - return num_array - - def get_boolean(self, verb, args): - boolstr = self.get_string(verb, args) - if ("true" == boolstr): - return True - if ("false" == boolstr): - return False - raise ValueError, "result is neither 'true' nor 'false': " + boolstr - - def get_boolean_array(self, verb, args): - boolarr = self.get_string_array(verb, args) - for i, boolstr in enumerate(boolarr): - if ("true" == boolstr): - boolarr[i] = True - continue - if ("false" == boolstr): - boolarr[i] = False - continue - raise ValueError, "result is neither 'true' nor 'false': " + boolarr[i] - return boolarr - - - - def click(self,locator): - """ - Clicks on a link, button, checkbox or radio button. If the click action - causes a new page to load (like a link usually does), call - waitForPageToLoad. - - 'locator' is an element locator - """ - self.do_command("click", [locator,]) - - - def double_click(self,locator): - """ - Double clicks on a link, button, checkbox or radio button. If the double click action - causes a new page to load (like a link usually does), call - waitForPageToLoad. - - 'locator' is an element locator - """ - self.do_command("doubleClick", [locator,]) - - - def context_menu(self,locator): - """ - Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element). - - 'locator' is an element locator - """ - self.do_command("contextMenu", [locator,]) - - - def click_at(self,locator,coordString): - """ - Clicks on a link, button, checkbox or radio button. If the click action - causes a new page to load (like a link usually does), call - waitForPageToLoad. - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("clickAt", [locator,coordString,]) - - - def double_click_at(self,locator,coordString): - """ - Doubleclicks on a link, button, checkbox or radio button. If the action - causes a new page to load (like a link usually does), call - waitForPageToLoad. - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("doubleClickAt", [locator,coordString,]) - - - def context_menu_at(self,locator,coordString): - """ - Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element). - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("contextMenuAt", [locator,coordString,]) - - - def fire_event(self,locator,eventName): - """ - Explicitly simulate an event, to trigger the corresponding "on\ *event*" - handler. - - 'locator' is an element locator - 'eventName' is the event name, e.g. "focus" or "blur" - """ - self.do_command("fireEvent", [locator,eventName,]) - - - def focus(self,locator): - """ - Move the focus to the specified element; for example, if the element is an input field, move the cursor to that field. - - 'locator' is an element locator - """ - self.do_command("focus", [locator,]) - - - def key_press(self,locator,keySequence): - """ - Simulates a user pressing and releasing a key. - - 'locator' is an element locator - 'keySequence' is Either be a string("\" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", "\119". - """ - self.do_command("keyPress", [locator,keySequence,]) - - - def shift_key_down(self): - """ - Press the shift key and hold it down until doShiftUp() is called or a new page is loaded. - - """ - self.do_command("shiftKeyDown", []) - - - def shift_key_up(self): - """ - Release the shift key. - - """ - self.do_command("shiftKeyUp", []) - - - def meta_key_down(self): - """ - Press the meta key and hold it down until doMetaUp() is called or a new page is loaded. - - """ - self.do_command("metaKeyDown", []) - - - def meta_key_up(self): - """ - Release the meta key. - - """ - self.do_command("metaKeyUp", []) - - - def alt_key_down(self): - """ - Press the alt key and hold it down until doAltUp() is called or a new page is loaded. - - """ - self.do_command("altKeyDown", []) - - - def alt_key_up(self): - """ - Release the alt key. - - """ - self.do_command("altKeyUp", []) - - - def control_key_down(self): - """ - Press the control key and hold it down until doControlUp() is called or a new page is loaded. - - """ - self.do_command("controlKeyDown", []) - - - def control_key_up(self): - """ - Release the control key. - - """ - self.do_command("controlKeyUp", []) - - - def key_down(self,locator,keySequence): - """ - Simulates a user pressing a key (without releasing it yet). - - 'locator' is an element locator - 'keySequence' is Either be a string("\" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", "\119". - """ - self.do_command("keyDown", [locator,keySequence,]) - - - def key_up(self,locator,keySequence): - """ - Simulates a user releasing a key. - - 'locator' is an element locator - 'keySequence' is Either be a string("\" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", "\119". - """ - self.do_command("keyUp", [locator,keySequence,]) - - - def mouse_over(self,locator): - """ - Simulates a user hovering a mouse over the specified element. - - 'locator' is an element locator - """ - self.do_command("mouseOver", [locator,]) - - - def mouse_out(self,locator): - """ - Simulates a user moving the mouse pointer away from the specified element. - - 'locator' is an element locator - """ - self.do_command("mouseOut", [locator,]) - - - def mouse_down(self,locator): - """ - Simulates a user pressing the left mouse button (without releasing it yet) on - the specified element. - - 'locator' is an element locator - """ - self.do_command("mouseDown", [locator,]) - - - def mouse_down_right(self,locator): - """ - Simulates a user pressing the right mouse button (without releasing it yet) on - the specified element. - - 'locator' is an element locator - """ - self.do_command("mouseDownRight", [locator,]) - - - def mouse_down_at(self,locator,coordString): - """ - Simulates a user pressing the left mouse button (without releasing it yet) at - the specified location. - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("mouseDownAt", [locator,coordString,]) - - - def mouse_down_right_at(self,locator,coordString): - """ - Simulates a user pressing the right mouse button (without releasing it yet) at - the specified location. - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("mouseDownRightAt", [locator,coordString,]) - - - def mouse_up(self,locator): - """ - Simulates the event that occurs when the user releases the mouse button (i.e., stops - holding the button down) on the specified element. - - 'locator' is an element locator - """ - self.do_command("mouseUp", [locator,]) - - - def mouse_up_right(self,locator): - """ - Simulates the event that occurs when the user releases the right mouse button (i.e., stops - holding the button down) on the specified element. - - 'locator' is an element locator - """ - self.do_command("mouseUpRight", [locator,]) - - - def mouse_up_at(self,locator,coordString): - """ - Simulates the event that occurs when the user releases the mouse button (i.e., stops - holding the button down) at the specified location. - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("mouseUpAt", [locator,coordString,]) - - - def mouse_up_right_at(self,locator,coordString): - """ - Simulates the event that occurs when the user releases the right mouse button (i.e., stops - holding the button down) at the specified location. - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("mouseUpRightAt", [locator,coordString,]) - - - def mouse_move(self,locator): - """ - Simulates a user pressing the mouse button (without releasing it yet) on - the specified element. - - 'locator' is an element locator - """ - self.do_command("mouseMove", [locator,]) - - - def mouse_move_at(self,locator,coordString): - """ - Simulates a user pressing the mouse button (without releasing it yet) on - the specified element. - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("mouseMoveAt", [locator,coordString,]) - - - def type(self,locator,value): - """ - Sets the value of an input field, as though you typed it in. - - - Can also be used to set the value of combo boxes, check boxes, etc. In these cases, - value should be the value of the option selected, not the visible text. - - - 'locator' is an element locator - 'value' is the value to type - """ - self.do_command("type", [locator,value,]) - - - def type_keys(self,locator,value): - """ - Simulates keystroke events on the specified element, as though you typed the value key-by-key. - - - This is a convenience method for calling keyDown, keyUp, keyPress for every character in the specified string; - this is useful for dynamic UI widgets (like auto-completing combo boxes) that require explicit key events. - - Unlike the simple "type" command, which forces the specified value into the page directly, this command - may or may not have any visible effect, even in cases where typing keys would normally have a visible effect. - For example, if you use "typeKeys" on a form element, you may or may not see the results of what you typed in - the field. - - In some cases, you may need to use the simple "type" command to set the value of the field and then the "typeKeys" command to - send the keystroke events corresponding to what you just typed. - - - 'locator' is an element locator - 'value' is the value to type - """ - self.do_command("typeKeys", [locator,value,]) - - - def set_speed(self,value): - """ - Set execution speed (i.e., set the millisecond length of a delay which will follow each selenium operation). By default, there is no such delay, i.e., - the delay is 0 milliseconds. - - 'value' is the number of milliseconds to pause after operation - """ - self.do_command("setSpeed", [value,]) - - - def get_speed(self): - """ - Get execution speed (i.e., get the millisecond length of the delay following each selenium operation). By default, there is no such delay, i.e., - the delay is 0 milliseconds. - - See also setSpeed. - - """ - return self.get_string("getSpeed", []) - - def get_log(self): - """ - Get RC logs associated with current session. - - """ - return self.get_string("getLog", []) - - - def check(self,locator): - """ - Check a toggle-button (checkbox/radio) - - 'locator' is an element locator - """ - self.do_command("check", [locator,]) - - - def uncheck(self,locator): - """ - Uncheck a toggle-button (checkbox/radio) - - 'locator' is an element locator - """ - self.do_command("uncheck", [locator,]) - - - def select(self,selectLocator,optionLocator): - """ - Select an option from a drop-down using an option locator. - - - - Option locators provide different ways of specifying options of an HTML - Select element (e.g. for selecting a specific option, or for asserting - that the selected option satisfies a specification). There are several - forms of Select Option Locator. - - - * \ **label**\ =\ *labelPattern*: - matches options based on their labels, i.e. the visible text. (This - is the default.) - - * label=regexp:^[Oo]ther - - - * \ **value**\ =\ *valuePattern*: - matches options based on their values. - - * value=other - - - * \ **id**\ =\ *id*: - - matches options based on their ids. - - * id=option1 - - - * \ **index**\ =\ *index*: - matches an option based on its index (offset from zero). - - * index=2 - - - - - - If no option locator prefix is provided, the default behaviour is to match on \ **label**\ . - - - - 'selectLocator' is an element locator identifying a drop-down menu - 'optionLocator' is an option locator (a label by default) - """ - self.do_command("select", [selectLocator,optionLocator,]) - - - def add_selection(self,locator,optionLocator): - """ - Add a selection to the set of selected options in a multi-select element using an option locator. - - @see #doSelect for details of option locators - - 'locator' is an element locator identifying a multi-select box - 'optionLocator' is an option locator (a label by default) - """ - self.do_command("addSelection", [locator,optionLocator,]) - - - def remove_selection(self,locator,optionLocator): - """ - Remove a selection from the set of selected options in a multi-select element using an option locator. - - @see #doSelect for details of option locators - - 'locator' is an element locator identifying a multi-select box - 'optionLocator' is an option locator (a label by default) - """ - self.do_command("removeSelection", [locator,optionLocator,]) - - - def remove_all_selections(self,locator): - """ - Unselects all of the selected options in a multi-select element. - - 'locator' is an element locator identifying a multi-select box - """ - self.do_command("removeAllSelections", [locator,]) - - - def submit(self,formLocator): - """ - Submit the specified form. This is particularly useful for forms without - submit buttons, e.g. single-input "Search" forms. - - 'formLocator' is an element locator for the form you want to submit - """ - self.do_command("submit", [formLocator,]) - - def open(self,url,ignoreResponseCode=True): - """ - Opens an URL in the test frame. This accepts both relative and absolute - URLs. - - The "open" command waits for the page to load before proceeding, - ie. the "AndWait" suffix is implicit. - - \ *Note*: The URL must be on the same domain as the runner HTML - due to security restrictions in the browser (Same Origin Policy). If you - need to open an URL on another domain, use the Selenium Server to start a - new browser session on that domain. - - 'url' is the URL to open; may be relative or absolute - 'ignoreResponseCode' if set to true: doesnt send ajax HEAD/GET request; if set to false: sends ajax HEAD/GET request to the url and reports error code if any as response to open. - """ - self.do_command("open", [url,ignoreResponseCode]) - - - def open_window(self,url,windowID): - """ - Opens a popup window (if a window with that ID isn't already open). - After opening the window, you'll need to select it using the selectWindow - command. - - - This command can also be a useful workaround for bug SEL-339. In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). - In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using - an empty (blank) url, like this: openWindow("", "myFunnyWindow"). - - - 'url' is the URL to open, which can be blank - 'windowID' is the JavaScript window ID of the window to select - """ - self.do_command("openWindow", [url,windowID,]) - - - def select_window(self,windowID): - """ - Selects a popup window using a window locator; once a popup window has been selected, all - commands go to that window. To select the main window again, use null - as the target. - - - - - Window locators provide different ways of specifying the window object: - by title, by internal JavaScript "name," or by JavaScript variable. - - - * \ **title**\ =\ *My Special Window*: - Finds the window using the text that appears in the title bar. Be careful; - two windows can share the same title. If that happens, this locator will - just pick one. - - * \ **name**\ =\ *myWindow*: - Finds the window using its internal JavaScript "name" property. This is the second - parameter "windowName" passed to the JavaScript method window.open(url, windowName, windowFeatures, replaceFlag) - (which Selenium intercepts). - - * \ **var**\ =\ *variableName*: - Some pop-up windows are unnamed (anonymous), but are associated with a JavaScript variable name in the current - application window, e.g. "window.foo = window.open(url);". In those cases, you can open the window using - "var=foo". - - - - - If no window locator prefix is provided, we'll try to guess what you mean like this: - - 1.) if windowID is null, (or the string "null") then it is assumed the user is referring to the original window instantiated by the browser). - - 2.) if the value of the "windowID" parameter is a JavaScript variable name in the current application window, then it is assumed - that this variable contains the return value from a call to the JavaScript window.open() method. - - 3.) Otherwise, selenium looks in a hash it maintains that maps string names to window "names". - - 4.) If \ *that* fails, we'll try looping over all of the known windows to try to find the appropriate "title". - Since "title" is not necessarily unique, this may have unexpected behavior. - - If you're having trouble figuring out the name of a window that you want to manipulate, look at the Selenium log messages - which identify the names of windows created via window.open (and therefore intercepted by Selenium). You will see messages - like the following for each window as it is opened: - - ``debug: window.open call intercepted; window ID (which you can use with selectWindow()) is "myNewWindow"`` - - In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). - (This is bug SEL-339.) In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using - an empty (blank) url, like this: openWindow("", "myFunnyWindow"). - - - 'windowID' is the JavaScript window ID of the window to select - """ - self.do_command("selectWindow", [windowID,]) - - - def select_pop_up(self,windowID): - """ - Simplifies the process of selecting a popup window (and does not offer - functionality beyond what ``selectWindow()`` already provides). - - * If ``windowID`` is either not specified, or specified as - "null", the first non-top window is selected. The top window is the one - that would be selected by ``selectWindow()`` without providing a - ``windowID`` . This should not be used when more than one popup - window is in play. - * Otherwise, the window will be looked up considering - ``windowID`` as the following in order: 1) the "name" of the - window, as specified to ``window.open()``; 2) a javascript - variable which is a reference to a window; and 3) the title of the - window. This is the same ordered lookup performed by - ``selectWindow`` . - - - - 'windowID' is an identifier for the popup window, which can take on a number of different meanings - """ - self.do_command("selectPopUp", [windowID,]) - - - def deselect_pop_up(self): - """ - Selects the main window. Functionally equivalent to using - ``selectWindow()`` and specifying no value for - ``windowID``. - - """ - self.do_command("deselectPopUp", []) - - - def select_frame(self,locator): - """ - Selects a frame within the current window. (You may invoke this command - multiple times to select nested frames.) To select the parent frame, use - "relative=parent" as a locator; to select the top frame, use "relative=top". - You can also select a frame by its 0-based index number; select the first frame with - "index=0", or the third frame with "index=2". - - - You may also use a DOM expression to identify the frame you want directly, - like this: ``dom=frames["main"].frames["subframe"]`` - - - 'locator' is an element locator identifying a frame or iframe - """ - self.do_command("selectFrame", [locator,]) - - - def get_whether_this_frame_match_frame_expression(self,currentFrameString,target): - """ - Determine whether current/locator identify the frame containing this running code. - - - This is useful in proxy injection mode, where this code runs in every - browser frame and window, and sometimes the selenium server needs to identify - the "current" frame. In this case, when the test calls selectFrame, this - routine is called for each frame to figure out which one has been selected. - The selected frame will return true, while all others will return false. - - - 'currentFrameString' is starting frame - 'target' is new frame (which might be relative to the current one) - """ - return self.get_boolean("getWhetherThisFrameMatchFrameExpression", [currentFrameString,target,]) - - - def get_whether_this_window_match_window_expression(self,currentWindowString,target): - """ - Determine whether currentWindowString plus target identify the window containing this running code. - - - This is useful in proxy injection mode, where this code runs in every - browser frame and window, and sometimes the selenium server needs to identify - the "current" window. In this case, when the test calls selectWindow, this - routine is called for each window to figure out which one has been selected. - The selected window will return true, while all others will return false. - - - 'currentWindowString' is starting window - 'target' is new window (which might be relative to the current one, e.g., "_parent") - """ - return self.get_boolean("getWhetherThisWindowMatchWindowExpression", [currentWindowString,target,]) - - - def wait_for_pop_up(self,windowID,timeout): - """ - Waits for a popup window to appear and load up. - - 'windowID' is the JavaScript window "name" of the window that will appear (not the text of the title bar) If unspecified, or specified as "null", this command will wait for the first non-top window to appear (don't rely on this if you are working with multiple popups simultaneously). - 'timeout' is a timeout in milliseconds, after which the action will return with an error. If this value is not specified, the default Selenium timeout will be used. See the setTimeout() command. - """ - self.do_command("waitForPopUp", [windowID,timeout,]) - - - def choose_cancel_on_next_confirmation(self): - """ - - - By default, Selenium's overridden window.confirm() function will - return true, as if the user had manually clicked OK; after running - this command, the next call to confirm() will return false, as if - the user had clicked Cancel. Selenium will then resume using the - default behavior for future confirmations, automatically returning - true (OK) unless/until you explicitly call this command for each - confirmation. - - - - Take note - every time a confirmation comes up, you must - consume it with a corresponding getConfirmation, or else - the next selenium operation will fail. - - - - """ - self.do_command("chooseCancelOnNextConfirmation", []) - - - def choose_ok_on_next_confirmation(self): - """ - - - Undo the effect of calling chooseCancelOnNextConfirmation. Note - that Selenium's overridden window.confirm() function will normally automatically - return true, as if the user had manually clicked OK, so you shouldn't - need to use this command unless for some reason you need to change - your mind prior to the next confirmation. After any confirmation, Selenium will resume using the - default behavior for future confirmations, automatically returning - true (OK) unless/until you explicitly call chooseCancelOnNextConfirmation for each - confirmation. - - - - Take note - every time a confirmation comes up, you must - consume it with a corresponding getConfirmation, or else - the next selenium operation will fail. - - - - """ - self.do_command("chooseOkOnNextConfirmation", []) - - - def answer_on_next_prompt(self,answer): - """ - Instructs Selenium to return the specified answer string in response to - the next JavaScript prompt [window.prompt()]. - - 'answer' is the answer to give in response to the prompt pop-up - """ - self.do_command("answerOnNextPrompt", [answer,]) - - - def go_back(self): - """ - Simulates the user clicking the "back" button on their browser. - - """ - self.do_command("goBack", []) - - - def refresh(self): - """ - Simulates the user clicking the "Refresh" button on their browser. - - """ - self.do_command("refresh", []) - - - def close(self): - """ - Simulates the user clicking the "close" button in the titlebar of a popup - window or tab. - - """ - self.do_command("close", []) - - - def is_alert_present(self): - """ - Has an alert occurred? - - - - This function never throws an exception - - - - """ - return self.get_boolean("isAlertPresent", []) - - - def is_prompt_present(self): - """ - Has a prompt occurred? - - - - This function never throws an exception - - - - """ - return self.get_boolean("isPromptPresent", []) - - - def is_confirmation_present(self): - """ - Has confirm() been called? - - - - This function never throws an exception - - - - """ - return self.get_boolean("isConfirmationPresent", []) - - - def get_alert(self): - """ - Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts. - - - Getting an alert has the same effect as manually clicking OK. If an - alert is generated but you do not consume it with getAlert, the next Selenium action - will fail. - - Under Selenium, JavaScript alerts will NOT pop up a visible alert - dialog. - - Selenium does NOT support JavaScript alerts that are generated in a - page's onload() event handler. In this case a visible dialog WILL be - generated and Selenium will hang until someone manually clicks OK. - - - """ - return self.get_string("getAlert", []) - - - def get_confirmation(self): - """ - Retrieves the message of a JavaScript confirmation dialog generated during - the previous action. - - - - By default, the confirm function will return true, having the same effect - as manually clicking OK. This can be changed by prior execution of the - chooseCancelOnNextConfirmation command. - - - - If an confirmation is generated but you do not consume it with getConfirmation, - the next Selenium action will fail. - - - - NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible - dialog. - - - - NOTE: Selenium does NOT support JavaScript confirmations that are - generated in a page's onload() event handler. In this case a visible - dialog WILL be generated and Selenium will hang until you manually click - OK. - - - - """ - return self.get_string("getConfirmation", []) - - - def get_prompt(self): - """ - Retrieves the message of a JavaScript question prompt dialog generated during - the previous action. - - - Successful handling of the prompt requires prior execution of the - answerOnNextPrompt command. If a prompt is generated but you - do not get/verify it, the next Selenium action will fail. - - NOTE: under Selenium, JavaScript prompts will NOT pop up a visible - dialog. - - NOTE: Selenium does NOT support JavaScript prompts that are generated in a - page's onload() event handler. In this case a visible dialog WILL be - generated and Selenium will hang until someone manually clicks OK. - - - """ - return self.get_string("getPrompt", []) - - - def get_location(self): - """ - Gets the absolute URL of the current page. - - """ - return self.get_string("getLocation", []) - - - def get_title(self): - """ - Gets the title of the current page. - - """ - return self.get_string("getTitle", []) - - - def get_body_text(self): - """ - Gets the entire text of the page. - - """ - return self.get_string("getBodyText", []) - - - def get_value(self,locator): - """ - Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter). - For checkbox/radio elements, the value will be "on" or "off" depending on - whether the element is checked or not. - - 'locator' is an element locator - """ - return self.get_string("getValue", [locator,]) - - - def get_text(self,locator): - """ - Gets the text of an element. This works for any element that contains - text. This command uses either the textContent (Mozilla-like browsers) or - the innerText (IE-like browsers) of the element, which is the rendered - text shown to the user. - - 'locator' is an element locator - """ - return self.get_string("getText", [locator,]) - - - def highlight(self,locator): - """ - Briefly changes the backgroundColor of the specified element yellow. Useful for debugging. - - 'locator' is an element locator - """ - self.do_command("highlight", [locator,]) - - - def get_eval(self,script): - """ - Gets the result of evaluating the specified JavaScript snippet. The snippet may - have multiple lines, but only the result of the last line will be returned. - - - Note that, by default, the snippet will run in the context of the "selenium" - object itself, so ``this`` will refer to the Selenium object. Use ``window`` to - refer to the window of your application, e.g. ``window.document.getElementById('foo')`` - - If you need to use - a locator to refer to a single element in your application page, you can - use ``this.browserbot.findElement("id=foo")`` where "id=foo" is your locator. - - - 'script' is the JavaScript snippet to run - """ - return self.get_string("getEval", [script,]) - - - def is_checked(self,locator): - """ - Gets whether a toggle-button (checkbox/radio) is checked. Fails if the specified element doesn't exist or isn't a toggle-button. - - 'locator' is an element locator pointing to a checkbox or radio button - """ - return self.get_boolean("isChecked", [locator,]) - - - def get_table(self,tableCellAddress): - """ - Gets the text from a cell of a table. The cellAddress syntax - tableLocator.row.column, where row and column start at 0. - - 'tableCellAddress' is a cell address, e.g. "foo.1.4" - """ - return self.get_string("getTable", [tableCellAddress,]) - - - def get_selected_labels(self,selectLocator): - """ - Gets all option labels (visible text) for selected options in the specified select or multi-select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string_array("getSelectedLabels", [selectLocator,]) - - - def get_selected_label(self,selectLocator): - """ - Gets option label (visible text) for selected option in the specified select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string("getSelectedLabel", [selectLocator,]) - - - def get_selected_values(self,selectLocator): - """ - Gets all option values (value attributes) for selected options in the specified select or multi-select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string_array("getSelectedValues", [selectLocator,]) - - - def get_selected_value(self,selectLocator): - """ - Gets option value (value attribute) for selected option in the specified select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string("getSelectedValue", [selectLocator,]) - - - def get_selected_indexes(self,selectLocator): - """ - Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string_array("getSelectedIndexes", [selectLocator,]) - - - def get_selected_index(self,selectLocator): - """ - Gets option index (option number, starting at 0) for selected option in the specified select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string("getSelectedIndex", [selectLocator,]) - - - def get_selected_ids(self,selectLocator): - """ - Gets all option element IDs for selected options in the specified select or multi-select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string_array("getSelectedIds", [selectLocator,]) - - - def get_selected_id(self,selectLocator): - """ - Gets option element ID for selected option in the specified select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string("getSelectedId", [selectLocator,]) - - - def is_something_selected(self,selectLocator): - """ - Determines whether some option in a drop-down menu is selected. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_boolean("isSomethingSelected", [selectLocator,]) - - - def get_select_options(self,selectLocator): - """ - Gets all option labels in the specified select drop-down. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string_array("getSelectOptions", [selectLocator,]) - - - def get_attribute(self,attributeLocator): - """ - Gets the value of an element attribute. The value of the attribute may - differ across browsers (this is the case for the "style" attribute, for - example). - - 'attributeLocator' is an element locator followed by an @ sign and then the name of the attribute, e.g. "foo@bar" - """ - return self.get_string("getAttribute", [attributeLocator,]) - - - def is_text_present(self,pattern): - """ - Verifies that the specified text pattern appears somewhere on the rendered page shown to the user. - - 'pattern' is a pattern to match with the text of the page - """ - return self.get_boolean("isTextPresent", [pattern,]) - - - def is_element_present(self,locator): - """ - Verifies that the specified element is somewhere on the page. - - 'locator' is an element locator - """ - return self.get_boolean("isElementPresent", [locator,]) - - - def is_visible(self,locator): - """ - Determines if the specified element is visible. An - element can be rendered invisible by setting the CSS "visibility" - property to "hidden", or the "display" property to "none", either for the - element itself or one if its ancestors. This method will fail if - the element is not present. - - 'locator' is an element locator - """ - return self.get_boolean("isVisible", [locator,]) - - - def is_editable(self,locator): - """ - Determines whether the specified input element is editable, ie hasn't been disabled. - This method will fail if the specified element isn't an input element. - - 'locator' is an element locator - """ - return self.get_boolean("isEditable", [locator,]) - - - def get_all_buttons(self): - """ - Returns the IDs of all buttons on the page. - - - If a given button has no ID, it will appear as "" in this array. - - - """ - return self.get_string_array("getAllButtons", []) - - - def get_all_links(self): - """ - Returns the IDs of all links on the page. - - - If a given link has no ID, it will appear as "" in this array. - - - """ - return self.get_string_array("getAllLinks", []) - - - def get_all_fields(self): - """ - Returns the IDs of all input fields on the page. - - - If a given field has no ID, it will appear as "" in this array. - - - """ - return self.get_string_array("getAllFields", []) - - - def get_attribute_from_all_windows(self,attributeName): - """ - Returns every instance of some attribute from all known windows. - - 'attributeName' is name of an attribute on the windows - """ - return self.get_string_array("getAttributeFromAllWindows", [attributeName,]) - - - def dragdrop(self,locator,movementsString): - """ - deprecated - use dragAndDrop instead - - 'locator' is an element locator - 'movementsString' is offset in pixels from the current location to which the element should be moved, e.g., "+70,-300" - """ - self.do_command("dragdrop", [locator,movementsString,]) - - - def set_mouse_speed(self,pixels): - """ - Configure the number of pixels between "mousemove" events during dragAndDrop commands (default=10). - - Setting this value to 0 means that we'll send a "mousemove" event to every single pixel - in between the start location and the end location; that can be very slow, and may - cause some browsers to force the JavaScript to timeout. - - If the mouse speed is greater than the distance between the two dragged objects, we'll - just send one "mousemove" at the start location and then one final one at the end location. - - - 'pixels' is the number of pixels between "mousemove" events - """ - self.do_command("setMouseSpeed", [pixels,]) - - - def get_mouse_speed(self): - """ - Returns the number of pixels between "mousemove" events during dragAndDrop commands (default=10). - - """ - return self.get_number("getMouseSpeed", []) - - - def drag_and_drop(self,locator,movementsString): - """ - Drags an element a certain distance and then drops it - - 'locator' is an element locator - 'movementsString' is offset in pixels from the current location to which the element should be moved, e.g., "+70,-300" - """ - self.do_command("dragAndDrop", [locator,movementsString,]) - - - def drag_and_drop_to_object(self,locatorOfObjectToBeDragged,locatorOfDragDestinationObject): - """ - Drags an element and drops it on another element - - 'locatorOfObjectToBeDragged' is an element to be dragged - 'locatorOfDragDestinationObject' is an element whose location (i.e., whose center-most pixel) will be the point where locatorOfObjectToBeDragged is dropped - """ - self.do_command("dragAndDropToObject", [locatorOfObjectToBeDragged,locatorOfDragDestinationObject,]) - - - def window_focus(self): - """ - Gives focus to the currently selected window - - """ - self.do_command("windowFocus", []) - - - def window_maximize(self): - """ - Resize currently selected window to take up the entire screen - - """ - self.do_command("windowMaximize", []) - - - def get_all_window_ids(self): - """ - Returns the IDs of all windows that the browser knows about. - - """ - return self.get_string_array("getAllWindowIds", []) - - - def get_all_window_names(self): - """ - Returns the names of all windows that the browser knows about. - - """ - return self.get_string_array("getAllWindowNames", []) - - - def get_all_window_titles(self): - """ - Returns the titles of all windows that the browser knows about. - - """ - return self.get_string_array("getAllWindowTitles", []) - - - def get_html_source(self): - """ - Returns the entire HTML source between the opening and - closing "html" tags. - - """ - return self.get_string("getHtmlSource", []) - - - def set_cursor_position(self,locator,position): - """ - Moves the text cursor to the specified position in the given input element or textarea. - This method will fail if the specified element isn't an input element or textarea. - - 'locator' is an element locator pointing to an input element or textarea - 'position' is the numerical position of the cursor in the field; position should be 0 to move the position to the beginning of the field. You can also set the cursor to -1 to move it to the end of the field. - """ - self.do_command("setCursorPosition", [locator,position,]) - - - def get_element_index(self,locator): - """ - Get the relative index of an element to its parent (starting from 0). The comment node and empty text node - will be ignored. - - 'locator' is an element locator pointing to an element - """ - return self.get_number("getElementIndex", [locator,]) - - - def is_ordered(self,locator1,locator2): - """ - Check if these two elements have same parent and are ordered siblings in the DOM. Two same elements will - not be considered ordered. - - 'locator1' is an element locator pointing to the first element - 'locator2' is an element locator pointing to the second element - """ - return self.get_boolean("isOrdered", [locator1,locator2,]) - - - def get_element_position_left(self,locator): - """ - Retrieves the horizontal position of an element - - 'locator' is an element locator pointing to an element OR an element itself - """ - return self.get_number("getElementPositionLeft", [locator,]) - - - def get_element_position_top(self,locator): - """ - Retrieves the vertical position of an element - - 'locator' is an element locator pointing to an element OR an element itself - """ - return self.get_number("getElementPositionTop", [locator,]) - - - def get_element_width(self,locator): - """ - Retrieves the width of an element - - 'locator' is an element locator pointing to an element - """ - return self.get_number("getElementWidth", [locator,]) - - - def get_element_height(self,locator): - """ - Retrieves the height of an element - - 'locator' is an element locator pointing to an element - """ - return self.get_number("getElementHeight", [locator,]) - - - def get_cursor_position(self,locator): - """ - Retrieves the text cursor position in the given input element or textarea; beware, this may not work perfectly on all browsers. - - - Specifically, if the cursor/selection has been cleared by JavaScript, this command will tend to - return the position of the last location of the cursor, even though the cursor is now gone from the page. This is filed as SEL-243. - - This method will fail if the specified element isn't an input element or textarea, or there is no cursor in the element. - - 'locator' is an element locator pointing to an input element or textarea - """ - return self.get_number("getCursorPosition", [locator,]) - - - def get_expression(self,expression): - """ - Returns the specified expression. - - - This is useful because of JavaScript preprocessing. - It is used to generate commands like assertExpression and waitForExpression. - - - 'expression' is the value to return - """ - return self.get_string("getExpression", [expression,]) - - - def get_xpath_count(self,xpath): - """ - Returns the number of nodes that match the specified xpath, eg. "//table" would give - the number of tables. - - 'xpath' is the xpath expression to evaluate. do NOT wrap this expression in a 'count()' function; we will do that for you. - """ - return self.get_number("getXpathCount", [xpath,]) - - def get_css_count(self,css): - """ - Returns the number of nodes that match the specified css selector, eg. "css=table" would give - the number of tables. - - 'css' is the css selector to evaluate. do NOT wrap this expression in a 'count()' function; we will do that for you. - """ - return self.get_number("getCssCount", [css,]) - - def assign_id(self,locator,identifier): - """ - Temporarily sets the "id" attribute of the specified element, so you can locate it in the future - using its ID rather than a slow/complicated XPath. This ID will disappear once the page is - reloaded. - - 'locator' is an element locator pointing to an element - 'identifier' is a string to be used as the ID of the specified element - """ - self.do_command("assignId", [locator,identifier,]) - - - def allow_native_xpath(self,allow): - """ - Specifies whether Selenium should use the native in-browser implementation - of XPath (if any native version is available); if you pass "false" to - this function, we will always use our pure-JavaScript xpath library. - Using the pure-JS xpath library can improve the consistency of xpath - element locators between different browser vendors, but the pure-JS - version is much slower than the native implementations. - - 'allow' is boolean, true means we'll prefer to use native XPath; false means we'll only use JS XPath - """ - self.do_command("allowNativeXpath", [allow,]) - - - def ignore_attributes_without_value(self,ignore): - """ - Specifies whether Selenium will ignore xpath attributes that have no - value, i.e. are the empty string, when using the non-native xpath - evaluation engine. You'd want to do this for performance reasons in IE. - However, this could break certain xpaths, for example an xpath that looks - for an attribute whose value is NOT the empty string. - - The hope is that such xpaths are relatively rare, but the user should - have the option of using them. Note that this only influences xpath - evaluation when using the ajaxslt engine (i.e. not "javascript-xpath"). - - 'ignore' is boolean, true means we'll ignore attributes without value at the expense of xpath "correctness"; false means we'll sacrifice speed for correctness. - """ - self.do_command("ignoreAttributesWithoutValue", [ignore,]) - - - def wait_for_condition(self,script,timeout): - """ - Runs the specified JavaScript snippet repeatedly until it evaluates to "true". - The snippet may have multiple lines, but only the result of the last line - will be considered. - - - Note that, by default, the snippet will be run in the runner's test window, not in the window - of your application. To get the window of your application, you can use - the JavaScript snippet ``selenium.browserbot.getCurrentWindow()``, and then - run your JavaScript in there - - - 'script' is the JavaScript snippet to run - 'timeout' is a timeout in milliseconds, after which this command will return with an error - """ - self.do_command("waitForCondition", [script,timeout,]) - - - def set_timeout(self,timeout): - """ - Specifies the amount of time that Selenium will wait for actions to complete. - - - Actions that require waiting include "open" and the "waitFor\*" actions. - - The default timeout is 30 seconds. - - 'timeout' is a timeout in milliseconds, after which the action will return with an error - """ - self.do_command("setTimeout", [timeout,]) - - - def wait_for_page_to_load(self,timeout): - """ - Waits for a new page to load. - - - You can use this command instead of the "AndWait" suffixes, "clickAndWait", "selectAndWait", "typeAndWait" etc. - (which are only available in the JS API). - - Selenium constantly keeps track of new pages loading, and sets a "newPageLoaded" - flag when it first notices a page load. Running any other Selenium command after - turns the flag to false. Hence, if you want to wait for a page to load, you must - wait immediately after a Selenium command that caused a page-load. - - - 'timeout' is a timeout in milliseconds, after which this command will return with an error - """ - self.do_command("waitForPageToLoad", [timeout,]) - - - def wait_for_frame_to_load(self,frameAddress,timeout): - """ - Waits for a new frame to load. - - - Selenium constantly keeps track of new pages and frames loading, - and sets a "newPageLoaded" flag when it first notices a page load. - - - See waitForPageToLoad for more information. - - 'frameAddress' is FrameAddress from the server side - 'timeout' is a timeout in milliseconds, after which this command will return with an error - """ - self.do_command("waitForFrameToLoad", [frameAddress,timeout,]) - - - def get_cookie(self): - """ - Return all cookies of the current page under test. - - """ - return self.get_string("getCookie", []) - - - def get_cookie_by_name(self,name): - """ - Returns the value of the cookie with the specified name, or throws an error if the cookie is not present. - - 'name' is the name of the cookie - """ - return self.get_string("getCookieByName", [name,]) - - - def is_cookie_present(self,name): - """ - Returns true if a cookie with the specified name is present, or false otherwise. - - 'name' is the name of the cookie - """ - return self.get_boolean("isCookiePresent", [name,]) - - - def create_cookie(self,nameValuePair,optionsString): - """ - Create a new cookie whose path and domain are same with those of current page - under test, unless you specified a path for this cookie explicitly. - - 'nameValuePair' is name and value of the cookie in a format "name=value" - 'optionsString' is options for the cookie. Currently supported options include 'path', 'max_age' and 'domain'. the optionsString's format is "path=/path/, max_age=60, domain=.foo.com". The order of options are irrelevant, the unit of the value of 'max_age' is second. Note that specifying a domain that isn't a subset of the current domain will usually fail. - """ - self.do_command("createCookie", [nameValuePair,optionsString,]) - - - def delete_cookie(self,name,optionsString): - """ - Delete a named cookie with specified path and domain. Be careful; to delete a cookie, you - need to delete it using the exact same path and domain that were used to create the cookie. - If the path is wrong, or the domain is wrong, the cookie simply won't be deleted. Also - note that specifying a domain that isn't a subset of the current domain will usually fail. - - Since there's no way to discover at runtime the original path and domain of a given cookie, - we've added an option called 'recurse' to try all sub-domains of the current domain with - all paths that are a subset of the current path. Beware; this option can be slow. In - big-O notation, it operates in O(n\*m) time, where n is the number of dots in the domain - name and m is the number of slashes in the path. - - 'name' is the name of the cookie to be deleted - 'optionsString' is options for the cookie. Currently supported options include 'path', 'domain' and 'recurse.' The optionsString's format is "path=/path/, domain=.foo.com, recurse=true". The order of options are irrelevant. Note that specifying a domain that isn't a subset of the current domain will usually fail. - """ - self.do_command("deleteCookie", [name,optionsString,]) - - - def delete_all_visible_cookies(self): - """ - Calls deleteCookie with recurse=true on all cookies visible to the current page. - As noted on the documentation for deleteCookie, recurse=true can be much slower - than simply deleting the cookies using a known domain/path. - - """ - self.do_command("deleteAllVisibleCookies", []) - - - def set_browser_log_level(self,logLevel): - """ - Sets the threshold for browser-side logging messages; log messages beneath this threshold will be discarded. - Valid logLevel strings are: "debug", "info", "warn", "error" or "off". - To see the browser logs, you need to - either show the log window in GUI mode, or enable browser-side logging in Selenium RC. - - 'logLevel' is one of the following: "debug", "info", "warn", "error" or "off" - """ - self.do_command("setBrowserLogLevel", [logLevel,]) - - - def run_script(self,script): - """ - Creates a new "script" tag in the body of the current test window, and - adds the specified text into the body of the command. Scripts run in - this way can often be debugged more easily than scripts executed using - Selenium's "getEval" command. Beware that JS exceptions thrown in these script - tags aren't managed by Selenium, so you should probably wrap your script - in try/catch blocks if there is any chance that the script will throw - an exception. - - 'script' is the JavaScript snippet to run - """ - self.do_command("runScript", [script,]) - - - def add_location_strategy(self,strategyName,functionDefinition): - """ - Defines a new function for Selenium to locate elements on the page. - For example, - if you define the strategy "foo", and someone runs click("foo=blah"), we'll - run your function, passing you the string "blah", and click on the element - that your function - returns, or throw an "Element not found" error if your function returns null. - - We'll pass three arguments to your function: - - * locator: the string the user passed in - * inWindow: the currently selected window - * inDocument: the currently selected document - - - The function must return null if the element can't be found. - - 'strategyName' is the name of the strategy to define; this should use only letters [a-zA-Z] with no spaces or other punctuation. - 'functionDefinition' is a string defining the body of a function in JavaScript. For example: ``return inDocument.getElementById(locator);`` - """ - self.do_command("addLocationStrategy", [strategyName,functionDefinition,]) - - - def capture_entire_page_screenshot(self,filename,kwargs): - """ - Saves the entire contents of the current window canvas to a PNG file. - Contrast this with the captureScreenshot command, which captures the - contents of the OS viewport (i.e. whatever is currently being displayed - on the monitor), and is implemented in the RC only. Currently this only - works in Firefox when running in chrome mode, and in IE non-HTA using - the EXPERIMENTAL "Snapsie" utility. The Firefox implementation is mostly - borrowed from the Screengrab! Firefox extension. Please see - http://www.screengrab.org and http://snapsie.sourceforge.net/ for - details. - - 'filename' is the path to the file to persist the screenshot as. No filename extension will be appended by default. Directories will not be created if they do not exist, and an exception will be thrown, possibly by native code. - 'kwargs' is a kwargs string that modifies the way the screenshot is captured. Example: "background=#CCFFDD" . Currently valid options: - * background - the background CSS for the HTML document. This may be useful to set for capturing screenshots of less-than-ideal layouts, for example where absolute positioning causes the calculation of the canvas dimension to fail and a black background is exposed (possibly obscuring black text). - - - """ - self.do_command("captureEntirePageScreenshot", [filename,kwargs,]) - - - def rollup(self,rollupName,kwargs): - """ - Executes a command rollup, which is a series of commands with a unique - name, and optionally arguments that control the generation of the set of - commands. If any one of the rolled-up commands fails, the rollup is - considered to have failed. Rollups may also contain nested rollups. - - 'rollupName' is the name of the rollup command - 'kwargs' is keyword arguments string that influences how the rollup expands into commands - """ - self.do_command("rollup", [rollupName,kwargs,]) - - - def add_script(self,scriptContent,scriptTagId): - """ - Loads script content into a new script tag in the Selenium document. This - differs from the runScript command in that runScript adds the script tag - to the document of the AUT, not the Selenium document. The following - entities in the script content are replaced by the characters they - represent: - - < - > - & - - The corresponding remove command is removeScript. - - 'scriptContent' is the Javascript content of the script to add - 'scriptTagId' is (optional) the id of the new script tag. If specified, and an element with this id already exists, this operation will fail. - """ - self.do_command("addScript", [scriptContent,scriptTagId,]) - - - def remove_script(self,scriptTagId): - """ - Removes a script tag from the Selenium document identified by the given - id. Does nothing if the referenced tag doesn't exist. - - 'scriptTagId' is the id of the script element to remove. - """ - self.do_command("removeScript", [scriptTagId,]) - - - def use_xpath_library(self,libraryName): - """ - Allows choice of one of the available libraries. - - 'libraryName' is name of the desired library Only the following three can be chosen: - * "ajaxslt" - Google's library - * "javascript-xpath" - Cybozu Labs' faster library - * "default" - The default library. Currently the default library is "ajaxslt" . - - If libraryName isn't one of these three, then no change will be made. - """ - self.do_command("useXpathLibrary", [libraryName,]) - - - def set_context(self,context): - """ - Writes a message to the status bar and adds a note to the browser-side - log. - - 'context' is the message to be sent to the browser - """ - self.do_command("setContext", [context,]) - - - def attach_file(self,fieldLocator,fileLocator): - """ - Sets a file input (upload) field to the file listed in fileLocator - - 'fieldLocator' is an element locator - 'fileLocator' is a URL pointing to the specified file. Before the file can be set in the input field (fieldLocator), Selenium RC may need to transfer the file to the local machine before attaching the file in a web page form. This is common in selenium grid configurations where the RC server driving the browser is not the same machine that started the test. Supported Browsers: Firefox ("\*chrome") only. - """ - self.do_command("attachFile", [fieldLocator,fileLocator,]) - - - def capture_screenshot(self,filename): - """ - Captures a PNG screenshot to the specified file. - - 'filename' is the absolute path to the file to be written, e.g. "c:\blah\screenshot.png" - """ - self.do_command("captureScreenshot", [filename,]) - - - def capture_screenshot_to_string(self): - """ - Capture a PNG screenshot. It then returns the file as a base 64 encoded string. - - """ - return self.get_string("captureScreenshotToString", []) - - - def captureNetworkTraffic(self, type): - """ - Returns the network traffic seen by the browser, including headers, AJAX requests, status codes, and timings. When this function is called, the traffic log is cleared, so the returned content is only the traffic seen since the last call. - - 'type' is The type of data to return the network traffic as. Valid values are: json, xml, or plain. - """ - return self.get_string("captureNetworkTraffic", [type,]) - - def capture_network_traffic(self, type): - return self.captureNetworkTraffic(type) - - def addCustomRequestHeader(self, key, value): - """ - Tells the Selenium server to add the specificed key and value as a custom outgoing request header. This only works if the browser is configured to use the built in Selenium proxy. - - 'key' the header name. - 'value' the header value. - """ - return self.do_command("addCustomRequestHeader", [key,value,]) - - def add_custom_request_header(self, key, value): - return self.addCustomRequestHeader(key, value) - - def capture_entire_page_screenshot_to_string(self,kwargs): - """ - Downloads a screenshot of the browser current window canvas to a - based 64 encoded PNG file. The \ *entire* windows canvas is captured, - including parts rendered outside of the current view port. - - Currently this only works in Mozilla and when running in chrome mode. - - 'kwargs' is A kwargs string that modifies the way the screenshot is captured. Example: "background=#CCFFDD". This may be useful to set for capturing screenshots of less-than-ideal layouts, for example where absolute positioning causes the calculation of the canvas dimension to fail and a black background is exposed (possibly obscuring black text). - """ - return self.get_string("captureEntirePageScreenshotToString", [kwargs,]) - - - def shut_down_selenium_server(self): - """ - Kills the running Selenium Server and all browser sessions. After you run this command, you will no longer be able to send - commands to the server; you can't remotely start the server once it has been stopped. Normally - you should prefer to run the "stop" command, which terminates the current browser session, rather than - shutting down the entire server. - - """ - self.do_command("shutDownSeleniumServer", []) - - - def retrieve_last_remote_control_logs(self): - """ - Retrieve the last messages logged on a specific remote control. Useful for error reports, especially - when running multiple remote controls in a distributed environment. The maximum number of log messages - that can be retrieve is configured on remote control startup. - - """ - return self.get_string("retrieveLastRemoteControlLogs", []) - - - def key_down_native(self,keycode): - """ - Simulates a user pressing a key (without releasing it yet) by sending a native operating system keystroke. - This function uses the java.awt.Robot class to send a keystroke; this more accurately simulates typing - a key on the keyboard. It does not honor settings from the shiftKeyDown, controlKeyDown, altKeyDown and - metaKeyDown commands, and does not target any particular HTML element. To send a keystroke to a particular - element, focus on the element first before running this command. - - 'keycode' is an integer keycode number corresponding to a java.awt.event.KeyEvent; note that Java keycodes are NOT the same thing as JavaScript keycodes! - """ - self.do_command("keyDownNative", [keycode,]) - - - def key_up_native(self,keycode): - """ - Simulates a user releasing a key by sending a native operating system keystroke. - This function uses the java.awt.Robot class to send a keystroke; this more accurately simulates typing - a key on the keyboard. It does not honor settings from the shiftKeyDown, controlKeyDown, altKeyDown and - metaKeyDown commands, and does not target any particular HTML element. To send a keystroke to a particular - element, focus on the element first before running this command. - - 'keycode' is an integer keycode number corresponding to a java.awt.event.KeyEvent; note that Java keycodes are NOT the same thing as JavaScript keycodes! - """ - self.do_command("keyUpNative", [keycode,]) - - - def key_press_native(self,keycode): - """ - Simulates a user pressing and releasing a key by sending a native operating system keystroke. - This function uses the java.awt.Robot class to send a keystroke; this more accurately simulates typing - a key on the keyboard. It does not honor settings from the shiftKeyDown, controlKeyDown, altKeyDown and - metaKeyDown commands, and does not target any particular HTML element. To send a keystroke to a particular - element, focus on the element first before running this command. - - 'keycode' is an integer keycode number corresponding to a java.awt.event.KeyEvent; note that Java keycodes are NOT the same thing as JavaScript keycodes! - """ - self.do_command("keyPressNative", [keycode,]) diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/__init__.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/__init__.py deleted file mode 100644 index 1cb8e4152..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/__init__.py +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/python -# -# Copyright 2008-2010 Webdriver_name committers -# Copyright 2008-2010 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from firefox.webdriver import WebDriver as Firefox -from firefox.firefox_profile import FirefoxProfile -from chrome.webdriver import WebDriver as Chrome -from ie.webdriver import WebDriver as Ie -from remote.webdriver import WebDriver as Remote -from common.desired_capabilities import DesiredCapabilities -from common.action_chains import ActionChains - -__version__ = '2.8.0' diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/chrome/__init__.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/chrome/__init__.py deleted file mode 100644 index 0266e8ae4..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/chrome/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2008-2009 WebDriver committers -# Copyright 2008-2009 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/chrome/service.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/chrome/service.py deleted file mode 100644 index c54dc0370..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/chrome/service.py +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/python -# -# Copyright 2011 Webdriver_name committers -# Copyright 2011 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import subprocess -from subprocess import PIPE -import time -import os -import signal -from selenium.common.exceptions import WebDriverException -from selenium.webdriver.common import utils - -class Service(object): - """ Object that manages the starting and stopping of the ChromeDriver """ - - def __init__(self, executable_path, port=0): - """ Creates a new instance of the Service - Args: - executable_path : Path to the ChromeDriver - port : Port the service is running on """ - - self.port = port - self.path = executable_path - if self.port == 0: - self.port = utils.free_port() - - def start(self): - """ Starts the ChromeDriver Service. - @Exceptions - WebDriverException : Raised either when it can't start the service - or when it can't connect to the service""" - try: - self.process = subprocess.Popen([self.path, "--port=%d" % self.port], - stdout=PIPE, stderr=PIPE) - except: - raise WebDriverException( - "ChromeDriver executable needs to be available in the path. \ - Please download from http://code.google.com/p/selenium/downloads/list\ - and read up at http://code.google.com/p/selenium/wiki/ChromeDriver") - count = 0 - while not utils.is_connectable(self.port): - count += 1 - time.sleep(1) - if count == 30: - raise WebDriverException("Can not connect to the ChromeDriver") - - @property - def service_url(self): - """ Gets the url of the ChromeDriver Service """ - return "http://localhost:%d" % self.port - - def stop(self): - """ Tells the ChromeDriver to stop and cleans up the process """ - #If its dead dont worry - if self.process is None: - return - - #Tell the Server to die! - import urllib2 - urllib2.urlopen("http://127.0.0.1:%d/shutdown" % self.port) - count = 0 - while not utils.is_connectable(self.port): - if count == 30: - break - count += 1 - time.sleep(1) - - #Tell the Server to properly die in case - try: - if self.process: - os.kill(self.process.pid, signal.SIGTERM) - os.wait() - except AttributeError: - # kill may not be available under windows environment - pass diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/chrome/webdriver.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/chrome/webdriver.py deleted file mode 100644 index 47f63e053..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/chrome/webdriver.py +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/python -# -# Copyright 2011 Webdriver_name committers -# Copyright 2011 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import base64 -import httplib -from selenium.webdriver.common.desired_capabilities import DesiredCapabilities -from selenium.webdriver.remote.command import Command -from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver -from service import Service - -class WebDriver(RemoteWebDriver): - """ Controls the ChromeDriver and allows you to drive the browser. - You will need to download the ChromeDriver executable from - http://code.google.com/p/selenium/downloads/list""" - - def __init__(self, executable_path="chromedriver", port=0, - desired_capabilities=DesiredCapabilities.CHROME): - """Creates a new instance of the chrome driver. - - Starts the service and then creates new instance of chrome driver. - - Args: - executable_path : path to the executable. If the default - is used it assumes the executable is in the $PATH - port : port you would like the service to run, if left - as 0, a free port will be found. - desired_capabilities: Dictionary object with desired - capabilities (Can be used to provide various chrome - switches). - """ - self.service = Service(executable_path, port=port) - self.service.start() - - RemoteWebDriver.__init__(self, - command_executor=self.service.service_url, - desired_capabilities=desired_capabilities) - - def quit(self): - """ Closes the browser and shuts down the ChromeDriver executable - that is started when starting the ChromeDriver """ - try: - RemoteWebDriver.quit(self) - except httplib.BadStatusLine: - pass - finally: - self.service.stop() - - def save_screenshot(self, filename): - """ - Gets the screenshot of the current window. Returns False if there is - any IOError, else returns True. Use full paths in your filename. - """ - png = self._execute(Command.SCREENSHOT)['value'] - try: - f = open(filename, 'wb') - f.write(base64.decodestring(png)) - f.close() - except IOError: - return False - finally: - del png - return True diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/__init__.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/__init__.py deleted file mode 100644 index f042f9da3..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2008-2009 WebDriver committers -# Copyright 2008-2009 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/action_chains.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/action_chains.py deleted file mode 100644 index e0d9d2c73..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/action_chains.py +++ /dev/null @@ -1,197 +0,0 @@ -# Copyright 2011 WebDriver committers -# Copyright 2011 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""The ActionChains implementation.""" -from selenium.webdriver.remote.command import Command - -class ActionChains(object): - """Generate user actions. - All actions are stored in the ActionChains object. Call perform() to fire - stored actions.""" - - def __init__(self, driver): - """Creates a new ActionChains. - Args: - driver: The WebDriver instance which performs user actions. - """ - self._driver = driver - self._actions = [] - - def perform(self): - """Performs all stored actions.""" - for action in self._actions: - action() - - def click(self, on_element=None): - """Clicks an element. - Args: - on_element: The element to click. - If None, clicks on current mouse position. - """ - if on_element: self.move_to_element(on_element) - self._actions.append(lambda: - self._driver.execute(Command.CLICK, {'button': 0})) - return self - - def click_and_hold(self, on_element): - """Holds down the left mouse button on an element. - Args: - on_element: The element to mouse down. - If None, clicks on current mouse position. - """ - if on_element: self.move_to_element(on_element) - self._actions.append(lambda: - self._driver.execute(Command.MOUSE_DOWN, {})) - return self - - def context_click(self, on_element): - """Performs a context-click (right click) on an element. - Args: - on_element: The element to context-click. - If None, clicks on current mouse position. - """ - if on_element: self.move_to_element(on_element) - self._actions.append(lambda: - self._driver.execute(Command.CLICK, {'button': 2})) - return self - - def double_click(self, on_element): - """Double-clicks an element. - Args: - on_element: The element to double-click. - If None, clicks on current mouse position. - """ - if on_element: self.move_to_element(on_element) - self._actions.append(lambda: - self._driver.execute(Command.DOUBLE_CLICK, {})) - return self - - def drag_and_drop(self, source, target): - """Holds down the left mouse button on the source element, - then moves to the target element and releases the mouse button. - Args: - source: The element to mouse down. - target: The element to mouse up. - """ - self.click_and_hold(source) - self.release(target) - return self - - def drag_and_drop_by_offset(self, source, xoffset, yoffset): - """Holds down the left mouse button on the source element, - then moves to the target element and releases the mouse button. - Args: - source: The element to mouse down. - xoffset: X offset to move to. - yoffset: Y offset to move to. - """ - self.click_and_hold(source) - self.move_by_offset(xoffset, yoffset) - self.release(source) - return self - - def key_down(self, key, element=None): - """Sends a key press only, without releasing it. - Should only be used with modifier keys (Control, Alt and Shift). - Args: - key: The modifier key to send. Values are defined in Keys class. - target: The element to send keys. - If None, sends a key to current focused element. - """ - if element: self.click(element) - self._actions.append(lambda: - self._driver.execute(Command.SEND_MODIFIER_KEY_TO_ACTIVE_ELEMENT, { - "value": key, - "isdown": True})) - return self - - def key_up(self, key, element=None): - """Releases a modifier key. - Args: - key: The modifier key to send. Values are defined in Keys class. - target: The element to send keys. - If None, sends a key to current focused element. - """ - if element: self.click(element) - self._actions.append(lambda: - self._driver.execute(Command.SEND_MODIFIER_KEY_TO_ACTIVE_ELEMENT, { - "value": key, - "isdown": False})) - return self - - def move_by_offset(self, xoffset, yoffset): - """Moving the mouse to an offset from current mouse position. - Args: - xoffset: X offset to move to. - yoffset: Y offset to move to. - """ - self._actions.append(lambda: - self._driver.execute(Command.MOVE_TO, { - 'xoffset': xoffset, - 'yoffset': yoffset})) - return self - - def move_to_element(self, to_element): - """Moving the mouse to the middle of an element. - Args: - to_element: The element to move to. - """ - self._actions.append(lambda: - self._driver.execute(Command.MOVE_TO, {'element': to_element.id})) - return self - - def move_to_element_with_offset(self, to_element, xoffset, yoffset): - """Move the mouse by an offset of the specificed element. - Offsets are relative to the top-left corner of the element. - Args: - to_element: The element to move to. - xoffset: X offset to move to. - yoffset: Y offset to move to. - """ - self._actions.append(lambda: - self._driver.execute(Command.MOVE_TO, { - 'element': to_element.id, - 'xoffset': xoffset, - 'yoffset': yoffset})) - return self - - def release(self, on_element): - """Releasing a held mouse button. - Args: - on_element: The element to mouse up. - """ - if on_element: self.move_to_element(on_element) - self._actions.append(lambda: - self._driver.execute(Command.MOUSE_UP, {})) - return self - - def send_keys(self, *keys_to_send): - """Sends keys to current focused element. - Args: - keys_to_send: The keys to send. - """ - self._actions.append(lambda: - self._driver.switch_to_active_element().send_keys(*keys_to_send)) - return self - - def send_keys_to_element(self, element, *keys_to_send): - """Sends keys to an element. - Args: - element: The element to send keys. - keys_to_send: The keys to send. - """ - self._actions.append(lambda: - element.send_keys(*keys_to_send)) - return self diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/alert.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/alert.py deleted file mode 100644 index 711f09cf8..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/alert.py +++ /dev/null @@ -1,39 +0,0 @@ -#Copyright 2007-2009 WebDriver committers -#Copyright 2007-2009 Google Inc. -# -#Licensed under the Apache License, Version 2.0 (the "License"); -#you may not use this file except in compliance with the License. -#You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -#Unless required by applicable law or agreed to in writing, software -#distributed under the License is distributed on an "AS IS" BASIS, -#WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -#See the License for the specific language governing permissions and -#limitations under the License. - -from selenium.webdriver.remote.command import Command - - -class Alert(object): - - def __init__(self, driver): - self.driver = driver - - @property - def text(self): - """ Gets the text of the Alert """ - return self.driver.execute(Command.GET_ALERT_TEXT)["value"] - - def dismiss(self): - """ Dismisses the alert available """ - self.driver.execute(Command.DISMISS_ALERT) - - def accept(self): - """ Accepts the alert available """ - self.driver.execute(Command.ACCEPT_ALERT) - - def send_keys(self, keysToSend): - """ Send Keys to the Alert """ - self.driver.execute(Command.SET_ALERT_VALUE, {'text': keysToSend}) diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/by.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/by.py deleted file mode 100644 index b54ca729f..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/by.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2008-2009 WebDriver committers -# Copyright 2008-2009 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -class By(object): - ID = "id" - XPATH = "xpath" - LINK_TEXT = "link text" - PARTIAL_LINK_TEXT = "partial link text" - NAME = "name" - TAG_NAME = "tag name" - CLASS_NAME = "class name" - CSS_SELECTOR = "css selector" diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/desired_capabilities.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/desired_capabilities.py deleted file mode 100644 index 76c17da97..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/desired_capabilities.py +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright 2008-2009 WebDriver committers -# Copyright 2008-2009 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class DesiredCapabilities(object): - - FIREFOX = { "browserName": "firefox", - "version": "", - "platform": "ANY", - "javascriptEnabled": True } - - INTERNETEXPLORER = { "browserName": "internet explorer", - "version": "", - "platform": "WINDOWS", - "javascriptEnabled": True } - - CHROME = {"browserName": "chrome", - "version": "", - "platform": "ANY", - "javascriptEnabled": True } - OPERA = {"browserName": "opera", - "version": "", - "platform": "ANY"} - - HTMLUNIT = {"browserName": "htmlunit", - "version": "", - "platform": "ANY" } - - HTMLUNITWITHJS = {"browserName": "htmlunit", - "version": "firefox", - "platform": "ANY", - "javascriptEnabled": True } - - IPHONE = {"browserName": "iphone", - "version": "", - "platform": "MAC", - "javascriptEnabled": True } - - ANDROID = {"browserName": "android", - "version": "", - "platform": "LINUX", - "javascriptEnabled": True } - - diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/keys.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/keys.py deleted file mode 100644 index c13681338..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/keys.py +++ /dev/null @@ -1,84 +0,0 @@ -# copyright 2008-2009 WebDriver committers -# Copyright 2008-2009 Google Inc. -# -# Licensed under the Apache License Version 2.0 = uthe "License") -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http //www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing software -# distributed under the License is distributed on an "AS IS" BASIS -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -class Keys(object): - - NULL = u'\ue000' - CANCEL = u'\ue001' # ^break - HELP = u'\ue002' - BACK_SPACE = u'\ue003' - TAB = u'\ue004' - CLEAR = u'\ue005' - RETURN = u'\ue006' - ENTER = u'\ue007' - SHIFT = u'\ue008' - LEFT_SHIFT = u'\ue008' # alias - CONTROL = u'\ue009' - LEFT_CONTROL = u'\ue009' # alias - ALT = u'\ue00a' - LEFT_ALT = u'\ue00a' # alias - PAUSE = u'\ue00b' - ESCAPE = u'\ue00c' - SPACE = u'\ue00d' - PAGE_UP = u'\ue00e' - PAGE_DOWN = u'\ue00f' - END = u'\ue010' - HOME = u'\ue011' - LEFT = u'\ue012' - ARROW_LEFT = u'\ue012' # alias - UP = u'\ue013' - ARROW_UP = u'\ue013' # alias - RIGHT = u'\ue014' - ARROW_RIGHT = u'\ue014' # alias - DOWN = u'\ue015' - ARROW_DOWN = u'\ue015' # alias - INSERT = u'\ue016' - DELETE = u'\ue017' - SEMICOLON = u'\ue018' - EQUALS = u'\ue019' - - NUMPAD0 = u'\ue01a' # numbe pad keys - NUMPAD1 = u'\ue01b' - NUMPAD2 = u'\ue01c' - NUMPAD3 = u'\ue01d' - NUMPAD4 = u'\ue01e' - NUMPAD5 = u'\ue01f' - NUMPAD6 = u'\ue020' - NUMPAD7 = u'\ue021' - NUMPAD8 = u'\ue022' - NUMPAD9 = u'\ue023' - MULTIPLY = u'\ue024' - ADD = u'\ue025' - SEPARATOR = u'\ue026' - SUBTRACT = u'\ue027' - DECIMAL = u'\ue028' - DIVIDE = u'\ue029' - - F1 = u'\ue031' # function keys - F2 = u'\ue032' - F3 = u'\ue033' - F4 = u'\ue034' - F5 = u'\ue035' - F6 = u'\ue036' - F7 = u'\ue037' - F8 = u'\ue038' - F9 = u'\ue039' - F10 = u'\ue03a' - F11 = u'\ue03b' - F12 = u'\ue03c' - - META = u'\ue03d' - COMMAND = u'\ue03d' diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/utils.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/utils.py deleted file mode 100644 index 43c564888..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/common/utils.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright 2008-2011 WebDriver committers -# Copyright 2008-2011 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import socket - - -def free_port(): - free_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - free_socket.bind(('127.0.0.1', 0)) - port = free_socket.getsockname()[1] - free_socket.close() - return port - -def is_connectable(port): - """Trys to connect to the server to see if it is running.""" - try: - socket_ = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - socket_.settimeout(1) - socket_.connect(("localhost", port)) - socket_.close() - return True - except socket.error: - return False - diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/emulation/__init__.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/emulation/__init__.py deleted file mode 100644 index 2af3f0449..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/emulation/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/python -# -# Copyright 2011 Webdriver_name committers -# Copyright 2011 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/emulation/base.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/emulation/base.py deleted file mode 100644 index 86b0a43f7..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/emulation/base.py +++ /dev/null @@ -1,9 +0,0 @@ - -class BaseCommand(object): - def __init__(self, driver, baseUrl): - self.driver = driver - if baseUrl.endswith('/'): - self.baseUrl = baseUrl[:-1] - else: - self.baseUrl = baseUrl - diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/emulation/navigation.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/emulation/navigation.py deleted file mode 100644 index 9968bab2e..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/emulation/navigation.py +++ /dev/null @@ -1,21 +0,0 @@ - -import selenium.webdriver.emulation.base as base - -class open(base.BaseCommand): - def __call__(self, url): - if url.find("://") == -1: - if url.startswith('/'): - toLoad = self.baseUrl + url - else: - toLoad = "%s/%s" % (self.baseUrl, url) - else: - toLoad = url - self.driver.get(toLoad) - -class go_back(base.BaseCommand): - def __call__(self): - self.driver.back() - -class stop(base.BaseCommand): - def __call__(self , *args, **kwargs): - self.driver.quit() \ No newline at end of file diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/emulation/selenium1.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/emulation/selenium1.py deleted file mode 100644 index 206fbfde2..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/emulation/selenium1.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/python -# -# Copyright 2011 Webdriver_name committers -# Copyright 2011 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from selenium.selenium import selenium -import selenium.webdriver.emulation.base as base -import selenium.webdriver.emulation.navigation as navigation - -class DrivenSelenium(selenium): - def __init__(self, driver, browserUrl): - self.driver = driver - self.browserUrl = browserUrl - - def start(self, browserConfigurationOptions=None): - # This become a no-op. Should we blow up at this point? - pass - - @property - def webdriver(self): - return self.driver - - def __getattribute__(self, attr): - if not attr.startswith('_') and hasattr(navigation, attr): - value = getattr(navigation, attr) - if issubclass(value, base.BaseCommand): - return value(self.driver, self.browserUrl) - - return super(DrivenSelenium, self).__getattribute__(attr) diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/firefox/__init__.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/firefox/__init__.py deleted file mode 100644 index a8bb36bb9..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/firefox/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2010 WebDriver committers -# Copyright 2010 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/firefox/extension_connection.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/firefox/extension_connection.py deleted file mode 100644 index d83683371..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/firefox/extension_connection.py +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright 2008-2011 WebDriver committers -# Copyright 2008-2011 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import logging -import time - -from selenium.webdriver.common.desired_capabilities import DesiredCapabilities -from selenium.webdriver.common import utils -from selenium.webdriver.remote.command import Command -from selenium.webdriver.remote.remote_connection import RemoteConnection - - -LOGGER = logging.getLogger(__name__) -PORT = 0 # -HOST = None -_URL = "" -class ExtensionConnection(RemoteConnection): - def __init__(self, host, firefox_profile, firefox_binary=None, timeout=30): - self.profile = firefox_profile - self.binary = firefox_binary - HOST = host - if self.binary is None: - self.binary = FirefoxBinary() - - if HOST is None: - HOST = "127.0.0.1" - - PORT = utils.free_port() - self.profile.port = PORT - self.profile.update_preferences() - - self.profile.add_extension() - - self.binary.launch_browser(self.profile) - _URL = "http://%s:%d/hub" % (HOST, PORT) - RemoteConnection.__init__( - self, _URL) - - def quit(self, sessionId=None): - self.execute(Command.QUIT, {'sessionId':sessionId}) - while self.is_connectable(): - LOGGER.info("waiting to quit") - time.sleep(1) - - def connect(self): - """Connects to the extension and retrieves the session id.""" - return self.execute(Command.NEW_SESSION, {'desiredCapabilities': DesiredCapabilities.FIREFOX}) - - @classmethod - def connect_and_quit(self): - """Connects to an running browser and quit immediately.""" - self._request('%s/extensions/firefox/quit' % _URL) - - @classmethod - def is_connectable(self): - """Trys to connect to the extension but do not retrieve context.""" - utils.is_connectable(self.port) - -class ExtensionConnectionError(Exception): - """An internal error occurred int the extension. - - Might be caused by bad input or bugs in webdriver - """ - pass - - diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/firefox/firefox_binary.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/firefox/firefox_binary.py deleted file mode 100644 index dac30b22e..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/firefox/firefox_binary.py +++ /dev/null @@ -1,137 +0,0 @@ -# Copyright 2008-2011 WebDriver committers -# Copyright 2008-2011 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import os -import platform -import logging -from subprocess import Popen, PIPE -from extension_connection import ExtensionConnection -from selenium.common.exceptions import WebDriverException -import time -import socket -import signal - - -class FirefoxBinary(object): - - NO_FOCUS_LIBRARY_NAME = "x_ignore_nofocus.so" - - def __init__(self, firefox_path=None): - self._start_cmd = firefox_path - if self._start_cmd is None: - self._start_cmd = self._get_firefox_start_cmd() - - def launch_browser(self, profile): - """Launches the browser for the given profile name. - It is assumed the profile already exists. - """ - self.profile = profile - - self._start_from_profile_path(self.profile.path) - self._wait_until_connectable() - - def kill(self): - """Kill the browser. - - This is useful when the browser is stuck. - """ - try: - if self.process: - os.kill(self.process.pid, signal.SIGTERM) - os.wait() - except AttributeError: - # kill may not be available under windows environment - pass - - def _start_from_profile_path(self, path): - os.environ["XRE_PROFILE_PATH"] = path - os.environ["MOZ_CRASHREPORTER_DISABLE"] = "1" - os.environ["MOZ_NO_REMOTE"] = "1" - os.environ["NO_EM_RESTART"] = "1" - Popen([self._start_cmd, "-silent"], stdout=PIPE, stderr=PIPE).wait() - self.process = Popen([self._start_cmd], stdout=PIPE, stderr=PIPE) - - def is_connectable(self): - """Trys to connect to the extension but do not retrieve context.""" - try: - socket_ = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - socket_.settimeout(1) - socket_.connect(("127.0.0.1", self.profile.port)) - socket_.close() - return True - except socket.error: - return False - - def _wait_until_connectable(self): - """Blocks until the extension is connectable in the firefox.""" - count = 0 - while not self.is_connectable(): - if self.process.returncode: - # Browser has exited - return WebDriverException("The browser appears to have exited before we could connect") - if count == 30: - self.kill() - raise WebDriverException("Can't load the profile. Profile Dir : %s" % self.profile.path) - count += 1 - time.sleep(1) - return True - - def _find_exe_in_registry(self): - from _winreg import OpenKey, QueryValue, HKEY_LOCAL_MACHINE - import shlex - keys = ( - r"SOFTWARE\Classes\FirefoxHTML\shell\open\command", - r"SOFTWARE\Classes\Applications\firefox.exe\shell\open\command" - ) - command = "" - for path in keys: - try: - key = OpenKey(HKEY_LOCAL_MACHINE, path) - command = QueryValue(key, "") - break - except WindowsError: - pass - else: - return "" - - return shlex.split(command)[0] - - def _get_firefox_start_cmd(self): - """Return the command to start firefox.""" - start_cmd = "" - if platform.system() == "Darwin": - start_cmd = ("/Applications/Firefox.app/Contents/MacOS/firefox-bin") - elif platform.system() == "Windows": - start_cmd = self._find_exe_in_registry() or self._default_windows_location() - else: - # Maybe iceweasel (Debian) is another candidate... - for ffname in ["firefox2", "firefox", "firefox-3.0", "firefox-4.0"]: - start_cmd = self.which(ffname) - if start_cmd is not None: - break - return start_cmd - - def _default_windows_location(self): - program_files = os.getenv("PROGRAMFILES", r"\Program Files") - return os.path.join(program_files, "Mozilla Firefox\\firefox.exe") - - def which(self, fname): - """Returns the fully qualified path by searching Path of the given name""" - for pe in os.environ['PATH'].split(os.pathsep): - checkname = os.path.join(pe, fname) - if os.access(checkname, os.X_OK) and not os.path.isdir(checkname): - return checkname - return None diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/firefox/firefox_profile.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/firefox/firefox_profile.py deleted file mode 100644 index 5bf1b6d14..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/firefox/firefox_profile.py +++ /dev/null @@ -1,268 +0,0 @@ -# Copyright 2008-2011 WebDriver committers -# Copyright 2008-2011 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import copy -import tempfile -import os -import logging -import zipfile -import shutil -import re -import base64 -from cStringIO import StringIO -import random -import string - -WEBDRIVER_EXT = "webdriver.xpi" -EXTENSION_NAME = "fxdriver@googlecode.com" - -class FirefoxProfile(object): - - ANONYMOUS_PROFILE_NAME = "WEBDRIVER_ANONYMOUS_PROFILE" - DEFAULT_PREFERENCES = { - "app.update.auto": "false", - "app.update.enabled": "false", - "browser.startup.page" : "0", - "browser.download.manager.showWhenStarting": "false", - "browser.EULA.override": "true", - "browser.EULA.3.accepted": "true", - "browser.link.open_external": "2", - "browser.link.open_newwindow": "2", - "browser.offline": "false", - "browser.safebrowsing.enabled": "false", - "browser.search.update": "false", - "browser.sessionstore.resume_from_crash": "false", - "browser.shell.checkDefaultBrowser": "false", - "browser.tabs.warnOnClose": "false", - "browser.tabs.warnOnOpen": "false", - "browser.startup.page": "0", - "browser.safebrowsing.malware.enabled": "false", - "startup.homepage_welcome_url": "\"about:blank\"", - "devtools.errorconsole.enabled": "true", - "dom.disable_open_during_load": "false", - "extensions.logging.enabled": "true", - "extensions.update.enabled": "false", - "extensions.update.notifyUser": "false", - "network.manage-offline-status": "false", - "network.http.max-connections-per-server": "10", - "network.http.phishy-userpass-length": "255", - "prompts.tab_modal.enabled": "false", - "security.fileuri.origin_policy": "3", - "security.fileuri.strict_origin_policy": "false", - "security.warn_entering_secure": "false", - "security.warn_submit_insecure": "false", - "security.warn_entering_secure.show_once": "false", - "security.warn_entering_weak": "false", - "security.warn_entering_weak.show_once": "false", - "security.warn_leaving_secure": "false", - "security.warn_leaving_secure.show_once": "false", - "security.warn_submit_insecure": "false", - "security.warn_viewing_mixed": "false", - "security.warn_viewing_mixed.show_once": "false", - "signon.rememberSignons": "false", - "toolkit.networkmanager.disable": "true", - "toolkit.telemetry.prompted": "true", - "javascript.options.showInConsole": "true", - "browser.dom.window.dump.enabled": "true", - "webdriver_accept_untrusted_certs": "true", - "webdriver_enable_native_events": "true", - "dom.max_script_run_time": "30", - } - - def __init__(self,profile_directory=None): - """ - Initialises a new instance of a Firefox Profile - - :args: - - profile_directory: Directory of profile that you want to use. - This defaults to None and will create a new - directory when object is created. - """ - self.default_preferences = copy.deepcopy(FirefoxProfile.DEFAULT_PREFERENCES) - self.profile_dir = _new_temp_folder_path() - if profile_directory is None: - os.mkdir(self.profile_dir) - else: - shutil.copytree(profile_directory, self.profile_dir) - self._read_existing_userjs() - self.extensionsDir = os.path.join(self.profile_dir, "extensions") - self.userPrefs = os.path.join(self.profile_dir, "user.js") - - #Public Methods - def set_preference(self, key, value): - """ - sets the preference that we want in the profile. - """ - clean_value = '' - if value is True: - clean_value = 'true' - elif value is False: - clean_value = 'false' - else: - clean_value = repr(value) - - self.default_preferences[key] = clean_value - - def add_extension(self, extension=WEBDRIVER_EXT): - self._install_extension(extension) - - def update_preferences(self): - self._write_user_prefs(self.default_preferences) - - #Properties - - @property - def path(self): - """ - Gets the profile directory that is currently being used - """ - return self.profile_dir - - @property - def port(self): - """ - Gets the port that WebDriver is working on - """ - return self._port - - @port.setter - def port(self, port): - """ - Sets the port that WebDriver will be running on - """ - self._port = port - self.default_preferences["webdriver_firefox_port"] = str(self._port) - - @property - def accept_untrusted_certs(self): - return bool(self.default_preferences["webdriver_accept_untrusted_certs"]) - - @accept_untrusted_certs.setter - def accept_untrusted_certs(self, value): - self.default_preferences["webdriver_accept_untrusted_certs"] = str(value) - - @property - def native_events_enabled(self): - return bool(self.default_preferences['webdriver_enable_native_events']) - - @native_events_enabled.setter - def native_events_enabled(self, value): - self.default_preferences['webdriver_enable_native_events'] = str(value) - - @property - def encoded(self): - """ - A zipped, base64 encoded string of profile directory - for use with remote WebDriver JSON wire protocol - """ - fp = StringIO() - zipped = zipfile.ZipFile(fp, 'w', zipfile.ZIP_DEFLATED) - path_root = len(self.path) + 1 # account for trailing slash - for base, dirs, files in os.walk(self.path): - for fyle in files: - filename = os.path.join(base, fyle) - zipped.write(filename, filename[path_root:]) - zipped.close() - return base64.encodestring(fp.getvalue()) - - - #Private Methods - - def _create_tempfolder(self): - """ - Creates a temp folder to store User.js and the extension - """ - return tempfile.mkdtemp() - - def _write_user_prefs(self, user_prefs): - """ - writes the current user prefs dictionary to disk - """ - f = open(self.userPrefs, "w") - for pref in user_prefs.keys(): - f.write('user_pref("%s", %s);\n' % (pref, user_prefs[pref])) - - f.close() - - def _read_existing_userjs(self): - try: - f = open(os.path.join(self.profile_dir, 'user.js'), "r") - tmp_usr = f.readlines() - f.close() - for usr in tmp_usr: - matches = re.search('user_pref\("(.*)",\s(.*)\)', usr) - self.default_preferences[matches.group(1)] = matches.group(2) - except: - # The profile given hasn't had any changes made, i.e no users.js - pass - - def _install_extension(self, extension): - tempdir = tempfile.mkdtemp() - ext_dir = "" - - if extension == WEBDRIVER_EXT: - extension = os.path.join(os.path.dirname(__file__), WEBDRIVER_EXT) - ext_dir = os.path.join(self.extensionsDir, EXTENSION_NAME) - - xpi = zipfile.ZipFile(extension) - - #Get directories ready - for file_in_xpi in xpi.namelist(): - name = file_in_xpi.replace("\\", os.path.sep).replace("/", os.path.sep) - dest = os.path.join(tempdir, name) - if (name.endswith(os.path.sep) and not os.path.exists(dest)): - os.makedirs(dest) - - #Copy files - for file_in_xpi in xpi.namelist(): - name = file_in_xpi.replace("\\", os.path.sep).replace("/", os.path.sep) - dest = os.path.join(tempdir, name) - if not (name.endswith(os.path.sep)): - outfile = open(dest, 'wb') - outfile.write(xpi.read(file_in_xpi)) - outfile.close() - - if ext_dir == "": - installrdfpath = os.path.join(tempdir,"install.rdf") - ext_dir = os.path.join( - self.extensionsDir, self._read_id_from_install_rdf(installrdfpath)) - if os.path.exists(ext_dir): - shutil.rmtree(ext_dir) - shutil.copytree(tempdir, ext_dir) - shutil.rmtree(tempdir) - - def _read_id_from_install_rdf(self, installrdfpath): - from rdflib import Graph - rdf = Graph() - installrdf = rdf.parse(file=file(installrdfpath)) - for i in installrdf.all_nodes(): - if re.search(".*@.*\..*", i): - return i.decode() - -_root_temp_folder_created = False -def _new_temp_folder_path(): - global _root_temp_folder_created - root_temp_folder_path = os.path.join(tempfile.gettempdir(), "webdriver-py-profiles") - if not _root_temp_folder_created: - if os.path.exists(root_temp_folder_path): - shutil.rmtree(root_temp_folder_path) - os.mkdir(root_temp_folder_path) - _root_temp_folder_created = True - temp_folder_path = None - while temp_folder_path is None or os.path.exists(temp_folder_path): - temp_folder_path = os.path.join( - root_temp_folder_path, - 'tmp' + ''.join(random.choice(string.ascii_lowercase + string.digits) for x in range(6))) - return temp_folder_path diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/firefox/webdriver.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/firefox/webdriver.py deleted file mode 100644 index 98ae04741..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/firefox/webdriver.py +++ /dev/null @@ -1,99 +0,0 @@ -# Copyright 2008-2011 WebDriver committers -# Copyright 2008-2011 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import base64 -import httplib -from selenium.common.exceptions import ErrorInResponseException -from selenium.webdriver.remote.command import Command -from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver -from selenium.webdriver.remote.webelement import WebElement -from firefox_binary import FirefoxBinary -from selenium.webdriver.firefox.firefox_profile import FirefoxProfile -from selenium.webdriver.firefox.extension_connection import ExtensionConnection -from selenium.webdriver.common.desired_capabilities import DesiredCapabilities -import urllib2 -import shutil -import socket - -class WebDriver(RemoteWebDriver): - - def __init__(self, firefox_profile=None, firefox_binary=None, timeout=30): - - self.binary = firefox_binary - self.profile = firefox_profile - - if self.profile is None: - self.profile = FirefoxProfile() - - if self.binary is None: - self.binary = FirefoxBinary() - - RemoteWebDriver.__init__(self, - command_executor=ExtensionConnection("127.0.0.1", self.profile, - self.binary, timeout), - desired_capabilities=DesiredCapabilities.FIREFOX) - - def create_web_element(self, element_id): - """Override from RemoteWebDriver to use firefox.WebElement.""" - return WebElement(self, element_id) - - def quit(self): - """Quits the driver and close every associated window.""" - try: - RemoteWebDriver.quit(self) - except httplib.BadStatusLine: - # Happens if Firefox shutsdown before we've read the response from - # the socket. - pass - self.binary.kill() - try: - shutil.rmtree(self.profile.path) - except Exception, e: - print str(e) - - @property - def firefox_profile(self): - return self.profile - - def save_screenshot(self, filename): - """ - Gets the screenshot of the current window. Returns False if there is - any IOError, else returns True. Use full paths in your filename. - """ - png = self._execute(Command.SCREENSHOT)['value'] - try: - f = open(filename, 'wb') - f.write(base64.decodestring(png)) - f.close() - except IOError: - return False - finally: - del png - return True - - def _execute(self, command, params=None): - try: - return RemoteWebDriver.execute(self, command, params) - except ErrorInResponseException, e: - # Legacy behavior: calling close() multiple times should not raise - # an error - if command != Command.CLOSE and command != Command.QUIT: - raise e - except urllib2.URLError, e: - # Legacy behavior: calling quit() multiple times should not raise - # an error - if command != Command.QUIT: - raise e diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/firefox/webdriver.xpi b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/firefox/webdriver.xpi deleted file mode 100644 index 6976a6dfc..000000000 Binary files a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/firefox/webdriver.xpi and /dev/null differ diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/ie/__init__.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/ie/__init__.py deleted file mode 100644 index edbfeebd3..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/ie/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/python -# -# Copyright 2008-2010 WebDriver committers -# Copyright 2008-2010 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/ie/webdriver.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/ie/webdriver.py deleted file mode 100644 index cbb4d4f2a..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/ie/webdriver.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/python -# -# Copyright 2008-2010 WebDriver committers -# Copyright 2008-2010 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from selenium.webdriver.common import utils -from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver -from selenium.webdriver.common.desired_capabilities import DesiredCapabilities -from selenium.webdriver.remote.command import Command -from selenium.common.exceptions import WebDriverException -from ctypes import * -import time -import os -import base64 - -DEFAULT_TIMEOUT = 30 -DEFAULT_PORT = 0 - -class WebDriver(RemoteWebDriver): - - def __init__(self, port=DEFAULT_PORT, timeout=DEFAULT_TIMEOUT): - self.port = port - if self.port == 0: - self.port = utils.free_port() - - # Create IE Driver instance of the unmanaged code - try: - self.iedriver = CDLL(os.path.join(os.path.dirname(__file__),"win32", "IEDriver.dll")) - except WindowsError: - try: - self.iedriver = CDLL(os.path.join(os.path.dirname(__file__),"x64", "IEDriver.dll")) - except WindowsError: - raise WebDriverException("Unable to load the IEDriver.dll component") - self.ptr = self.iedriver.StartServer(self.port) - - seconds = 0 - while not utils.is_connectable(self.port): - seconds += 1 - if seconds > DEFAULT_TIMEOUT: - raise RuntimeError("Unable to connect to IE") - time.sleep(1) - - RemoteWebDriver.__init__( - self, - command_executor='http://localhost:%d' % self.port, - desired_capabilities=DesiredCapabilities.INTERNETEXPLORER) - - def quit(self): - RemoteWebDriver.quit(self) - self.iedriver.StopServer(self.ptr) - del self.iedriver - del self.ptr - - def save_screenshot(self, filename): - """ - Gets the screenshot of the current window. Returns False if there is - any IOError, else returns True. Use full paths in your filename. - """ - png = self._execute(Command.SCREENSHOT)['value'] - try: - f = open(filename, 'wb') - f.write(base64.decodestring(png)) - f.close() - except IOError: - return False - finally: - del png - return True diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/ie/win32/IEDriver.dll b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/ie/win32/IEDriver.dll deleted file mode 100644 index e0bb90d15..000000000 Binary files a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/ie/win32/IEDriver.dll and /dev/null differ diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/ie/x64/IEDriver.dll b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/ie/x64/IEDriver.dll deleted file mode 100644 index 6ff17f89f..000000000 Binary files a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/ie/x64/IEDriver.dll and /dev/null differ diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/opera/service.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/opera/service.py deleted file mode 100644 index 31bc22f65..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/opera/service.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/python -# -# Copyright 2011 Webdriver_name committers -# Copyright 2011 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import subprocess -from subprocess import PIPE -import time -import os -import signal -from selenium.common.exceptions import WebDriverException -from selenium.webdriver.common import utils - - -class Service(object): - - MISSING_TEXT = '''Unable to find the Selenium server jar. Please download the standalone - server from http://code.google.com/p/selenium/downloads/list and set the - SELENIUM_SERVER_JAR environmental variable to its location. More info at - http://code.google.com/p/selenium/wiki/OperaDriver.''' - - def __init__(self, jar, port=0): - self.port = port - self.path = jar - if self.port == 0: - self.port = utils.free_port() - - def start(self): - """ Starts the ChromeDriver Service. - @Exceptions - WebDriverException : Raised either when it can't start the service - or when it can't connect to the service""" - try: - self.process = subprocess.Popen([self.path, "--port=%d" % self.port], - stdout=PIPE, stderr=PIPE) - except: - raise WebDriverException(self.MISSING_TEXT) - count = 0 - while not utils.is_connectable(self.port): - count += 1 - time.sleep(1) - if count == 30: - raise WebDriverException("Can not connect to the ChromeDriver") - - @property - def service_url(self): - """ Gets the url of the ChromeDriver Service """ - return "http://localhost:%d" % self.port - - def stop(self): - """ Tells the ChromeDriver to stop and cleans up the process """ - #If its dead dont worry - if self.process is None: - return - - #Tell the Server to die! - import urllib2 - urllib2.urlopen("http://127.0.0.1:%d/shutdown" % self.port) - count = 0 - while not utils.is_connectable(self.port): - if count == 30: - break - count += 1 - time.sleep(1) - - #Tell the Server to properly die in case - try: - if self.process: - os.kill(self.process.pid, signal.SIGTERM) - os.wait() - except AttributeError: - # kill may not be available under windows environment - pass diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/opera/webdriver.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/opera/webdriver.py deleted file mode 100644 index f3ce67541..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/opera/webdriver.py +++ /dev/null @@ -1,43 +0,0 @@ -import copy -import base64 -import httplib - -from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver -from selenium.webdriver.common.desired_capabilities import DesiredCapabilities -from selenium.webdriver.remote.command import Command -from service import Service - -class Opera(RemoteWebDriver): - - def __init__(self): - self.service = Service(logging_level, port) - self.service.start() - RemoteWebDriver.__init__(self, - command_executor=self.service.service_url, - desired_capabilities=DesiredCapabilities.OPERA) - - def quit(self): - """ Closes the browser and shuts down the ChromeDriver executable - that is started when starting the ChromeDriver """ - try: - RemoteWebDriver.quit(self) - except httplib.BadStatusLine: - pass - finally: - self.service.stop() - - def save_screenshot(self, filename): - """ - Gets the screenshot of the current window. Returns False if there is - any IOError, else returns True. Use full paths in your filename. - """ - png = self._execute(Command.SCREENSHOT)['value'] - try: - f = open(filename, 'wb') - f.write(base64.decodestring(png)) - f.close() - except IOError: - return False - finally: - del png - return True diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/__init__.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/__init__.py deleted file mode 100644 index f042f9da3..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# Copyright 2008-2009 WebDriver committers -# Copyright 2008-2009 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/command.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/command.py deleted file mode 100644 index 6a0f3ee52..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/command.py +++ /dev/null @@ -1,95 +0,0 @@ -# Copyright 2010 WebDriver committers -# Copyright 2010 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -class Command(object): - """Defines constants for the standard WebDriver commands. - - While these constants have no meaning in and of themselves, they are - used to marshal commands through a service that implements WebDriver's - remote wire protocol: - http://code.google.com/p/selenium/wiki/JsonWireProtocol - """ - - # Keep in sync with org.openqa.selenium.remote.DriverCommand - - NEW_SESSION = "newSession" - DELETE_SESSION = "deleteSession" - CLOSE = "close" - QUIT = "quit" - GET = "get" - GO_BACK = "goBack" - GO_FORWARD = "goForward" - REFRESH = "refresh" - ADD_COOKIE = "addCookie" - GET_COOKIE = "getCookie" - GET_ALL_COOKIES = "getCookies" - DELETE_COOKIE = "deleteCookie" - DELETE_ALL_COOKIES = "deleteAllCookies" - FIND_ELEMENT = "findElement" - FIND_ELEMENTS = "findElements" - FIND_CHILD_ELEMENT = "findChildElement" - FIND_CHILD_ELEMENTS = "findChildElements" - CLEAR_ELEMENT = "clearElement" - CLICK_ELEMENT = "clickElement" - HOVER_OVER_ELEMENT = "hoverOverElement" - SEND_KEYS_TO_ELEMENT = "sendKeysToElement" - SEND_MODIFIER_KEY_TO_ACTIVE_ELEMENT = "sendModifierKeyToActiveElement" - SUBMIT_ELEMENT = "submitElement" - TOGGLE_ELEMENT = "toggleElement" - GET_CURRENT_WINDOW_HANDLE = "getCurrentWindowHandle" - GET_WINDOW_HANDLES = "getWindowHandles" - SWITCH_TO_WINDOW = "switchToWindow" - SWITCH_TO_FRAME = "switchToFrame" - GET_ACTIVE_ELEMENT = "getActiveElement" - GET_CURRENT_URL = "getCurrentUrl" - GET_PAGE_SOURCE = "getPageSource" - GET_TITLE = "getTitle" - EXECUTE_SCRIPT = "executeScript" - GET_SPEED = "getSpeed" - SET_SPEED = "setSpeed" - SET_BROWSER_VISIBLE = "setBrowserVisible" - IS_BROWSER_VISIBLE = "isBrowserVisible" - GET_ELEMENT_TEXT = "getElementText" - GET_ELEMENT_VALUE = "getElementValue" - GET_ELEMENT_TAG_NAME = "getElementTagName" - SET_ELEMENT_SELECTED = "setElementSelected" - DRAG_ELEMENT = "dragElement" - IS_ELEMENT_SELECTED = "isElementSelected" - IS_ELEMENT_ENABLED = "isElementEnabled" - IS_ELEMENT_DISPLAYED = "isElementDisplayed" - GET_ELEMENT_LOCATION = "getElementLocation" - GET_ELEMENT_LOCATION_ONCE_SCROLLED_INTO_VIEW = ( - "getElementLocationOnceScrolledIntoView") - GET_ELEMENT_SIZE = "getElementSize" - GET_ELEMENT_ATTRIBUTE = "getElementAttribute" - GET_ELEMENT_VALUE_OF_CSS_PROPERTY = "getElementValueOfCssProperty" - ELEMENT_EQUALS = "elementEquals" - SCREENSHOT = "screenshot" - IMPLICIT_WAIT = "implicitlyWait" - EXECUTE_ASYNC_SCRIPT = "executeAsyncScript" - SET_SCRIPT_TIMEOUT = "setScriptTimeout" - - #Alerts - DISMISS_ALERT = "dismissAlert" - ACCEPT_ALERT = "acceptAlert" - SET_ALERT_VALUE = "setAlertValue" - GET_ALERT_TEXT = "getAlertText" - - # Advanced user interactions - CLICK = "mouseClick"; - DOUBLE_CLICK = "mouseDoubleClick"; - MOUSE_DOWN = "mouseButtonDown"; - MOUSE_UP = "mouseButtonUp"; - MOVE_TO = "mouseMoveTo"; diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/errorhandler.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/errorhandler.py deleted file mode 100644 index b5f838a0c..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/errorhandler.py +++ /dev/null @@ -1,121 +0,0 @@ -# Copyright 2010 WebDriver committers -# Copyright 2010 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from selenium.common.exceptions import ElementNotSelectableException -from selenium.common.exceptions import ElementNotVisibleException -from selenium.common.exceptions import InvalidCookieDomainException -from selenium.common.exceptions import InvalidElementStateException -from selenium.common.exceptions import NoSuchElementException -from selenium.common.exceptions import NoSuchFrameException -from selenium.common.exceptions import NoSuchWindowException -from selenium.common.exceptions import StaleElementReferenceException -from selenium.common.exceptions import UnableToSetCookieException -from selenium.common.exceptions import ErrorInResponseException -from selenium.common.exceptions import TimeoutException -from selenium.common.exceptions import WebDriverException - - -class ErrorCode(object): - """Error codes defined in the WebDriver wire protocol.""" - # Keep in sync with org.openqa.selenium.remote.ErrorCodes and errorcodes.h - SUCCESS = 0 - NO_SUCH_ELEMENT = 7 - NO_SUCH_FRAME = 8 - UNKNOWN_COMMAND = 9 - STALE_ELEMENT_REFERENCE = 10 - ELEMENT_NOT_VISIBLE = 11 - INVALID_ELEMENT_STATE = 12 - UNKNOWN_ERROR = 13 - ELEMENT_IS_NOT_SELECTABLE = 15 - JAVASCRIPT_ERROR = 17 - XPATH_LOOKUP_ERROR = 19 - TIMEOUT = 21 - NO_SUCH_WINDOW = 23 - INVALID_COOKIE_DOMAIN = 24 - UNABLE_TO_SET_COOKIE = 25 - UNEXPECTED_ALERT_OPEN = 26 - NO_ALERT_OPEN = 27 - SCRIPT_TIMEOUT = 28 - INVALID_ELEMENT_COORDINATES = 29 - INVALID_SELECTOR = 32 - - -class ErrorHandler(object): - """Handles errors returned by the WebDriver server.""" - def check_response(self, response): - """ - Checks that a JSON response from the WebDriver does not have an error. - Args: - response - The JSON response from the WebDriver server as a dictionary - object. - Raises: - If the response contains an error message. - """ - status = response['status'] - if status == ErrorCode.SUCCESS: - return - exception_class = ErrorInResponseException - if status == ErrorCode.NO_SUCH_ELEMENT: - exception_class = NoSuchElementException - elif status == ErrorCode.NO_SUCH_FRAME: - exception_class = NoSuchFrameException - elif status == ErrorCode.NO_SUCH_WINDOW: - exception_class = NoSuchWindowException - elif status == ErrorCode.STALE_ELEMENT_REFERENCE: - exception_class = StaleElementReferenceException - elif status == ErrorCode.ELEMENT_NOT_VISIBLE: - exception_class = ElementNotVisibleException - elif status == ErrorCode.INVALID_ELEMENT_STATE: - exception_class = WebDriverException - elif status == ErrorCode.ELEMENT_IS_NOT_SELECTABLE: - exception_class = ElementNotSelectableException - elif status == ErrorCode.INVALID_COOKIE_DOMAIN: - exception_class = WebDriverException - elif status == ErrorCode.UNABLE_TO_SET_COOKIE: - exception_class = WebDriverException - elif status == ErrorCode.TIMEOUT: - exception_class = TimeoutException - elif status == ErrorCode.SCRIPT_TIMEOUT: - exception_class = TimeoutException - elif status == ErrorCode.UNKNOWN_ERROR: - exception_class = WebDriverException - else: - exception_class = WebDriverException - value = response['value'] - if type(value) is str: - if exception_class == ErrorInResponseException: - raise exception_class(response, value) - raise exception_class(value) - message = '' - if 'message' in value: - message = value['message'] - - screen = None - if 'screen' in value: - screen = value['screen'] - - stacktrace = None - if 'stackTrace' in value: - zeroeth = value['stackTrace'][0] - if zeroeth.has_key('methodName'): - stacktrace = "Method %s threw an error in %s" % \ - (zeroeth['methodName'], - self._value_or_default(zeroeth, 'fileName', '[No file name]')) - if exception_class == ErrorInResponseException: - raise exception_class(response, message) - raise exception_class(message, screen, stacktrace) - - def _value_or_default(self, obj, key, default): - return obj[key] if obj.has_key(key) else default diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/remote_connection.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/remote_connection.py deleted file mode 100644 index 7ffdf4c43..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/remote_connection.py +++ /dev/null @@ -1,317 +0,0 @@ -# Copyright 2008-2009 WebDriver committers -# Copyright 2008-2009 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import logging -import socket -import string -import urllib2 -import urlparse - -from command import Command -import utils - -LOGGER = logging.getLogger(__name__) - -class Request(urllib2.Request): - """Extends the urllib2.Request to support all HTTP request types.""" - - def __init__(self, url, data=None, method=None): - """Initialise a new HTTP request. - - Args: - url - String for the URL to send the request to. - data - Data to send with the request. - """ - if method is None: - method = data is not None and 'POST' or 'GET' - elif method != 'POST' and method != 'PUT': - data = None - self._method = method - urllib2.Request.__init__(self, url, data=data) - - def get_method(self): - """Returns the HTTP method used by this request.""" - return self._method - - -class Response(object): - """Represents an HTTP response. - - Attributes: - fp - File object for the response body. - code - The HTTP status code returned by the server. - headers - A dictionary of headers returned by the server. - url - URL of the retrieved resource represented by this Response. - """ - - def __init__(self, fp, code, headers, url): - """Initialise a new Response. - - Args: - fp - The response body file object. - code - The HTTP status code returned by the server. - headers - A dictionary of headers returned by the server. - url - URL of the retrieved resource represented by this Response. - """ - self.fp = fp - self.read = fp.read - self.code = code - self.headers = headers - self.url = url - - def close(self): - """Close the response body file object.""" - self.read = None - self.fp = None - - def info(self): - """Returns the response headers.""" - return self.headers - - def geturl(self): - """Returns the URL for the resource returned in this response.""" - return self.url - - -class HttpErrorHandler(urllib2.HTTPDefaultErrorHandler): - """A custom HTTP error handler. - - Used to return Response objects instead of raising an HTTPError exception. - """ - - def http_error_default(self, req, fp, code, msg, headers): - """Default HTTP error handler. - - Args: - req - The original Request object. - fp - The response body file object. - code - The HTTP status code returned by the server. - msg - The HTTP status message returned by the server. - headers - The response headers. - - Returns: - A new Response object. - """ - return Response(fp, code, headers, req.get_full_url()) - - -class RemoteConnection(object): - """A connection with the Remote WebDriver server. - - Communicates with the server using the WebDriver wire protocol: - http://code.google.com/p/selenium/wiki/JsonWireProtocol - """ - - def __init__(self, remote_server_addr): - # Attempt to resolve the hostname and get an IP address. - parsed_url = urlparse.urlparse(remote_server_addr) - if parsed_url.hostname: - try: - netloc = socket.gethostbyname(parsed_url.hostname) - if parsed_url.port: - netloc += ':%d' % parsed_url.port - if parsed_url.username: - auth = parsed_url.username - if parsed_url.password: - auth += ':%s' % parsed_url.password - netloc = '%s@%s' % (auth, netloc) - remote_server_addr = urlparse.urlunparse( - (parsed_url.scheme, netloc, parsed_url.path, - parsed_url.params, parsed_url.query, parsed_url.fragment)) - except socket.gaierror: - LOGGER.info('Could not get IP address for host: %s' % - parsed_url.hostname) - - self._url = remote_server_addr - self._commands = { - Command.NEW_SESSION: ('POST', '/session'), - Command.QUIT: ('DELETE', '/session/$sessionId'), - Command.GET_CURRENT_WINDOW_HANDLE: - ('GET', '/session/$sessionId/window_handle'), - Command.GET_WINDOW_HANDLES: - ('GET', '/session/$sessionId/window_handles'), - Command.GET: ('POST', '/session/$sessionId/url'), - Command.GO_FORWARD: ('POST', '/session/$sessionId/forward'), - Command.GO_BACK: ('POST', '/session/$sessionId/back'), - Command.REFRESH: ('POST', '/session/$sessionId/refresh'), - Command.EXECUTE_SCRIPT: ('POST', '/session/$sessionId/execute'), - Command.GET_CURRENT_URL: ('GET', '/session/$sessionId/url'), - Command.GET_TITLE: ('GET', '/session/$sessionId/title'), - Command.GET_PAGE_SOURCE: ('GET', '/session/$sessionId/source'), - Command.SCREENSHOT: ('GET', '/session/$sessionId/screenshot'), - Command.SET_BROWSER_VISIBLE: - ('POST', '/session/$sessionId/visible'), - Command.IS_BROWSER_VISIBLE: ('GET', '/session/$sessionId/visible'), - Command.FIND_ELEMENT: ('POST', '/session/$sessionId/element'), - Command.FIND_ELEMENTS: ('POST', '/session/$sessionId/elements'), - Command.GET_ACTIVE_ELEMENT: - ('POST', '/session/$sessionId/element/active'), - Command.FIND_CHILD_ELEMENT: - ('POST', '/session/$sessionId/element/$id/element'), - Command.FIND_CHILD_ELEMENTS: - ('POST', '/session/$sessionId/element/$id/elements'), - Command.CLICK_ELEMENT: ('POST', '/session/$sessionId/element/$id/click'), - Command.CLEAR_ELEMENT: ('POST', '/session/$sessionId/element/$id/clear'), - Command.SUBMIT_ELEMENT: ('POST', '/session/$sessionId/element/$id/submit'), - Command.GET_ELEMENT_TEXT: ('GET', '/session/$sessionId/element/$id/text'), - Command.SEND_KEYS_TO_ELEMENT: - ('POST', '/session/$sessionId/element/$id/value'), - Command.SEND_MODIFIER_KEY_TO_ACTIVE_ELEMENT: - ('POST', '/session/$sessionId/modifier'), - Command.GET_ELEMENT_VALUE: - ('GET', '/session/$sessionId/element/$id/value'), - Command.GET_ELEMENT_TAG_NAME: - ('GET', '/session/$sessionId/element/$id/name'), - Command.IS_ELEMENT_SELECTED: - ('GET', '/session/$sessionId/element/$id/selected'), - Command.SET_ELEMENT_SELECTED: - ('POST', '/session/$sessionId/element/$id/selected'), - Command.TOGGLE_ELEMENT: - ('POST', '/session/$sessionId/element/$id/toggle'), - Command.IS_ELEMENT_ENABLED: - ('GET', '/session/$sessionId/element/$id/enabled'), - Command.IS_ELEMENT_DISPLAYED: - ('GET', '/session/$sessionId/element/$id/displayed'), - Command.HOVER_OVER_ELEMENT: - ('POST', '/session/$sessionId/element/$id/hover'), - Command.GET_ELEMENT_LOCATION: - ('GET', '/session/$sessionId/element/$id/location'), - Command.GET_ELEMENT_LOCATION_ONCE_SCROLLED_INTO_VIEW: - ('GET', '/session/$sessionId/element/$id/location_in_view'), - Command.GET_ELEMENT_SIZE: - ('GET', '/session/$sessionId/element/$id/size'), - Command.GET_ELEMENT_ATTRIBUTE: - ('GET', '/session/$sessionId/element/$id/attribute/$name'), - Command.ELEMENT_EQUALS: - ('GET', '/session/$sessionId/element/$id/equals/$other'), - Command.GET_ALL_COOKIES: ('GET', '/session/$sessionId/cookie'), - Command.ADD_COOKIE: ('POST', '/session/$sessionId/cookie'), - Command.DELETE_ALL_COOKIES: - ('DELETE', '/session/$sessionId/cookie'), - Command.DELETE_COOKIE: - ('DELETE', '/session/$sessionId/cookie/$name'), - Command.SWITCH_TO_FRAME: ('POST', '/session/$sessionId/frame'), - Command.SWITCH_TO_WINDOW: ('POST', '/session/$sessionId/window'), - Command.CLOSE: ('DELETE', '/session/$sessionId/window'), - Command.DRAG_ELEMENT: - ('POST', '/session/$sessionId/element/$id/drag'), - Command.GET_SPEED: ('GET', '/session/$sessionId/speed'), - Command.SET_SPEED: ('POST', '/session/$sessionId/speed'), - Command.GET_ELEMENT_VALUE_OF_CSS_PROPERTY: - ('GET', '/session/$sessionId/element/$id/css/$propertyName'), - Command.IMPLICIT_WAIT: - ('POST', '/session/$sessionId/timeouts/implicit_wait'), - Command.EXECUTE_ASYNC_SCRIPT: ('POST','/session/$sessionId/execute_async'), - Command.SET_SCRIPT_TIMEOUT: - ('POST', '/session/$sessionId/timeouts/async_script'), - Command.GET_ELEMENT_VALUE_OF_CSS_PROPERTY: - ('GET', '/session/$sessionId/element/$id/css/$propertyName'), - Command.DISMISS_ALERT: - ('POST', '/session/$sessionId/dismiss_alert'), - Command.ACCEPT_ALERT: - ('POST', '/session/$sessionId/accept_alert'), - Command.SET_ALERT_VALUE: - ('POST', '/session/$sessionId/alert_text'), - Command.GET_ALERT_TEXT: - ('GET', '/session/$sessionId/alert_text'), - Command.CLICK: - ('POST', '/session/$sessionId/click'), - Command.DOUBLE_CLICK: - ('POST', '/session/$sessionId/doubleclick'), - Command.MOUSE_DOWN: - ('POST', '/session/$sessionId/buttondown'), - Command.MOUSE_UP: - ('POST', '/session/$sessionId/buttonup'), - Command.MOVE_TO: - ('POST', '/session/$sessionId/moveto')} - - def execute(self, command, params): - """Send a command to the remote server. - - Any path subtitutions required for the URL mapped to the command should be - included in the command parameters. - - Args: - command - A string specifying the command to execute. - params - A dictionary of named parameters to send with the command as - its JSON payload. - """ - command_info = self._commands[command] - assert command_info is not None, 'Unrecognised command %s' % command - data = utils.dump_json(params) - path = string.Template(command_info[1]).substitute(params) - url = '%s%s' % (self._url, path) - return self._request(url, method=command_info[0], data=data) - - def _request(self, url, data=None, method=None): - """Send an HTTP request to the remote server. - - Args: - method - A string for the HTTP method to send the request with. - url - The URL to send the request to. - body - The message body to send. - - Returns: - A dictionary with the server's parsed JSON response. - """ - LOGGER.debug('%s %s %s' % (method, url, data)) - - parsed_url = urlparse.urlparse(url) - auth = None - password_manager = None - if parsed_url.username: - netloc = parsed_url.hostname - if parsed_url.port: - netloc += ":%s" % parsed_url.port - cleaned_url = urlparse.urlunparse((parsed_url.scheme, netloc, parsed_url.path, - parsed_url.params, parsed_url.query, parsed_url.fragment)) - password_manager = urllib2.HTTPPasswordMgrWithDefaultRealm() - password_manager.add_password(None, "%s://%s" % (parsed_url.scheme, netloc), parsed_url.username, parsed_url.password) - request = Request(cleaned_url, data=data, method=method) - else: - request = Request(url, data=data, method=method) - - - request.add_header('Accept', 'application/json') - - if password_manager: - opener = urllib2.build_opener(urllib2.HTTPRedirectHandler(), - HttpErrorHandler(), - urllib2.HTTPBasicAuthHandler(password_manager)) - else: - opener = urllib2.build_opener(urllib2.HTTPRedirectHandler(), - HttpErrorHandler()) - response = opener.open(request) - try: - if response.code > 399 and response.code < 500: - return {'status': response.code, 'value': response.read()} - body = response.read().replace('\x00', '').strip() - content_type = response.info().getheader('Content-Type') or [] - if 'application/json' in content_type: - data = utils.load_json(body.strip()) - assert type(data) is dict, ( - 'Invalid server response body: %s' % body) - assert 'status' in data, ( - 'Invalid server response; no status: %s' % body) - # Some of the drivers incorrectly return a response - # with no 'value' field when they should return null. - if 'value' not in data: - data['value'] = None - return data - elif 'image/png' in content_type: - data = {'status': 0, 'value': body.strip()} - return data - finally: - response.close() diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/utils.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/utils.py deleted file mode 100644 index aa32fa672..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/utils.py +++ /dev/null @@ -1,112 +0,0 @@ -# Copyright 2008-2009 WebDriver committers -# Copyright 2008-2009 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import logging -import os -import tempfile -import zipfile - -try: - import json -except ImportError: # < 2.6 - import simplejson as json - -if not hasattr(json, 'dumps'): - import simplejson as json - -from selenium.common.exceptions import NoSuchElementException - -LOGGER = logging.getLogger(__name__) - -def format_json(json_struct): - return json.dumps(json_struct, indent=4) - -def dump_json(json_struct): - return json.dumps(json_struct) - -def load_json(s): - return json.loads(s) - -def handle_find_element_exception(e): - if ("Unable to find" in e.response["value"]["message"] or - "Unable to locate" in e.response["value"]["message"]): - raise NoSuchElementException("Unable to locate element:") - else: - raise e - -def return_value_if_exists(resp): - if resp and "value" in resp: - return resp["value"] - -def get_root_parent(elem): - parent = elem.parent - while True: - try: - parent.parent - parent = parent.parent - except AttributeError: - return parent - -def unzip_to_temp_dir(zip_file_name): - """Unzip zipfile to a temporary directory. - - The directory of the unzipped files is returned if success, - otherwise None is returned. """ - if not zip_file_name or not os.path.exists(zip_file_name): - return None - - zf = zipfile.ZipFile(zip_file_name) - - if zf.testzip() is not None: - return None - - # Unzip the files into a temporary directory - LOGGER.info("Extracting zipped file: %s" % zip_file_name) - tempdir = tempfile.mkdtemp() - - try: - # Create directories that don't exist - for zip_name in zf.namelist(): - # We have no knowledge on the os where the zipped file was - # created, so we restrict to zip files with paths without - # charactor "\" and "/". - name = (zip_name.replace("\\", os.path.sep). - replace("/", os.path.sep)) - dest = os.path.join(tempdir, name) - if (name.endswith(os.path.sep) and not os.path.exists(dest)): - os.mkdir(dest) - LOGGER.debug("Directory %s created." % dest) - - # Copy files - for zip_name in zf.namelist(): - # We have no knowledge on the os where the zipped file was - # created, so we restrict to zip files with paths without - # charactor "\" and "/". - name = (zip_name.replace("\\", os.path.sep). - replace("/", os.path.sep)) - dest = os.path.join(tempdir, name) - if not (name.endswith(os.path.sep)): - LOGGER.debug("Copying file %s......" % dest) - outfile = open(dest, 'wb') - outfile.write(zf.read(zip_name)) - outfile.close() - LOGGER.debug("File %s copied." % dest) - - LOGGER.info("Unzipped file can be found at %s" % tempdir) - return tempdir - - except IOError, err: - LOGGER.error("Error in extracting webdriver.xpi: %s" % err) - return None diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/webdriver.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/webdriver.py deleted file mode 100644 index 7b5d4f50f..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/webdriver.py +++ /dev/null @@ -1,562 +0,0 @@ -# Copyright 2008-2011 WebDriver committers -# Copyright 2008-2011 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"""The WebDriver implementation.""" -import base64 -from command import Command -from webelement import WebElement -from remote_connection import RemoteConnection -from errorhandler import ErrorHandler -from selenium.common.exceptions import WebDriverException -from selenium.webdriver.common.by import By -from selenium.webdriver.common.alert import Alert -from selenium.common.exceptions import WebDriverException - -class WebDriver(object): - """Controls a browser by sending commands to a remote server. - This server is expected to be running the WebDriver wire protocol as defined - here: http://code.google.com/p/selenium/wiki/JsonWireProtocol - - Attributes: - command_executor - The command.CommandExecutor object used to execute - commands. - error_handler - errorhandler.ErrorHandler object used to verify that the - server did not return an error. - session_id - The session ID to send with every command. - capabilities - A dictionary of capabilities of the underlying browser for - this instance's session.""" - - def __init__(self, command_executor='http://127.0.0.1:4444/wd/hub', - desired_capabilities=None, browser_profile=None): - """Create a new driver that will issue commands using the wire protocol. - Args: - command_executor - Either a command.CommandExecutor object or a string - that specifies the URL of a remote server to send commands to. - desired_capabilities - Dictionary holding predefined values for - starting a browser - browser_profile: - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile - object. Only used if Firefox is requested. - """ - if desired_capabilities is None: - raise WebDriverException("Desired Capabilities can't be None") - self.command_executor = command_executor - if type(self.command_executor) is str: - self.command_executor = RemoteConnection(command_executor) - self.session_id = None - self.capabilities = {} - self.error_handler = ErrorHandler() - self.start_client() - self.start_session(desired_capabilities, browser_profile) - - @property - def name(self): - """Returns the name of the underlying browser for this instance. - Usage: - driver.name - """ - if 'browserName' in self.capabilities: - return self.capabilities['browserName'] - else: - raise KeyError('browserName not specified in session capabilities') - - def start_client(self): - """Called before starting a new session. This method may be overridden - to define custom startup behavior.""" - pass - - def stop_client(self): - """Called after executing a quit command. This method may be overridden - to define custom shutdown behavior.""" - pass - - def start_session(self, desired_capabilities, browser_profile=None): - """Creates a new session with the desired capabilities. - Args: - browser_name: The name of the browser to request. - version: Which browser version to request. - platform: Which platform to request the browser on. - javascript_enabled: Whether the new session should support JavaScript. - browser_profile: - A selenium.webdriver.firefox.firefox_profile.FirefoxProfile - object. Only used if Firefox is requested. - """ - if browser_profile: - desired_capabilities['firefox_profile'] = browser_profile.encoded - response = self.execute(Command.NEW_SESSION, { - 'desiredCapabilities': desired_capabilities, - }) - self.session_id = response['sessionId'] - self.capabilities = response['value'] - - def _wrap_value(self, value): - if isinstance(value, dict): - converted = {} - for key, val in value.items(): - converted[key] = self._wrap_value(val) - return converted - elif isinstance(value, WebElement): - return {'ELEMENT': value.id} - elif isinstance(value, list): - return list(self._wrap_value(item) for item in value) - else: - return value - - def create_web_element(self, element_id): - """Creates a web element with the specified element_id.""" - return WebElement(self, element_id) - - def _unwrap_value(self, value): - if isinstance(value, dict) and 'ELEMENT' in value: - return self.create_web_element(value['ELEMENT']) - elif isinstance(value, list): - return list(self._unwrap_value(item) for item in value) - else: - return value - - def execute(self, driver_command, params=None): - """Sends a command to be executed by a command.CommandExecutor. - Args: - driver_command: The name of the command to execute as a string. - params: A dictionary of named parameters to send with the command. - Returns: - The command's JSON response loaded into a dictionary object. - """ - if not params: - params = {'sessionId': self.session_id} - elif 'sessionId' not in params: - params['sessionId'] = self.session_id - - params = self._wrap_value(params) - response = self.command_executor.execute(driver_command, params) - if response: - self.error_handler.check_response(response) - response['value'] = self._unwrap_value( - response.get('value', None)) - return response - # If the server doesn't send a response, assume the command was - # a success - return {'success': 0, 'value': None, 'sessionId': self.session_id} - - def get(self, url): - """Loads a web page in the current browser session.""" - self.execute(Command.GET, {'url': url}) - - @property - def title(self): - """Returns the title of the current page. - Usage: - driver.title - """ - resp = self.execute(Command.GET_TITLE) - return resp['value'] if resp['value'] is not None else "" - - def find_element_by_id(self, id_): - """Finds an element by id. - Args: - id_: The id of the element to be found. - Usage: - driver.find_element_by_id('foo') - """ - return self.find_element(by=By.ID, value=id_) - - def find_elements_by_id(self, id_): - """Finds multiple elements by id. - Args: - id_: The id of the elements to be found. - Usage: - driver.find_element_by_id('foo') - """ - return self.find_elements(by=By.ID, value=id_) - - def find_element_by_xpath(self, xpath): - """Finds an element by xpath. - Args: - xpath: The xpath locator of the element to find. - Usage: - driver.find_element_by_xpath('//div/td[1]') - """ - return self.find_element(by=By.XPATH, value=xpath) - - def find_elements_by_xpath(self, xpath): - """Finds multiple elements by xpath. - Args: - xpath: The xpath locator of the elements to be found. - Usage: - driver.find_elements_by_xpath("//div[contains(@class, 'foo')]") - """ - return self.find_elements(by=By.XPATH, value=xpath) - - def find_element_by_link_text(self, link_text): - """Finds an element by link text. - Args: - link_text: The text of the element to be found. - Usage: - driver.find_element_by_link_text('Sign In') - """ - return self.find_element(by=By.LINK_TEXT, value=link_text) - - def find_elements_by_link_text(self, text): - """Finds elements by link text. - Args: - link_text: The text of the elements to be found. - Usage: - driver.find_elements_by_link_text('Sign In') - """ - return self.find_elements(by=By.LINK_TEXT, value=text) - - def find_element_by_partial_link_text(self, link_text): - """Finds an element by a partial match of its link text. - Args: - link_text: The text of the element to partially match on. - Usage: - driver.find_element_by_partial_link_text('Sign') - """ - return self.find_element(by=By.PARTIAL_LINK_TEXT, value=link_text) - - def find_elements_by_partial_link_text(self, link_text): - """Finds elements by a partial match of their link text. - Args: - link_text: The text of the element to partial match on. - Usage: - driver.find_element_by_partial_link_text('Sign') - """ - return self.find_elements(by=By.PARTIAL_LINK_TEXT, value=link_text) - - def find_element_by_name(self, name): - """Finds an element by name. - Args: - name: The name of the element to find. - Usage: - driver.find_element_by_name('foo') - """ - return self.find_element(by=By.NAME, value=name) - - def find_elements_by_name(self, name): - """Finds elements by name. - Args: - name: The name of the elements to find. - Usage: - driver.find_elements_by_name('foo') - """ - return self.find_elements(by=By.NAME, value=name) - - def find_element_by_tag_name(self, name): - """Finds an element by tag name. - Args: - name: The tag name of the element to find. - Usage: - driver.find_element_by_tag_name('foo') - """ - return self.find_element(by=By.TAG_NAME, value=name) - - def find_elements_by_tag_name(self, name): - """Finds elements by tag name. - Args: - name: The tag name the use when finding elements. - Usage: - driver.find_elements_by_tag_name('foo') - """ - return self.find_elements(by=By.TAG_NAME, value=name) - - def find_element_by_class_name(self, name): - """Finds an element by class name. - Args: - name: The class name of the element to find. - Usage: - driver.find_element_by_class_name('foo') - """ - return self.find_element(by=By.CLASS_NAME, value=name) - - def find_elements_by_class_name(self, name): - """Finds elements by class name. - Args: - name: The class name of the elements to find. - Usage: - driver.find_elements_by_class_name('foo') - """ - return self.find_elements(by=By.CLASS_NAME, value=name) - - def find_element_by_css_selector(self, css_selector): - """Finds an element by css selector. - Args: - css_selector: The css selector to use when finding elements. - Usage: - driver.find_element_by_css_selector('#foo') - """ - return self.find_element(by=By.CSS_SELECTOR, value=css_selector) - - def find_elements_by_css_selector(self, css_selector): - """Finds elements by css selector. - Args: - css_selector: The css selector to use when finding elements. - Usage: - driver.find_element_by_css_selector('#foo') - """ - return self.find_elements(by=By.CSS_SELECTOR, value=css_selector) - - def execute_script(self, script, *args): - """Synchronously Executes JavaScript in the current window/frame. - Args: - script: The JavaScript to execute. - *args: Any applicable arguments for your JavaScript. - Usage: - driver.execute_script('document.title') - """ - if len(args) == 1: - converted_args = args[0] - else: - converted_args = list(args) - converted_args = list(args) - return self.execute(Command.EXECUTE_SCRIPT, - {'script': script, 'args':converted_args})['value'] - - def execute_async_script(self, script, *args): - """Asynchronously Executes JavaScript in the current window/frame. - Args: - script: The JavaScript to execute. - args: Any applicable arguments for your JavaScript. - Usage: - driver.execute_async_script('document.title') - """ - if len(args) == 1: - converted_args = args[0] - else: - converted_args = list(args) - converted_args = list(args) - return self.execute(Command.EXECUTE_ASYNC_SCRIPT, - {'script': script, 'args':converted_args})['value'] - - @property - def current_url(self): - """Gets the URL of the current page. - Usage: - driver.current_url - """ - return self.execute(Command.GET_CURRENT_URL)['value'] - - @property - def page_source(self): - """Gets the source of the current page. - Usage: - driver.page_source - """ - return self.execute(Command.GET_PAGE_SOURCE)['value'] - - def close(self): - """Closes the current window. - Usage: - driver.close() - """ - self.execute(Command.CLOSE) - - def quit(self): - """Quits the driver and closes every associated window. - Usage: - driver.quit() - """ - try: - self.execute(Command.QUIT) - finally: - self.stop_client() - - @property - def current_window_handle(self): - """Returns the handle of the current window. - Usage: - driver.current_window_handle - """ - return self.execute(Command.GET_CURRENT_WINDOW_HANDLE)['value'] - - @property - def window_handles(self): - """Returns the handles of all windows within the current session. - Usage: - driver.window_handles - """ - return self.execute(Command.GET_WINDOW_HANDLES)['value'] - - #Target Locators - def switch_to_active_element(self): - """Returns the element with focus, or BODY if nothing has focus. - Usage: - driver.switch_to_active_element() - """ - return self.execute(Command.GET_ACTIVE_ELEMENT)['value'] - - def switch_to_window(self, window_name): - """Switches focus to the specified window. - Args: - window_name: The name of the window to switch to. - Usage: - driver.switch_to_window('main') - """ - self.execute(Command.SWITCH_TO_WINDOW, {'name': window_name}) - - def switch_to_frame(self, index_or_name): - """Switches focus to the specified frame, by index or name. - Args: - index_or_name: The name of the window to switch to, or - an integer representing the index to switch to. - Usage: - driver.switch_to_frame('frame_name') - driver.switch_to_frame(1) - """ - self.execute(Command.SWITCH_TO_FRAME, {'id': index_or_name}) - - def switch_to_default_content(self): - """Switch focus to the default frame. - Usage: - driver.switch_to_default_content() - """ - self.execute(Command.SWITCH_TO_FRAME, {'id': None}) - - def switch_to_alert(self): - """Switches focus to an alert on the page. - Usage: - driver.switch_to_alert() - """ - return Alert(self) - - #Navigation - def back(self): - """Goes one step backward in the browser history. - Usage: - driver.back() - """ - self.execute(Command.GO_BACK) - - def forward(self): - """Goes one step forward in the browser history. - Usage: - driver.forward() - """ - self.execute(Command.GO_FORWARD) - - def refresh(self): - """Refreshes the current page. - Usage: - driver.refresh() - """ - self.execute(Command.REFRESH) - - # Options - def get_cookies(self): - """Returns a set of dictionaries, corresponding to cookies visible in the - current session. - Usage: - driver.get_cookies() - """ - return self.execute(Command.GET_ALL_COOKIES)['value'] - - def get_cookie(self, name): - """Get a single cookie by name. Returns the cookie if found, None if not. - Usage: - driver.get_cookie('my_cookie') - """ - cookies = self.get_cookies() - for cookie in cookies: - if cookie['name'] == name: - return cookie - return None - - def delete_cookie(self, name): - """Deletes a single cookie with the given name. - Usage: - driver.delete_cookie('my_cookie') - """ - self.execute(Command.DELETE_COOKIE, {'name': name}) - - def delete_all_cookies(self): - """Delete all cookies in the scope of the session. - Usage: - driver.delete_all_cookies() - """ - self.execute(Command.DELETE_ALL_COOKIES) - - def add_cookie(self, cookie_dict): - """Adds a cookie to your current session. - Args: - cookie_dict: A dictionary object, with the desired cookie name as the key, and - the value being the desired contents. - Usage: - driver.add_cookie({'foo': 'bar',}) - """ - self.execute(Command.ADD_COOKIE, {'cookie': cookie_dict}) - - # Timeouts - def implicitly_wait(self, time_to_wait): - """Sets a sticky timeout to implicitly wait for an element to be found, - or a command to complete. This method only needs to be called one time per session. - Args: - time_to_wait: Amount of time to wait - Usage: - driver.implicitly_wait(30) - """ - self.execute(Command.IMPLICIT_WAIT, {'ms': float(time_to_wait) * 1000}) - - def set_script_timeout(self, time_to_wait): - """Set the amount of time that the script should wait before throwing an - error. - Args: - time_to_wait: The amount of time to wait - Usage: - driver.set_script_timeout(30) - """ - self.execute(Command.SET_SCRIPT_TIMEOUT, {'ms': float(time_to_wait) * 1000}) - - def find_element(self, by=By.ID, value=None): - """'Private' method used by the find_element_by_* methods. - Usage: - Use the corresponding find_element_by_* instead of this. - """ - return self.execute(Command.FIND_ELEMENT, - {'using': by, 'value': value})['value'] - - def find_elements(self, by=By.ID, value=None): - """'Private' method used by the find_elements_by_* methods. - Usage: - Use the corresponding find_elements_by_* instead of this. - """ - return self.execute(Command.FIND_ELEMENTS, - {'using': by, 'value': value})['value'] - @property - def desired_capabilities(self): - """ returns the drivers current desired capabilities being used""" - return self.capabilities - - def get_screenshot_as_file(self, filename): - """Gets the screenshot of the current window. Returns False if there is - any IOError, else returns True. Use full paths in your filename. - Args: - filename: The full path you wish to save your screenshot to. - Usage: - driver.get_screenshot_as_file('/Screenshots/foo.png') - """ - png = self.execute(Command.SCREENSHOT)['value'] - try: - with open(filename, 'wb') as f: - f.write(base64.decodestring(png)) - except IOError: - return False - del png - return True - - def get_screenshot_as_base64(self): - """Gets the screenshot of the current window as a base64 encoded string - which is useful in embedded images in HTML. - Usage: - driver.get_screenshot_as_base64() - """ - return self.execute(Command.SCREENSHOT)['value'] diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/webelement.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/webelement.py deleted file mode 100644 index 4b42cead1..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/remote/webelement.py +++ /dev/null @@ -1,202 +0,0 @@ -# Copyright 2008-2009 WebDriver committers -# Copyright 2008-2009 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -"""WebElement implementation.""" -from command import Command -from selenium.common.exceptions import NoSuchAttributeException -from selenium.webdriver.common.by import By -from selenium.webdriver.common.keys import Keys - - -class WebElement(object): - """Represents an HTML element. - - Generally, all interesting operations to do with interacting with a page - will be performed through this interface.""" - def __init__(self, parent, id_): - self._parent = parent - self._id = id_ - - @property - def tag_name(self): - """Gets this element's tagName property.""" - return self._execute(Command.GET_ELEMENT_TAG_NAME)['value'] - - @property - def text(self): - """Gets the text of the element.""" - return self._execute(Command.GET_ELEMENT_TEXT)['value'] - - def click(self): - """Clicks the element.""" - self._execute(Command.CLICK_ELEMENT) - - def submit(self): - """Submits a form.""" - self._execute(Command.SUBMIT_ELEMENT) - - def clear(self): - """Clears the text if it's a text entry element.""" - self._execute(Command.CLEAR_ELEMENT) - - def get_attribute(self, name): - """Gets the attribute value.""" - resp = self._execute(Command.GET_ELEMENT_ATTRIBUTE, {'name': name}) - attributeValue = '' - if resp['value'] is None: - attributeValue = None - else: - attributeValue = unicode(resp['value']) - if type(resp['value']) is bool: - attributeValue = attributeValue.lower() - - return attributeValue - - def is_selected(self): - """Whether the element is selected.""" - return self._execute(Command.IS_ELEMENT_SELECTED)['value'] - - def is_enabled(self): - """Whether the element is enabled.""" - return self._execute(Command.IS_ELEMENT_ENABLED)['value'] - - def find_element_by_id(self, id_): - """Finds element by id.""" - return self.find_element(by=By.ID, value=id_) - - def find_elements_by_id(self, id_): - return self.find_elements(by=By.ID, value=id_) - - def find_element_by_name(self, name): - """Find element by name.""" - return self.find_element(by=By.NAME, value=name) - - def find_elements_by_name(self, name): - return self.find_elements(by=By.NAME, value=name) - - def find_element_by_link_text(self, link_text): - """Finds element by link text.""" - return self.find_element(by=By.LINK_TEXT, value=link_text) - - def find_elements_by_link_text(self, link_text): - return self.find_elements(by=By.LINK_TEXT, value=link_text) - - def find_element_by_partial_link_text(self, link_text): - return self.find_element(by=By.PARTIAL_LINK_TEXT, value=link_text) - - def find_elements_by_partial_link_text(self, link_text): - return self.find_elements(by=By.PARTIAL_LINK_TEXT, value=link_text) - - def find_element_by_tag_name(self, name): - return self.find_element(by=By.TAG_NAME, value=name) - - def find_elements_by_tag_name(self, name): - return self.find_elements(by=By.TAG_NAME, value=name) - - def find_element_by_xpath(self, xpath): - """Finds element by xpath.""" - return self.find_element(by=By.XPATH, value=xpath) - - def find_elements_by_xpath(self, xpath): - """Finds elements within the elements by xpath.""" - return self.find_elements(by=By.XPATH, value=xpath) - - def find_element_by_class_name(self, name): - """Finds an element by their class name.""" - return self.find_element(by=By.CLASS_NAME, value=name) - - def find_elements_by_class_name(self, name): - """Finds elements by their class name.""" - return self.find_elements(by=By.CLASS_NAME, value=name) - - def find_element_by_css_selector(self, css_selector): - """Find and return an element by CSS selector.""" - return self.find_element(by=By.CSS_SELECTOR, value=css_selector) - - def find_elements_by_css_selector(self, css_selector): - """Find and return list of multiple elements by CSS selector.""" - return self.find_elements(by=By.CSS_SELECTOR, value=css_selector) - - def send_keys(self, *value): - """Simulates typing into the element.""" - typing = [] - for val in value: - if isinstance(val, Keys): - typing.append(val) - elif isinstance(val, int): - val = str(val) - for i in range(len(val)): - typing.append(val[i]) - else: - for i in range(len(val)): - typing.append(val[i]) - self._execute(Command.SEND_KEYS_TO_ELEMENT, {'value': typing}) - - # RenderedWebElement Items - def is_displayed(self): - """Whether the element would be visible to a user""" - return self._execute(Command.IS_ELEMENT_DISPLAYED)['value'] - - @property - def size(self): - """ Returns the size of the element """ - size = self._execute(Command.GET_ELEMENT_SIZE)['value'] - new_size = {} - new_size["height"] = size["height"] - new_size["width"] = size["width"] - return new_size - - def value_of_css_property(self, property_name): - """ Returns the value of a CSS property """ - return self._execute(Command.GET_ELEMENT_VALUE_OF_CSS_PROPERTY, - {'propertyName': property_name})['value'] - - @property - def location(self): - """ Returns the location of the element in the renderable canvas""" - return self._execute(Command.GET_ELEMENT_LOCATION)['value'] - - @property - def parent(self): - return self._parent - - @property - def id(self): - return self._id - - # Private Methods - def _execute(self, command, params=None): - """Executes a command against the underlying HTML element. - - Args: - command: The name of the command to _execute as a string. - params: A dictionary of named parameters to send with the command. - - Returns: - The command's JSON response loaded into a dictionary object. - """ - if not params: - params = {} - params['id'] = self._id - return self._parent.execute(command, params) - - def find_element(self, by=By.ID, value=None): - return self._execute(Command.FIND_CHILD_ELEMENT, - {"using": by, "value": value})['value'] - - def find_elements(self, by=By.ID, value=None): - return self._execute(Command.FIND_CHILD_ELEMENTS, - {"using": by, "value": value})['value'] diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/support/__init__.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/support/__init__.py deleted file mode 100644 index 79219fdf0..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/support/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/python -# -# Copyright 2011 WebDriver committers -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/support/ui.py b/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/support/ui.py deleted file mode 100644 index e5cf2dd40..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/support/ui.py +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright 2011 WebDriver committers -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import time -from selenium.common.exceptions import NoSuchElementException -from selenium.common.exceptions import TimeoutException - -POLL_FREQUENCY = 0.5 # How long to sleep inbetween checks to the - - -class WebDriverWait(object): - - def __init__(self, driver, timeout, poll_frequency=POLL_FREQUENCY): - """Constructor, takes a WebDriver instance and timeout in seconds.""" - self._driver = driver - self._timeout = timeout - self._poll = poll_frequency - # avoid the divide by zero - if self._poll == 0: - self._poll = POLL_FREQUENCY - - def until(self, method): - """Calls the method provided with the driver as an argument until the \ - return value is not Falsy.""" - for _ in xrange(max(1, int(self._timeout/self._poll))): - try: - value = method(self._driver) - if value: - return value - except NoSuchElementException: - pass - time.sleep(self._poll) - raise TimeoutException() diff --git a/src/Selenium2Library/lib/selenium-2.8.1/selenium.egg-info/PKG-INFO b/src/Selenium2Library/lib/selenium-2.8.1/selenium.egg-info/PKG-INFO deleted file mode 100644 index d287b7864..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/selenium.egg-info/PKG-INFO +++ /dev/null @@ -1,78 +0,0 @@ -Metadata-Version: 1.0 -Name: selenium -Version: 2.8.1 -Summary: Python bindings for Selenium -Home-page: http://code.google.com/p/selenium/ -Author: UNKNOWN -Author-email: UNKNOWN -License: UNKNOWN -Description: ============ - Introduction - ============ - :Author: David Burns - - Selenium Python Client Driver is a Python language binding for Selenium Remote - Control (version 1.0 and 2.0). - - Currently the remote protocol, Firefox and Chrome for Selenium 2.0 are - supported, as well as the Selenium 1.0 bindings. As work will progresses we'll - add more "native" drivers. - - See here_ for more information. - - .. _here: http://code.google.com/p/selenium/ - - Installing - ========== - - Python Client - ------------- - :: - - pip install -U selenium - - Java Server - ----------- - - Download the server from http://selenium.googlecode.com/files/selenium-server-standalone-2.8.0.jar - :: - - java -jar selenium-server-standalone-2.8.0.jar - - Example - ======= - :: - - from selenium import webdriver - from selenium.common.exceptions import NoSuchElementException - from selenium.webdriver.common.keys import Keys - import time - - browser = webdriver.Firefox() # Get local session of firefox - browser.get("http://www.yahoo.com") # Load page - assert "Yahoo!" in browser.title - elem = browser.find_element_by_name("p") # Find the query box - elem.send_keys("seleniumhq" + Keys.RETURN) - time.sleep(0.2) # Let the page load, will be added to the API - try: - browser.find_element_by_xpath("//a[contains(@href,'http://seleniumhq.org')]") - except NoSuchElementException: - assert 0, "can't find seleniumhq" - browser.close() - - Documentation - ============= - Coming soon, in the meantime - `"Use the source Luke"`_ - - .. _"Use the source Luke": http://code.google.com/p/selenium/source/browse/trunk/py/selenium/webdriver/remote/webdriver.py - -Platform: UNKNOWN -Classifier: Development Status :: 5 - Production/Stable -Classifier: Intended Audience :: Developers -Classifier: License :: OSI Approved :: Apache Software License -Classifier: Operating System :: POSIX -Classifier: Operating System :: Microsoft :: Windows -Classifier: Operating System :: MacOS :: MacOS X -Classifier: Topic :: Software Development :: Testing -Classifier: Topic :: Software Development :: Libraries -Classifier: Programming Language :: Python diff --git a/src/Selenium2Library/lib/selenium-2.8.1/selenium.egg-info/SOURCES.txt b/src/Selenium2Library/lib/selenium-2.8.1/selenium.egg-info/SOURCES.txt deleted file mode 100644 index 59d5e10f7..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/selenium.egg-info/SOURCES.txt +++ /dev/null @@ -1,67 +0,0 @@ -.classpath -.git-fixfiles -.gitignore -.project -COPYING -CREDITS.txt -MANIFEST.in -README.md -Rakefile -WebDriver.sln -WebDriver.snk -go -go.bat -properties.yml -selenium.eml -selenium.iml -setup.py -wire.py -docs/api/py/index.rst -py/CHANGES -py/selenium/__init__.py -py/selenium/selenium.py -py/selenium/common/__init__.py -py/selenium/common/exceptions.py -py/selenium/webdriver/__init__.py -py/selenium/webdriver/chrome/__init__.py -py/selenium/webdriver/chrome/service.py -py/selenium/webdriver/chrome/webdriver.py -py/selenium/webdriver/common/__init__.py -py/selenium/webdriver/common/action_chains.py -py/selenium/webdriver/common/alert.py -py/selenium/webdriver/common/by.py -py/selenium/webdriver/common/desired_capabilities.py -py/selenium/webdriver/common/keys.py -py/selenium/webdriver/common/utils.py -py/selenium/webdriver/emulation/__init__.py -py/selenium/webdriver/emulation/base.py -py/selenium/webdriver/emulation/navigation.py -py/selenium/webdriver/emulation/selenium1.py -py/selenium/webdriver/firefox/__init__.py -py/selenium/webdriver/firefox/extension_connection.py -py/selenium/webdriver/firefox/firefox_binary.py -py/selenium/webdriver/firefox/firefox_profile.py -py/selenium/webdriver/firefox/webdriver.py -py/selenium/webdriver/firefox/webdriver.xpi -py/selenium/webdriver/ie/__init__.py -py/selenium/webdriver/ie/webdriver.py -py/selenium/webdriver/ie/win32/IEDriver.dll -py/selenium/webdriver/ie/x64/IEDriver.dll -py/selenium/webdriver/opera/__init__.py -py/selenium/webdriver/opera/service.py -py/selenium/webdriver/opera/webdriver.py -py/selenium/webdriver/remote/__init__.py -py/selenium/webdriver/remote/command.py -py/selenium/webdriver/remote/errorhandler.py -py/selenium/webdriver/remote/remote_connection.py -py/selenium/webdriver/remote/utils.py -py/selenium/webdriver/remote/webdriver.py -py/selenium/webdriver/remote/webelement.py -py/selenium/webdriver/support/__init__.py -py/selenium/webdriver/support/ui.py -selenium.egg-info/PKG-INFO -selenium.egg-info/SOURCES.txt -selenium.egg-info/dependency_links.txt -selenium.egg-info/not-zip-safe -selenium.egg-info/requires.txt -selenium.egg-info/top_level.txt \ No newline at end of file diff --git a/src/Selenium2Library/lib/selenium-2.8.1/selenium.egg-info/dependency_links.txt b/src/Selenium2Library/lib/selenium-2.8.1/selenium.egg-info/dependency_links.txt deleted file mode 100644 index 8b1378917..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/selenium.egg-info/dependency_links.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/Selenium2Library/lib/selenium-2.8.1/selenium.egg-info/not-zip-safe b/src/Selenium2Library/lib/selenium-2.8.1/selenium.egg-info/not-zip-safe deleted file mode 100644 index 8b1378917..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/selenium.egg-info/not-zip-safe +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/Selenium2Library/lib/selenium-2.8.1/selenium.egg-info/requires.txt b/src/Selenium2Library/lib/selenium-2.8.1/selenium.egg-info/requires.txt deleted file mode 100644 index fa9c3161f..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/selenium.egg-info/requires.txt +++ /dev/null @@ -1 +0,0 @@ -rdflib==3.1.0 \ No newline at end of file diff --git a/src/Selenium2Library/lib/selenium-2.8.1/selenium.egg-info/top_level.txt b/src/Selenium2Library/lib/selenium-2.8.1/selenium.egg-info/top_level.txt deleted file mode 100644 index 7cb6656b2..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/selenium.egg-info/top_level.txt +++ /dev/null @@ -1 +0,0 @@ -selenium diff --git a/src/Selenium2Library/lib/selenium-2.8.1/selenium.eml b/src/Selenium2Library/lib/selenium-2.8.1/selenium.eml deleted file mode 100644 index 569e62d82..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/selenium.eml +++ /dev/null @@ -1,186 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Selenium2Library/lib/selenium-2.8.1/selenium.iml b/src/Selenium2Library/lib/selenium-2.8.1/selenium.iml deleted file mode 100644 index 46adf0f79..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/selenium.iml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/Selenium2Library/lib/selenium-2.8.1/setup.cfg b/src/Selenium2Library/lib/selenium-2.8.1/setup.cfg deleted file mode 100644 index 861a9f554..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/setup.cfg +++ /dev/null @@ -1,5 +0,0 @@ -[egg_info] -tag_build = -tag_date = 0 -tag_svn_revision = 0 - diff --git a/src/Selenium2Library/lib/selenium-2.8.1/setup.py b/src/Selenium2Library/lib/selenium-2.8.1/setup.py deleted file mode 100644 index 9ac5d034b..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/setup.py +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env python -# Copyright 2008-2009 WebDriver committers -# Copyright 2008-2009 Google Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -from setuptools import setup -from setuptools.command.install import install - -from os.path import dirname, join, isfile -from shutil import copy -import sys - - -def setup_python3(): - # Taken from "distribute" setup.py - from distutils.filelist import FileList - from distutils import dir_util, file_util, util, log - - tmp_src = join("build", "src") - log.set_verbosity(1) - fl = FileList() - for line in open("MANIFEST.in"): - if not line.strip(): - continue - fl.process_template_line(line) - dir_util.create_tree(tmp_src, fl.files) - outfiles_2to3 = [] - for f in fl.files: - outf, copied = file_util.copy_file(f, join(tmp_src, f), update=1) - if copied and outf.endswith(".py"): - outfiles_2to3.append(outf) - - util.run_2to3(outfiles_2to3) - - # arrange setup to use the copy - sys.path.insert(0, tmp_src) - - return tmp_src - - -def find_longdesc(): - for path in ("docs/api/py/index.rst", "docs/index.rst"): - try: - index = join(dirname(__file__), path) - return open(index).read() - except IOError: - pass - - print("WARNING: Can't find index.rst") - return "" - -if sys.version_info >= (3,): - src_root = setup_python3() -else: - src_root = "." - - -setup( - cmdclass={'install': install}, - name='selenium', - version="2.8.1", - description='Python bindings for Selenium', - long_description=find_longdesc(), - url='http://code.google.com/p/selenium/', - src_root=src_root, - classifiers=['Development Status :: 5 - Production/Stable', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: Apache Software License', - 'Operating System :: POSIX', - 'Operating System :: Microsoft :: Windows', - 'Operating System :: MacOS :: MacOS X', - 'Topic :: Software Development :: Testing', - 'Topic :: Software Development :: Libraries', - 'Programming Language :: Python'], - package_dir={ - 'selenium': 'py/selenium', - 'selenium.common': 'py/selenium/common', - 'selenium.webdriver': 'py/selenium/webdriver', - 'selenium.webdriver.chrome': 'py/selenium/webdriver/chrome', - 'selenium.webdriver.common': 'py/selenium/webdriver/common', - 'selenium.webdriver.firefox': 'py/selenium/webdriver/firefox', - 'selenium.webdriver.ie': 'py/selenium/webdriver/ie', - 'selenium.webdriver.remote': 'py/selenium/webdriver/remote', - 'selenium.webdriver.support': 'py/selenium/webdriver/support', - }, - packages=['selenium', - 'selenium.common', - 'selenium.webdriver', - 'selenium.webdriver.chrome', - 'selenium.webdriver.common', - 'selenium.webdriver.support', - 'selenium.webdriver.firefox', - 'selenium.webdriver.ie', - 'selenium.webdriver.remote', - 'selenium.webdriver.support', ], - package_data={ - 'selenium.webdriver.firefox': ['*.xpi'], - }, - data_files=[('selenium/webdriver/ie/win32',['py/selenium/webdriver/ie/win32/IEDriver.dll']), - ('selenium/webdriver/ie/x64',['py/selenium/webdriver/ie/x64/IEDriver.dll'])], - include_package_data=True, - install_requires=['rdflib==3.1.0'], - zip_safe=False, - -) diff --git a/src/Selenium2Library/lib/selenium-2.8.1/wire.py b/src/Selenium2Library/lib/selenium-2.8.1/wire.py deleted file mode 100644 index b7aa6cd92..000000000 --- a/src/Selenium2Library/lib/selenium-2.8.1/wire.py +++ /dev/null @@ -1,1526 +0,0 @@ -# Copyright 2008-2010 WebDriver committers -# Copyright 2008-2010 Google Inc. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Script for generating the wire protocol wiki documentation. - -This script is probably overkill, but it ensures commands are documented with -consistent formatting. - -Usage: - - python trunk/wire.py > wiki/JsonWireProtocol.wiki -""" - -import re -import sys - -class Resource(object): - def __init__(self, path): - self.path = path - self.methods = [] - - def __getattribute__(self, attr): - try: - return super(Resource, self).__getattribute__(attr) - except AttributeError, e: - if self.methods: - return self.methods[len(self.methods) - 1].__getattribute__(attr) - raise e - - def Post(self, summary): - return self.AddMethod(Method(self, 'POST', summary)) - - def Get(self, summary): - return self.AddMethod(Method(self, 'GET', summary)) - - def Delete(self, summary): - return self.AddMethod(Method(self, 'DELETE', summary)) - - def AddMethod(self, method): - self.methods.append(method) - return self - - def ToWikiString(self): - str = '=== %s ===\n' % self.path - for method in self.methods: - str = '%s%s' % (str, method.ToWikiString(self.path)) - return str - - def ToWikiTableString(self): - return ''.join(m.ToWikiTableString() for m in self.methods) - - -class SessionResource(Resource): - def AddMethod(self, method): - return (Resource.AddMethod(self, method). - AddUrlParameter(':sessionId', - 'ID of the session to route the command to.')) - - -class ElementResource(SessionResource): - def AddMethod(self, method): - return (SessionResource.AddMethod(self, method). - AddUrlParameter(':id', - 'ID of the element to route the command to.'). - AddError('StaleElementReference', - 'If the element referenced by `:id` is no longer attached ' - 'to the page\'s DOM.')) - - def RequiresVisibility(self): - return self.AddError('ElementNotVisible', - 'If the referenced element is not visible on the page ' - '(either is hidden by CSS, has 0-width, or has 0-height)') - - def RequiresEnabledState(self): - return self.AddError('InvalidElementState', - 'If the referenced element is disabled.') - - -class Method(object): - def __init__(self, parent, method, summary): - self.parent = parent - self.method = method - self.summary = summary - self.url_parameters = [] - self.json_parameters = [] - self.return_type = None - self.errors = {} - - def AddUrlParameter(self, name, description): - self.url_parameters.append({ - 'name': name, - 'desc': description}) - return self.parent - - def AddJsonParameter(self, name, type, description): - self.json_parameters.append({ - 'name': name, - 'type': type, - 'desc': description}) - return self.parent - - def AddError(self, type, summary): - self.errors[type] = {'type': type, 'summary': summary} - return self.parent - - def SetReturnType(self, type, description): - self.return_type = { - 'type': type, - 'desc': description} - return self.parent - - def _GetUrlParametersWikiString(self): - if not self.url_parameters: - return '' - return ''' -
-
-
*URL Parameters:*
-%s -
-
''' % '\n'.join('
`%s` - %s
' % - (param['name'], param['desc']) - for param in self.url_parameters) - - def _GetJsonParametersWikiString(self): - if not self.json_parameters: - return '' - return ''' -
-
-
*JSON Parameters:*
-%s -
-
''' % '\n'.join('
`%s` - `%s` %s
' % - (param['name'], param['type'], param['desc']) - for param in self.json_parameters) - - def _GetReturnTypeWikiString(self): - if not self.return_type: - return '' - type = '' - if self.return_type['type']: - type = '`%s` ' % self.return_type['type'] - return ''' -
-
-
*Returns:*
-
%s%s
-
-
''' % (type, self.return_type['desc']) - - def _GetErrorWikiString(self): - if not self.errors.values(): - return '' - return ''' -
-
-
*Potential Errors:*
-%s -
-
''' % '\n'.join('
`%s` - %s
' % - (error['type'], error['summary']) - for error in self.errors.values()) - - def ToWikiString(self, path): - return ''' -
-
-==== %s %s ==== -
-
-
-
%s
%s%s%s%s -
-
-
-''' % (self.method, path, self.summary, - self._GetUrlParametersWikiString(), - self._GetJsonParametersWikiString(), - self._GetReturnTypeWikiString(), - self._GetErrorWikiString()) - - def ToWikiTableString(self): - return '|| %s || [#%s_%s %s] || %s ||\n' % ( - self.method, self.method, self.parent.path, self.parent.path, - self.summary[:self.summary.find('.') + 1].replace('\n', '').strip()) - - -class ErrorCode(object): - def __init__(self, code, summary, detail): - self.code = code - self.summary = summary - self.detail = detail - - def ToWikiTableString(self): - return '|| %d || `%s` || %s ||' % (self.code, self.summary, self.detail) - -def log(string): - sys.stderr.write(str(string) + '\n') - -class AbstractErrorCodeGatherer(object): - def __init__(self, name, path_to_error_codes, regex): - self.name = name - self.path_to_error_codes = path_to_error_codes - self.regex = regex - - def __str__(self): - return self.name - - def get_error_codes(self): - error_codes = {} - error_codes_file = open(self.path_to_error_codes, 'r') - try: - for line in error_codes_file: - match = self.regex.match(line) - if match is not None: - name, code = self.extract_from_match(match) - error_codes[code] = name - finally: - error_codes_file.close() - return error_codes - - def extract_from_match(self, match): - raise NotImplementedError - -class JavaErrorCodeGatherer(AbstractErrorCodeGatherer): - def __init__(self, path_to_error_codes): - super(JavaErrorCodeGatherer, self).__init__( \ - 'Java', - path_to_error_codes, \ - re.compile('^\s*public static final int ([A-Z_]+) = (\d+);$')) - - def extract_from_match(self, match): - return match.group(1), int(match.group(2)) - -class JavascriptErrorCodeGatherer(AbstractErrorCodeGatherer): - def __init__(self, path_to_error_codes, name): - super(JavascriptErrorCodeGatherer, self).__init__( \ - name, - path_to_error_codes, \ - re.compile('^\s*([A-Z_]+): (\d+)')) - - def extract_from_match(self, match): - return match.group(1), int(match.group(2)) - -class RubyErrorCodeGatherer(AbstractErrorCodeGatherer): - def __init__(self, path_to_error_codes): - super(RubyErrorCodeGatherer, self).__init__( \ - 'Ruby', - path_to_error_codes, \ - re.compile('^\s*(([A-Z][a-z]*)+),?\s*# (\d+)$')) - - def extract_from_match(self, match): - return match.group(1), int(match.group(len(match.groups()))) - -class PythonErrorCodeGatherer(AbstractErrorCodeGatherer): - def __init__(self, path_to_error_codes): - super(PythonErrorCodeGatherer, self).__init__( \ - 'Python', - path_to_error_codes, \ - re.compile('^\s*([A-Z_]+) = (\d+)$')) - - def extract_from_match(self, match): - return match.group(1), int(match.group(2)) - -class CErrorCodeGatherer(AbstractErrorCodeGatherer): - def __init__(self, path_to_error_codes): - super(CErrorCodeGatherer, self).__init__( \ - 'C', - path_to_error_codes, \ - re.compile('^#define ([A-Z]+)\s+(\d+)$')) - - def extract_from_match(self, match): - return match.group(1), int(match.group(2)) - -class CSharpErrorCodeGatherer(AbstractErrorCodeGatherer): - def __init__(self, path_to_error_codes): - super(CSharpErrorCodeGatherer, self).__init__( \ - 'C#', - path_to_error_codes, \ - re.compile('^\s*(([A-Z][a-z]*)+) = (\d+)')) - - def extract_from_match(self, match): - return match.group(1), int(match.group(len(match.groups()))) - -class ErrorCodeChecker(object): - def __init__(self): - self.gatherers = [] - self.inconsistencies = {} - - def using(self, gatherer): - self.gatherers.append(gatherer) - return self - - def check_error_codes_are_consistent(self, json_error_codes): - log('Checking error codes are consistent across languages and \ -browsers') - for gatherer in self.gatherers: - self.compare(gatherer, json_error_codes) - if not self.inconsistencies: - log('Error codes are consistent') - for code,(present,missing) in self.inconsistencies.items(): - log('Error code %d was present in %s but not %s' % (code, present, missing)) - - def add_inconsistency(self, code, present_in, missing_from): - if self.inconsistencies.has_key(code): - already_present, already_missing = self.inconsistencies[code] - already_present.add(present_in) - already_missing.add(missing_from) - else: - self.inconsistencies[code] = (set([present_in]), set([missing_from])) - - def compare(self, gatherer, raw_json_error_codes): - log('Checking %s (%s)' % (gatherer, gatherer.path_to_error_codes)) - gathered_error_codes = gatherer.get_error_codes() - json_error_codes = map(lambda code: code.code, raw_json_error_codes) - for json_error_code in json_error_codes: - if not gathered_error_codes.has_key(json_error_code): - self.add_inconsistency(json_error_code, 'JSON', str(gatherer)) - for gathered_code,_ in gathered_error_codes.items(): - if not gathered_code in json_error_codes: - self.add_inconsistency(gathered_code, str(gatherer), 'JSON') - - -def main(): - error_codes = [ - ErrorCode(0, 'Success', 'The command executed successfully.'), -# ErrorCode(1, 'IndexOutOfBounds', 'This is probably an unused \ -#implementation detail of an old version of the IEDriver.'), -# ErrorCode(2, 'NoCollection', 'This is probably an unused \ -#implementation detail of an old version of the IEDriver.'), -# ErrorCode(3, 'NoString', 'This is probably an unused \ -#implementation detail of an old version of the IEDriver.'), -# ErrorCode(4, 'NoStringLength', 'This is probably an unused \ -#implementation detail of an old version of the IEDriver.'), -# ErrorCode(5, 'NoStringWrapper', 'This is probably an unused \ -#implementation detail of an old version of the IEDriver.'), -# ErrorCode(6, 'NoSuchDriver', 'This is probably an unused \ -#implementation detail of an old version of the IEDriver.'), - ErrorCode(7, 'NoSuchElement', 'An element could not be located on the \ -page using the given search parameters.'), - ErrorCode(8, 'NoSuchFrame', 'A request to switch to a frame could not be \ -satisfied because the frame could not be found.'), - ErrorCode(9, 'UnknownCommand', 'The requested resource could not be \ -found, or a request was received using an HTTP method that is not supported \ -by the mapped resource.'), - ErrorCode(10, 'StaleElementReference', 'An element command failed \ -because the referenced element is no longer attached to the DOM.'), - ErrorCode(11, 'ElementNotVisible', 'An element command could not \ -be completed because the element is not visible on the page.'), - ErrorCode(12, 'InvalidElementState', 'An element command could not be \ -completed because the element is in an invalid state (e.g. attempting to \ -click a disabled element).'), - ErrorCode(13, 'UnknownError', 'An unknown server-side error occurred \ -while processing the command.'), -# ErrorCode(14, 'ExpectedError', 'This is probably an unused \ -#implementation detail of an old version of the IEDriver.'), - ErrorCode(15, 'ElementIsNotSelectable', 'An attempt was made to select \ -an element that cannot be selected.'), -# ErrorCode(16, 'NoSuchDocument', 'This is probably an unused \ -#implementation detail of an old version of the IEDriver.'), - ErrorCode(17, 'JavaScriptError', 'An error occurred while executing user \ -supplied !JavaScript.'), -# ErrorCode(18, 'NoScriptResult', 'This is probably an unused \ -#implementation detail of an old version of the IEDriver.'), - ErrorCode(19, 'XPathLookupError', 'An error occurred while searching for \ -an element by XPath.'), -# ErrorCode(20, 'NoSuchCollection', 'This is probably an unused \ -#implementation detail of an old version of the IEDriver.'), - ErrorCode(21, 'Timeout', 'An operation did not complete before its \ -timeout expired.'), -# ErrorCode(22, 'NullPointer', 'This is probably an unused \ -#implementation detail of an old version of the IEDriver.'), - ErrorCode(23, 'NoSuchWindow', 'A request to switch to a different window \ -could not be satisfied because the window could not be found.'), - ErrorCode(24, 'InvalidCookieDomain', 'An illegal attempt was made to set \ -a cookie under a different domain than the current page.'), - ErrorCode(25, 'UnableToSetCookie', 'A request to set a cookie\'s value \ -could not be satisfied.'), - ErrorCode(26, 'UnexpectedAlertOpen', 'A modal dialog was open, blocking \ -this operation'), - ErrorCode(27, 'NoAlertOpenError', 'An attempt was made to operate on a \ -modal dialog when one was not open.'), - ErrorCode(28, 'ScriptTimeout', 'A script did not complete before its \ -timeout expired.'), - ErrorCode(29, 'InvalidElementCoordinates', 'The coordinates provided to \ -an interactions operation are invalid.'), - ErrorCode(30, 'IMENotAvailable', 'IME was not available.'), - ErrorCode(31, 'IMEEngineActivationFailed', 'An IME engine could not be \ -started.'), - ErrorCode(32, 'InvalidSelector', 'Argument was an invalid selector \ -(e.g. XPath/CSS).') - ] - - ErrorCodeChecker() \ - .using(JavaErrorCodeGatherer('java/client/src/org/openqa/selenium/remote/ErrorCodes.java')) \ - .using(JavascriptErrorCodeGatherer('javascript/atoms/error.js', 'Javascript atoms')) \ - .using(JavascriptErrorCodeGatherer('javascript/firefox-driver/js/errorcode.js', 'Javascript firefox driver')) \ - .using(RubyErrorCodeGatherer('rb/lib/selenium/webdriver/common/error.rb')) \ - .using(PythonErrorCodeGatherer('py/selenium/webdriver/remote/errorhandler.py')) \ - .using(CErrorCodeGatherer('cpp/webdriver-interactions/errorcodes.h')) \ - .using(CSharpErrorCodeGatherer('dotnet/src/WebDriver/WebDriverResult.cs')) \ - .check_error_codes_are_consistent(error_codes) - - resources = [] - - resources.append(Resource('/status'). - Get(''' -Query the server\'s current status. The server should respond with a general \ -"HTTP 200 OK" response if it is alive and accepting commands. The response \ -body should be a JSON object describing the state of the server. All server \ -implementations should return two basic objects describing the server's \ -current platform and when the server was built. All fields are optional; \ -if omitted, the client should assume the value is uknown. Furthermore, \ -server implementations may include additional fields not listed here. - -|| *Key* || *Type* || *Description* || -|| build || object || || -|| build.version || string || A generic release label (i.e. "2.0rc3") || -|| build.revision || string || The revision of the local source control client \ -from which the server was built || -|| build.time || string || A timestamp from when the server was built. || -|| os || object || || -|| os.arch || string || The current system architecture. || -|| os.name || string || The name of the operating system the server is \ -currently running on: "windows", "linux", etc. || -|| os.version || string || The operating system version. || - -'''). - SetReturnType('{object}', - 'An object describing the general status of the server.')) - - resources.append( - Resource('/session'). - Post(''' -Create a new session. The server should attempt to create a session that most \ -closely matches the desired capabilities.'''). - AddJsonParameter('desiredCapabilities', - '{object}', - 'An object describing the session\'s ' - '[#Desired_Capabilities desired capabilities].'). - SetReturnType(None, - 'A `303 See Other` redirect to `/session/:sessionId`, where' - ' `:sessionId` is the ID of the newly created session.')) - - resources.append( - SessionResource('/session/:sessionId'). - Get('Retrieve the capabilities of the specified session.'). - SetReturnType('{object}', - 'An object describing the session\'s ' - '[#Actual_Capabilities capabilities].'). - Delete('Delete the session.')) - - resources.append( - SessionResource('/session/:sessionId/timeouts/async_script'). - Post('''Set the amount of time, in milliseconds, that asynchronous \ -scripts executed by `/session/:sessionId/execute_async` are permitted to run \ -before they are aborted and a |Timeout| error is returned to the client.'''). - AddJsonParameter('ms', '{number}', - 'The amount of time, in milliseconds, that time-limited' - ' commands are permitted to run.')) - - resources.append( - SessionResource('/session/:sessionId/timeouts/implicit_wait'). - Post('''Set the amount of time the driver should wait when searching for \ -elements. When -searching for a single element, the driver should poll the page until an \ -element is found or -the timeout expires, whichever occurs first. When searching for multiple \ -elements, the driver -should poll the page until at least one element is found or the timeout \ -expires, at which point -it should return an empty list. - -If this command is never sent, the driver should default to an implicit wait of\ - 0ms.'''). - AddJsonParameter('ms', '{number}', - 'The amount of time to wait, in milliseconds. This value' - ' has a lower bound of 0.')) - - resources.append( - SessionResource('/session/:sessionId/window_handle'). - Get('Retrieve the current window handle.'). - SetReturnType('{string}', 'The current window handle.')) - - resources.append( - SessionResource('/session/:sessionId/window_handles'). - Get('Retrieve the list of all window handles available to the session.'). - SetReturnType('{Array.}', 'A list of window handles.')) - - resources.append( - SessionResource('/session/:sessionId/url'). - Get('Retrieve the URL of the current page.'). - SetReturnType('{string}', 'The current URL.'). - Post('Navigate to a new URL.'). - AddJsonParameter('url', '{string}', 'The URL to navigate to.')) - - resources.append( - SessionResource('/session/:sessionId/forward'). - Post('Navigate forwards in the browser history, if possible.')) - - resources.append( - SessionResource('/session/:sessionId/back'). - Post('Navigate backwards in the browser history, if possible.')) - - resources.append( - SessionResource('/session/:sessionId/refresh'). - Post('Refresh the current page.')) - - resources.append( - SessionResource('/session/:sessionId/execute'). - Post(''' -Inject a snippet of !JavaScript into the page for execution in the context of \ -the currently selected frame. The executed script is assumed to be \ -synchronous and the result of evaluating the script is returned to the client. - -The `script` argument defines the script to execute in the form of a \ -function body. The value returned by that function will be returned to the \ -client. The function will be invoked with the provided `args` array and the \ -values may be accessed via the `arguments` object in the order specified. - -Arguments may be any JSON-primitive, array, or JSON object. JSON objects that \ -define a [#WebElement_JSON_Object WebElement reference] will be converted to \ -the corresponding DOM element. Likewise, any !WebElements in the script result \ -will be returned to the client as [#WebElement_JSON_Object WebElement \ -JSON objects].'''). - AddJsonParameter('script', '{string}', 'The script to execute.'). - AddJsonParameter('args', '{Array.<*>}', 'The script arguments.'). - AddError('JavaScriptError', 'If the script throws an Error.'). - AddError('StaleElementReference', - 'If one of the script arguments is a !WebElement that is not ' - 'attached to the page\'s DOM.'). - SetReturnType('{*}', 'The script result.')) - - resources.append( - SessionResource('/session/:sessionId/execute_async'). - Post(''' -Inject a snippet of !JavaScript into the page for execution in the context of \ -the currently selected frame. The executed script is assumed to be \ -asynchronous and must signal that is done by invoking the provided callback, \ -which is always provided as the final argument to the function. The value \ -to this callback will be returned to the client. - -Asynchronous script commands may not span page loads. If an `unload` event is \ -fired while waiting for a script result, an error should be returned to the \ -client. - -The `script` argument defines the script to execute in teh form of a function \ -body. The function will be invoked with the provided `args` array and the \ -values may be accessed via the `arguments` object in the order specified. The \ -final argument will always be a callback function that must be invoked to \ -signal that the script has finished. - -Arguments may be any JSON-primitive, array, or JSON object. JSON objects that \ -define a [#WebElement_JSON_Object WebElement reference] will be converted to \ -the corresponding DOM element. Likewise, any !WebElements in the script result \ -will be returned to the client as [#WebElement_JSON_Object WebElement \ -JSON objects].'''). - AddJsonParameter('script', '{string}', 'The script to execute.'). - AddJsonParameter('args', '{Array.<*>}', 'The script arguments.'). - AddError('JavaScriptError', - 'If the script throws an Error or if an `unload` event is ' - 'fired while waiting for the script to finish.'). - AddError('StaleElementReference', - 'If one of the script arguments is a !WebElement that is not ' - 'attached to the page\'s DOM.'). - AddError('Timeout', - 'If the script callback is not invoked before the timout ' - 'expires. Timeouts are controlled by the ' - '`/session/:sessionId/timeout/async_script` command.'). - SetReturnType('{*}', 'The script result.')) - - resources.append( - SessionResource('/session/:sessionId/screenshot'). - Get('Take a screenshot of the current page.'). - SetReturnType('{string}', 'The screenshot as a base64 encoded PNG.')) - - resources.append( - SessionResource('/session/:sessionId/ime/available_engines'). - Get('List all available engines on the machine. To use an engine, it has to be present in this list.'). - AddError('ImeNotAvailableException', 'If the host does not support IME'). - SetReturnType('{Array.}', 'A list of available engines')) - - resources.append( - SessionResource('/session/:sessionId/ime/active_engine'). - Get('Get the name of the active IME engine. The name string is platform specific.'). - AddError('ImeNotAvailableException', 'If the host does not support IME'). - SetReturnType('{string}', 'The name of the active IME engine.')) - - resources.append( - SessionResource('/session/:sessionId/ime/activated'). - Get('Indicates whether IME input is active at the moment (not if it\'s available.'). - AddError('ImeNotAvailableException', 'If the host does not support IME'). - SetReturnType('{boolean}', - 'true if IME input is available and currently active, false otherwise')) - - resources.append( - SessionResource('/session/:sessionId/ime/deactivate'). - Post('De-activates the currently-active IME engine.'). - AddError('ImeNotAvailableException', 'If the host does not support IME')) - - resources.append( - SessionResource('/session/:sessionId/ime/activate'). - Post('''Make an engines that is available (appears on the list -returned by getAvailableEngines) active. After this call, the engine will -be added to the list of engines loaded in the IME daemon and the input sent -using sendKeys will be converted by the active engine. -Note that this is a platform-independent method of activating IME -(the platform-specific way being using keyboard shortcuts'''). - AddJsonParameter('engine', '{string}', - 'Name of the engine to activate.'). - AddError('ImeActivationFailedException', - 'If the engine is not available or if the activation fails for other reasons.'). - AddError('ImeNotAvailableException', 'If the host does not support IME')) - - resources.append( - SessionResource('/session/:sessionId/frame'). - Post('''Change focus to another frame on the page. If the frame ID is \ -`null`, the server -should switch to the page's default content.'''). - AddJsonParameter('id', '{string|number|null}', - 'Identifier for the frame to change focus to.'). - AddError('NoSuchFrame', 'If the frame specified by `id` cannot be found.')) - - resources.append( - SessionResource('/session/:sessionId/window'). - Post('''Change focus to another window. The window to change focus to \ -may be specified by its -server assigned window handle, or by the value of its `name` attribute.'''). - AddJsonParameter('name', '{string}', 'The window to change focus to.'). - Delete('''Close the current window.'''). - AddError('NoSuchWindow', 'If the window specified by `name` cannot be found.')) - - resources.append( - SessionResource('/session/:sessionId/cookie'). - Get('Retrieve all cookies visible to the current page.'). - SetReturnType('{Array.}', 'A list of [#Cookie_JSON_Object cookies].'). - Post('''Set a cookie. If the [#Cookie_JSON_Object cookie] path is not \ -specified, it should be set to `"/"`. Likewise, if the domain is omitted, it \ -should default to the current page's domain.'''). - AddJsonParameter('cookie', '{object}', - 'A [#Cookie_JSON_Object JSON object] defining the ' - 'cookie to add.'). - Delete('''Delete all cookies visible to the current page.'''). - AddError('InvalidCookieDomain', - 'If the cookie\'s `domain` is not visible from the current page.'). - AddError('UnableToSetCookie', - 'If attempting to set a cookie on a page that does not support ' - 'cookies (e.g. pages with mime-type `text/plain`).')) - - resources.append( - SessionResource('/session/:sessionId/cookie/:name'). - Delete('''Delete the cookie with the given name. This command should be \ -a no-op if there is no -such cookie visible to the current page.'''). - AddUrlParameter(':name', 'The name of the cookie to delete.')) - - resources.append( - SessionResource('/session/:sessionId/source'). - Get('Get the current page source.'). - SetReturnType('{string}', 'The current page source.')) - - resources.append( - SessionResource('/session/:sessionId/title'). - Get('Get the current page title.'). - SetReturnType('{string}', 'The current page title.')) - - resources.append( - SessionResource('/session/:sessionId/element'). - Post('''Search for an element on the page, starting from the document \ -root. The located element will be returned as a WebElement JSON object. \ -The table below lists the locator strategies that each server should support. \ -Each locator must return the first matching element located in the DOM. - -|| *Strategy* || *Description* || -|| class name || Returns an element whose class name contains the search \ -value; compound class names are not permitted. || -|| css selector || Returns an element matching a CSS selector. || -|| id || Returns an element whose ID attribute matches the search value. || -|| name || Returns an element whose NAME attribute matches the search value. || -|| link text || Returns an anchor element whose visible text matches the \ -search value. || -|| partial link text || Returns an anchor element whose visible text \ -partially matches the search value. || -|| tag name || Returns an element whose tag name matches the search value. || -|| xpath || Returns an element matching an XPath expression. || - -'''). - AddJsonParameter('using', '{string}', 'The locator strategy to use.'). - AddJsonParameter('value', '{string}', 'The The search target.'). - SetReturnType('{ELEMENT:string}', - 'A WebElement JSON object for the located element.'). - AddError('XPathLookupError', 'If using XPath and the input expression is invalid.'). - AddError('NoSuchElement', 'If the element cannot be found.')) - - resources.append( - SessionResource('/session/:sessionId/elements'). - Post('''Search for multiple elements on the page, starting from the \ -document root. The located elements will be returned as a WebElement JSON \ -objects. The table below lists the locator strategies that each server should \ -support. Elements should be returned in the order located in the DOM. - -|| *Strategy* || *Description* || -|| class name || Returns all elements whose class name contains the search \ -value; compound class names are not permitted. || -|| css selector || Returns all elements matching a CSS selector. || -|| id || Returns all elements whose ID attribute matches the search value. || -|| name || Returns all elements whose NAME attribute matches the search value. || -|| link text || Returns all anchor elements whose visible text matches the \ -search value. || -|| partial link text || Returns all anchor elements whose visible text \ -partially matches the search value. || -|| tag name || Returns all elements whose tag name matches the search value. || -|| xpath || Returns all elements matching an XPath expression. || - -'''). - AddJsonParameter('using', '{string}', 'The locator strategy to use.'). - AddJsonParameter('value', '{string}', 'The The search target.'). - SetReturnType('{Array.<{ELEMENT:string}>}', - 'A list of WebElement JSON objects for the located elements.'). - AddError('XPathLookupError', 'If using XPath and the input expression is invalid.')) - - resources.append( - SessionResource('/session/:sessionId/element/active'). - Post('Get the element on the page that currently has focus. The element will be returned as ' - 'a WebElement JSON object.'). - SetReturnType('{ELEMENT:string}', 'A WebElement JSON object for the active element.')) - - resources.append( - ElementResource('/session/:sessionId/element/:id'). - Get('''Describe the identified element. - -*Note:* This command is reserved for future use; its return type is currently \ -undefined.''')) - - resources.append( - ElementResource('/session/:sessionId/element/:id/element'). - Post('''Search for an element on the page, starting from the identified \ -element. The located element will be returned as a WebElement JSON object. \ -The table below lists the locator strategies that each server should support. \ -Each locator must return the first matching element located in the DOM. - -|| *Strategy* || *Description* || -|| class name || Returns an element whose class name contains the search \ -value; compound class names are not permitted. || -|| css selector || Returns an element matching a CSS selector. || -|| id || Returns an element whose ID attribute matches the search value. || -|| name || Returns an element whose NAME attribute matches the search value. || -|| link text || Returns an anchor element whose visible text matches the \ -search value. || -|| partial link text || Returns an anchor element whose visible text \ -partially matches the search value. || -|| tag name || Returns an element whose tag name matches the search value. || -|| xpath || Returns an element matching an XPath expression. The provided \ -XPath expression must be applied to the server "as is"; if the expression is \ -not relative to the element root, the server should not modify it. \ -Consequently, an XPath query may return elements not contained in the root \ -element's subtree. || - -'''). - AddJsonParameter('using', '{string}', 'The locator strategy to use.'). - AddJsonParameter('value', '{string}', 'The The search target.'). - SetReturnType('{ELEMENT:string}', - 'A WebElement JSON object for the located element.'). - AddError('NoSuchElement', 'If the element cannot be found.'). - AddError('XPathLookupError', 'If using XPath and the input expression is invalid.')) - - resources.append( - ElementResource('/session/:sessionId/element/:id/elements'). - Post('''Search for multiple elements on the page, starting from the \ -identified element. The located elements will be returned as a WebElement \ -JSON objects. The table below lists the locator strategies that each server \ -should support. Elements should be returned in the order located in the DOM. - -|| *Strategy* || *Description* || -|| class name || Returns all elements whose class name contains the search \ -value; compound class names are not permitted. || -|| css selector || Returns all elements matching a CSS selector. || -|| id || Returns all elements whose ID attribute matches the search value. || -|| name || Returns all elements whose NAME attribute matches the search value. || -|| link text || Returns all anchor elements whose visible text matches the \ -search value. || -|| partial link text || Returns all anchor elements whose visible text \ -partially matches the search value. || -|| tag name || Returns all elements whose tag name matches the search value. || -|| xpath || Returns all elements matching an XPath expression. The provided \ -XPath expression must be applied to the server "as is"; if the expression is \ -not relative to the element root, the server should not modify it. \ -Consequently, an XPath query may return elements not contained in the root \ -element's subtree. || - -'''). - AddJsonParameter('using', '{string}', 'The locator strategy to use.'). - AddJsonParameter('value', '{string}', 'The The search target.'). - SetReturnType('{Array.<{ELEMENT:string}>}', - 'A list of WebElement JSON objects for the located elements.'). - AddError('XPathLookupError', 'If using XPath and the input expression is invalid.')) - - resources.append( - ElementResource('/session/:sessionId/element/:id/click'). - Post('Click on an element.'). - RequiresVisibility()) - - resources.append( - ElementResource('/session/:sessionId/element/:id/submit'). - Post('Submit a `FORM` element. The submit command may also be applied to any element that is ' - 'a descendant of a `FORM` element.')) - - resources.append( - ElementResource('/session/:sessionId/element/:id/text'). - Get('Returns the visible text for the element.')) - - resources.append( - ElementResource('/session/:sessionId/element/:id/value'). - Post('''Send a sequence of key strokes to an element. - -Any UTF-8 character may be specified, however, if the server does not support \ -native key events, it should simulate key strokes for a standard US keyboard \ -layout. The Unicode [http://unicode.org/faq/casemap_charprop.html#8 Private Use\ - Area] code points, 0xE000-0xF8FF, are used to represent pressable, non-text \ - keys (see table below). - - - - -
-|| *Key* || *Code* || -|| NULL || U+E000 || -|| Cancel || U+E001 || -|| Help || U+E002 || -|| Back space || U+E003 || -|| Tab || U+E004 || -|| Clear || U+E005 || -|| Return^1^ || U+E006 || -|| Enter^1^ || U+E007 || -|| Shift || U+E008 || -|| Control || U+E009 || -|| Alt || U+E00A || -|| Pause || U+E00B || -|| Escape || U+E00C || - - -|| *Key* || *Code* || -|| Space || U+E00D || -|| Pageup || U+E00E || -|| Pagedown || U+E00F || -|| End || U+E010 || -|| Home || U+E011 || -|| Left arrow || U+E012 || -|| Up arrow || U+E013 || -|| Right arrow || U+E014 || -|| Down arrow || U+E015 || -|| Insert || U+E016 || -|| Delete || U+E017 || -|| Semicolon || U+E018 || -|| Equals || U+E019 || - - -|| *Key* || *Code* || -|| Numpad 0 || U+E01A || -|| Numpad 1 || U+E01B || -|| Numpad 2 || U+E01C || -|| Numpad 3 || U+E01D || -|| Numpad 4 || U+E01E || -|| Numpad 5 || U+E01F || -|| Numpad 6 || U+E020 || -|| Numpad 7 || U+E021 || -|| Numpad 8 || U+E022 || -|| Numpad 9 || U+E023 || - - -|| *Key* || *Code* || -|| Multiply || U+E024 || -|| Add || U+E025 || -|| Separator || U+E026 || -|| Subtract || U+E027 || -|| Decimal || U+E028 || -|| Divide || U+E029 || - - -|| *Key* || *Code* || -|| F1 || U+E031 || -|| F2 || U+E032 || -|| F3 || U+E033 || -|| F4 || U+E034 || -|| F5 || U+E035 || -|| F6 || U+E036 || -|| F7 || U+E037 || -|| F8 || U+E038 || -|| F9 || U+E039 || -|| F10 || U+E03A || -|| F11 || U+E03B || -|| F12 || U+E03C || -|| Command/Meta || U+E03D || - -
^1^ The return key is _not the same_ as the \ -[http://en.wikipedia.org/wiki/Enter_key enter key].
- -The server must process the key sequence as follows: - * Each key that appears on the keyboard without requiring modifiers are sent \ -as a keydown followed by a key up. - * If the server does not support native events and must simulate key strokes \ -with !JavaScript, it must generate keydown, keypress, and keyup events, in that\ - order. The keypress event should only be fired when the corresponding key is \ -for a printable character. - * If a key requires a modifier key (e.g. "!" on a standard US keyboard), the \ -sequence is: modifier down, key down, key up, \ -modifier up, where key is the ideal unmodified key value \ -(using the previous example, a "1"). - * Modifier keys (Ctrl, Shift, Alt, and Command/Meta) are assumed to be \ -"sticky"; each modifier should be held down (e.g. only a keydown event) until \ -either the modifier is encountered again in the sequence, or the `NULL` \ -(U+E000) key is encountered. - * Each key sequence is terminated with an implicit `NULL` key. Subsequently, \ -all depressed modifier keys must be released (with corresponding keyup events) \ -at the end of the sequence. -'''). - RequiresVisibility(). - AddJsonParameter('value', '{Array.}', - 'The sequence of keys to type. An array must be provided. ' - 'The server should flatten the array items to a single ' - 'string to be typed.')) - - resources.append( - SessionResource('/session/:sessionId/modifier'). - Post('Send an event to the active element to depress or release a ' - 'modifier key.'). - AddJsonParameter('value', '{string}', - 'The modifier key event to be sent. This key must be one' - ' Ctrl, Shift, Alt, or Command/Meta, as defined by the ' - '[JsonWireProtocol#/session/:sessionId/element/:id/value' - ' send keys] command.'). - AddJsonParameter('isdown', '{boolean}', - 'Whether to generate a key down or key up.')) - - resources.append( - ElementResource('/session/:sessionId/element/:id/name'). - Get('Query for an element\'s tag name.'). - SetReturnType('{string}', 'The element\'s tag name, as a lowercase string.')) - - resources.append( - ElementResource('/session/:sessionId/element/:id/clear'). - Post('Clear a `TEXTAREA` or `text INPUT` element\'s value.'). - RequiresVisibility(). - RequiresEnabledState()) - - resources.append( - ElementResource('/session/:sessionId/element/:id/selected'). - Get('Determine if an `OPTION` element, or an `INPUT` element of type `checkbox` or ' - '`radiobutton` is currently selected.'). - SetReturnType('{boolean}', 'Whether the element is selected.')) - - resources.append( - ElementResource('/session/:sessionId/element/:id/enabled'). - Get('Determine if an element is currently enabled.'). - SetReturnType('{boolean}', 'Whether the element is enabled.')) - - resources.append( - ElementResource('/session/:sessionId/element/:id/attribute/:name'). - Get('Get the value of an element\'s attribute.'). - SetReturnType('{string|null}', - 'The value of the attribute, or null if it is not set on the element.')) - - resources.append( - ElementResource('/session/:sessionId/element/:id/equals/:other'). - Get('Test if two element IDs refer to the same DOM element.'). - AddUrlParameter(':other', 'ID of the element to compare against.'). - SetReturnType('{boolean}', 'Whether the two IDs refer to the same element.'). - AddError('StaleElementReference', - 'If either the element refered to by `:id` or `:other` is no ' - 'longer attached to the page\'s DOM.')) - - resources.append( - ElementResource('/session/:sessionId/element/:id/displayed'). - Get('Determine if an element is currently displayed.'). - SetReturnType('{boolean}', 'Whether the element is displayed.')) - - resources.append( - ElementResource('/session/:sessionId/element/:id/location'). - Get('Determine an element\'s location on the page. The point `(0, 0)` refers to the ' - 'upper-left corner of the page. The element\'s coordinates are returned as a JSON object ' - 'with `x` and `y` properties.'). - SetReturnType('{x:number, y:number}', 'The X and Y coordinates for the element on the page.')) - - resources.append( - ElementResource('/session/:sessionId/element/:id/location_in_view'). - Get('''Determine an element\'s location on the screen once it has been \ -scrolled into view. - -*Note:* This is considered an internal command and should *only* be used to \ -determine an element's -location for correctly generating native events.'''). - SetReturnType('{x:number, y:number}', 'The X and Y coordinates for the element.')) - - resources.append( - ElementResource('/session/:sessionId/element/:id/size'). - Get('Determine an element\'s size in pixels. The size will be returned as a JSON object ' - ' with `width` and `height` properties.'). - SetReturnType('{width:number, height:number}', 'The width and height of the element, in pixels.')) - - resources.append( - ElementResource('/session/:sessionId/element/:id/css/:propertyName'). - Get('Query the value of an element\'s computed CSS property. The CSS property to query should' - ' be specified using the CSS property name, *not* the !JavaScript property name (e.g. ' - '`background-color` instead of `backgroundColor`).'). - SetReturnType('{string}', 'The value of the specified CSS property.')) - - resources.append( - SessionResource('/session/:sessionId/orientation'). - Get('Get the current browser orientation. The server should return a ' - 'valid orientation value as defined in [http://selenium.googlecode.' - 'com/svn/trunk/docs/api/java/org/openqa/selenium/ScreenOrientation' - '.html ScreenOrientation]: `{LANDSCAPE|PORTRAIT}`.'). - SetReturnType('{string}', 'The current browser orientation corresponding' - ' to a value defined in [http://selenium.googlecode.com/' - 'svn/trunk/docs/api/java/org/openqa/selenium/' - 'ScreenOrientation.html ScreenOrientation]: ' - '`{LANDSCAPE|PORTRAIT}`.'). - Post('Set the browser orientation. The orientation should be specified ' - 'as defined in [http://selenium.googlecode.com/svn/trunk/docs/api/' - 'java/org/openqa/selenium/ScreenOrientation.html ScreenOrientation]' - ': `{LANDSCAPE|PORTRAIT}`.'). - AddJsonParameter('orientation', '{string}', - 'The new browser orientation as defined in ' - '[http://selenium.googlecode.com/svn/trunk/docs/api/' - 'java/org/openqa/selenium/ScreenOrientation.html ' - 'ScreenOrientation]: `{LANDSCAPE|PORTRAIT}`.')) - - resources.append( - SessionResource('/session/:sessionId/alert_text'). - Get('Gets the text of the currently displayed JavaScript `alert()`, `confirm()`, ' - 'or `prompt()` dialog.'). - SetReturnType('{string}', 'The text of the currently displayed alert.'). - AddError('NoAlertPresent', 'If there is no alert displayed.'). - Post('Sends keystrokes to a JavaScript `prompt()` dialog.'). - AddJsonParameter('text', '{string}', 'Keystrokes to send to the `prompt()` dialog.'). - AddError('NoAlertPresent', 'If there is no alert displayed.')) - - resources.append( - SessionResource('/session/:sessionId/accept_alert'). - Post('Accepts the currently displayed alert dialog. Usually, this is equivalent ' - 'to clicking on the \'OK\' button in the dialog.'). - AddError('NoAlertPresent', 'If there is no alert displayed.')) - - resources.append( - SessionResource('/session/:sessionId/dismiss_alert'). - Post('Dismisses the currently displayed alert dialog. For `confirm()` and `prompt()` ' - 'dialogs, this is equivalent to clicking the \'Cancel\' button. For `alert()` ' - 'dialogs, this is equivalent to clicking the \'OK\' button.'). - AddError('NoAlertPresent', 'If there is no alert displayed.')) - - resources.append( - SessionResource('/session/:sessionId/moveto'). - Post('Move the mouse by an offset of the specificed element. If no element ' - 'is specified, the move is relative to the current mouse cursor. If an ' - 'element is provided but no offset, the mouse will be moved to the center' - ' of the element. If the element is not visible, it will be scrolled into view.'). - AddJsonParameter('element', '{string}', 'ID of the element to move to. If not specified' - ' or is null, the offset is relative to current position of the mouse.'). - AddJsonParameter('xoffset', '{number}', 'X offset to move to, relative to the top-left ' - 'corner of the element. If not specified, the mouse' - ' will move to the middle of the element.'). - AddJsonParameter('yoffset', '{number}', 'Y offset to move to, relative to the top-left ' - 'corner of the element. If not specified, the mouse' - ' will move to the middle of the element.')) - - resources.append( - SessionResource('/session/:sessionId/click'). - Post('Click any mouse button (at the coordinates set by the last moveto command). Note ' - 'that calling this command after calling buttondown and before calling button up ' - '(or any out-of-order interactions sequence) will yield undefined behaviour).'). - AddJsonParameter('button', '{number}', 'Which button, enum: `{LEFT = 0, MIDDLE = 1 ' - ', RIGHT = 2}`. Defaults to the left mouse button if not specified.')) - - resources.append( - SessionResource('/session/:sessionId/buttondown'). - Post('Click and hold the left mouse button (at the coordinates set by the last moveto ' - 'command). Note that the next mouse-related command that should follow is buttondown' - ' . Any other mouse command (such as click or another call to buttondown) will yield' - ' undefined behaviour.')) - - resources.append( - SessionResource('/session/:sessionId/buttonup'). - Post('Releases the mouse button previously held (where the mouse is currently at). ' - 'Must be called once for every buttondown command issued. See the note in click and ' - 'buttondown about implications of out-of-order commands.')) - - resources.append( - SessionResource('/session/:sessionId/doubleclick'). - Post('Double-clicks at the current mouse coordinates (set by moveto).')) - - resources.append( - SessionResource('/session/:sessionId/touch/click'). - Post('Single tap on the touch enabled device.'). - AddJsonParameter('element', '{string}', 'ID of the element to single tap ' - 'on.')) - resources.append( - SessionResource('/session/:sessionId/touch/down'). - Post('Finger down on the screen.'). - AddJsonParameter('x', '{number}', 'X coordinate on the screen.'). - AddJsonParameter('y', '{number}', 'Y coordinate on the screen.')) - resources.append( - SessionResource('/session/:sessionId/touch/up'). - Post('Finger up on the screen.'). - AddJsonParameter('x', '{number}', 'X coordinate on the screen.'). - AddJsonParameter('y', '{number}', 'Y coordinate on the screen.')) - resources.append( - SessionResource('session/:sessionId/touch/move'). - Post('Finger move on the screen.'). - AddJsonParameter('x', '{number}', 'X coordinate on the screen.'). - AddJsonParameter('y', '{number}', 'Y coordinate on the screen.')) - resources.append( - SessionResource('session/:sessionId/touch/scroll'). - Post('Scroll on the touch screen using finger based motion events. Use ' - 'this command to start scrolling at a particular screen location.'). - AddJsonParameter('element', '{string}', 'ID of the element where the ' - 'scroll starts.'). - AddJsonParameter('xOffset', '{number}', 'The x offset in pixels to scroll ' - 'by.'). - AddJsonParameter('yOffset', '{number}', 'The y offset in pixels to scroll ' - 'by.')) - resources.append( - SessionResource('session/:sessionId/touch/scroll'). - Post('Scroll on the touch screen using finger based motion events. Use ' - 'this command if you don\'t care where the scroll starts on the ' - 'screen.'). - AddJsonParameter('xOffset', '{number}', 'The x offset in pixels to scroll' - 'by.'). - AddJsonParameter('yOffset', '{number}', 'The y offset in pixels to scroll' - 'by.')) - resources.append( - SessionResource('session/:sessionId/touch/doubleclick'). - Post('Double tap on the touch screen using finger motion events.'). - AddJsonParameter('element', '{string}', 'ID of the element to double tap ' - 'on.')) - resources.append( - SessionResource('session/:sessionId/touch/longclick'). - Post('Long press on the touch screen using finger motion events.'). - AddJsonParameter('element', '{string}', 'ID of the element to long press ' - 'on.')) - resources.append( - SessionResource('session/:sessionId/touch/flick'). - Post('Flick on the touch screen using finger motion events. This flick' - 'command starts at a particulat screen location.'). - AddJsonParameter('element', '{string}', 'ID of the element where the ' - 'flick starts.'). - AddJsonParameter('xOffset', '{number}', 'The x offset in pixels to flick ' - 'by.'). - AddJsonParameter('yOffset', '{number}', 'The y offset in pixels to flick ' - 'by.'). - AddJsonParameter('speed', '{number}', 'The speed in pixels per seconds.')) - resources.append( - SessionResource('session/:sessionId/touch/flick'). - Post('Flick on the touch screen using finger motion events. Use this ' - 'flick command if you don\'t care where the flick starts on the screen.'). - AddJsonParameter('xSpeed', '{number}', 'The x speed in pixels per ' - 'second.'). - AddJsonParameter('ySpeed', '{number}', 'The y speed in pixels per ' - 'second.')) - - print '''#summary A description of the protocol used by WebDriver to \ -communicate with remote instances -#labels WebDriver - -======================================================== -======================================================== - -DO NOT EDIT THIS WIKI PAGE THROUGH THE UI. - -Instead, use http://selenium.googlecode.com/svn/trunk/wire.py - -$ svn co https://selenium.googlecode.com/svn/ --depth=empty wire_protocol -$ cd wire_protocol -$ svn update --depth=infinity ./wiki -$ svn update --depth=files ./trunk -# modify ./trunk/wire.py -$ python ./trunk/wire.py > ./wiki/JsonWireProtocol.wiki -$ svn commit ./trunk/wire.py ./wiki/JsonWireProtocol.wiki - -======================================================== -======================================================== - - -*The !WebDriver Wire Protocol* - -*Status:* _DRAFT_ - - - -= Introduction = - -All implementations of WebDriver that communicate with the browser, or a \ -RemoteWebDriver server shall use a common wire protocol. This wire protocol \ -defines a [http://www.google.com?q=RESTful+web+service RESTful web service] \ -using [http://www.json.org JSON] over HTTP. - -The protocol will assume that the WebDriver API has been "flattened", but there\ - is an expectation that client implementations will take a more Object-Oriented\ - approach, as demonstrated in the existing Java API. The wire protocol is\ - implemented in request/response pairs of "commands" and "responses". - -== Basic Terms and Concepts == - -
-
-==== Client ==== -
-
The machine on which the !WebDriver API is being used. - -
-
-==== Server ==== -
-
The machine running the RemoteWebDriver. This term may also refer to a \ -specific browser that implements the wire protocol directly, such as the \ -FirefoxDriver or IPhoneDriver. - -
-
-==== Session ==== -
-
The server should maintain one browser per session. Commands sent to a \ -session will be directed to the corresponding browser. - -
-
-==== !WebElement ==== -
-
An object in the !WebDriver API that represents a DOM element on the page. - -
-
-==== !WebElement JSON Object ==== -
-
The JSON representation of a !WebElement for transmission over the wire. \ -This object will have the following properties: - -|| *Key* || *Type* || *Description* || -|| ELEMENT || string || The opaque ID assigned to the element by the server. \ -This ID should be used in all subsequent commands issued against the element. || - -
- -
-==== Capabilities JSON Object ==== -
-
Not all server implementations will support every !WebDriver feature. \ -Therefore, the client and server should use JSON objects with the properties \ -listed below when describing which features a session supports. - -|| *Key* || *Type* || *Description* || -|| browserName || string || The name of the browser being used; should be one \ -of `{chrome|firefox|htmlunit|internet explorer|iphone}`. || -|| version || string || The browser version, or the empty string if unknown. || -|| platform || string || A key specifying which platform the browser is running \ -on. This value should be one of `{WINDOWS|XP|VISTA|MAC|LINUX|UNIX}`. When \ -requesting a new session, the client may specify `ANY` to indicate any \ -available platform may be used. || -|| javascriptEnabled || boolean || Whether the session supports executing user \ -supplied JavaScript in the context of the current page. || -|| takesScreenshot || boolean || Whether the session supports taking \ -screenshots of the current page. || -|| handlesAlerts || boolean || Whether the session can interact with modal \ -popups, such as `window.alert` and `window.confirm`. || -|| databaseEnabled || boolean || Whether the session can interact \ -database storage. || -|| locationContextEnabled || boolean || Whether the session can set and query \ -the browser's location context. || -|| applicationCacheEnabled || boolean || Whether the session can interact with \ -the application cache. || -|| browserConnectionEnabled || boolean || Whether the session can query for \ -the browser's connectivity and disable it if desired. || -|| cssSelectorsEnabled || boolean || Whether the session supports CSS \ -selectors when searching for elements. || -|| webStorageEnabled || boolean || Whether the session supports interactions \ -with [http://www.w3.org/TR/2009/WD-webstorage-20091029/ storage objects]. || -|| rotatable || boolean || Whether the session can rotate the current page's \ -current layout between portrait and landscape orientations (only applies to \ -mobile platforms). || -|| acceptSslCerts || boolean || Whether the session should accept all SSL \ -certs by default. || -|| nativeEvents || boolean || Whether the session is capable of generating \ -native events when simulating user input. || - - -
- -
-==== Desired Capabilities ==== -
-
A Capabilities JSON Object sent by the client describing the capabilities \ -a new session created by the server should possess. Any omitted keys implicitly \ -indicate the corresponding capability is irrelevant.
- -
-==== Actual Capabilities ==== -
-
A Capabilities JSON Object returned by the server describing what \ -features a session actually supports. Any omitted keys implicitly indicate \ -the corresponding capability is not supported.
- -
-==== Cookie JSON Object ==== -
-
-A JSON object describing a Cookie. - -|| *Key* || *Type* || *Description* || -|| name || string || The name of the cookie. || -|| value || string || The cookie value. || -|| path || string || (Optional) The cookie path.^1^ || -|| domain || string || (Optional) The domain the cookie is visible to.^1^ || -|| secure || boolean || (Optional) Whether the cookie is a secure cookie.^1^ || -|| expiry || number || (Optional) When the cookie expires, specified in \ -seconds since midnight, January 1, 1970 UTC.^1^ || - -^1^ When returning Cookie objects, the server should only omit an optional \ -field if it is incapable of providing the information.
- -
- -= Messages = - -== Commands == - -!WebDriver command messages should conform to the [http://www.w3.org/Protocols/\ -rfc2616/rfc2616-sec5.html#sec5 HTTP/1.1 request specification]. Although the \ -server may be extended to respond to other content-types, the wire protocol \ -dictates that all commands accept a content-type of \ -`application/json;charset=UTF-8`. Likewise, the message bodies for POST and PUT\ - request must use an `application/json;charset=UTF-8` content-type. - -Each command in the WebDriver service will be mapped to an HTTP method at a \ -specific path. Path segments prefixed with a colon (:) indicate that segment \ -is a variable used to further identify the underlying resource. For example, \ -consider an arbitrary resource mapped as: -{{{ -GET /favorite/color/:name -}}} -Given this mapping, the server should respond to GET requests sent to \ -"/favorite/color/Jack" and "/favorite/color/Jill", with the variable `:name` \ -set to "Jack" and "Jill", respectively. - -== Responses == - -Command responses shall be sent as \ -[http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6 HTTP/1.1 response \ -messages]. If the remote server must return a 4xx response, the response body \ -shall have a Content-Type of text/plain and the message body shall be a \ -descriptive message of the bad request. For all other cases, if a response \ -includes a message body, it must have a Content-Type of \ -application/json;charset=UTF-8 and will be a JSON object with the following \ -properties: - -|| *Key* || *Type* || *Description* || -|| sessionId || string|null || An opaque handle used by the server to \ -determine where to route session-specific commands. This ID should be included \ -in all future session-commands in place of the :sessionId path segment \ -variable. || -|| status || number || A status code summarizing the result of the command. \ -A non-zero value indicates that the command failed. || -|| value || `*` || The response JSON value. || - -=== Response Status Codes === - -The wire protocol will inherit its status codes from those used by the \ -InternetExplorerDriver: - -|| *Code* || *Summary* || *Detail* || -%s - -The client should interpret a 404 Not Found response from the server as an \ -"Unknown command" response. All other 4xx and 5xx responses from the server \ -that do not define a status field should be interpreted as "Unknown error" \ -responses. - -== Error Handling == - -There are two levels of error handling specified by the wire protocol: invalid \ -requests and failed commands. - -=== Invalid Requests === - -All invalid requests should result in the server returning a 4xx HTTP \ -response. The response Content-Type should be set to text/plain and the \ -message body should be a descriptive error message. The categories of invalid \ -requests are as follows: - -
-
*Unknown Commands*
-
If the server receives a command request whose path is not mapped to a \ -resource in the REST service, it should respond with a `404 Not Found` message. - -
-
*Unimplemented Commands*
-
Every server implementing the WebDriver wire protocol must respond to \ -every defined command. If an individual command has not been implemented on \ -the server, the server should respond with a `501 Not Implemented` error \ -message. Note this is the only error in the Invalid Request category that does \ -not return a `4xx` status code. - -
-
*Variable Resource Not Found*
-
If a request path maps to a variable resource, but that resource does not \ -exist, then the server should respond with a `404 Not Found`. For example, if \ -ID `my-session` is not a valid session ID on the server, and a command is sent \ -to `GET /session/my-session HTTP/1.1`, then the server should gracefully \ -return a `404`. - -
-
*Invalid Command Method*
-
If a request path maps to a valid resource, but that resource does not \ -respond to the request method, the server should respond with a `405 Method \ -Not Allowed`. The response must include an Allows header with a list of the \ -allowed methods for the requested resource. - -
-
*Missing Command Parameters*
-
If a POST/PUT command maps to a resource that expects a set of JSON \ -parameters, and the response body does not include one of those parameters, \ -the server should respond with a `400 Bad Request`. The response body should \ -list the missing parameters. - -
-
- -=== Failed Commands === - -If a request maps to a valid command and contains all of the expected \ -parameters in the request body, yet fails to execute successfully, then the \ -server should send a 500 Internal Server Error. This response should have a \ -Content-Type of `application/json;charset=UTF-8` and the response body should \ -be a well formed JSON response object. - -The response status should be one of the defined status codes and the response \ -value should be another JSON object with detailed information for the failing \ -command: - -|| Key || Type || Description || -|| message || string || A descriptive message for the command failure. || -|| screen || string || (Optional) If included, a screenshot of the current \ -page as a base64 encoded string. || -|| class || string || (Optional) If included, specifies the fully qualified \ -class name for the exception that was thrown when the command failed. || -|| stackTrace || array || (Optional) If included, specifies an array of JSON \ -objects describing the stack trace for the exception that was thrown when the \ -command failed. The zeroeth element of the array represents the top of the \ -stack. || - -Each JSON object in the stackTrace array must contain the following properties: - -|| *Key* || *Type* || *Description* || -|| fileName || string || The name of the source file containing the line \ -represented by this frame. || -|| className || string || The fully qualified class name for the class active \ -in this frame. If the class name cannot be determined, or is not applicable \ -for the language the server is implemented in, then this property should be \ -set to the empty string. || -|| methodName || string || The name of the method active in this frame, or \ -the empty string if unknown/not applicable. || -|| lineNumber || number || The line number in the original source file for the \ -frame, or 0 if unknown. || - -= Resource Mapping = - -Resources in the WebDriver REST service are mapped to individual URL patterns. \ -Each resource may respond to one or more HTTP request methods. If a resource \ -responds to a GET request, then it should also respond to HEAD requests. All \ -resources should respond to OPTIONS requests with an `Allow` header field, \ -whose value is a list of all methods that resource responds to. - -If a resource is mapped to a URL containing a variable path segment name, that \ -path segment should be used to further route the request. Variable path \ -segments are indicated in the resource mapping by a colon-prefix. For example, \ -consider the following: -{{{ -/favorite/color/:person -}}} -A resource mapped to this URL should parse the value of the `:person` path \ -segment to further determine how to respond to the request. If this resource \ -received a request for `/favorite/color/Jack`, then it should return Jack's \ -favorite color. Likewise, the server should return Jill's favorite color for \ -any requests to `/favorite/color/Jill`. - -Two resources may only be mapped to the same URL pattern if one of those \ -resources' patterns contains variable path segments, and the other does not. In\ - these cases, the server should always route requests to the resource whose \ -path is the best match for the request. Consider the following two resource \ -paths: - - # `/session/:sessionId/element/active` - # `/session/:sessionId/element/:id` - -Given these mappings, the server should always route requests whose final path \ -segment is active to the first resource. All other requests should be routed to\ - second. - -= Command Reference = - -== Command Summary == - -|| *HTTP Method* || *Path* || *Summary* || -%s - -== Command Detail == - -%s''' % ('\n'.join(e.ToWikiTableString() for e in error_codes), - ''.join(r.ToWikiTableString() for r in resources), - '\n----\n\n'.join(r.ToWikiString() for r in resources)) - - - -if __name__ == '__main__': - main() diff --git a/src/Selenium2Library/locators/__init__.py b/src/Selenium2Library/locators/__init__.py index e0a0b3b4f..c7a5d18a7 100644 --- a/src/Selenium2Library/locators/__init__.py +++ b/src/Selenium2Library/locators/__init__.py @@ -1,9 +1,9 @@ -from elementfinder import ElementFinder -from tableelementfinder import TableElementFinder -from windowmanager import WindowManager - -__all__ = [ - "ElementFinder", - "TableElementFinder", - "WindowManager" +from elementfinder import ElementFinder +from tableelementfinder import TableElementFinder +from windowmanager import WindowManager + +__all__ = [ + "ElementFinder", + "TableElementFinder", + "WindowManager" ] \ No newline at end of file diff --git a/src/Selenium2Library/locators/elementfinder.py b/src/Selenium2Library/locators/elementfinder.py index 2d074ec1b..821d183f8 100644 --- a/src/Selenium2Library/locators/elementfinder.py +++ b/src/Selenium2Library/locators/elementfinder.py @@ -1,23 +1,24 @@ from Selenium2Library import utils -class ElementFinder(object): - - def __init__(self): - self._strategies = { - 'identifier': self._find_by_identifier, - 'id': self._find_by_id, - 'name': self._find_by_name, - 'xpath': self._find_by_xpath, - 'link': self._find_by_link_text, - 'css': self._find_by_css_selector, - 'tag': self._find_by_tag_name, - None: self._find_by_default - } - - def find(self, browser, locator, tag=None): - assert browser is not None - assert locator is not None and len(locator) > 0 - +class ElementFinder(object): + + def __init__(self): + self._strategies = { + 'identifier': self._find_by_identifier, + 'id': self._find_by_id, + 'name': self._find_by_name, + 'xpath': self._find_by_xpath, + 'dom': self._find_by_dom, + 'link': self._find_by_link_text, + 'css': self._find_by_css_selector, + 'tag': self._find_by_tag_name, + None: self._find_by_default + } + + def find(self, browser, locator, tag=None): + assert browser is not None + assert locator is not None and len(locator) > 0 + (prefix, criteria) = self._parse_locator(locator) strategy = self._strategies.get(prefix) if strategy is None: @@ -47,6 +48,14 @@ def _find_by_xpath(self, browser, criteria, tag, constraints): browser.find_elements_by_xpath(criteria), tag, constraints) + def _find_by_dom(self, browser, criteria, tag, constraints): + result = browser.execute_script("return %s;" % criteria) + if result is None: + return [] + if not isinstance(result, list): + result = [result] + return self._filter_elements(result, tag, constraints) + def _find_by_link_text(self, browser, criteria, tag, constraints): return self._filter_elements( browser.find_elements_by_link_text(criteria), @@ -150,8 +159,8 @@ def _get_base_url(self, browser): url = browser.get_current_url() if '/' in url: url = '/'.join(url.split('/')[:-1]) - return url - + return url + def _parse_locator(self, locator): prefix = None criteria = locator @@ -159,5 +168,5 @@ def _parse_locator(self, locator): locator_parts = locator.partition('=') if len(locator_parts[1]) > 0: prefix = locator_parts[0].strip().lower() - criteria = locator_parts[2].strip() + criteria = locator_parts[2].strip() return (prefix, criteria) diff --git a/src/Selenium2Library/locators/windowmanager.py b/src/Selenium2Library/locators/windowmanager.py index 561725ec7..c03fac8eb 100644 --- a/src/Selenium2Library/locators/windowmanager.py +++ b/src/Selenium2Library/locators/windowmanager.py @@ -1,23 +1,30 @@ from types import * from robot import utils +from selenium.webdriver.remote.webdriver import WebDriver from selenium.common.exceptions import NoSuchWindowException -class WindowManager(object): - - def __init__(self): - self._strategies = { - 'title': self._select_by_title, - 'name': self._select_by_name, - 'url': self._select_by_url, - None: self._select_by_default - } - - def get_window_handles(self, browser): - return browser.get_window_handles() - - def select(self, browser, locator): - assert browser is not None - +class WindowManager(object): + + def __init__(self): + self._strategies = { + 'title': self._select_by_title, + 'name': self._select_by_name, + 'url': self._select_by_url, + None: self._select_by_default + } + + def get_window_ids(self, browser): + return [ window_info[1] for window_info in self._get_window_infos(browser) ] + + def get_window_names(self, browser): + return [ window_info[2] for window_info in self._get_window_infos(browser) ] + + def get_window_titles(self, browser): + return [ window_info[3] for window_info in self._get_window_infos(browser) ] + + def select(self, browser, locator): + assert browser is not None + (prefix, criteria) = self._parse_locator(locator) strategy = self._strategies.get(prefix) if strategy is None: @@ -29,19 +36,19 @@ def select(self, browser, locator): def _select_by_title(self, browser, criteria): self._select_matching( browser, - lambda browser: browser.get_title().strip().lower() == criteria.lower(), + lambda window_info: window_info[3].strip().lower() == criteria.lower(), "Unable to locate window with title '" + criteria + "'") def _select_by_name(self, browser, criteria): - try: - browser.switch_to_window(criteria) - except NoSuchWindowException: - raise ValueError("Unable to locate window with name '" + criteria + "'") + self._select_matching( + browser, + lambda window_info: window_info[2].strip().lower() == criteria.lower(), + "Unable to locate window with name '" + criteria + "'") def _select_by_url(self, browser, criteria): self._select_matching( browser, - lambda browser: browser.get_current_url().strip().lower() == criteria.lower(), + lambda window_info: window_info[4].strip().lower() == criteria.lower(), "Unable to locate window with URL '" + criteria + "'") def _select_by_default(self, browser, criteria): @@ -61,8 +68,8 @@ def _select_by_default(self, browser, criteria): raise ValueError("Unable to locate window with name or title '" + criteria + "'") - # Private - + # Private + def _parse_locator(self, locator): prefix = None criteria = locator @@ -70,14 +77,28 @@ def _parse_locator(self, locator): locator_parts = locator.partition('=') if len(locator_parts[1]) > 0: prefix = locator_parts[0].strip().lower() - criteria = locator_parts[2].strip() + criteria = locator_parts[2].strip() + if prefix is None or prefix == 'name': + if criteria is None or criteria.lower() == 'main': + criteria = '' return (prefix, criteria) + def _get_window_infos(self, browser): + window_infos = [] + starting_handle = browser.get_current_window_handle() + try: + for handle in browser.get_window_handles(): + browser.switch_to_window(handle) + window_infos.append(browser.get_current_window_info()) + finally: + browser.switch_to_window(starting_handle) + return window_infos + def _select_matching(self, browser, matcher, error): starting_handle = browser.get_current_window_handle() for handle in browser.get_window_handles(): browser.switch_to_window(handle) - if matcher(browser): + if matcher(browser.get_current_window_info()): return browser.switch_to_window(starting_handle) raise ValueError(error) diff --git a/src/Selenium2Library/metadata.py b/src/Selenium2Library/metadata.py deleted file mode 100644 index 2bc170a7c..000000000 --- a/src/Selenium2Library/metadata.py +++ /dev/null @@ -1,45 +0,0 @@ -import os -import utils - -ROOT_DIR = os.path.dirname(os.path.abspath(__file__)) -DATA_DIRS = [ 'lib', 'resources' ] - -VERSION = '0.5' -NAME = "robotframework-selenium2library" -PACKAGE_NAME = "Selenium2Library" - -SHORT_DESCRIPTION = "Web testing library for Robot Framework" -LONG_DESCRIPTION = """ -Selenium2Library is a web testing library for Robot Framework -that leverage the Selenium 2 (WebDriver) libraries. -"""[1:-1] - -AUTHOR = "Robot Framework Developers" -AUTHOR_EMAIL = "robotframework@gmail.com" -PROJECT_URL = "http://www.google.com" - -LICENSE = "Apache License 2.0" -KEYWORDS = "robotframework testing testautomation selenium selenium2 webdriver web" -PLATFORMS = "any" - -TROVE_CLASSIFIERS = [ - "Development Status :: 4 - Beta", - #"Development Status :: 5 - Production/Stable", - "License :: OSI Approved :: Apache Software License", - "Operating System :: OS Independent", - "Programming Language :: Python", - "Topic :: Software Development :: Testing" -] - -def get_all_packages(): - packages = [ PACKAGE_NAME ] - packages.extend(utils.get_child_packages_in(ROOT_DIR, exclusions=DATA_DIRS)) - return packages - -def get_all_package_data(): - files = [] - for data_dir in DATA_DIRS: - for path, dirnames, filenames in os.walk(os.path.join(ROOT_DIR, data_dir)): - files.extend( [ os.path.join(path, filename)[len(ROOT_DIR)+1:] - for filename in filenames ] ) - return { PACKAGE_NAME: files } diff --git a/src/Selenium2Library/utils/__init__.py b/src/Selenium2Library/utils/__init__.py index d51150bcd..c73348123 100644 --- a/src/Selenium2Library/utils/__init__.py +++ b/src/Selenium2Library/utils/__init__.py @@ -1,7 +1,7 @@ -import os -from fnmatch import fnmatch -from browsercache import BrowserCache - +import os +from fnmatch import fnmatch +from browsercache import BrowserCache + __all__ = [ "get_child_packages_in", "get_module_names_under", diff --git a/src/Selenium2Library/utils/browsercache.py b/src/Selenium2Library/utils/browsercache.py index 9daca4b8e..f05f2f055 100644 --- a/src/Selenium2Library/utils/browsercache.py +++ b/src/Selenium2Library/utils/browsercache.py @@ -1,7 +1,7 @@ from robot.utils import ConnectionCache -class BrowserCache(ConnectionCache): - +class BrowserCache(ConnectionCache): + def __init__(self): ConnectionCache.__init__(self, no_current_msg='No current browser') self._closed = set() @@ -12,22 +12,22 @@ def browsers(self): def get_open_browsers(self): open_browsers = [] - for browser in self._connections: - if browser not in self._closed: + for browser in self._connections: + if browser not in self._closed: open_browsers.append(browser) return open_browsers def close(self): if self.current: browser = self.current - browser.quit() - self.current = self._no_current + browser.quit() + self.current = self._no_current self.current_index = None self._closed.add(browser) - - def close_all(self): - for browser in self._connections: - if browser not in self._closed: - browser.quit() - self.empty_cache() - return self.current + + def close_all(self): + for browser in self._connections: + if browser not in self._closed: + browser.quit() + self.empty_cache() + return self.current diff --git a/src/Selenium2Library/version.py b/src/Selenium2Library/version.py new file mode 100644 index 000000000..1dea037c1 --- /dev/null +++ b/src/Selenium2Library/version.py @@ -0,0 +1 @@ +VERSION = '1.0.1' diff --git a/src/Selenium2Library/webdrivermonkeypatches.py b/src/Selenium2Library/webdrivermonkeypatches.py index 7c761bbdd..88474f06e 100644 --- a/src/Selenium2Library/webdrivermonkeypatches.py +++ b/src/Selenium2Library/webdrivermonkeypatches.py @@ -1,6 +1,7 @@ import time from robot import utils from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver +from locators import WindowManager class WebDriverMonkeyPatches: @@ -19,6 +20,12 @@ def get_current_url(self): def get_current_window_handle(self): return self.current_window_handle + def get_current_window_info(self): + atts = self.execute_script("return [ window.id, window.name, document.title, document.location ];") + atts = [ att if att is not None and len(att) else 'undefined' + for att in atts ] + return (self.current_window_handle, atts[0], atts[1], atts[2], atts[3]) + def get_page_source(self): return self.page_source @@ -28,6 +35,9 @@ def get_title(self): def get_window_handles(self): return self.window_handles + def current_window_is_main(self): + return self.current_window_handle == self.window_handles[0]; + def set_speed(self, seconds): self._speed = seconds @@ -40,6 +50,7 @@ def _get_speed(self): RemoteWebDriver.get_current_url = get_current_url RemoteWebDriver.get_page_source = get_page_source RemoteWebDriver.get_current_window_handle = get_current_window_handle + RemoteWebDriver.get_current_window_info = get_current_window_info RemoteWebDriver.get_window_handles = get_window_handles RemoteWebDriver.set_speed = set_speed RemoteWebDriver._get_speed = _get_speed diff --git a/src/ez_setup.py b/src/ez_setup.py new file mode 100644 index 000000000..b74adc065 --- /dev/null +++ b/src/ez_setup.py @@ -0,0 +1,284 @@ +#!python +"""Bootstrap setuptools installation + +If you want to use setuptools in your package's setup.py, just include this +file in the same directory with it, and add this to the top of your setup.py:: + + from ez_setup import use_setuptools + use_setuptools() + +If you want to require a specific version of setuptools, set a download +mirror, or use an alternate download directory, you can do so by supplying +the appropriate options to ``use_setuptools()``. + +This file can also be run as a script to install or upgrade setuptools. +""" +import sys +DEFAULT_VERSION = "0.6c11" +DEFAULT_URL = "http://pypi.python.org/packages/%s/s/setuptools/" % sys.version[:3] + +md5_data = { + 'setuptools-0.6b1-py2.3.egg': '8822caf901250d848b996b7f25c6e6ca', + 'setuptools-0.6b1-py2.4.egg': 'b79a8a403e4502fbb85ee3f1941735cb', + 'setuptools-0.6b2-py2.3.egg': '5657759d8a6d8fc44070a9d07272d99b', + 'setuptools-0.6b2-py2.4.egg': '4996a8d169d2be661fa32a6e52e4f82a', + 'setuptools-0.6b3-py2.3.egg': 'bb31c0fc7399a63579975cad9f5a0618', + 'setuptools-0.6b3-py2.4.egg': '38a8c6b3d6ecd22247f179f7da669fac', + 'setuptools-0.6b4-py2.3.egg': '62045a24ed4e1ebc77fe039aa4e6f7e5', + 'setuptools-0.6b4-py2.4.egg': '4cb2a185d228dacffb2d17f103b3b1c4', + 'setuptools-0.6c1-py2.3.egg': 'b3f2b5539d65cb7f74ad79127f1a908c', + 'setuptools-0.6c1-py2.4.egg': 'b45adeda0667d2d2ffe14009364f2a4b', + 'setuptools-0.6c10-py2.3.egg': 'ce1e2ab5d3a0256456d9fc13800a7090', + 'setuptools-0.6c10-py2.4.egg': '57d6d9d6e9b80772c59a53a8433a5dd4', + 'setuptools-0.6c10-py2.5.egg': 'de46ac8b1c97c895572e5e8596aeb8c7', + 'setuptools-0.6c10-py2.6.egg': '58ea40aef06da02ce641495523a0b7f5', + 'setuptools-0.6c11-py2.3.egg': '2baeac6e13d414a9d28e7ba5b5a596de', + 'setuptools-0.6c11-py2.4.egg': 'bd639f9b0eac4c42497034dec2ec0c2b', + 'setuptools-0.6c11-py2.5.egg': '64c94f3bf7a72a13ec83e0b24f2749b2', + 'setuptools-0.6c11-py2.6.egg': 'bfa92100bd772d5a213eedd356d64086', + 'setuptools-0.6c2-py2.3.egg': 'f0064bf6aa2b7d0f3ba0b43f20817c27', + 'setuptools-0.6c2-py2.4.egg': '616192eec35f47e8ea16cd6a122b7277', + 'setuptools-0.6c3-py2.3.egg': 'f181fa125dfe85a259c9cd6f1d7b78fa', + 'setuptools-0.6c3-py2.4.egg': 'e0ed74682c998bfb73bf803a50e7b71e', + 'setuptools-0.6c3-py2.5.egg': 'abef16fdd61955514841c7c6bd98965e', + 'setuptools-0.6c4-py2.3.egg': 'b0b9131acab32022bfac7f44c5d7971f', + 'setuptools-0.6c4-py2.4.egg': '2a1f9656d4fbf3c97bf946c0a124e6e2', + 'setuptools-0.6c4-py2.5.egg': '8f5a052e32cdb9c72bcf4b5526f28afc', + 'setuptools-0.6c5-py2.3.egg': 'ee9fd80965da04f2f3e6b3576e9d8167', + 'setuptools-0.6c5-py2.4.egg': 'afe2adf1c01701ee841761f5bcd8aa64', + 'setuptools-0.6c5-py2.5.egg': 'a8d3f61494ccaa8714dfed37bccd3d5d', + 'setuptools-0.6c6-py2.3.egg': '35686b78116a668847237b69d549ec20', + 'setuptools-0.6c6-py2.4.egg': '3c56af57be3225019260a644430065ab', + 'setuptools-0.6c6-py2.5.egg': 'b2f8a7520709a5b34f80946de5f02f53', + 'setuptools-0.6c7-py2.3.egg': '209fdf9adc3a615e5115b725658e13e2', + 'setuptools-0.6c7-py2.4.egg': '5a8f954807d46a0fb67cf1f26c55a82e', + 'setuptools-0.6c7-py2.5.egg': '45d2ad28f9750e7434111fde831e8372', + 'setuptools-0.6c8-py2.3.egg': '50759d29b349db8cfd807ba8303f1902', + 'setuptools-0.6c8-py2.4.egg': 'cba38d74f7d483c06e9daa6070cce6de', + 'setuptools-0.6c8-py2.5.egg': '1721747ee329dc150590a58b3e1ac95b', + 'setuptools-0.6c9-py2.3.egg': 'a83c4020414807b496e4cfbe08507c03', + 'setuptools-0.6c9-py2.4.egg': '260a2be2e5388d66bdaee06abec6342a', + 'setuptools-0.6c9-py2.5.egg': 'fe67c3e5a17b12c0e7c541b7ea43a8e6', + 'setuptools-0.6c9-py2.6.egg': 'ca37b1ff16fa2ede6e19383e7b59245a', +} + +import sys, os +try: from hashlib import md5 +except ImportError: from md5 import md5 + +def _validate_md5(egg_name, data): + if egg_name in md5_data: + digest = md5(data).hexdigest() + if digest != md5_data[egg_name]: + print >>sys.stderr, ( + "md5 validation of %s failed! (Possible download problem?)" + % egg_name + ) + sys.exit(2) + return data + +def use_setuptools( + version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, + download_delay=15 +): + """Automatically find/download setuptools and make it available on sys.path + + `version` should be a valid setuptools version number that is available + as an egg for download under the `download_base` URL (which should end with + a '/'). `to_dir` is the directory where setuptools will be downloaded, if + it is not already available. If `download_delay` is specified, it should + be the number of seconds that will be paused before initiating a download, + should one be required. If an older version of setuptools is installed, + this routine will print a message to ``sys.stderr`` and raise SystemExit in + an attempt to abort the calling script. + """ + was_imported = 'pkg_resources' in sys.modules or 'setuptools' in sys.modules + def do_download(): + egg = download_setuptools(version, download_base, to_dir, download_delay) + sys.path.insert(0, egg) + import setuptools; setuptools.bootstrap_install_from = egg + try: + import pkg_resources + except ImportError: + return do_download() + try: + pkg_resources.require("setuptools>="+version); return + except pkg_resources.VersionConflict, e: + if was_imported: + print >>sys.stderr, ( + "The required version of setuptools (>=%s) is not available, and\n" + "can't be installed while this script is running. Please install\n" + " a more recent version first, using 'easy_install -U setuptools'." + "\n\n(Currently using %r)" + ) % (version, e.args[0]) + sys.exit(2) + except pkg_resources.DistributionNotFound: + pass + + del pkg_resources, sys.modules['pkg_resources'] # reload ok + return do_download() + +def download_setuptools( + version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, + delay = 15 +): + """Download setuptools from a specified location and return its filename + + `version` should be a valid setuptools version number that is available + as an egg for download under the `download_base` URL (which should end + with a '/'). `to_dir` is the directory where the egg will be downloaded. + `delay` is the number of seconds to pause before an actual download attempt. + """ + import urllib2, shutil + egg_name = "setuptools-%s-py%s.egg" % (version,sys.version[:3]) + url = download_base + egg_name + saveto = os.path.join(to_dir, egg_name) + src = dst = None + if not os.path.exists(saveto): # Avoid repeated downloads + try: + from distutils import log + if delay: + log.warn(""" +--------------------------------------------------------------------------- +This script requires setuptools version %s to run (even to display +help). I will attempt to download it for you (from +%s), but +you may need to enable firewall access for this script first. +I will start the download in %d seconds. + +(Note: if this machine does not have network access, please obtain the file + + %s + +and place it in this directory before rerunning this script.) +---------------------------------------------------------------------------""", + version, download_base, delay, url + ); from time import sleep; sleep(delay) + log.warn("Downloading %s", url) + src = urllib2.urlopen(url) + # Read/write all in one block, so we don't create a corrupt file + # if the download is interrupted. + data = _validate_md5(egg_name, src.read()) + dst = open(saveto,"wb"); dst.write(data) + finally: + if src: src.close() + if dst: dst.close() + return os.path.realpath(saveto) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +def main(argv, version=DEFAULT_VERSION): + """Install or upgrade setuptools and EasyInstall""" + try: + import setuptools + except ImportError: + egg = None + try: + egg = download_setuptools(version, delay=0) + sys.path.insert(0,egg) + from setuptools.command.easy_install import main + return main(list(argv)+[egg]) # we're done here + finally: + if egg and os.path.exists(egg): + os.unlink(egg) + else: + if setuptools.__version__ == '0.0.1': + print >>sys.stderr, ( + "You have an obsolete version of setuptools installed. Please\n" + "remove it from your system entirely before rerunning this script." + ) + sys.exit(2) + + req = "setuptools>="+version + import pkg_resources + try: + pkg_resources.require(req) + except pkg_resources.VersionConflict: + try: + from setuptools.command.easy_install import main + except ImportError: + from easy_install import main + main(list(argv)+[download_setuptools(delay=0)]) + sys.exit(0) # try to force an exit + else: + if argv: + from setuptools.command.easy_install import main + main(argv) + else: + print "Setuptools version",version,"or greater has been installed." + print '(Run "ez_setup.py -U setuptools" to reinstall or upgrade.)' + +def update_md5(filenames): + """Update our built-in md5 registry""" + + import re + + for name in filenames: + base = os.path.basename(name) + f = open(name,'rb') + md5_data[base] = md5(f.read()).hexdigest() + f.close() + + data = [" %r: %r,\n" % it for it in md5_data.items()] + data.sort() + repl = "".join(data) + + import inspect + srcfile = inspect.getsourcefile(sys.modules[__name__]) + f = open(srcfile, 'rb'); src = f.read(); f.close() + + match = re.search("\nmd5_data = {\n([^}]+)}", src) + if not match: + print >>sys.stderr, "Internal error!" + sys.exit(2) + + src = src[:match.start(1)] + repl + src[match.end(1):] + f = open(srcfile,'w') + f.write(src) + f.close() + + +if __name__=='__main__': + if len(sys.argv)>2 and sys.argv[1]=='--md5update': + update_md5(sys.argv[2:]) + else: + main(sys.argv[1:]) + + + + + + diff --git a/test/README.txt b/test/README.txt deleted file mode 100644 index 8b1b938a5..000000000 --- a/test/README.txt +++ /dev/null @@ -1,54 +0,0 @@ -Selenium2Library Tests -====================== - - -Introduction ------------- - -This directory contains everything needed to run Selenium2Library -tests with Robot Framework. This includes: - -- Unit tests under `unit` directory. -- Acceptance tests written with Robot Framework under `acceptance` - directory -- A very simple httpserver.py which is used to serve the html for tests in - `resources/testserver` -- A collection of simple html files under 'resources/html' directory -- Start-up scripts for executing the tests - - -Running Tests -------------- - -There is a python script for running the tests. It can be -used as follows:: - - python run_tests.py python|jython ff|ie|chrome [options] - -The first argument to the script defines the interpreter to be used -to run Robot. The second argument defines the browser to be used, -using the same browser tokens that you would use in your Robot -tests. - -Due to the structure of the tests, the directory containg the test -case files (`acceptance`) is always given to Robot as test data path. -To run only a subset of test cases, Robot command line arguments ---test, --suite, --include and --exclude may be used. - -Examples:: - - # Run all tests with Python and Firefox - test/run_tests.py python ff - # Run only test suite `javascript` with Jython and Internet Explorer - test/run_tests.py jython ie -s javascript - - -Failing Tests -------------- - -When the tests are executed, a number of test cases can be seen to -fail in the console output. This is because these test cases are -designed to test error messages of Selenium2Library. The script -'teststatuschecker.py' is used to check that these test cases failed -with expected error message. After that, report and log files are -generated and these files show the correct status of the test run. diff --git a/test/acceptance/keywords/async_javascript.txt b/test/acceptance/keywords/async_javascript.txt new file mode 100644 index 000000000..9adf09a69 --- /dev/null +++ b/test/acceptance/keywords/async_javascript.txt @@ -0,0 +1,87 @@ +*** Settings *** +Test Setup Go To Page "javascript/dynamic_content.html" +Suite Teardown Set Selenium Timeout 5 seconds +Resource ../resource.txt + +*** Test Cases *** +Should Not Timeout If Callback Invoked Immediately + ${result} = Execute Async Javascript arguments[arguments.length - 1](123); + Should Be Equal ${result} ${123} + +Should Be Able To Return Javascript Primitives From Async Scripts Neither None Nor Undefined + ${result} = Execute Async Javascript arguments[arguments.length - 1](123); + Should Be Equal ${result} ${123} + ${result} = Execute Async Javascript arguments[arguments.length - 1]('abc'); + Should Be Equal ${result} abc + ${result} = Execute Async Javascript arguments[arguments.length - 1](false); + Should Be Equal ${result} ${false} + ${result} = Execute Async Javascript arguments[arguments.length - 1](true); + Should Be Equal ${result} ${true} + +Should Be Able To Return Javascript Primitives From Async Scripts Null And Undefined + ${result} = Execute Async Javascript arguments[arguments.length - 1](null); + Should Be Equal ${result} ${None} + ${result} = Execute Async Javascript arguments[arguments.length - 1](); + Should Be Equal ${result} ${None} + +Should Be Able To Return An Array Literal From An Async Script + ${result} = Execute Async Javascript arguments[arguments.length - 1]([]); + Should Not Be Equal ${result} ${None} + Length Should Be ${result} 0 + +Should Be Able To Return An Array Object From An Async Script + ${result} = Execute Async Javascript arguments[arguments.length - 1](new Array()); + Should Not Be Equal ${result} ${None} + Length Should Be ${result} 0 + +Should Be Able To Return Arrays Of Primitives From Async Scripts + ${result} = Execute Async Javascript arguments[arguments.length - 1]([null, 123, 'abc', true, false]); + Should Not Be Equal ${result} ${None} + Length Should Be ${result} 5 + ${value} = Remove From List ${result} -1 + Should Be Equal ${value} ${false} + ${value} = Remove From List ${result} -1 + Should Be Equal ${value} ${true} + ${value} = Remove From List ${result} -1 + Should Be Equal ${value} abc + ${value} = Remove From List ${result} -1 + Should Be Equal ${value} ${123} + ${value} = Remove From List ${result} -1 + Should Be Equal ${value} ${None} + Length Should Be ${result} 0 + +Should Timeout If Script Does Not Invoke Callback + Run Keyword And Expect Error TimeoutException: Message: ''\ \ + ... Execute Async Javascript return 1 + 2; + +Should Timeout If Script Does Not Invoke Callback With A Zero Timeout + Run Keyword And Expect Error TimeoutException: Message: ''\ \ + ... Execute Async Javascript window.setTimeout(function() {}, 0); + +Should Not Timeout If Script Callsback Inside A Zero Timeout + ${result} = Execute Async Javascript + ... var callback = arguments[arguments.length - 1]; + ... window.setTimeout(function() { callback(123); }, 0) + +Should Timeout If Script Does Not Invoke Callback With Long Timeout + Set Selenium Timeout 0.5 seconds + Run Keyword And Expect Error TimeoutException: Message: ''\ \ + ... Execute Async Javascript var callback = arguments[arguments.length - 1]; window.setTimeout(callback, 1500); + +Should Detect Page Loads While Waiting On An Async Script And Return An Error + Set Selenium Timeout 0.1 seconds + Run Keyword And Expect Error WebDriverException: Message: ''\ \ + ... Execute Async Javascript window.location = javascript/dynamic; + +Should Catch Errors When Executing Initial Script + Run Keyword And Expect Error WebDriverException: Message: ''\ \ + ... Execute Async Javascript throw Error('you should catch this!'); + +#TODO Implement Selenium asynchronous javascript test +#Should Be Able To Execute Asynchronous Scripts +# # To Do + +#TODO EdManlove Add support for arguement passing to selenium javascript calls +#Should Be Able To Pass Multiple Arguments To Async Scripts +# ${result} = Execute Async Javascript arguments[arguments.length - 1](arguments[0] + arguments[1]); 1 2 +# Should Be Equal ${result} ${3} diff --git a/test/acceptance/keywords/checkbox_and_radio_buttons.txt b/test/acceptance/keywords/checkbox_and_radio_buttons.txt index 61ede9a36..733d6379c 100644 --- a/test/acceptance/keywords/checkbox_and_radio_buttons.txt +++ b/test/acceptance/keywords/checkbox_and_radio_buttons.txt @@ -4,43 +4,43 @@ Resource ../resource.txt *** Test Cases *** Checkbox Should Be Selected - [Documentation] LOG 1 Verifying checkbox 'can_send_email' is selected. + [Documentation] LOG 2 Verifying checkbox 'can_send_email' is selected. Checkbox Should Be Selected can_send_email Run Keyword And Expect Error Checkbox 'can_send_sms' should have been selected but was not Checkbox Should Be Selected can_send_sms Checkbox Should Not Be Selected - [Documentation] LOG 1 Verifying checkbox 'can_send_sms' is not selected. + [Documentation] LOG 2 Verifying checkbox 'can_send_sms' is not selected. Checkbox Should Not Be Selected can_send_sms Run Keyword And Expect Error Checkbox 'can_send_email' should not have been selected Checkbox Should Not Be Selected can_send_email Select Checkbox - [Documentation] LOG 1 Selecting checkbox 'can_send_sms'. + [Documentation] LOG 2 Selecting checkbox 'can_send_sms'. Select Checkbox can_send_sms Checkbox Should Be Selected can_send_sms Select Checkbox can_send_sms Checkbox Should Be Selected can_send_sms UnSelect Checkbox - [Documentation] LOG 1 Unselecting checkbox 'can_send_email'. + [Documentation] LOG 2 Unselecting checkbox 'can_send_email'. Unselect Checkbox can_send_email Checkbox Should Not Be Selected can_send_email Unselect Checkbox can_send_email Checkbox Should Not Be Selected can_send_email Radio Button Should Be Set To - [Documentation] LOG 1 Verifying radio button 'sex' has selection 'female'. + [Documentation] LOG 2 Verifying radio button 'sex' has selection 'female'. Radio Button Should Be Set To sex female Run Keyword And Expect Error Selection of radio button 'sex' should have been 'male' but was 'female' Radio Button Should Be Set To sex male Select Radio Button - [Documentation] LOG 1 Selecting 'male' from radio button 'sex'. + [Documentation] LOG 2 Selecting 'male' from radio button 'sex'. Select Radio Button sex male Radio Button Should Be Set To sex male Select Radio Button sex female Radio Button Should Be Set To sex female Radio Button Should Not Be Selected - [Documentation] LOG 1 Verifying radio button 'referrer' has no selection. + [Documentation] LOG 2 Verifying radio button 'referrer' has no selection. Radio Button Should Not Be Selected referrer Run Keyword And Expect Error Radio button group 'sex' should not have had selection, but 'female' was selected Radio Button Should Not Be Selected sex diff --git a/test/acceptance/keywords/click_element.txt b/test/acceptance/keywords/click_element.txt index 36b996c30..bdc1951b0 100644 --- a/test/acceptance/keywords/click_element.txt +++ b/test/acceptance/keywords/click_element.txt @@ -5,13 +5,14 @@ Resource ../resource.txt *** Test Cases *** Click Element - [Documentation] LOG 1 Clicking element 'singleClickButton'. + [Documentation] LOG 2 Clicking element 'singleClickButton'. Click Element singleClickButton - Element Text Should Be output single clicked - -Double Click Element - [Documentation] LOG 1 Double clicking element 'doubleClickButton'. - Double Click Element doubleClickButton + Element Text Should Be output single clicked + +Double Click Element + [Tags] Known Issue - Firefox + [Documentation] LOG 2 Double clicking element 'doubleClickButton'. + Double Click Element doubleClickButton Element Text Should Be output double clicked *** Keywords *** diff --git a/test/acceptance/keywords/content_assertions.txt b/test/acceptance/keywords/content_assertions.txt index 3b98bcf8e..5df4736c8 100644 --- a/test/acceptance/keywords/content_assertions.txt +++ b/test/acceptance/keywords/content_assertions.txt @@ -6,32 +6,32 @@ Resource ../resource.txt *** Test Cases *** Location Should Be - [Documentation] LOG 1:2 Current location is '${FRONT PAGE}'. + [Documentation] LOG 2:2 Current location is '${FRONT PAGE}'. Location Should Be ${FRONT PAGE} Run Keyword And Expect Error Location should have been 'non existing' but was '${FRONT PAGE}' Location Should Be non existing Location Should Contain - [Documentation] LOG 1:2 Current location contains 'html'. + [Documentation] LOG 2:2 Current location contains 'html'. Location Should Contain html Run Keyword And Expect Error Location should have contained 'not a location' but it was '${FRONT PAGE}'. Location Should Contain not a location Title Should Be - [Documentation] LOG 1:2 Page title is '(root)/index.html'. + [Documentation] LOG 2:2 Page title is '(root)/index.html'. Title Should Be (root)/index.html Run Keyword And Expect Error Title should have been 'not a title' but was '(root)/index.html' Title Should Be not a title Page Should Contain - [Documentation] LOG 1:3 Current page contains text 'needle'. LOG 3.1:6 REGEXP: (?i) + [Documentation] LOG 2:3 Current page contains text 'needle'. LOG 4.1:6 REGEXP: (?i) Page Should Contain needle Page Should Contain This is the haystack Run Keyword And Expect Error Page should have contained text 'non existing text' but did not Page Should Contain non existing text Page Should Contain With Custom Log Level - [Documentation] LOG 1.1:6 DEBUG REGEXP: (?i) + [Documentation] LOG 2.1:6 DEBUG REGEXP: (?i) Run Keyword And Expect Error Page should have contained text 'non existing text' but did not Page Should Contain non existing text DEBUG Page Should Contain With Disabling Source Logging - [Documentation] LOG 2:2 NONE + [Documentation] LOG 3:2 NONE Set Log Level INFO Run Keyword And Expect Error Page should have contained text 'non existing text' but did not Page Should Contain non existing text loglevel=NONE [Teardown] Set Log Level DEBUG @@ -41,16 +41,16 @@ Page Should Contain With Frames Page Should Contain You're looking at right. Page Should Not Contain - [Documentation] LOG 1:5 Current page does not contain text 'non existing text'. LOG 2.1:4 REGEXP: (?i) + [Documentation] LOG 2:5 Current page does not contain text 'non existing text'. LOG 3.1:4 REGEXP: (?i) Page Should Not Contain non existing text Run Keyword And Expect Error Page should not have contained text 'needle' Page Should Not Contain needle Page Should Not Contain With Custom Log Level - [Documentation] LOG 1.1:4 DEBUG REGEXP: (?i) + [Documentation] LOG 2.1:4 DEBUG REGEXP: (?i) Run Keyword And Expect Error Page should not have contained text 'needle' Page Should Not Contain needle DEBUG Page Should Not Contain With Disabling Source Logging - [Documentation] LOG 2:2 NONE + [Documentation] LOG 3:2 NONE Set Log Level INFO Run Keyword And Expect Error Page should not have contained text 'needle' Page Should Not Contain needle loglevel=NONE [Teardown] Set Log Level DEBUG @@ -63,7 +63,7 @@ Page Should Contain Element With Custom Message Run Keyword And Expect Error Custom error message Page Should Contain Element invalid Custom error message Page Should Contain Element With Disabling Source Logging - [Documentation] LOG 2:2 NONE + [Documentation] LOG 3:2 NONE Set Log Level INFO Run Keyword And Expect Error Page should have contained element 'non-existent' but did not Page Should Contain Element non-existent loglevel=NONE [Teardown] Set Log Level DEBUG @@ -73,7 +73,7 @@ Page Should Not Contain Element Run Keyword And Expect Error Page should not have contained element 'some_id' Page Should Not Contain Element some_id Page Should Not Contain Element With Disabling Source Logging - [Documentation] LOG 2:2 NONE + [Documentation] LOG 3:2 NONE Set Log Level INFO Run Keyword And Expect Error Page should not have contained element 'some_id' Page Should Not Contain Element some_id loglevel=NONE [Teardown] Set Log Level DEBUG @@ -86,6 +86,10 @@ Element Text Should Be Element Text Should Be some_id This text is inside an identified element Run Keyword And Expect Error The text of element 'some_id' should have been 'inside' but in fact it was 'This text is inside an identified element'. Element Text Should Be some_id inside +Get Text + ${str} = Get Text some_id + Should Match ${str} This text is inside an identified element + Element Should Be Visible [Setup] Go To Page "visibility.html" Element Should Be Visible i_am_visible @@ -97,14 +101,14 @@ Element Should Not Be Visible Run Keyword And Expect Error The element 'i_am_visible' should not be visible, but it is. Element Should Not Be Visible i_am_visible Page Should Contain Checkbox - [Documentation] LOG 1:3 Current page contains checkbox 'can_send_email'. + [Documentation] LOG 2:3 Current page contains checkbox 'can_send_email'. [Setup] Go To Page "forms/prefilled_email_form.html" Page Should Contain Checkbox can_send_email Page Should Contain Checkbox xpath=//input[@type='checkbox' and @name='can_send_sms'] Run Keyword And Expect Error Page should have contained checkbox 'non-existing' but did not Page Should Contain Checkbox non-existing Page Should Not Contain Checkbox - [Documentation] LOG 1:3 Current page does not contain checkbox 'non-existing'. + [Documentation] LOG 2:3 Current page does not contain checkbox 'non-existing'. [Setup] Go To Page "forms/prefilled_email_form.html" Page Should Not Contain Checkbox non-existing Run Keyword And Expect Error Page should not have contained checkbox 'can_send_email' Page Should Not Contain Checkbox can_send_email @@ -163,7 +167,7 @@ Page Should Not Contain Text Field Run Keyword And Expect Error Page should not have contained text field 'name' Page Should Not Contain Text Field name TextField Should Contain - [Documentation] LOG 1:4 Text field 'name' contains text ''. + [Documentation] LOG 2:4 Text field 'name' contains text ''. [Setup] Go To Page "forms/email_form.html" TextField Should contain name ${EMPTY} Input Text name my name @@ -171,7 +175,7 @@ TextField Should Contain Run Keyword And Expect Error Text field 'name' should have contained text 'non-existing' but it contained 'my name' TextField Should contain name non-existing TextField Value Should Be - [Documentation] LOG 1:4 Content of text field 'name' is ''. + [Documentation] LOG 2:4 Content of text field 'name' is ''. [Setup] Go To Page "forms/email_form.html" textfield Value Should Be name ${EMPTY} Input Text name my name diff --git a/test/acceptance/keywords/elements.txt b/test/acceptance/keywords/elements.txt index 0a51bf7b5..f6b4d2029 100644 --- a/test/acceptance/keywords/elements.txt +++ b/test/acceptance/keywords/elements.txt @@ -2,18 +2,20 @@ Suite Setup Go To Page "links.html" Resource ../resource.txt -*** Test Cases *** -Assign Id To Element - [Documentation] Tests also Reload Page keyword. - Page Should Not Contain Element my id - Assign ID to Element xpath=//div[@id="first_div"] my id - Page Should Contain Element my id - Reload Page +*** Test Cases *** +Assign Id To Element + [Documentation] Tests also Reload Page keyword. + Page Should Not Contain Element my id + Assign ID to Element xpath=//div[@id="first_div"] my id + Page Should Contain Element my id + Reload Page Page Should Not Contain Element my id Get Element Attribute ${id}= Get Element Attribute link=Link with id@id Should Be Equal ${id} some_id + ${id}= Get Element Attribute dom=document.getElementsByTagName('a')[3]@id + Should Be Equal ${id} some_id ${class}= Get Element Attribute second_div@class Should Be Equal ${class} Second Class diff --git a/test/acceptance/keywords/forms_and_buttons.txt b/test/acceptance/keywords/forms_and_buttons.txt index 5c8858920..73deadf02 100644 --- a/test/acceptance/keywords/forms_and_buttons.txt +++ b/test/acceptance/keywords/forms_and_buttons.txt @@ -10,7 +10,7 @@ ${FORM SUBMITTED} forms/submit.html *** Test Cases *** Submit Form - [Documentation] LOG 1 Submitting form 'form_name'. + [Documentation] LOG 2 Submitting form 'form_name'. Submit Form form_name Verify Location Is "${FORM SUBMITTED}" @@ -20,7 +20,7 @@ Submit Form Without Args Verify Location Is "target/first.html" Click Ok Button By Name - [Documentation] LOG 1 Clicking button 'ok_button'. + [Documentation] LOG 2 Clicking button 'ok_button'. Click Button ok_button Verify Location Is "${FORM SUBMITTED}" diff --git a/test/acceptance/keywords/frames.txt b/test/acceptance/keywords/frames.txt index 1d4e074d2..4c557b5f7 100644 --- a/test/acceptance/keywords/frames.txt +++ b/test/acceptance/keywords/frames.txt @@ -10,10 +10,45 @@ Frame Should Contain Frame Should contain right You're looking at right. Frame Should Contain left Links +Frame Should Contain should also work with iframes + [setup] Go To Page "frames/iframes.html" + Frame Should contain right You're looking at right. + Frame Should Contain left Links + + +Page Should Contain Text Within Frames + Page Should contain You're looking at right. + Page Should Contain Links + +Page Should Contain Text Within Frames should also work with iframes + [setup] Go To Page "frames/iframes.html" + Page Should contain You're looking at right. + Page Should Contain Links + + Select And Unselect Frame - [Documentation] LOG 1 Selecting frame 'left'. + [Documentation] LOG 2 Selecting frame 'left'. + Select Frame left + Click Link foo + Unselect Frame + Select Frame right + Current Frame Contains You're looking at foo. + +Select And Unselect Frame should also work with iframes + [Documentation] Selecting frame leftiframe + [setup] Go To Page "frames/iframes.html" Select Frame left Click Link foo Unselect Frame Select Frame right Current Frame Contains You're looking at foo. + +Select Frame with non-unique name attribute + [Documentation] Descerning frame 'left' from link 'left'. + [setup] Go To Page "frames/poorlynamedframe.html" + Run Keyword And Expect Error NoSuchFrameException* Select Frame left + Select Frame xpath=//frame[@name='left']|//iframe[@name='left'] + Click Link foo + Unselect Frame + Select Frame right + Current Frame Contains You're looking at foo. diff --git a/test/acceptance/keywords/javascript.txt b/test/acceptance/keywords/javascript.txt index 5be57802c..8aac959fc 100644 --- a/test/acceptance/keywords/javascript.txt +++ b/test/acceptance/keywords/javascript.txt @@ -25,6 +25,7 @@ Get Alert Message Run Keyword And Expect Error There were no alerts Get Alert Message Mouse Down On Link + [TAGS] Known Issue - Firefox [Setup] Go To Page "javascript/mouse_events.html" Mouse Down On Image image_mousedown Text Field Should Contain textfield onmousedown @@ -46,16 +47,32 @@ Cancel Action Should Be Equal ${msg} Really change the title? Execute Javascript - [Documentation] LOG 1 Executing JavaScript:\n window.add_content('button_target', 'Inserted directly') + [Documentation] LOG 2 Executing JavaScript:\n window.add_content('button_target', 'Inserted directly') Execute Javascript window.add_content('button_target', 'Inserted directly') Page Should Contain Inserted directly Execute Javascript from File - [Documentation] LOG 1:1 REGEXP: Reading JavaScript from file .* LOG 1:2 Executing JavaScript:\n window.add_content('button_target', 'Inserted via file') + [Documentation] LOG 2:1 REGEXP: Reading JavaScript from file .* LOG 2:2 Executing JavaScript:\n window.add_content('button_target', 'Inserted via file') Execute Javascript ${CURDIR}/executed_by_execute_javascript.js Page Should Contain Inserted via file Open Context Menu + [TAGS] Known Issue - Firefox Go To Page "javascript/context_menu.html" Open Context Menu myDiv +Drag and Drop + [Setup] Go To Page "javascript/drag_and_drop.html" + Element Text Should Be id=droppable Drop here + Drag and Drop id=draggable id=droppable + Element Text Should Be id=droppable Dropped! + +Drag and Drop by Offset + [Setup] Go To Page "javascript/drag_and_drop.html" + Element Text Should Be id=droppable Drop here + Drag and Drop by Offset id=draggable 1 1 + Element Text Should Be id=droppable Drop here + Drag and Drop by Offset id=draggable 100 20 + Element Text Should Be id=droppable Dropped! + + diff --git a/test/acceptance/keywords/lists.txt b/test/acceptance/keywords/lists.txt index 181204f0d..fcbda8dce 100644 --- a/test/acceptance/keywords/lists.txt +++ b/test/acceptance/keywords/lists.txt @@ -35,7 +35,7 @@ Get Selected List Labels Should Be Equal ${selected} ${expected} List Selection Should Be - [Documentation] LOG 1 Verifying list 'interests' has no options selected. LOG 4 Verifying list 'possible_channels' has option(s) [ email | Telephone ] selected. + [Documentation] LOG 2 Verifying list 'interests' has no options selected. LOG 5 Verifying list 'possible_channels' has option(s) [ email | Telephone ] selected. List Selection Should Be interests List Selection Should Be preferred_channel Telephone List Selection Should Be preferred_channel phone @@ -49,7 +49,7 @@ List Selection Should Be When List Does Not Exist Run Keyword And Expect Error Page should have contained list 'nonexisting' but did not List Selection Should Be nonexisting whatever UnSelect Single Value From List - [Documentation] LOG 1.1 Unselecting option(s) 'Email' from list 'possible_channels'. + [Documentation] LOG 2.1 Unselecting option(s) 'Email' from list 'possible_channels'. Unselect and Verify Selection possible_channels Email phone Comment unselecting already unselected option has no effect Unselect and Verify Selection possible_channels Email phone @@ -57,22 +57,24 @@ UnSelect Single Value From List Run Keyword And Expect Error Keyword 'Unselect from list' works only for multiselect lists. Unselect From List preferred_channel UnSelect All From List - [Documentation] LOG 1 Unselecting all options from list 'possible_channels'. + [Documentation] LOG 2 Unselecting all options from list 'possible_channels'. Unselect From List possible_channels List Selection Should Be possible_channels Select From Single Selection List - [Documentation] LOG 1.1 Selecting option(s) 'Email' from list 'preferred_channel'. + [Documentation] LOG 2.1 Selecting option(s) 'Email' from list 'preferred_channel'. Select And verify selection preferred_channel Email Email Select And verify selection preferred_channel Email Email Select And verify selection preferred_channel directmail Direct mail - Select From List preferred_channel email Telephone + Select From List preferred_channel Telephone + #do something else... anything to ensure the list is really set as the next keyword will pass if list item is highlighted but not selected + Unselect from List possible_channels List Selection Should Be preferred_channel Telephone Select From List preferred_channel List Selection Should Be preferred_channel Direct mail Select From Multiselect List - [Documentation] LOG 4 Selecting option(s) 'Direct mail, phone' from list 'possible_channels'. + [Documentation] LOG 5 Selecting option(s) 'Direct mail, phone' from list 'possible_channels'. Select And verify selection possible_channels email email Telephone Select And verify selection possible_channels Direct mail Direct mail email Telephone Unselect from List possible_channels @@ -80,13 +82,13 @@ Select From Multiselect List List Selection Should Be possible_channels Telephone directmail Select All From List - [Documentation] LOG 1 Selecting all options from list 'interests'. + [Documentation] LOG 2 Selecting all options from list 'interests'. Select All From List interests List Selection Should Be interests Males Females Others Run Keyword And Expect Error Keyword 'Select all from list' works only for multiselect lists. Select All From List preferred_channel List Should Have No Selections - [Documentation] LOG 1 Verifying list 'interests' has no selection. + [Documentation] LOG 2 Verifying list 'interests' has no selection. List Should Have No Selections interests Select All From List interests Run Keyword And Expect Error List 'interests' should have had no selection (selection was [ Males | Females | Others ]) List Should Have No Selections interests diff --git a/test/acceptance/keywords/mouse.txt b/test/acceptance/keywords/mouse.txt index 53ebbcc04..5a5b36e59 100644 --- a/test/acceptance/keywords/mouse.txt +++ b/test/acceptance/keywords/mouse.txt @@ -4,26 +4,33 @@ Resource ../resource.txt *** Test Cases *** Mouse Over - Mouse Over test_element - Textfield Value Should Be test_element mouseover test_element - Textfield Value Should Be secondary_element ${EMPTY} + [TAGS] Known Issue - Firefox + Mouse Over el_for_mouseover + Textfield Value Should Be el_for_mouseover mouseover el_for_mouseover Run Keyword And Expect Error ERROR: Element not_there not found. Mouse Over not_there Mouse Out - Mouse Out test_element - Textfield Value Should Be test_element mouseout test_element - Textfield Value Should Be secondary_element ${EMPTY} + [TAGS] Known Issue - Firefox + Mouse Out el_for_mouseout + Textfield Value Should Be el_for_mouseout mouseout el_for_mouseout Run Keyword And Expect Error ERROR: Element not_there not found. Mouse Out not_there Mouse Down - Mouse Down test_element - Textfield Value Should Be test_element mousedown test_element - Textfield Value Should Be secondary_element ${EMPTY} + [TAGS] Known Issue - Firefox + Mouse Down el_for_mousedown + Textfield Value Should Be el_for_mousedown mousedown el_for_mousedown Run Keyword And Expect Error ERROR: Element not_there not found. Mouse Down not_there Mouse Up - Mouse Up test_element - Textfield Value Should Be test_element mouseup test_element - Textfield Value Should Be secondary_element ${EMPTY} + [TAGS] Known Issue - Firefox + Mouse Up el_for_mouseup + Textfield Value Should Be el_for_mouseup mouseup el_for_mouseup Run Keyword And Expect Error ERROR: Element not_there not found. Mouse Up not_there +Focus + Focus el_for_focus + Textfield Value Should Be el_for_focus focus el_for_focus + +Simulate + Simulate el_for_blur blur + Textfield Value Should Be el_for_blur blur el_for_blur diff --git a/test/acceptance/keywords/navigation.txt b/test/acceptance/keywords/navigation.txt index b9a914098..6db887d88 100644 --- a/test/acceptance/keywords/navigation.txt +++ b/test/acceptance/keywords/navigation.txt @@ -18,7 +18,7 @@ Go Back Title Should Be ${LINKS TITLE} Click Link - [Documentation] LOG 1 Clicking link 'Relative'. + [Documentation] LOG 2 Clicking link 'Relative'. Click Link Relative Verify Location Is "index.html" Title Should Be ${INDEX TITLE} @@ -56,7 +56,7 @@ Click Link With Unicode Verify Location Is "index.html" Click Image - [Documentation] LOG 1 Clicking image 'image.jpg'. + [Documentation] LOG 2 Clicking image 'image.jpg'. Click Image image.jpg Verify Location Is "index.html" diff --git a/test/acceptance/keywords/screenshots.txt b/test/acceptance/keywords/screenshots.txt index d862b370b..cf3d86844 100644 --- a/test/acceptance/keywords/screenshots.txt +++ b/test/acceptance/keywords/screenshots.txt @@ -6,12 +6,13 @@ Suite Setup Go To Page "links.html" * Test Cases * Capture page screenshot to default location - [Documentation] LOG 1:2 REGEXP: + [Documentation] LOG 2:2 REGEXP: [Setup] Remove Files ${OUTPUTDIR}/selenium-screenshot-*.png Capture Page Screenshot ${count} = Count Files In Directory ${OUTPUTDIR} selenium-screenshot-*.png Should Be Equal As Integers ${count} 1 Click Link Relative + Wait Until Page Contains Element tag=body Capture Page Screenshot ${count} = Count Files In Directory ${OUTPUTDIR} selenium-screenshot-*.png Should Be Equal As Integers ${count} 2 diff --git a/test/acceptance/keywords/textfields.txt b/test/acceptance/keywords/textfields.txt index bac69f49a..81bec976c 100644 --- a/test/acceptance/keywords/textfields.txt +++ b/test/acceptance/keywords/textfields.txt @@ -16,7 +16,7 @@ Input Unicode In Text Field Should Be Equal ${text} ${unic_text} Input Password - [Documentation] LOG 2 Typing password into text field 'password_field' + [Documentation] LOG 3 Typing password into text field 'password_field' [Setup] Go To Page "forms/login.html" Input Text username_field username Input Password password_field password @@ -28,5 +28,6 @@ Press Key Cannot Be Executed in IE Input Text username_field James Bond Press Key password_field f + Press Key password_field \\9 Press Key login_button \\13 Verify Location Is "forms/submit.html" diff --git a/test/acceptance/multiple_browsers.txt b/test/acceptance/multiple_browsers.txt index eebca1a96..cc001cbb0 100644 --- a/test/acceptance/multiple_browsers.txt +++ b/test/acceptance/multiple_browsers.txt @@ -12,7 +12,7 @@ It Should Be Possible To Switch Between Browsers Using Indexes Verify Location Is "" It Should Be Give An Alias To New Browser Instance - Open Browser ${ROOT}/forms/prefilled_email_form.html ${BROWSER} Third Browser + Open Browser ${ROOT}/forms/prefilled_email_form.html ${BROWSER} Third Browser remote_url=${REMOTE_URL} desired_capabilities=${DESIRED_CAPABILITIES} Verify Location Is "forms/prefilled_email_form.html" Switch Browser ${BROWSER1} Verify Location Is "" @@ -20,12 +20,13 @@ It Should Be Give An Alias To New Browser Instance Verify Location Is "forms/prefilled_email_form.html" It Should Be Possible Close A Browser - Open Browser ${ROOT}/forms/prefilled_email_form.html ${BROWSER} Third + Open Browser ${ROOT}/forms/prefilled_email_form.html ${BROWSER} Third remote_url=${REMOTE_URL} desired_capabilities=${DESIRED_CAPABILITIES} Switch Browser ${BROWSER2} Close Browser Switch Browser Third Close Browser - ${BROWSER2} = Open Browser ${ROOT}/links.html ${BROWSER} + ${BROWSER2} = Open Browser ${ROOT}/links.html ${BROWSER} remote_url=${REMOTE_URL} desired_capabilities=${DESIRED_CAPABILITIES} + Correct Error Message Should Be Given When Trying To Switch To Non-Existing Browser Run Keyword And Expect Error No browser with index or alias 'non-existing' found. Switch Browser non-existing @@ -33,8 +34,8 @@ Correct Error Message Should Be Given When Trying To Switch To Non-Existing Brow *** Keywords *** Open Two Browsers And Register Indexes Cannot Be Executed in IE - ${BROWSER1} = Open Browser ${FRONT PAGE} ${BROWSER} - ${BROWSER2} = Open Browser ${ROOT}/links.html ${BROWSER} + ${BROWSER1} = Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} desired_capabilities=${DESIRED_CAPABILITIES} + ${BROWSER2} = Open Browser ${ROOT}/links.html ${BROWSER} remote_url=${REMOTE_URL} desired_capabilities=${DESIRED_CAPABILITIES} Set Suite Variable $BROWSER1 Set Suite Variable $BROWSER2 diff --git a/test/acceptance/open_and_close.txt b/test/acceptance/open_and_close.txt index 3ad254d34..9285b543e 100644 --- a/test/acceptance/open_and_close.txt +++ b/test/acceptance/open_and_close.txt @@ -1,11 +1,17 @@ *** Settings *** Resource resource.txt +Suite Teardown Close All Browsers *** Test Cases *** Browser Should Open And Close Open Browser To Start Page Without Testing Default Options Close Browser +Browser Open With Implicit Wait Should Not Override Default + Open Browser To Start Page And Test Implicit Wait 10 + Close Browser + + There Should Be A Good Error Message If Browser Is Not Opened Run Keyword And Expect Error No browser is open Title Should Be foo diff --git a/test/acceptance/resource.txt b/test/acceptance/resource.txt index ab0a4dd00..35784b96a 100644 --- a/test/acceptance/resource.txt +++ b/test/acceptance/resource.txt @@ -1,12 +1,14 @@ *Setting* -Library Selenium2Library run_on_failure=Nothing +Library Selenium2Library run_on_failure=Nothing implicit_wait=0 Library Collections Library OperatingSystem *Variable* -${SERVER} localhost:7272 -${BROWSER} *firefox +${SERVER} localhost:7000 +${BROWSER} firefox +${REMOTE_URL} ${NONE} +${DESIRED_CAPABILITIES} ${NONE} ${ROOT} http://${SERVER}/html ${FRONT PAGE} ${ROOT}/ ${SPEED} 0 @@ -21,11 +23,22 @@ Open Browser To Start Page Should Be Equal ${default timeout} 5 seconds Open Browser To Start Page Without Testing Default Options - Open Browser ${FRONT PAGE} ${BROWSER} + Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} desired_capabilities=${DESIRED_CAPABILITIES} ${orig speed} = Set Selenium Speed ${SPEED} ${orig timeout} = Set Selenium Timeout 10 seconds [Return] ${orig speed} 5 seconds +Open Browser To Start Page And Test Implicit Wait + [DOCUMENTATION] This keyword tests that 'Set Selenium Implicit Wait' and 'Get Selenium Implicit Wait' work as expected + [ARGUMENTS] ${implicit_wait} + Should Not Be Equal 0 ${implicit_wait} Please do not pass in a value of 0 for the implicit wait argument for this function + ${old_wait}= Set Selenium Implicit Wait ${implicit_wait} + Open Browser ${FRONT PAGE} ${BROWSER} remote_url=${REMOTE_URL} desired_capabilities=${DESIRED_CAPABILITIES} + ${default_implicit_wait} = Get Selenium Implicit Wait + Should Be Equal ${implicit_wait} seconds ${default_implicit_wait} + #be sure to revert the implicit wait to whatever it was before so as to not effect other tests + Set Selenium Implicit Wait ${old_wait} + Cannot Be Executed In IE ${runsInIE}= Set Variable If "${BROWSER}".replace(' ', '').lower() in ['ie', '*iexplore', 'internetexplorer'] ${TRUE} Run Keyword If ${runsInIE} Set Tags ie-incompatible diff --git a/test/acceptance/windows.txt b/test/acceptance/windows.txt index 24a14c803..afc9b3785 100644 --- a/test/acceptance/windows.txt +++ b/test/acceptance/windows.txt @@ -14,14 +14,23 @@ Popup Windows Created With Javascript Do Action In Popup Window And Verify Select Main Window And Verify +Get Window Titles + ${exp_titles}= Create List Click link to show a popup window Original + Click Link my popup + ${titles}= Get Window Titles + Should Be Equal ${titles} ${exp_titles} + +Get Window Names + ${exp_names}= Create List selenium_main_app_window myName + Click Link my popup + ${names}= Get Window Names + Should Be Equal ${names} ${exp_names} + Get Window Identifiers + ${exp_ids}= Create List undefined undefined Click Link my popup - @{window_ids}= Get Window Identifiers - Length Should Be ${window_ids} 2 - Select Window @{window_ids}[0] - Title Should Be Click link to show a popup window - Select Window @{window_ids}[1] - Title Should Be Original + ${ids}= Get Window Identifiers + Should Be Equal ${ids} ${exp_ids} *Keywords* Open Popup Window, Select It And Verify @@ -32,7 +41,7 @@ Open Popup Window, Select It And Verify Select Main Window And Verify Close Window - Select Window + Select Window main Title Should Be Click link to show a popup window Do Action In Popup Window And Verify diff --git a/test/resources/html/frames/iframes.html b/test/resources/html/frames/iframes.html new file mode 100644 index 000000000..445ed72c2 --- /dev/null +++ b/test/resources/html/frames/iframes.html @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/test/resources/html/frames/poorlynamedframe.html b/test/resources/html/frames/poorlynamedframe.html new file mode 100644 index 000000000..5daf98620 --- /dev/null +++ b/test/resources/html/frames/poorlynamedframe.html @@ -0,0 +1,5 @@ + + Relative
+ + + diff --git a/test/resources/html/javascript/drag_and_drop.html b/test/resources/html/javascript/drag_and_drop.html new file mode 100644 index 000000000..0efddd6e4 --- /dev/null +++ b/test/resources/html/javascript/drag_and_drop.html @@ -0,0 +1,39 @@ + + + + + + + + + + + +
+
+

Drag me to my target

+
+
+

Drop here

+
+
+ + + diff --git a/test/resources/html/javascript/jquery-ui.css b/test/resources/html/javascript/jquery-ui.css new file mode 100644 index 000000000..0c82c3fcb --- /dev/null +++ b/test/resources/html/javascript/jquery-ui.css @@ -0,0 +1,466 @@ +/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.core.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.progressbar.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.slider.css, jquery.ui.tabs.css, jquery.ui.theme.css +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; } +.ui-helper-clearfix:after { clear: both; } +.ui-helper-clearfix { zoom: 1; } +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + +/* IE/Win - Fix animation bug - #4615 */ +.ui-accordion { width: 100%; } +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } +.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } +.ui-accordion .ui-accordion-content-active { display: block; } + +.ui-autocomplete { position: absolute; cursor: default; } + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +/* + * jQuery UI Menu 1.8.21 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu#theming + */ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; + float: left; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin:0; + padding: 0; + zoom: 1; + float: left; + clear: left; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; + zoom:1; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} + +.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ +.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ +button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ +.ui-button-icons-only { width: 3.4em; } +button.ui-button-icons-only { width: 3.7em; } + +/*button text element */ +.ui-button .ui-button-text { display: block; line-height: 1.4; } +.ui-button-text-only .ui-button-text { padding: .4em 1em; } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } +.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } +.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } +.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } +/* no icon support for input elements, provide padding by default */ +input.ui-button { padding: .4em 1em; } + +/*button icon element(s) */ +.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } +.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } +.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } +.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } +.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } + +/*button sets*/ +.ui-buttonset { margin-right: 7px; } +.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } + +/* workarounds */ +button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ + +.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +} +.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } +.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } +.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } + +.ui-progressbar { height:2em; text-align: left; overflow: hidden; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; } +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} +.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } + +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; } +.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ +.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } +.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; } +.ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; } +.ui-widget-content a { color: #222222/*{fcContent}*/; } +.ui-widget-header { border: 1px solid #aaaaaa/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; } +.ui-widget-header a { color: #222222/*{fcHeader}*/; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; } +.ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; text-decoration: none; } +.ui-widget :active { outline: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636/*{fcHighlight}*/; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; } +.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a/*{fcError}*/; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a/*{fcError}*/; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -khtml-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; } +.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; -khtml-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; } + +/* Overlays */ +.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; } +.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -khtml-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; } \ No newline at end of file diff --git a/test/resources/html/javascript/jquery-ui.min.js b/test/resources/html/javascript/jquery-ui.min.js new file mode 100644 index 000000000..e98e1e81c --- /dev/null +++ b/test/resources/html/javascript/jquery-ui.min.js @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.8.21 - 2012-06-05 +* https://github.com/jquery/jquery-ui +* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.droppable.js, jquery.ui.resizable.js, jquery.ui.selectable.js, jquery.ui.sortable.js, jquery.effects.core.js, jquery.effects.blind.js, jquery.effects.bounce.js, jquery.effects.clip.js, jquery.effects.drop.js, jquery.effects.explode.js, jquery.effects.fade.js, jquery.effects.fold.js, jquery.effects.highlight.js, jquery.effects.pulsate.js, jquery.effects.scale.js, jquery.effects.shake.js, jquery.effects.slide.js, jquery.effects.transfer.js, jquery.ui.accordion.js, jquery.ui.autocomplete.js, jquery.ui.button.js, jquery.ui.datepicker.js, jquery.ui.dialog.js, jquery.ui.position.js, jquery.ui.progressbar.js, jquery.ui.slider.js, jquery.ui.tabs.js +* Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */ +(function(a,b){function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;return!b.href||!g||f.nodeName.toLowerCase()!=="map"?!1:(h=a("img[usemap=#"+g+"]")[0],!!h&&d(h))}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(a.ui.version)return;a.extend(a.ui,{version:"1.8.21",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;return a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0),/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){return a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)}),c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){return c===b?g["inner"+d].call(this):this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){return typeof b!="number"?g["outer"+d].call(this,b):this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));c.offsetHeight,a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!d||!a.element[0].parentNode)return;for(var e=0;e0?!0:(b[d]=1,e=b[d]>0,b[d]=0,e)},isOverAxis:function(a,b,c){return a>b&&a=9||!!b.button?this._mouseStarted?(this._mouseDrag(b),b.preventDefault()):(this._mouseDistanceMet(b)&&this._mouseDelayMet(b)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,b)!==!1,this._mouseStarted?this._mouseDrag(b):this._mouseUp(b)),!this._mouseStarted):this._mouseUp(b)},_mouseUp:function(b){return a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,b.target==this._mouseDownEvent.target&&a.data(b.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(b)),!1},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(a){return this.mouseDelayMet},_mouseStart:function(a){},_mouseDrag:function(a){},_mouseStop:function(a){},_mouseCapture:function(a){return!0}})}(jQuery),function(a,b){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1},_create:function(){this.options.helper=="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative"),this.options.addClasses&&this.element.addClass("ui-draggable"),this.options.disabled&&this.element.addClass("ui-draggable-disabled"),this._mouseInit()},destroy:function(){if(!this.element.data("draggable"))return;return this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled"),this._mouseDestroy(),this},_mouseCapture:function(b){var c=this.options;return this.helper||c.disabled||a(b.target).is(".ui-resizable-handle")?!1:(this.handle=this._getHandle(b),this.handle?(c.iframeFix&&a(c.iframeFix===!0?"iframe":c.iframeFix).each(function(){a('
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(a(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(b){var c=this.options;return this.helper=this._createHelper(b),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),a.ui.ddmanager&&(a.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt),c.containment&&this._setContainment(),this._trigger("start",b)===!1?(this._clear(),!1):(this._cacheHelperProportions(),a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this._mouseDrag(b,!0),a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b),!0)},_mouseDrag:function(b,c){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute");if(!c){var d=this._uiHash();if(this._trigger("drag",b,d)===!1)return this._mouseUp({}),!1;this.position=d.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";return a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),!1},_mouseStop:function(b){var c=!1;a.ui.ddmanager&&!this.options.dropBehaviour&&(c=a.ui.ddmanager.drop(this,b)),this.dropped&&(c=this.dropped,this.dropped=!1);var d=this.element[0],e=!1;while(d&&(d=d.parentNode))d==document&&(e=!0);if(!e&&this.options.helper==="original")return!1;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===!0||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var f=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){f._trigger("stop",b)!==!1&&f._clear()})}else this._trigger("stop",b)!==!1&&this._clear();return!1},_mouseUp:function(b){return this.options.iframeFix===!0&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b),a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(b){var c=!this.options.handle||!a(this.options.handle,this.element).length?!0:!1;return a(this.options.handle,this.element).find("*").andSelf().each(function(){this==b.target&&(c=!0)}),c},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;return d.parents("body").length||d.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo),d[0]!=this.element[0]&&!/(fixed|absolute)/.test(d.css("position"))&&d.css("position","absolute"),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,(b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){var c=a(b.containment),d=c[0];if(!d)return;var e=c.offset(),f=a(d).css("overflow")!="hidden";this.containment=[(parseInt(a(d).css("borderLeftWidth"),10)||0)+(parseInt(a(d).css("paddingLeft"),10)||0),(parseInt(a(d).css("borderTopWidth"),10)||0)+(parseInt(a(d).css("paddingTop"),10)||0),(f?Math.max(d.scrollWidth,d.offsetWidth):d.offsetWidth)-(parseInt(a(d).css("borderLeftWidth"),10)||0)-(parseInt(a(d).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(f?Math.max(d.scrollHeight,d.offsetHeight):d.offsetHeight)-(parseInt(a(d).css("borderTopWidth"),10)||0)-(parseInt(a(d).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=c}else b.containment.constructor==Array&&(this.containment=b.containment)},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName),f=b.pageX,g=b.pageY;if(this.originalPosition){var h;if(this.containment){if(this.relative_container){var i=this.relative_container.offset();h=[this.containment[0]+i.left,this.containment[1]+i.top,this.containment[2]+i.left,this.containment[3]+i.top]}else h=this.containment;b.pageX-this.offset.click.lefth[2]&&(f=h[2]+this.offset.click.left),b.pageY-this.offset.click.top>h[3]&&(g=h[3]+this.offset.click.top)}if(c.grid){var j=c.grid[1]?this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;g=h?j-this.offset.click.toph[3]?j-this.offset.click.toph[2]?k-this.offset.click.left=0;k--){var l=d.snapElements[k].left,m=l+d.snapElements[k].width,n=d.snapElements[k].top,o=n+d.snapElements[k].height;if(!(l-f=k&&g<=l||h>=k&&h<=l||gl)&&(e>=i&&e<=j||f>=i&&f<=j||ej);default:return!1}},a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],e=c?c.type:null,f=(b.currentItem||b.element).find(":data(droppable)").andSelf();g:for(var h=0;h').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("resizable",this.element.data("resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=c.handles||(a(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se");if(this.handles.constructor==String){this.handles=="all"&&(this.handles="n,e,s,w,se,sw,ne,nw");var d=this.handles.split(",");this.handles={};for(var e=0;e');h.css({zIndex:c.zIndex}),"se"==f&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[f]=".ui-resizable-"+f,this.element.append(h)}}this._renderAxis=function(b){b=b||this.element;for(var c in this.handles){this.handles[c].constructor==String&&(this.handles[c]=a(this.handles[c],this.element).show());if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var d=a(this.handles[c],this.element),e=0;e=/sw|ne|nw|se|n|s/.test(c)?d.outerHeight():d.outerWidth();var f=["padding",/ne|nw|n/.test(c)?"Top":/se|sw|s/.test(c)?"Bottom":/^e$/.test(c)?"Right":"Left"].join("");b.css(f,e),this._proportionallyResize()}if(!a(this.handles[c]).length)continue}},this._renderAxis(this.element),this._handles=a(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){if(!b.resizing){if(this.className)var a=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=a&&a[1]?a[1]:"se"}}),c.autoHide&&(this._handles.hide(),a(this.element).addClass("ui-resizable-autohide").hover(function(){if(c.disabled)return;a(this).removeClass("ui-resizable-autohide"),b._handles.show()},function(){if(c.disabled)return;b.resizing||(a(this).addClass("ui-resizable-autohide"),b._handles.hide())})),this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(b){a(b).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var c=this.element;c.after(this.originalElement.css({position:c.css("position"),width:c.outerWidth(),height:c.outerHeight(),top:c.css("top"),left:c.css("left")})).remove()}return this.originalElement.css("resize",this.originalResizeStyle),b(this.originalElement),this},_mouseCapture:function(b){var c=!1;for(var d in this.handles)a(this.handles[d])[0]==b.target&&(c=!0);return!this.options.disabled&&c},_mouseStart:function(b){var d=this.options,e=this.element.position(),f=this.element;this.resizing=!0,this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()},(f.is(".ui-draggable")||/absolute/.test(f.css("position")))&&f.css({position:"absolute",top:e.top,left:e.left}),this._renderProxy();var g=c(this.helper.css("left")),h=c(this.helper.css("top"));d.containment&&(g+=a(d.containment).scrollLeft()||0,h+=a(d.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:g,top:h},this.size=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalSize=this._helper?{width:f.outerWidth(),height:f.outerHeight()}:{width:f.width(),height:f.height()},this.originalPosition={left:g,top:h},this.sizeDiff={width:f.outerWidth()-f.width(),height:f.outerHeight()-f.height()},this.originalMousePosition={left:b.pageX,top:b.pageY},this.aspectRatio=typeof d.aspectRatio=="number"?d.aspectRatio:this.originalSize.width/this.originalSize.height||1;var i=a(".ui-resizable-"+this.axis).css("cursor");return a("body").css("cursor",i=="auto"?this.axis+"-resize":i),f.addClass("ui-resizable-resizing"),this._propagate("start",b),!0},_mouseDrag:function(b){var c=this.helper,d=this.options,e={},f=this,g=this.originalMousePosition,h=this.axis,i=b.pageX-g.left||0,j=b.pageY-g.top||0,k=this._change[h];if(!k)return!1;var l=k.apply(this,[b,i,j]),m=a.browser.msie&&a.browser.version<7,n=this.sizeDiff;this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)l=this._updateRatio(l,b);return l=this._respectSize(l,b),this._propagate("resize",b),c.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"}),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),this._updateCache(l),this._trigger("resize",b,this.ui()),!1},_mouseStop:function(b){this.resizing=!1;var c=this.options,d=this;if(this._helper){var e=this._proportionallyResizeElements,f=e.length&&/textarea/i.test(e[0].nodeName),g=f&&a.ui.hasScroll(e[0],"left")?0:d.sizeDiff.height,h=f?0:d.sizeDiff.width,i={width:d.helper.width()-h,height:d.helper.height()-g},j=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,k=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;c.animate||this.element.css(a.extend(i,{top:k,left:j})),d.helper.height(d.size.height),d.helper.width(d.size.width),this._helper&&!c.animate&&this._proportionallyResize()}return a("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",b),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(a){var b=this.options,c,e,f,g,h;h={minWidth:d(b.minWidth)?b.minWidth:0,maxWidth:d(b.maxWidth)?b.maxWidth:Infinity,minHeight:d(b.minHeight)?b.minHeight:0,maxHeight:d(b.maxHeight)?b.maxHeight:Infinity};if(this._aspectRatio||a)c=h.minHeight*this.aspectRatio,f=h.minWidth/this.aspectRatio,e=h.maxHeight*this.aspectRatio,g=h.maxWidth/this.aspectRatio,c>h.minWidth&&(h.minWidth=c),f>h.minHeight&&(h.minHeight=f),ea.width,k=d(a.height)&&e.minHeight&&e.minHeight>a.height;j&&(a.width=e.minWidth),k&&(a.height=e.minHeight),h&&(a.width=e.maxWidth),i&&(a.height=e.maxHeight);var l=this.originalPosition.left+this.originalSize.width,m=this.position.top+this.size.height,n=/sw|nw|w/.test(g),o=/nw|ne|n/.test(g);j&&n&&(a.left=l-e.minWidth),h&&n&&(a.left=l-e.maxWidth),k&&o&&(a.top=m-e.minHeight),i&&o&&(a.top=m-e.maxHeight);var p=!a.width&&!a.height;return p&&!a.left&&a.top?a.top=null:p&&!a.top&&a.left&&(a.left=null),a},_proportionallyResize:function(){var b=this.options;if(!this._proportionallyResizeElements.length)return;var c=this.helper||this.element;for(var d=0;d');var d=a.browser.msie&&a.browser.version<7,e=d?1:0,f=d?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-e+"px",top:this.elementOffset.top-e+"px",zIndex:++c.zIndex}),this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(a,b,c){return{width:this.originalSize.width+b}},w:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{left:f.left+b,width:e.width-b}},n:function(a,b,c){var d=this.options,e=this.originalSize,f=this.originalPosition;return{top:f.top+c,height:e.height-c}},s:function(a,b,c){return{height:this.originalSize.height+c}},se:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},sw:function(b,c,d){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,c,d]))},ne:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,c,d]))},nw:function(b,c,d){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,c,d]))}},_propagate:function(b,c){a.ui.plugin.call(this,b,[c,this.ui()]),b!="resize"&&this._trigger(b,c,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),a.extend(a.ui.resizable,{version:"1.8.21"}),a.ui.plugin.add("resizable","alsoResize",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=function(b){a(b).each(function(){var b=a(this);b.data("resizable-alsoresize",{width:parseInt(b.width(),10),height:parseInt(b.height(),10),left:parseInt(b.css("left"),10),top:parseInt(b.css("top"),10)})})};typeof e.alsoResize=="object"&&!e.alsoResize.parentNode?e.alsoResize.length?(e.alsoResize=e.alsoResize[0],f(e.alsoResize)):a.each(e.alsoResize,function(a){f(a)}):f(e.alsoResize)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.originalSize,g=d.originalPosition,h={height:d.size.height-f.height||0,width:d.size.width-f.width||0,top:d.position.top-g.top||0,left:d.position.left-g.left||0},i=function(b,d){a(b).each(function(){var b=a(this),e=a(this).data("resizable-alsoresize"),f={},g=d&&d.length?d:b.parents(c.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(g,function(a,b){var c=(e[b]||0)+(h[b]||0);c&&c>=0&&(f[b]=c||null)}),b.css(f)})};typeof e.alsoResize=="object"&&!e.alsoResize.nodeType?a.each(e.alsoResize,function(a,b){i(a,b)}):i(e.alsoResize)},stop:function(b,c){a(this).removeData("resizable-alsoresize")}}),a.ui.plugin.add("resizable","animate",{stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d._proportionallyResizeElements,g=f.length&&/textarea/i.test(f[0].nodeName),h=g&&a.ui.hasScroll(f[0],"left")?0:d.sizeDiff.height,i=g?0:d.sizeDiff.width,j={width:d.size.width-i,height:d.size.height-h},k=parseInt(d.element.css("left"),10)+(d.position.left-d.originalPosition.left)||null,l=parseInt(d.element.css("top"),10)+(d.position.top-d.originalPosition.top)||null;d.element.animate(a.extend(j,l&&k?{top:l,left:k}:{}),{duration:e.animateDuration,easing:e.animateEasing,step:function(){var c={width:parseInt(d.element.css("width"),10),height:parseInt(d.element.css("height"),10),top:parseInt(d.element.css("top"),10),left:parseInt(d.element.css("left"),10)};f&&f.length&&a(f[0]).css({width:c.width,height:c.height}),d._updateCache(c),d._propagate("resize",b)}})}}),a.ui.plugin.add("resizable","containment",{start:function(b,d){var e=a(this).data("resizable"),f=e.options,g=e.element,h=f.containment,i=h instanceof a?h.get(0):/parent/.test(h)?g.parent().get(0):h;if(!i)return;e.containerElement=a(i);if(/document/.test(h)||h==document)e.containerOffset={left:0,top:0},e.containerPosition={left:0,top:0},e.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight};else{var j=a(i),k=[];a(["Top","Right","Left","Bottom"]).each(function(a,b){k[a]=c(j.css("padding"+b))}),e.containerOffset=j.offset(),e.containerPosition=j.position(),e.containerSize={height:j.innerHeight()-k[3],width:j.innerWidth()-k[1]};var l=e.containerOffset,m=e.containerSize.height,n=e.containerSize.width,o=a.ui.hasScroll(i,"left")?i.scrollWidth:n,p=a.ui.hasScroll(i)?i.scrollHeight:m;e.parentData={element:i,left:l.left,top:l.top,width:o,height:p}}},resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.containerSize,g=d.containerOffset,h=d.size,i=d.position,j=d._aspectRatio||b.shiftKey,k={top:0,left:0},l=d.containerElement;l[0]!=document&&/static/.test(l.css("position"))&&(k=g),i.left<(d._helper?g.left:0)&&(d.size.width=d.size.width+(d._helper?d.position.left-g.left:d.position.left-k.left),j&&(d.size.height=d.size.width/d.aspectRatio),d.position.left=e.helper?g.left:0),i.top<(d._helper?g.top:0)&&(d.size.height=d.size.height+(d._helper?d.position.top-g.top:d.position.top),j&&(d.size.width=d.size.height*d.aspectRatio),d.position.top=d._helper?g.top:0),d.offset.left=d.parentData.left+d.position.left,d.offset.top=d.parentData.top+d.position.top;var m=Math.abs((d._helper?d.offset.left-k.left:d.offset.left-k.left)+d.sizeDiff.width),n=Math.abs((d._helper?d.offset.top-k.top:d.offset.top-g.top)+d.sizeDiff.height),o=d.containerElement.get(0)==d.element.parent().get(0),p=/relative|absolute/.test(d.containerElement.css("position"));o&&p&&(m-=d.parentData.left),m+d.size.width>=d.parentData.width&&(d.size.width=d.parentData.width-m,j&&(d.size.height=d.size.width/d.aspectRatio)),n+d.size.height>=d.parentData.height&&(d.size.height=d.parentData.height-n,j&&(d.size.width=d.size.height*d.aspectRatio))},stop:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.position,g=d.containerOffset,h=d.containerPosition,i=d.containerElement,j=a(d.helper),k=j.offset(),l=j.outerWidth()-d.sizeDiff.width,m=j.outerHeight()-d.sizeDiff.height;d._helper&&!e.animate&&/relative/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m}),d._helper&&!e.animate&&/static/.test(i.css("position"))&&a(this).css({left:k.left-h.left-g.left,width:l,height:m})}}),a.ui.plugin.add("resizable","ghost",{start:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size;d.ghost=d.originalElement.clone(),d.ghost.css({opacity:.25,display:"block",position:"relative",height:f.height,width:f.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof e.ghost=="string"?e.ghost:""),d.ghost.appendTo(d.helper)},resize:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(b,c){var d=a(this).data("resizable"),e=d.options;d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}}),a.ui.plugin.add("resizable","grid",{resize:function(b,c){var d=a(this).data("resizable"),e=d.options,f=d.size,g=d.originalSize,h=d.originalPosition,i=d.axis,j=e._aspectRatio||b.shiftKey;e.grid=typeof e.grid=="number"?[e.grid,e.grid]:e.grid;var k=Math.round((f.width-g.width)/(e.grid[0]||1))*(e.grid[0]||1),l=Math.round((f.height-g.height)/(e.grid[1]||1))*(e.grid[1]||1);/^(se|s|e)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l):/^(ne)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l):/^(sw)$/.test(i)?(d.size.width=g.width+k,d.size.height=g.height+l,d.position.left=h.left-k):(d.size.width=g.width+k,d.size.height=g.height+l,d.position.top=h.top-l,d.position.left=h.left-k)}});var c=function(a){return parseInt(a,10)||0},d=function(a){return!isNaN(parseInt(a,10))}}(jQuery),function(a,b){a.widget("ui.selectable",a.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var b=this;this.element.addClass("ui-selectable"),this.dragged=!1;var c;this.refresh=function(){c=a(b.options.filter,b.element[0]),c.addClass("ui-selectee"),c.each(function(){var b=a(this),c=b.offset();a.data(this,"selectable-item",{element:this,$element:b,left:c.left,top:c.top,right:c.left+b.outerWidth(),bottom:c.top+b.outerHeight(),startselected:!1,selected:b.hasClass("ui-selected"),selecting:b.hasClass("ui-selecting"),unselecting:b.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=c.addClass("ui-selectee"),this._mouseInit(),this.helper=a("
")},destroy:function(){return this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy(),this},_mouseStart:function(b){var c=this;this.opos=[b.pageX,b.pageY];if(this.options.disabled)return;var d=this.options;this.selectees=a(d.filter,this.element[0]),this._trigger("start",b),a(d.appendTo).append(this.helper),this.helper.css({left:b.clientX,top:b.clientY,width:0,height:0}),d.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var d=a.data(this,"selectable-item");d.startselected=!0,!b.metaKey&&!b.ctrlKey&&(d.$element.removeClass("ui-selected"),d.selected=!1,d.$element.addClass("ui-unselecting"),d.unselecting=!0,c._trigger("unselecting",b,{unselecting:d.element}))}),a(b.target).parents().andSelf().each(function(){var d=a.data(this,"selectable-item");if(d){var e=!b.metaKey&&!b.ctrlKey||!d.$element.hasClass("ui-selected");return d.$element.removeClass(e?"ui-unselecting":"ui-selected").addClass(e?"ui-selecting":"ui-unselecting"),d.unselecting=!e,d.selecting=e,d.selected=e,e?c._trigger("selecting",b,{selecting:d.element}):c._trigger("unselecting",b,{unselecting:d.element}),!1}})},_mouseDrag:function(b){var c=this;this.dragged=!0;if(this.options.disabled)return;var d=this.options,e=this.opos[0],f=this.opos[1],g=b.pageX,h=b.pageY;if(e>g){var i=g;g=e,e=i}if(f>h){var i=h;h=f,f=i}return this.helper.css({left:e,top:f,width:g-e,height:h-f}),this.selectees.each(function(){var i=a.data(this,"selectable-item");if(!i||i.element==c.element[0])return;var j=!1;d.tolerance=="touch"?j=!(i.left>g||i.righth||i.bottome&&i.rightf&&i.bottom *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3},_create:function(){var a=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},destroy:function(){a.Widget.prototype.destroy.call(this),this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){b==="disabled"?(this.options[b]=c,this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")):a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type=="static")return!1;this._refreshItems(b);var e=null,f=this,g=a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==f)return e=a(this),!1});a.data(b.target,d.widgetName+"-item")==f&&(e=a(b.target));if(!e)return!1;if(this.options.handle&&!c){var h=!1;a(this.options.handle,e).find("*").andSelf().each(function(){this==b.target&&(h=!0)});if(!h)return!1}return this.currentItem=e,this._removeCurrentsFromItems(),!0},_mouseStart:function(b,c,d){var e=this.options,f=this;this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(b),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(b),this.originalPageX=b.pageX,this.originalPageY=b.pageY,e.cursorAt&&this._adjustOffsetFromHelper(e.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!=this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),e.containment&&this._setContainment(),e.cursor&&(a("body").css("cursor")&&(this._storedCursor=a("body").css("cursor")),a("body").css("cursor",e.cursor)),e.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",e.opacity)),e.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",e.zIndex)),this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",b,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(var g=this.containers.length-1;g>=0;g--)this.containers[g]._trigger("activate",b,f._uiHash(this));return a.ui.ddmanager&&(a.ui.ddmanager.current=this),a.ui.ddmanager&&!e.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(b),!0},_mouseDrag:function(b){this.position=this._generatePosition(b),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){var c=this.options,d=!1;this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY=0;e--){var f=this.items[e],g=f.item[0],h=this._intersectsWithPointer(f);if(!h)continue;if(g!=this.currentItem[0]&&this.placeholder[h==1?"next":"prev"]()[0]!=g&&!a.ui.contains(this.placeholder[0],g)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],g):!0)){this.direction=h==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(f))this._rearrange(b,f);else break;this._trigger("change",b,this._uiHash());break}}return this._contactContainers(b),a.ui.ddmanager&&a.ui.ddmanager.drag(this,b),this._trigger("sort",b,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(b,c){if(!b)return;a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this,e=d.placeholder.offset();d.reverting=!0,a(this.helper).animate({left:e.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:e.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return!1},cancel:function(){var b=this;if(this.dragging){this._mouseUp({target:null}),this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("deactivate",null,b._uiHash(this)),this.containers[c].containerCache.over&&(this.containers[c]._trigger("out",null,b._uiHash(this)),this.containers[c].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),a.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},a(c).each(function(){var c=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);c&&d.push((b.key||c[1]+"[]")+"="+(b.key&&b.expression?c[1]:c[2]))}),!d.length&&b.key&&d.push(b.key+"="),d.join("&")},toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];return b=b||{},c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")}),d},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,d=this.positionAbs.top,e=d+this.helperProportions.height,f=a.left,g=f+a.width,h=a.top,i=h+a.height,j=this.offset.click.top,k=this.offset.click.left,l=d+j>h&&d+jf&&b+ka[this.floating?"width":"height"]?l:f0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){return this._refreshItems(a),this.refreshPositions(),this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(b){var c=this,d=[],e=[],f=this._connectWith();if(f&&b)for(var g=f.length-1;g>=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&e.push([a.isFunction(j.options.items)?j.options.items.call(j.element):a(j.options.items,j.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),j])}}e.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(var g=e.length-1;g>=0;g--)e[g][0].each(function(){d.push(this)});return a(d)},_removeCurrentsFromItems:function(){var a=this.currentItem.find(":data("+this.widgetName+"-item)");for(var b=0;b=0;g--){var h=a(f[g]);for(var i=h.length-1;i>=0;i--){var j=a.data(h[i],this.widgetName);j&&j!=this&&!j.options.disabled&&(e.push([a.isFunction(j.options.items)?j.options.items.call(j.element[0],b,{item:this.currentItem}):a(j.options.items,j.element),j]),this.containers.push(j))}}for(var g=e.length-1;g>=0;g--){var k=e[g][1],l=e[g][0];for(var i=0,m=l.length;i=0;c--){var d=this.items[c];if(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])continue;var e=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;b||(d.width=e.outerWidth(),d.height=e.outerHeight());var f=e.offset();d.left=f.left,d.top=f.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(var c=this.containers.length-1;c>=0;c--){var f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left,this.containers[c].containerCache.top=f.top,this.containers[c].containerCache.width=this.containers[c].element.outerWidth(),this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var e=d.placeholder;d.placeholder={element:function(){var b=a(document.createElement(c.currentItem[0].nodeName)).addClass(e||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];return e||(b.style.visibility="hidden"),b},update:function(a,b){if(e&&!d.forcePlaceholderSize)return;b.height()||b.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10)),b.width()||b.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||0,10))}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem)),c.currentItem.after(c.placeholder),d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){var c=null,d=null;for(var e=this.containers.length-1;e>=0;e--){if(a.ui.contains(this.currentItem[0],this.containers[e].element[0]))continue;if(this._intersectsWith(this.containers[e].containerCache)){if(c&&a.ui.contains(this.containers[e].element[0],c.element[0]))continue;c=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",b,this._uiHash(this)),this.containers[e].containerCache.over=0)}if(!c)return;if(this.containers.length===1)this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1;else if(this.currentContainer!=this.containers[d]){var f=1e4,g=null,h=this.positionAbs[this.containers[d].floating?"left":"top"];for(var i=this.items.length-1;i>=0;i--){if(!a.ui.contains(this.containers[d].element[0],this.items[i].item[0]))continue;var j=this.containers[d].floating?this.items[i].item.offset().left:this.items[i].item.offset().top;Math.abs(j-h)0?"down":"up")}if(!g&&!this.options.dropOnEmpty)return;this.currentContainer=this.containers[d],g?this._rearrange(b,g,null,!0):this._rearrange(b,null,this.containers[d].element,!0),this._trigger("change",b,this._uiHash()),this.containers[d]._trigger("change",b,this._uiHash(this)),this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[d]._trigger("over",b,this._uiHash(this)),this.containers[d].containerCache.over=1}},_createHelper:function(b){var c=this.options,d=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;return d.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(d[0]),d[0]==this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(d[0].style.width==""||c.forceHelperSize)&&d.width(this.currentItem.width()),(d[0].style.height==""||c.forceHelperSize)&&d.height(this.currentItem.height()),d},_adjustOffsetFromHelper:function(b){typeof b=="string"&&(b=b.split(" ")),a.isArray(b)&&(b={left:+b[0],top:+b[1]||0}),"left"in b&&(this.offset.click.left=b.left+this.margins.left),"right"in b&&(this.offset.click.left=this.helperProportions.width-b.right+this.margins.left),"top"in b&&(this.offset.click.top=b.top+this.margins.top),"bottom"in b&&(this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])&&(b.left+=this.scrollParent.scrollLeft(),b.top+=this.scrollParent.scrollTop());if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.currentItem.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;b.containment=="parent"&&(b.containment=this.helper[0].parentNode);if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=a(b.containment)[0],d=a(b.containment).offset(),e=a(c).css("overflow")!="hidden";this.containment=[d.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,d.top+(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,d.left+(e?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,d.top+(e?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){c||(c=this.position);var d=b=="absolute"?1:-1,e=this.options,f=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,g=/(html|body)/i.test(f[0].tagName);return{top:c.top+this.offset.relative.top*d+this.offset.parent.top*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():g?0:f.scrollTop())*d),left:c.left+this.offset.relative.left*d+this.offset.parent.left*d-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():g?0:f.scrollLeft())*d)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&(this.scrollParent[0]==document||!a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,e=/(html|body)/i.test(d[0].tagName);this.cssPosition=="relative"&&(this.scrollParent[0]==document||this.scrollParent[0]==this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());var f=b.pageX,g=b.pageY;if(this.originalPosition){this.containment&&(b.pageX-this.offset.click.leftthis.containment[2]&&(f=this.containment[2]+this.offset.click.left),b.pageY-this.offset.click.top>this.containment[3]&&(g=this.containment[3]+this.offset.click.top));if(c.grid){var h=this.originalPageY+Math.round((g-this.originalPageY)/c.grid[1])*c.grid[1];g=this.containment?h-this.offset.click.topthis.containment[3]?h-this.offset.click.topthis.containment[2]?i-this.offset.click.left=0;f--)a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c&&(d.push(function(a){return function(b){a._trigger("receive",b,this._uiHash(this))}}.call(this,this.containers[f])),d.push(function(a){return function(b){a._trigger("update",b,this._uiHash(this))}}.call(this,this.containers[f])))}for(var f=this.containers.length-1;f>=0;f--)c||d.push(function(a){return function(b){a._trigger("deactivate",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over&&(d.push(function(a){return function(b){a._trigger("out",b,this._uiHash(this))}}.call(this,this.containers[f])),this.containers[f].containerCache.over=0);this._storedCursor&&a("body").css("cursor",this._storedCursor),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex),this.dragging=!1;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",b,this._uiHash());for(var f=0;f").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e=document.activeElement;try{e.id}catch(f){e=document.body}return b.wrap(d),(b[0]===e||a.contains(b[0],e))&&a(e).focus(),d=b.parent(),b.css("position")=="static"?(d.css({position:"relative"}),b.css({position:"relative"})):(a.extend(c,{position:b.css("position"),zIndex:b.css("z-index")}),a.each(["top","left","bottom","right"],function(a,d){c[d]=b.css(d),isNaN(parseInt(c[d],10))&&(c[d]="auto")}),b.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),d.css(c).show()},removeWrapper:function(b){var c,d=document.activeElement;return b.parent().is(".ui-effects-wrapper")?(c=b.parent().replaceWith(b),(b[0]===d||a.contains(b[0],d))&&a(d).focus(),c):b},setTransition:function(b,c,d,e){return e=e||{},a.each(c,function(a,c){var f=b.cssUnit(c);f[0]>0&&(e[c]=f[0]*d+f[1])}),e}}),a.fn.extend({effect:function(b,c,d,e){var f=k.apply(this,arguments),g={options:f[1],duration:f[2],callback:f[3]},h=g.options.mode,i=a.effects[b];return a.fx.off||!i?h?this[h](g.duration,g.callback):this.each(function(){g.callback&&g.callback.call(this)}):i.call(this,g)},_show:a.fn.show,show:function(a){if(l(a))return this._show.apply(this,arguments);var b=k.apply(this,arguments);return b[1].mode="show",this.effect.apply(this,b)},_hide:a.fn.hide,hide:function(a){if(l(a))return this._hide.apply(this,arguments);var b=k.apply(this,arguments);return b[1].mode="hide",this.effect.apply(this,b)},__toggle:a.fn.toggle,toggle:function(b){if(l(b)||typeof b=="boolean"||a.isFunction(b))return this.__toggle.apply(this,arguments);var c=k.apply(this,arguments);return c[1].mode="toggle",this.effect.apply(this,c)},cssUnit:function(b){var c=this.css(b),d=[];return a.each(["em","px","%","pt"],function(a,b){c.indexOf(b)>0&&(d=[parseFloat(c),b])}),d}}),a.easing.jswing=a.easing.swing,a.extend(a.easing,{def:"easeOutQuad",swing:function(b,c,d,e,f){return a.easing[a.easing.def](b,c,d,e,f)},easeInQuad:function(a,b,c,d,e){return d*(b/=e)*b+c},easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c},easeInOutQuad:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b+c:-d/2*(--b*(b-2)-1)+c},easeInCubic:function(a,b,c,d,e){return d*(b/=e)*b*b+c},easeOutCubic:function(a,b,c,d,e){return d*((b=b/e-1)*b*b+1)+c},easeInOutCubic:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b+c:d/2*((b-=2)*b*b+2)+c},easeInQuart:function(a,b,c,d,e){return d*(b/=e)*b*b*b+c},easeOutQuart:function(a,b,c,d,e){return-d*((b=b/e-1)*b*b*b-1)+c},easeInOutQuart:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b+c:-d/2*((b-=2)*b*b*b-2)+c},easeInQuint:function(a,b,c,d,e){return d*(b/=e)*b*b*b*b+c},easeOutQuint:function(a,b,c,d,e){return d*((b=b/e-1)*b*b*b*b+1)+c},easeInOutQuint:function(a,b,c,d,e){return(b/=e/2)<1?d/2*b*b*b*b*b+c:d/2*((b-=2)*b*b*b*b+2)+c},easeInSine:function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c},easeOutSine:function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c},easeInOutSine:function(a,b,c,d,e){return-d/2*(Math.cos(Math.PI*b/e)-1)+c},easeInExpo:function(a,b,c,d,e){return b==0?c:d*Math.pow(2,10*(b/e-1))+c},easeOutExpo:function(a,b,c,d,e){return b==e?c+d:d*(-Math.pow(2,-10*b/e)+1)+c},easeInOutExpo:function(a,b,c,d,e){return b==0?c:b==e?c+d:(b/=e/2)<1?d/2*Math.pow(2,10*(b-1))+c:d/2*(-Math.pow(2,-10*--b)+2)+c},easeInCirc:function(a,b,c,d,e){return-d*(Math.sqrt(1-(b/=e)*b)-1)+c},easeOutCirc:function(a,b,c,d,e){return d*Math.sqrt(1-(b=b/e-1)*b)+c},easeInOutCirc:function(a,b,c,d,e){return(b/=e/2)<1?-d/2*(Math.sqrt(1-b*b)-1)+c:d/2*(Math.sqrt(1-(b-=2)*b)+1)+c},easeInElastic:function(a,b,c,d,e){var f=1.70158,g=0,h=d;if(b==0)return c;if((b/=e)==1)return c+d;g||(g=e*.3);if(h").css({position:"absolute",visibility:"visible",left:-j*(g/d),top:-i*(h/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:g/d,height:h/c,left:f.left+j*(g/d)+(b.options.mode=="show"?(j-Math.floor(d/2))*(g/d):0),top:f.top+i*(h/c)+(b.options.mode=="show"?(i-Math.floor(c/2))*(h/c):0),opacity:b.options.mode=="show"?0:1}).animate({left:f.left+j*(g/d)+(b.options.mode=="show"?0:(j-Math.floor(d/2))*(g/d)),top:f.top+i*(h/c)+(b.options.mode=="show"?0:(i-Math.floor(c/2))*(h/c)),opacity:b.options.mode=="show"?1:0},b.duration||500);setTimeout(function(){b.options.mode=="show"?e.css({visibility:"visible"}):e.css({visibility:"visible"}).hide(),b.callback&&b.callback.apply(e[0]),e.dequeue(),a("div.ui-effects-explode").remove()},b.duration||500)})}}(jQuery),function(a,b){a.effects.fade=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"hide");c.animate({opacity:d},{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}}(jQuery),function(a,b){a.effects.fold=function(b){return this.queue(function(){var c=a(this),d=["position","top","bottom","left","right"],e=a.effects.setMode(c,b.options.mode||"hide"),f=b.options.size||15,g=!!b.options.horizFirst,h=b.duration?b.duration/2:a.fx.speeds._default/2;a.effects.save(c,d),c.show();var i=a.effects.createWrapper(c).css({overflow:"hidden"}),j=e=="show"!=g,k=j?["width","height"]:["height","width"],l=j?[i.width(),i.height()]:[i.height(),i.width()],m=/([0-9]+)%/.exec(f);m&&(f=parseInt(m[1],10)/100*l[e=="hide"?0:1]),e=="show"&&i.css(g?{height:0,width:f}:{height:f,width:0});var n={},p={};n[k[0]]=e=="show"?l[0]:f,p[k[1]]=e=="show"?l[1]:0,i.animate(n,h,b.options.easing).animate(p,h,b.options.easing,function(){e=="hide"&&c.hide(),a.effects.restore(c,d),a.effects.removeWrapper(c),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}}(jQuery),function(a,b){a.effects.highlight=function(b){return this.queue(function(){var c=a(this),d=["backgroundImage","backgroundColor","opacity"],e=a.effects.setMode(c,b.options.mode||"show"),f={backgroundColor:c.css("backgroundColor")};e=="hide"&&(f.opacity=0),a.effects.save(c,d),c.show().css({backgroundImage:"none",backgroundColor:b.options.color||"#ffff99"}).animate(f,{queue:!1,duration:b.duration,easing:b.options.easing,complete:function(){e=="hide"&&c.hide(),a.effects.restore(c,d),e=="show"&&!a.support.opacity&&this.style.removeAttribute("filter"),b.callback&&b.callback.apply(this,arguments),c.dequeue()}})})}}(jQuery),function(a,b){a.effects.pulsate=function(b){return this.queue(function(){var c=a(this),d=a.effects.setMode(c,b.options.mode||"show"),e=(b.options.times||5)*2-1,f=b.duration?b.duration/2:a.fx.speeds._default/2,g=c.is(":visible"),h=0;g||(c.css("opacity",0).show(),h=1),(d=="hide"&&g||d=="show"&&!g)&&e--;for(var i=0;i').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}}(jQuery),function(a,b){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:!0,clearStyle:!1,collapsible:!1,event:"click",fillSpace:!1,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:!1,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0,b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"),b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){if(c.disabled)return;a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){if(c.disabled)return;a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){if(c.disabled)return;a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){if(c.disabled)return;a(this).removeClass("ui-state-focus")}),b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var e=d.closest(".ui-accordion-header");e.length?b.active=e:b.active=d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top"),b.active.next().addClass("ui-accordion-content-active"),b._createIcons(),b.resize(),b.element.attr("role","tablist"),b.headers.attr("role","tab").bind("keydown.accordion",function(a){return b._keydown(a)}).next().attr("role","tabpanel"),b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide(),b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0),a.browser.safari||b.headers.find("a").attr("tabIndex",-1),c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(a){b._clickHandler.call(b,a,this),a.preventDefault()})},_createIcons:function(){var b=this.options;b.icons&&(a("").addClass("ui-icon "+b.icons.header).prependTo(this.headers),this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected),this.element.addClass("ui-accordion-icons"))},_destroyIcons:function(){this.headers.children(".ui-icon").remove(),this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role"),this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex"),this.headers.find("a").removeAttr("tabIndex"),this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");return(b.autoHeight||b.fillHeight)&&c.css("height",""),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b=="active"&&this.activate(c),b=="icons"&&(this._destroyIcons(),c&&this._createIcons()),b=="disabled"&&this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(this.options.disabled||b.altKey||b.ctrlKey)return;var c=a.ui.keyCode,d=this.headers.length,e=this.headers.index(b.target),f=!1;switch(b.keyCode){case c.RIGHT:case c.DOWN:f=this.headers[(e+1)%d];break;case c.LEFT:case c.UP:f=this.headers[(e-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target),b.preventDefault()}return f?(a(b.target).attr("tabIndex",-1),a(f).attr("tabIndex",0),f.focus(),!1):!0},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height(),a.browser.msie&&this.element.parent().css("overflow",d),this.headers.each(function(){c-=a(this).outerHeight(!0)}),this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+a(this).height()))}).css("overflow","auto")}else b.autoHeight&&(c=0,this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c));return this},activate:function(a){this.options.active=a;var b=this._findActive(a)[0];return this._clickHandler({target:b},b),this},_findActive:function(b){return b?typeof b=="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===!1?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;if(d.disabled)return;if(!b.target){if(!d.collapsible)return;this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),this.active.next().addClass("ui-accordion-content-active");var e=this.active.next(),f={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:e},g=this.active=a([]);this._toggle(g,e,f);return}var h=a(b.currentTarget||c),i=h[0]===this.active[0];d.active=d.collapsible&&i?!1:this.headers.index(h);if(this.running||!d.collapsible&&i)return;var j=this.active,g=h.next(),e=this.active.next(),f={options:d,newHeader:i&&d.collapsible?a([]):h,oldHeader:this.active,newContent:i&&d.collapsible?a([]):g,oldContent:e},k=this.headers.index(this.active[0])>this.headers.index(h[0]);this.active=i?a([]):h,this._toggle(g,e,f,i,k),j.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header),i||(h.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected),h.next().addClass("ui-accordion-content-active"));return},_toggle:function(b,c,d,e,f){var g=this,h=g.options;g.toShow=b,g.toHide=c,g.data=d;var i=function(){if(!g)return;return g._completed.apply(g,arguments)};g._trigger("changestart",null,g.data),g.running=c.size()===0?b.size():c.size();if(h.animated){var j={};h.collapsible&&e?j={toShow:a([]),toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace}:j={toShow:b,toHide:c,complete:i,down:f,autoHeight:h.autoHeight||h.fillSpace},h.proxied||(h.proxied=h.animated),h.proxiedDuration||(h.proxiedDuration=h.duration),h.animated=a.isFunction(h.proxied)?h.proxied(j):h.proxied,h.duration=a.isFunction(h.proxiedDuration)?h.proxiedDuration(j):h.proxiedDuration;var k=a.ui.accordion.animations,l=h.duration,m=h.animated;m&&!k[m]&&!a.easing[m]&&(m="slide"),k[m]||(k[m]=function(a){this.slide(a,{easing:m,duration:l||700})}),k[m](j)}else h.collapsible&&e?b.toggle():(c.hide(),b.show()),i(!0);c.prev().attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).blur(),b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(this.running)return;this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""}),this.toHide.removeClass("ui-accordion-content-active"),this.toHide.length&&(this.toHide.parent()[0].className=this.toHide.parent()[0].className),this._trigger("change",null,this.data)}}),a.extend(a.ui.accordion,{version:"1.8.21",animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(!b.toHide.size()){b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b);return}if(!b.toShow.size()){b.toHide.animate({height:"hide",paddingTop:"hide",paddingBottom:"hide"},b);return}var d=b.toShow.css("overflow"),e=0,f={},g={},h=["height","paddingTop","paddingBottom"],i,j=b.toShow;i=j[0].style.width,j.width(j.parent().width()-parseFloat(j.css("paddingLeft"))-parseFloat(j.css("paddingRight"))-(parseFloat(j.css("borderLeftWidth"))||0)-(parseFloat(j.css("borderRightWidth"))||0)),a.each(h,function(c,d){g[d]="hide";var e=(""+a.css(b.toShow[0],d)).match(/^([\d+-.]+)(.*)$/);f[d]={value:e[1],unit:e[2]||"px"}}),b.toShow.css({height:0,overflow:"hidden"}).show(),b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(g,{step:function(a,c){c.prop=="height"&&(e=c.end-c.start===0?0:(c.now-c.start)/(c.end-c.start)),b.toShow[0].style[c.prop]=e*f[c.prop].value+f[c.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height",""),b.toShow.css({width:i,overflow:d}),b.complete()}})},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1e3:200})}}})}(jQuery),function(a,b){var c=0;a.widget("ui.autocomplete",{options:{appendTo:"body",autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},pending:0,_create:function(){var b=this,c=this.element[0].ownerDocument,d;this.isMultiLine=this.element.is("textarea"),this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(b.options.disabled||b.element.propAttr("readOnly"))return;d=!1;var e=a.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:b._move("previousPage",c);break;case e.PAGE_DOWN:b._move("nextPage",c);break;case e.UP:b._keyEvent("previous",c);break;case e.DOWN:b._keyEvent("next",c);break;case e.ENTER:case e.NUMPAD_ENTER:b.menu.active&&(d=!0,c.preventDefault());case e.TAB:if(!b.menu.active)return;b.menu.select(c);break;case e.ESCAPE:b.element.val(b.term),b.close(c);break;default:clearTimeout(b.searching),b.searching=setTimeout(function(){b.term!=b.element.val()&&(b.selectedItem=null,b.search(null,c))},b.options.delay)}}).bind("keypress.autocomplete",function(a){d&&(d=!1,a.preventDefault())}).bind("focus.autocomplete",function(){if(b.options.disabled)return;b.selectedItem=null,b.previous=b.element.val()}).bind("blur.autocomplete",function(a){if(b.options.disabled)return;clearTimeout(b.searching),b.closing=setTimeout(function(){b.close(a),b._change(a)},150)}),this._initSource(),this.menu=a("
    ").addClass("ui-autocomplete").appendTo(a(this.options.appendTo||"body",c)[0]).mousedown(function(c){var d=b.menu.element[0];a(c.target).closest(".ui-menu-item").length||setTimeout(function(){a(document).one("mousedown",function(c){c.target!==b.element[0]&&c.target!==d&&!a.ui.contains(d,c.target)&&b.close()})},1),setTimeout(function(){clearTimeout(b.closing)},13)}).menu({focus:function(a,c){var d=c.item.data("item.autocomplete");!1!==b._trigger("focus",a,{item:d})&&/^key/.test(a.originalEvent.type)&&b.element.val(d.value)},selected:function(a,d){var e=d.item.data("item.autocomplete"),f=b.previous;b.element[0]!==c.activeElement&&(b.element.focus(),b.previous=f,setTimeout(function(){b.previous=f,b.selectedItem=e},1)),!1!==b._trigger("select",a,{item:e})&&b.element.val(e.value),b.term=b.element.val(),b.close(a),b.selectedItem=e},blur:function(a,c){b.menu.element.is(":visible")&&b.element.val()!==b.term&&b.element.val(b.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu"),a.fn.bgiframe&&this.menu.element.bgiframe(),b.beforeunloadHandler=function(){b.element.removeAttr("autocomplete")},a(window).bind("beforeunload",b.beforeunloadHandler)},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"),this.menu.element.remove(),a(window).unbind("beforeunload",this.beforeunloadHandler),a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments),b==="source"&&this._initSource(),b==="appendTo"&&this.menu.element.appendTo(a(c||"body",this.element[0].ownerDocument)[0]),b==="disabled"&&c&&this.xhr&&this.xhr.abort()},_initSource:function(){var b=this,c,d;a.isArray(this.options.source)?(c=this.options.source,this.source=function(b,d){d(a.ui.autocomplete.filter(c,b.term))}):typeof this.options.source=="string"?(d=this.options.source,this.source=function(c,e){b.xhr&&b.xhr.abort(),b.xhr=a.ajax({url:d,data:c,dataType:"json",success:function(a,b){e(a)},error:function(){e([])}})}):this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val(),this.term=this.element.val();if(a.length").data("item.autocomplete",c).append(a("").text(c.label)).appendTo(b)},_move:function(a,b){if(!this.menu.element.is(":visible")){this.search(null,b);return}if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term),this.menu.deactivate();return}this.menu[a](b)},widget:function(){return this.menu.element},_keyEvent:function(a,b){if(!this.isMultiLine||this.menu.element.is(":visible"))this._move(a,b),b.preventDefault()}}),a.extend(a.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(b,c){var d=new RegExp(a.ui.autocomplete.escapeRegex(c),"i");return a.grep(b,function(a){return d.test(a.label||a.value||a)})}})}(jQuery),function(a){a.widget("ui.menu",{_create:function(){var b=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(c){if(!a(c.target).closest(".ui-menu-item a").length)return;c.preventDefault(),b.select(c)}),this.refresh()},refresh:function(){var b=this,c=this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem");c.children("a").addClass("ui-corner-all").attr("tabindex",-1).mouseenter(function(c){b.activate(c,a(this).parent())}).mouseleave(function(){b.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var c=b.offset().top-this.element.offset().top,d=this.element.scrollTop(),e=this.element.height();c<0?this.element.scrollTop(d+c):c>=e&&this.element.scrollTop(d+c-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end(),this._trigger("focus",a,{item:b})},deactivate:function(){if(!this.active)return;this.active.children("a").removeClass("ui-state-hover").removeAttr("id"),this._trigger("blur"),this.active=null},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,c){if(!this.active){this.activate(c,this.element.children(b));return}var d=this.active[a+"All"](".ui-menu-item").eq(0);d.length?this.activate(c,d):this.activate(c,this.element.children(b))},nextPage:function(b){if(this.hasScroll()){if(!this.active||this.last()){this.activate(b,this.element.children(".ui-menu-item:first"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c-d+a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:last")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(b){if(this.hasScroll()){if(!this.active||this.first()){this.activate(b,this.element.children(".ui-menu-item:last"));return}var c=this.active.offset().top,d=this.element.height(),e=this.element.children(".ui-menu-item").filter(function(){var b=a(this).offset().top-c+d-a(this).height();return b<10&&b>-10});e.length||(e=this.element.children(".ui-menu-item:first")),this.activate(b,e)}else this.activate(b,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary,f=[];d.primary||d.secondary?(this.options.text&&f.push("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary")),d.primary&&b.prepend(""),d.secondary&&b.append(""),this.options.text||(f.push(e?"ui-button-icons-only":"ui-button-icon-only"),this.hasTitle||b.attr("title",c))):f.push("ui-button-text-only"),b.addClass(f.join(" "))}}),a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c),a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var b=this.element.css("direction")==="rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(b?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(b?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset"),this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy"),a.Widget.prototype.destroy.call(this)}})}(jQuery),function($,undefined){function Datepicker(){this.debug=!1,this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},$.extend(this._defaults,this.regional[""]),this.dpDiv=bindHover($('
    '))}function bindHover(a){var b="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return a.bind("mouseout",function(a){var c=$(a.target).closest(b);if(!c.length)return;c.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(c){var d=$(c.target).closest(b);if($.datepicker._isDisabledDatepicker(instActive.inline?a.parent()[0]:instActive.input[0])||!d.length)return;d.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),d.addClass("ui-state-hover"),d.hasClass("ui-datepicker-prev")&&d.addClass("ui-datepicker-prev-hover"),d.hasClass("ui-datepicker-next")&&d.addClass("ui-datepicker-next-hover")})}function extendRemove(a,b){$.extend(a,b);for(var c in b)if(b[c]==null||b[c]==undefined)a[c]=b[c];return a}function isArray(a){return a&&($.browser.safari&&typeof a=="object"&&a.length||a.constructor&&a.constructor.toString().match(/\Array\(\)/))}$.extend($.ui,{datepicker:{version:"1.8.21"}});var PROP_NAME="datepicker",dpuuid=(new Date).getTime(),instActive;$.extend(Datepicker.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){return extendRemove(this._defaults,a||{}),this},_attachDatepicker:function(target,settings){var inlineSettings=null;for(var attrName in this._defaults){var attrValue=target.getAttribute("date:"+attrName);if(attrValue){inlineSettings=inlineSettings||{};try{inlineSettings[attrName]=eval(attrValue)}catch(err){inlineSettings[attrName]=attrValue}}}var nodeName=target.nodeName.toLowerCase(),inline=nodeName=="div"||nodeName=="span";target.id||(this.uuid+=1,target.id="dp"+this.uuid);var inst=this._newInst($(target),inline);inst.settings=$.extend({},settings||{},inlineSettings||{}),nodeName=="input"?this._connectDatepicker(target,inst):inline&&this._inlineDatepicker(target,inst)},_newInst:function(a,b){var c=a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1");return{id:c,input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:b?bindHover($('
    ')):this.dpDiv}},_connectDatepicker:function(a,b){var c=$(a);b.append=$([]),b.trigger=$([]);if(c.hasClass(this.markerClassName))return;this._attachments(c,b),c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),this._autoSize(b),$.data(a,PROP_NAME,b),b.settings.disabled&&this._disableDatepicker(a)},_attachments:function(a,b){var c=this._get(b,"appendText"),d=this._get(b,"isRTL");b.append&&b.append.remove(),c&&(b.append=$(''+c+""),a[d?"before":"after"](b.append)),a.unbind("focus",this._showDatepicker),b.trigger&&b.trigger.remove();var e=this._get(b,"showOn");(e=="focus"||e=="both")&&a.focus(this._showDatepicker);if(e=="button"||e=="both"){var f=this._get(b,"buttonText"),g=this._get(b,"buttonImage");b.trigger=$(this._get(b,"buttonImageOnly")?$("").addClass(this._triggerClass).attr({src:g,alt:f,title:f}):$('').addClass(this._triggerClass).html(g==""?f:$("").attr({src:g,alt:f,title:f}))),a[d?"before":"after"](b.trigger),b.trigger.click(function(){return $.datepicker._datepickerShowing&&$.datepicker._lastInput==a[0]?$.datepicker._hideDatepicker():$.datepicker._datepickerShowing&&$.datepicker._lastInput!=a[0]?($.datepicker._hideDatepicker(),$.datepicker._showDatepicker(a[0])):$.datepicker._showDatepicker(a[0]),!1})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var d=function(a){var b=0,c=0;for(var d=0;db&&(b=a[d].length,c=d);return c};b.setMonth(d(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort"))),b.setDate(d(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=$(a);if(c.hasClass(this.markerClassName))return;c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(a,c,d){b.settings[c]=d}).bind("getData.datepicker",function(a,c){return this._get(b,c)}),$.data(a,PROP_NAME,b),this._setDate(b,this._getDefaultDate(b),!0),this._updateDatepicker(b),this._updateAlternate(b),b.settings.disabled&&this._disableDatepicker(a),b.dpDiv.css("display","block")},_dialogDatepicker:function(a,b,c,d,e){var f=this._dialogInst;if(!f){this.uuid+=1;var g="dp"+this.uuid;this._dialogInput=$(''),this._dialogInput.keydown(this._doKeyDown),$("body").append(this._dialogInput),f=this._dialogInst=this._newInst(this._dialogInput,!1),f.settings={},$.data(this._dialogInput[0],PROP_NAME,f)}extendRemove(f.settings,d||{}),b=b&&b.constructor==Date?this._formatDate(f,b):b,this._dialogInput.val(b),this._pos=e?e.length?e:[e.pageX,e.pageY]:null;if(!this._pos){var h=document.documentElement.clientWidth,i=document.documentElement.clientHeight,j=document.documentElement.scrollLeft||document.body.scrollLeft,k=document.documentElement.scrollTop||document.body.scrollTop;this._pos=[h/2-100+j,i/2-150+k]}return this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),f.settings.onSelect=c,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),$.blockUI&&$.blockUI(this.dpDiv),$.data(this._dialogInput[0],PROP_NAME,f),this},_destroyDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();$.removeData(a,PROP_NAME),d=="input"?(c.append.remove(),c.trigger.remove(),b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):(d=="div"||d=="span")&&b.removeClass(this.markerClassName).empty()},_enableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!1,c.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().removeClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b})},_disableDatepicker:function(a){var b=$(a),c=$.data(a,PROP_NAME);if(!b.hasClass(this.markerClassName))return;var d=a.nodeName.toLowerCase();if(d=="input")a.disabled=!0,c.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"});else if(d=="div"||d=="span"){var e=b.children("."+this._inlineClass);e.children().addClass("ui-state-disabled"),e.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=$.map(this._disabledInputs,function(b){return b==a?null:b}),this._disabledInputs[this._disabledInputs.length]=a},_isDisabledDatepicker:function(a){if(!a)return!1;for(var b=0;b-1}},_doKeyUp:function(a){var b=$.datepicker._getInst(a.target);if(b.input.val()!=b.lastVal)try{var c=$.datepicker.parseDate($.datepicker._get(b,"dateFormat"),b.input?b.input.val():null,$.datepicker._getFormatConfig(b));c&&($.datepicker._setDateFromField(b),$.datepicker._updateAlternate(b),$.datepicker._updateDatepicker(b))}catch(d){$.datepicker.log(d)}return!0},_showDatepicker:function(a){a=a.target||a,a.nodeName.toLowerCase()!="input"&&(a=$("input",a.parentNode)[0]);if($.datepicker._isDisabledDatepicker(a)||$.datepicker._lastInput==a)return;var b=$.datepicker._getInst(a);$.datepicker._curInst&&$.datepicker._curInst!=b&&($.datepicker._curInst.dpDiv.stop(!0,!0),b&&$.datepicker._datepickerShowing&&$.datepicker._hideDatepicker($.datepicker._curInst.input[0]));var c=$.datepicker._get(b,"beforeShow"),d=c?c.apply(a,[a,b]):{};if(d===!1)return;extendRemove(b.settings,d),b.lastVal=null,$.datepicker._lastInput=a,$.datepicker._setDateFromField(b),$.datepicker._inDialog&&(a.value=""),$.datepicker._pos||($.datepicker._pos=$.datepicker._findPos(a),$.datepicker._pos[1]+=a.offsetHeight);var e=!1;$(a).parents().each(function(){return e|=$(this).css("position")=="fixed",!e}),e&&$.browser.opera&&($.datepicker._pos[0]-=document.documentElement.scrollLeft,$.datepicker._pos[1]-=document.documentElement.scrollTop);var f={left:$.datepicker._pos[0],top:$.datepicker._pos[1]};$.datepicker._pos=null,b.dpDiv.empty(),b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),$.datepicker._updateDatepicker(b),f=$.datepicker._checkOffset(b,f,e),b.dpDiv.css({position:$.datepicker._inDialog&&$.blockUI?"static":e?"fixed":"absolute",display:"none",left:f.left+"px",top:f.top+"px"});if(!b.inline){var g=$.datepicker._get(b,"showAnim"),h=$.datepicker._get(b,"duration"),i=function(){var a=b.dpDiv.find("iframe.ui-datepicker-cover");if(!!a.length){var c=$.datepicker._getBorders(b.dpDiv);a.css({left:-c[0],top:-c[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex($(a).zIndex()+1),$.datepicker._datepickerShowing=!0,$.effects&&$.effects[g]?b.dpDiv.show(g,$.datepicker._get(b,"showOptions"),h,i):b.dpDiv[g||"show"](g?h:null,i),(!g||!h)&&i(),b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus(),$.datepicker._curInst=b}},_updateDatepicker:function(a){var b=this;b.maxRows=4;var c=$.datepicker._getBorders(a.dpDiv);instActive=a,a.dpDiv.empty().append(this._generateHTML(a));var d=a.dpDiv.find("iframe.ui-datepicker-cover");!d.length||d.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}),a.dpDiv.find("."+this._dayOverClass+" a").mouseover();var e=this._getNumberOfMonths(a),f=e[1],g=17;a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),f>1&&a.dpDiv.addClass("ui-datepicker-multi-"+f).css("width",g*f+"em"),a.dpDiv[(e[0]!=1||e[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi"),a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),a==$.datepicker._curInst&&$.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var h=a.yearshtml;setTimeout(function(){h===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml),h=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(a){return{thin:1,medium:2,thick:3}[a]||a};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var d=a.dpDiv.outerWidth(),e=a.dpDiv.outerHeight(),f=a.input?a.input.outerWidth():0,g=a.input?a.input.outerHeight():0,h=document.documentElement.clientWidth+$(document).scrollLeft(),i=document.documentElement.clientHeight+$(document).scrollTop();return b.left-=this._get(a,"isRTL")?d-f:0,b.left-=c&&b.left==a.input.offset().left?$(document).scrollLeft():0,b.top-=c&&b.top==a.input.offset().top+g?$(document).scrollTop():0,b.left-=Math.min(b.left,b.left+d>h&&h>d?Math.abs(b.left+d-h):0),b.top-=Math.min(b.top,b.top+e>i&&i>e?Math.abs(e+g):0),b},_findPos:function(a){var b=this._getInst(a),c=this._get(b,"isRTL");while(a&&(a.type=="hidden"||a.nodeType!=1||$.expr.filters.hidden(a)))a=a[c?"previousSibling":"nextSibling"];var d=$(a).offset();return[d.left,d.top]},_hideDatepicker:function(a){var b=this._curInst;if(!b||a&&b!=$.data(a,PROP_NAME))return;if(this._datepickerShowing){var c=this._get(b,"showAnim"),d=this._get(b,"duration"),e=function(){$.datepicker._tidyDialog(b)};$.effects&&$.effects[c]?b.dpDiv.hide(c,$.datepicker._get(b,"showOptions"),d,e):b.dpDiv[c=="slideDown"?"slideUp":c=="fadeIn"?"fadeOut":"hide"](c?d:null,e),c||e(),this._datepickerShowing=!1;var f=this._get(b,"onClose");f&&f.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),$.blockUI&&($.unblockUI(),$("body").append(this.dpDiv))),this._inDialog=!1}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(a){if(!$.datepicker._curInst)return;var b=$(a.target),c=$.datepicker._getInst(b[0]);(b[0].id!=$.datepicker._mainDivId&&b.parents("#"+$.datepicker._mainDivId).length==0&&!b.hasClass($.datepicker.markerClassName)&&!b.closest("."+$.datepicker._triggerClass).length&&$.datepicker._datepickerShowing&&(!$.datepicker._inDialog||!$.blockUI)||b.hasClass($.datepicker.markerClassName)&&$.datepicker._curInst!=c)&&$.datepicker._hideDatepicker()},_adjustDate:function(a,b,c){var d=$(a),e=this._getInst(d[0]);if(this._isDisabledDatepicker(d[0]))return;this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"):0),c),this._updateDatepicker(e)},_gotoToday:function(a){var b=$(a),c=this._getInst(b[0]);if(this._get(c,"gotoCurrent")&&c.currentDay)c.selectedDay=c.currentDay,c.drawMonth=c.selectedMonth=c.currentMonth,c.drawYear=c.selectedYear=c.currentYear;else{var d=new Date;c.selectedDay=d.getDate(),c.drawMonth=c.selectedMonth=d.getMonth(),c.drawYear=c.selectedYear=d.getFullYear()}this._notifyChange(c),this._adjustDate(b)},_selectMonthYear:function(a,b,c){var d=$(a),e=this._getInst(d[0]);e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10),this._notifyChange(e),this._adjustDate(d)},_selectDay:function(a,b,c,d){var e=$(a);if($(d).hasClass(this._unselectableClass)||this._isDisabledDatepicker(e[0]))return;var f=this._getInst(e[0]);f.selectedDay=f.currentDay=$("a",d).html(),f.selectedMonth=f.currentMonth=b,f.selectedYear=f.currentYear=c,this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))},_clearDate:function(a){var b=$(a),c=this._getInst(b[0]);this._selectDate(b,"")},_selectDate:function(a,b){var c=$(a),d=this._getInst(c[0]);b=b!=null?b:this._formatDate(d),d.input&&d.input.val(b),this._updateAlternate(d);var e=this._get(d,"onSelect");e?e.apply(d.input?d.input[0]:null,[b,d]):d.input&&d.input.trigger("change"),d.inline?this._updateDatepicker(d):(this._hideDatepicker(),this._lastInput=d.input[0],typeof d.input[0]!="object"&&d.input.focus(),this._lastInput=null)},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),d=this._getDate(a),e=this.formatDate(c,d,this._getFormatConfig(a));$(b).each(function(){$(this).val(e)})}},noWeekends:function(a){var b=a.getDay();return[b>0&&b<6,""]},iso8601Week:function(a){var b=new Date(a.getTime());b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;var d=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;d=typeof d!="string"?d:(new Date).getFullYear()%100+parseInt(d,10);var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,g=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,h=(c?c.monthNames:null)||this._defaults.monthNames,i=-1,j=-1,k=-1,l=-1,m=!1,n=function(b){var c=s+1-1){j=1,k=l;do{var u=this._getDaysInMonth(i,j-1);if(k<=u)break;j++,k-=u}while(!0)}var t=this._daylightSavingAdjust(new Date(i,j-1,k));if(t.getFullYear()!=i||t.getMonth()+1!=j||t.getDate()!=k)throw"Invalid date";return t},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1e7,formatDate:function(a,b,c){if(!b)return"";var d=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,e=(c?c.dayNames:null)||this._defaults.dayNames,f=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,h=function(b){var c=m+112?a.getHours()+2:0),a):null},_setDate:function(a,b,c){var d=!b,e=a.selectedMonth,f=a.selectedYear,g=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=g.getDate(),a.drawMonth=a.selectedMonth=a.currentMonth=g.getMonth(),a.drawYear=a.selectedYear=a.currentYear=g.getFullYear(),(e!=a.selectedMonth||f!=a.selectedYear)&&!c&&this._notifyChange(a),this._adjustInstDate(a),a.input&&a.input.val(d?"":this._formatDate(a))},_getDate:function(a){var b=!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return b},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),d=this._get(a,"showButtonPanel"),e=this._get(a,"hideIfNoPrevNext"),f=this._get(a,"navigationAsDateFormat"),g=this._getNumberOfMonths(a),h=this._get(a,"showCurrentAtPos"),i=this._get(a,"stepMonths"),j=g[0]!=1||g[1]!=1,k=this._daylightSavingAdjust(a.currentDay?new Date(a.currentYear,a.currentMonth,a.currentDay):new Date(9999,9,9)),l=this._getMinMaxDate(a,"min"),m=this._getMinMaxDate(a,"max"),n=a.drawMonth-h,o=a.drawYear;n<0&&(n+=12,o--);if(m){var p=this._daylightSavingAdjust(new Date(m.getFullYear(),m.getMonth()-g[0]*g[1]+1,m.getDate()));p=l&&pp)n--,n<0&&(n=11,o--)}a.drawMonth=n,a.drawYear=o;var q=this._get(a,"prevText");q=f?this.formatDate(q,this._daylightSavingAdjust(new Date(o,n-i,1)),this._getFormatConfig(a)):q;var r=this._canAdjustMonth(a,-1,o,n)?''+q+"":e?"":''+q+"",s=this._get(a,"nextText");s=f?this.formatDate(s,this._daylightSavingAdjust(new Date(o,n+i,1)),this._getFormatConfig(a)):s;var t=this._canAdjustMonth(a,1,o,n)?''+s+"":e?"":''+s+"",u=this._get(a,"currentText"),v=this._get(a,"gotoCurrent")&&a.currentDay?k:b;u=f?this.formatDate(u,v,this._getFormatConfig(a)):u;var w=a.inline?"":'",x=d?'
    '+(c?w:"")+(this._isInRange(a,v)?'":"")+(c?"":w)+"
    ":"",y=parseInt(this._get(a,"firstDay"),10);y=isNaN(y)?0:y;var z=this._get(a,"showWeek"),A=this._get(a,"dayNames"),B=this._get(a,"dayNamesShort"),C=this._get(a,"dayNamesMin"),D=this._get(a,"monthNames"),E=this._get(a,"monthNamesShort"),F=this._get(a,"beforeShowDay"),G=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths"),I=this._get(a,"calculateWeek")||this.iso8601Week,J=this._getDefaultDate(a),K="";for(var L=0;L1)switch(N){case 0:Q+=" ui-datepicker-group-first",P=" ui-corner-"+(c?"right":"left");break;case g[1]-1:Q+=" ui-datepicker-group-last",P=" ui-corner-"+(c?"left":"right");break;default:Q+=" ui-datepicker-group-middle",P=""}Q+='">'}Q+='
    '+(/all|left/.test(P)&&L==0?c?t:r:"")+(/all|right/.test(P)&&L==0?c?r:t:"")+this._generateMonthYearHeader(a,n,o,l,m,L>0||N>0,D,E)+'
    '+"";var R=z?'":"";for(var S=0;S<7;S++){var T=(S+y)%7;R+="=5?' class="ui-datepicker-week-end"':"")+">"+''+C[T]+""}Q+=R+"";var U=this._getDaysInMonth(o,n);o==a.selectedYear&&n==a.selectedMonth&&(a.selectedDay=Math.min(a.selectedDay,U));var V=(this._getFirstDayOfMonth(o,n)-y+7)%7,W=Math.ceil((V+U)/7),X=j?this.maxRows>W?this.maxRows:W:W;this.maxRows=X;var Y=this._daylightSavingAdjust(new Date(o,n,1-V));for(var Z=0;Z";var _=z?'":"";for(var S=0;S<7;S++){var ba=F?F.apply(a.input?a.input[0]:null,[Y]):[!0,""],bb=Y.getMonth()!=n,bc=bb&&!H||!ba[0]||l&&Ym;_+='",Y.setDate(Y.getDate()+1),Y=this._daylightSavingAdjust(Y)}Q+=_+""}n++,n>11&&(n=0,o++),Q+="
    '+this._get(a,"weekHeader")+"
    '+this._get(a,"calculateWeek")(Y)+""+(bb&&!G?" ":bc?''+Y.getDate()+"":''+Y.getDate()+"")+"
    "+(j?""+(g[0]>0&&N==g[1]-1?'
    ':""):""),M+=Q}K+=M}return K+=x+($.browser.msie&&parseInt($.browser.version,10)<7&&!a.inline?'':""),a._keyEvent=!1,K},_generateMonthYearHeader:function(a,b,c,d,e,f,g,h){var i=this._get(a,"changeMonth"),j=this._get(a,"changeYear"),k=this._get(a,"showMonthAfterYear"),l='
    ',m="";if(f||!i)m+=''+g[b]+"";else{var n=d&&d.getFullYear()==c,o=e&&e.getFullYear()==c;m+='"}k||(l+=m+(f||!i||!j?" ":""));if(!a.yearshtml){a.yearshtml="";if(f||!j)l+=''+c+"";else{var q=this._get(a,"yearRange").split(":"),r=(new Date).getFullYear(),s=function(a){var b=a.match(/c[+-].*/)?c+parseInt(a.substring(1),10):a.match(/[+-].*/)?r+parseInt(a,10):parseInt(a,10);return isNaN(b)?r:b},t=s(q[0]),u=Math.max(t,s(q[1]||""));t=d?Math.max(t,d.getFullYear()):t,u=e?Math.min(u,e.getFullYear()):u,a.yearshtml+='",l+=a.yearshtml,a.yearshtml=null}}return l+=this._get(a,"yearSuffix"),k&&(l+=(f||!i||!j?" ":"")+m),l+="
    ",l},_adjustInstDate:function(a,b,c){var d=a.drawYear+(c=="Y"?b:0),e=a.drawMonth+(c=="M"?b:0),f=Math.min(a.selectedDay,this._getDaysInMonth(d,e))+(c=="D"?b:0),g=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(d,e,f)));a.selectedDay=g.getDate(),a.drawMonth=a.selectedMonth=g.getMonth(),a.drawYear=a.selectedYear=g.getFullYear(),(c=="M"||c=="Y")&&this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max"),e=c&&bd?d:e,e},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");b&&b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){var b=this._get(a,"numberOfMonths");return b==null?[1,1]:typeof b=="number"?[1,b]:b},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,d){var e=this._getNumberOfMonths(a),f=this._daylightSavingAdjust(new Date(c,d+(b<0?b:e[0]*e[1]),1));return b<0&&f.setDate(this._getDaysInMonth(f.getFullYear(),f.getMonth())),this._isInRange(a,f)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min"),d=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!d||b.getTime()<=d.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");return b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10),{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,d){b||(a.currentDay=a.selectedDay,a.currentMonth=a.selectedMonth,a.currentYear=a.selectedYear);var e=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(d,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),e,this._getFormatConfig(a))}}),$.fn.datepicker=function(a){if(!this.length)return this;$.datepicker.initialized||($(document).mousedown($.datepicker._checkExternalClick).find("body").append($.datepicker.dpDiv),$.datepicker.initialized=!0);var b=Array.prototype.slice.call(arguments,1);return typeof a!="string"||a!="isDisabled"&&a!="getDate"&&a!="widget"?a=="option"&&arguments.length==2&&typeof arguments[1]=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b)):this.each(function(){typeof a=="string"?$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this].concat(b)):$.datepicker._attachDatepicker(this,a)}):$.datepicker["_"+a+"Datepicker"].apply($.datepicker,[this[0]].concat(b))},$.datepicker=new Datepicker,$.datepicker.initialized=!1,$.datepicker.uuid=(new Date).getTime(),$.datepicker.version="1.8.21",window["DP_jQuery_"+dpuuid]=$}(jQuery),function(a,b){var c="ui-dialog ui-widget ui-widget-content ui-corner-all ",d={buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},e={maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},f=a.attrFn||{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0,click:!0};a.widget("ui.dialog",{options:{autoOpen:!0,buttons:{},closeOnEscape:!0,closeText:"close",dialogClass:"",draggable:!0,hide:null,height:"auto",maxHeight:!1,maxWidth:!1,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",collision:"fit",using:function(b){var c=a(this).css(b).offset().top;c<0&&a(this).css("top",b.top-c)}},resizable:!0,show:null,stack:!0,title:"",width:300,zIndex:1e3},_create:function(){this.originalTitle=this.element.attr("title"),typeof this.originalTitle!="string"&&(this.originalTitle=""),this.options.title=this.options.title||this.originalTitle;var b=this,d=b.options,e=d.title||" ",f=a.ui.dialog.getTitleId(b.element),g=(b.uiDialog=a("
    ")).appendTo(document.body).hide().addClass(c+d.dialogClass).css({zIndex:d.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(c){d.closeOnEscape&&!c.isDefaultPrevented()&&c.keyCode&&c.keyCode===a.ui.keyCode.ESCAPE&&(b.close(c),c.preventDefault())}).attr({role:"dialog","aria-labelledby":f}).mousedown(function(a){b.moveToTop(!1,a)}),h=b.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g),i=(b.uiDialogTitlebar=a("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),j=a('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){j.addClass("ui-state-hover")},function(){j.removeClass("ui-state-hover")}).focus(function(){j.addClass("ui-state-focus")}).blur(function(){j.removeClass("ui-state-focus")}).click(function(a){return b.close(a),!1}).appendTo(i),k=(b.uiDialogTitlebarCloseText=a("")).addClass("ui-icon ui-icon-closethick").text(d.closeText).appendTo(j),l=a("").addClass("ui-dialog-title").attr("id",f).html(e).prependTo(i);a.isFunction(d.beforeclose)&&!a.isFunction(d.beforeClose)&&(d.beforeClose=d.beforeclose),i.find("*").add(i).disableSelection(),d.draggable&&a.fn.draggable&&b._makeDraggable(),d.resizable&&a.fn.resizable&&b._makeResizable(),b._createButtons(d.buttons),b._isOpen=!1,a.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;return a.overlay&&a.overlay.destroy(),a.uiDialog.hide(),a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"),a.uiDialog.remove(),a.originalTitle&&a.element.attr("title",a.originalTitle),a},widget:function(){return this.uiDialog},close:function(b){var c=this,d,e;if(!1===c._trigger("beforeClose",b))return;return c.overlay&&c.overlay.destroy(),c.uiDialog.unbind("keypress.ui-dialog"),c._isOpen=!1,c.options.hide?c.uiDialog.hide(c.options.hide,function(){c._trigger("close",b)}):(c.uiDialog.hide(),c._trigger("close",b)),a.ui.dialog.overlay.resize(),c.options.modal&&(d=0,a(".ui-dialog").each(function(){this!==c.uiDialog[0]&&(e=a(this).css("z-index"),isNaN(e)||(d=Math.max(d,e)))}),a.ui.dialog.maxZ=d),c},isOpen:function(){return this._isOpen},moveToTop:function(b,c){var d=this,e=d.options,f;return e.modal&&!b||!e.stack&&!e.modal?d._trigger("focus",c):(e.zIndex>a.ui.dialog.maxZ&&(a.ui.dialog.maxZ=e.zIndex),d.overlay&&(a.ui.dialog.maxZ+=1,d.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)),f={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()},a.ui.dialog.maxZ+=1,d.uiDialog.css("z-index",a.ui.dialog.maxZ),d.element.attr(f),d._trigger("focus",c),d)},open:function(){if(this._isOpen)return;var b=this,c=b.options,d=b.uiDialog;return b.overlay=c.modal?new a.ui.dialog.overlay(b):null,b._size(),b._position(c.position),d.show(c.show),b.moveToTop(!0),c.modal&&d.bind("keydown.ui-dialog",function(b){if(b.keyCode!==a.ui.keyCode.TAB)return;var c=a(":tabbable",this),d=c.filter(":first"),e=c.filter(":last");if(b.target===e[0]&&!b.shiftKey)return d.focus(1),!1;if(b.target===d[0]&&b.shiftKey)return e.focus(1),!1}),a(b.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus(),b._isOpen=!0,b._trigger("open"),b},_createButtons:function(b){var c=this,d=!1,e=a("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=a("
    ").addClass("ui-dialog-buttonset").appendTo(e);c.uiDialog.find(".ui-dialog-buttonpane").remove(),typeof b=="object"&&b!==null&&a.each(b,function(){return!(d=!0)}),d&&(a.each(b,function(b,d){d=a.isFunction(d)?{click:d,text:b}:d;var e=a('').click(function(){d.click.apply(c.element[0],arguments)}).appendTo(g);a.each(d,function(a,b){if(a==="click")return;a in f?e[a](b):e.attr(a,b)}),a.fn.button&&e.button()}),e.appendTo(c.uiDialog))},_makeDraggable:function(){function f(a){return{position:a.position,offset:a.offset}}var b=this,c=b.options,d=a(document),e;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(d,g){e=c.height==="auto"?"auto":a(this).height(),a(this).height(a(this).height()).addClass("ui-dialog-dragging"),b._trigger("dragStart",d,f(g))},drag:function(a,c){b._trigger("drag",a,f(c))},stop:function(g,h){c.position=[h.position.left-d.scrollLeft(),h.position.top-d.scrollTop()],a(this).removeClass("ui-dialog-dragging").height(e),b._trigger("dragStop",g,f(h)),a.ui.dialog.overlay.resize()}})},_makeResizable:function(c){function h(a){return{originalPosition:a.originalPosition,originalSize:a.originalSize,position:a.position,size:a.size}}c=c===b?this.options.resizable:c;var d=this,e=d.options,f=d.uiDialog.css("position"),g=typeof c=="string"?c:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:g,start:function(b,c){a(this).addClass("ui-dialog-resizing"),d._trigger("resizeStart",b,h(c))},resize:function(a,b){d._trigger("resize",a,h(b))},stop:function(b,c){a(this).removeClass("ui-dialog-resizing"),e.height=a(this).height(),e.width=a(this).width(),d._trigger("resizeStop",b,h(c)),a.ui.dialog.overlay.resize()}}).css("position",f).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(b){var c=[],d=[0,0],e;if(b){if(typeof b=="string"||typeof b=="object"&&"0"in b)c=b.split?b.split(" "):[b[0],b[1]],c.length===1&&(c[1]=c[0]),a.each(["left","top"],function(a,b){+c[a]===c[a]&&(d[a]=c[a],c[a]=b)}),b={my:c.join(" "),at:c.join(" "),offset:d.join(" ")};b=a.extend({},a.ui.dialog.prototype.options.position,b)}else b=a.ui.dialog.prototype.options.position;e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},b)),e||this.uiDialog.hide()},_setOptions:function(b){var c=this,f={},g=!1;a.each(b,function(a,b){c._setOption(a,b),a in d&&(g=!0),a in e&&(f[a]=b)}),g&&this._size(),this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",f)},_setOption:function(b,d){var e=this,f=e.uiDialog;switch(b){case"beforeclose":b="beforeClose";break;case"buttons":e._createButtons(d);break;case"closeText":e.uiDialogTitlebarCloseText.text(""+d);break;case"dialogClass":f.removeClass(e.options.dialogClass).addClass(c+d);break;case"disabled":d?f.addClass("ui-dialog-disabled"):f.removeClass("ui-dialog-disabled");break;case"draggable":var g=f.is(":data(draggable)");g&&!d&&f.draggable("destroy"),!g&&d&&e._makeDraggable();break;case"position":e._position(d);break;case"resizable":var h=f.is(":data(resizable)");h&&!d&&f.resizable("destroy"),h&&typeof d=="string"&&f.resizable("option","handles",d),!h&&d!==!1&&e._makeResizable(d);break;case"title":a(".ui-dialog-title",e.uiDialogTitlebar).html(""+(d||" "))}a.Widget.prototype._setOption.apply(e,arguments)},_size:function(){var b=this.options,c,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0}),b.minWidth>b.width&&(b.width=b.minWidth),c=this.uiDialog.css({height:"auto",width:b.width}).height(),d=Math.max(0,b.minHeight-c);if(b.height==="auto")if(a.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();var f=this.element.css("height","auto").height();e||this.uiDialog.hide(),this.element.height(Math.max(f,d))}else this.element.height(Math.max(b.height-c,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}}),a.extend(a.ui.dialog,{version:"1.8.21",uuid:0,maxZ:0,getTitleId:function(a){var b=a.attr("id");return b||(this.uuid+=1,b=this.uuid),"ui-dialog-title-"+b},overlay:function(b){this.$el=a.ui.dialog.overlay.create(b)}}),a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(b){this.instances.length===0&&(setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(b){if(a(b.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});return a.fn.bgiframe&&c.bgiframe(),this.instances.push(c),c},destroy:function(b){var c=a.inArray(b,this.instances);c!=-1&&this.oldInstances.push(this.instances.splice(c,1)[0]),this.instances.length===0&&a([document,window]).unbind(".dialog-overlay"),b.remove();var d=0;a.each(this.instances,function(){d=Math.max(d,this.css("z-index"))}),this.maxZ=d},height:function(){var b,c;return a.browser.msie&&a.browser.version<7?(b=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),c=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight),b0?b.left-e:Math.max(b.left-c.collisionPosition.left,b.left)},top:function(b,c){var d=a(window),e=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop();b.top=e>0?b.top-e:Math.max(b.top-c.collisionPosition.top,b.top)}},flip:{left:function(b,c){if(c.at[0]===e)return;var d=a(window),f=c.collisionPosition.left+c.collisionWidth-d.width()-d.scrollLeft(),g=c.my[0]==="left"?-c.elemWidth:c.my[0]==="right"?c.elemWidth:0,h=c.at[0]==="left"?c.targetWidth:-c.targetWidth,i=-2*c.offset[0];b.left+=c.collisionPosition.left<0?g+h+i:f>0?g+h+i:0},top:function(b,c){if(c.at[1]===e)return;var d=a(window),f=c.collisionPosition.top+c.collisionHeight-d.height()-d.scrollTop(),g=c.my[1]==="top"?-c.elemHeight:c.my[1]==="bottom"?c.elemHeight:0,h=c.at[1]==="top"?c.targetHeight:-c.targetHeight,i=-2*c.offset[1];b.top+=c.collisionPosition.top<0?g+h+i:f>0?g+h+i:0}}},a.offset.setOffset||(a.offset.setOffset=function(b,c){/static/.test(a.curCSS(b,"position"))&&(b.style.position="relative");var d=a(b),e=d.offset(),f=parseInt(a.curCSS(b,"top",!0),10)||0,g=parseInt(a.curCSS(b,"left",!0),10)||0,h={top:c.top-e.top+f,left:c.left-e.left+g};"using"in c?c.using.call(b,h):d.css(h)},a.fn.offset=function(b){var c=this[0];return!c||!c.ownerDocument?null:b?a.isFunction(b)?this.each(function(c){a(this).offset(b.call(this,c,a(this).offset()))}):this.each(function(){a.offset.setOffset(this,b)}):h.call(this)}),function(){var b=document.getElementsByTagName("body")[0],c=document.createElement("div"),d,e,g,h,i;d=document.createElement(b?"div":"body"),g={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},b&&a.extend(g,{position:"absolute",left:"-1000px",top:"-1000px"});for(var j in g)d.style[j]=g[j];d.appendChild(c),e=b||document.documentElement,e.insertBefore(d,e.firstChild),c.style.cssText="position: absolute; left: 10.7432222px; top: 10.432325px; height: 30px; width: 201px;",h=a(c).offset(function(a,b){return b}).offset(),d.innerHTML="",e.removeChild(d),i=h.top+h.left+(b?2e3:0),f.fractions=i>21&&i<22}()}(jQuery),function(a,b){a.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()}),this.valueDiv=a("
    ").appendTo(this.element),this.oldValue=this._value(),this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove(),a.Widget.prototype.destroy.apply(this,arguments)},value:function(a){return a===b?this._value():(this._setOption("value",a),this)},_setOption:function(b,c){b==="value"&&(this.options.value=c,this._refreshValue(),this._value()===this.options.max&&this._trigger("complete")),a.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;return typeof a!="number"&&(a=0),Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100*this._value()/this.options.max},_refreshValue:function(){var a=this.value(),b=this._percentage();this.oldValue!==a&&(this.oldValue=a,this._trigger("change")),this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(b.toFixed(0)+"%"),this.element.attr("aria-valuenow",a)}}),a.extend(a.ui.progressbar,{version:"1.8.21"})}(jQuery),function(a,b){var c=5;a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null},_create:function(){var b=this,d=this.options,e=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f="",g=d.values&&d.values.length||1,h=[];this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"+(d.disabled?" ui-slider-disabled ui-disabled":"")),this.range=a([]),d.range&&(d.range===!0&&(d.values||(d.values=[this._valueMin(),this._valueMin()]),d.values.length&&d.values.length!==2&&(d.values=[d.values[0],d.values[0]])),this.range=a("
    ").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(d.range==="min"||d.range==="max"?" ui-slider-range-"+d.range:"")));for(var i=e.length;ic&&(f=c,g=a(this),i=b)}),c.range===!0&&this.values(1)===c.min&&(i+=1,g=a(this.handles[i])),j=this._start(b,i),j===!1?!1:(this._mouseSliding=!0,h._handleIndex=i,g.addClass("ui-state-active").focus(),k=g.offset(),l=!a(b.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:b.pageX-k.left-g.width()/2,top:b.pageY-k.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(b,i,e),this._animateOff=!0,!0))},_mouseStart:function(a){return!0},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},c=this._normValueFromMouse(b);return this._slide(a,this._handleIndex,c),!1},_mouseStop:function(a){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(a,this._handleIndex),this._change(a,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,c,d,e,f;return this.orientation==="horizontal"?(b=this.elementSize.width,c=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(b=this.elementSize.height,c=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),d=c/b,d>1&&(d=1),d<0&&(d=0),this.orientation==="vertical"&&(d=1-d),e=this._valueMax()-this._valueMin(),f=this._valueMin()+d*e,this._trimAlignValue(f)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};return this.options.values&&this.options.values.length&&(c.value=this.values(b),c.values=this.values()),this._trigger("start",a,c)},_slide:function(a,b,c){var d,e,f;this.options.values&&this.options.values.length?(d=this.values(b?0:1),this.options.values.length===2&&this.options.range===!0&&(b===0&&c>d||b===1&&c1){this.options.values[b]=this._trimAlignValue(c),this._refreshValue(),this._change(null,b);return}if(!arguments.length)return this._values();if(!a.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(b):this.value();d=this.options.values,e=arguments[0];for(f=0;f=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b,d=a-c;return Math.abs(c)*2>=b&&(d+=c>0?b:-b),parseFloat(d.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=this.options.range,c=this.options,d=this,e=this._animateOff?!1:c.animate,f,g={},h,i,j,k;this.options.values&&this.options.values.length?this.handles.each(function(b,i){f=(d.values(b)-d._valueMin())/(d._valueMax()-d._valueMin())*100,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",a(this).stop(1,1)[e?"animate":"css"](g,c.animate),d.options.range===!0&&(d.orientation==="horizontal"?(b===0&&d.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({width:f-h+"%"},{queue:!1,duration:c.animate})):(b===0&&d.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},c.animate),b===1&&d.range[e?"animate":"css"]({height:f-h+"%"},{queue:!1,duration:c.animate}))),h=f}):(i=this.value(),j=this._valueMin(),k=this._valueMax(),f=k!==j?(i-j)/(k-j)*100:0,g[d.orientation==="horizontal"?"left":"bottom"]=f+"%",this.handle.stop(1,1)[e?"animate":"css"](g,c.animate),b==="min"&&this.orientation==="horizontal"&&this.range.stop(1,1)[e?"animate":"css"]({width:f+"%"},c.animate),b==="max"&&this.orientation==="horizontal"&&this.range[e?"animate":"css"]({width:100-f+"%"},{queue:!1,duration:c.animate}),b==="min"&&this.orientation==="vertical"&&this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},c.animate),b==="max"&&this.orientation==="vertical"&&this.range[e?"animate":"css"]({height:100-f+"%"},{queue:!1,duration:c.animate}))}}),a.extend(a.ui.slider,{version:"1.8.21"})}(jQuery),function(a,b){function e(){return++c}function f(){return++d}var c=0,d=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:!1,cookie:null,collapsible:!1,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
    ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(!0)},_setOption:function(a,b){if(a=="selected"){if(this.options.collapsible&&b==this.options.selected)return;this.select(b)}else this.options[a]=b,this._tabify()},_tabId:function(a){return a.title&&a.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+e()},_sanitizeSelector:function(a){return a.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+f());return a.cookie.apply(null,[b].concat(a.makeArray(arguments)))},_ui:function(a,b){return{tab:a,panel:b,index:this.anchors.index(a)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b=a(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(c){function m(b,c){b.css("display",""),!a.support.opacity&&c.opacity&&b[0].style.removeAttribute("filter")}var d=this,e=this.options,f=/^#.+/;this.list=this.element.find("ol,ul").eq(0),this.lis=a(" > li:has(a[href])",this.list),this.anchors=this.lis.map(function(){return a("a",this)[0]}),this.panels=a([]),this.anchors.each(function(b,c){var g=a(c).attr("href"),h=g.split("#")[0],i;h&&(h===location.toString().split("#")[0]||(i=a("base")[0])&&h===i.href)&&(g=c.hash,c.href=g);if(f.test(g))d.panels=d.panels.add(d.element.find(d._sanitizeSelector(g)));else if(g&&g!=="#"){a.data(c,"href.tabs",g),a.data(c,"load.tabs",g.replace(/#.*$/,""));var j=d._tabId(c);c.href="#"+j;var k=d.element.find("#"+j);k.length||(k=a(e.panelTemplate).attr("id",j).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(d.panels[b-1]||d.list),k.data("destroy.tabs",!0)),d.panels=d.panels.add(k)}else e.disabled.push(b)}),c?(this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"),this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.lis.addClass("ui-state-default ui-corner-top"),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom"),e.selected===b?(location.hash&&this.anchors.each(function(a,b){if(b.hash==location.hash)return e.selected=a,!1}),typeof e.selected!="number"&&e.cookie&&(e.selected=parseInt(d._cookie(),10)),typeof e.selected!="number"&&this.lis.filter(".ui-tabs-selected").length&&(e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"))),e.selected=e.selected||(this.lis.length?0:-1)):e.selected===null&&(e.selected=-1),e.selected=e.selected>=0&&this.anchors[e.selected]||e.selected<0?e.selected:0,e.disabled=a.unique(e.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(a,b){return d.lis.index(a)}))).sort(),a.inArray(e.selected,e.disabled)!=-1&&e.disabled.splice(a.inArray(e.selected,e.disabled),1),this.panels.addClass("ui-tabs-hide"),this.lis.removeClass("ui-tabs-selected ui-state-active"),e.selected>=0&&this.anchors.length&&(d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash)).removeClass("ui-tabs-hide"),this.lis.eq(e.selected).addClass("ui-tabs-selected ui-state-active"),d.element.queue("tabs",function(){d._trigger("show",null,d._ui(d.anchors[e.selected],d.element.find(d._sanitizeSelector(d.anchors[e.selected].hash))[0]))}),this.load(e.selected)),a(window).bind("unload",function(){d.lis.add(d.anchors).unbind(".tabs"),d.lis=d.anchors=d.panels=null})):e.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")),this.element[e.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible"),e.cookie&&this._cookie(e.selected,e.cookie);for(var g=0,h;h=this.lis[g];g++)a(h)[a.inArray(g,e.disabled)!=-1&&!a(h).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");e.cache===!1&&this.anchors.removeData("cache.tabs"),this.lis.add(this.anchors).unbind(".tabs");if(e.event!=="mouseover"){var i=function(a,b){b.is(":not(.ui-state-disabled)")&&b.addClass("ui-state-"+a)},j=function(a,b){b.removeClass("ui-state-"+a)};this.lis.bind("mouseover.tabs",function(){i("hover",a(this))}),this.lis.bind("mouseout.tabs",function(){j("hover",a(this))}),this.anchors.bind("focus.tabs",function(){i("focus",a(this).closest("li"))}),this.anchors.bind("blur.tabs",function(){j("focus",a(this).closest("li"))})}var k,l;e.fx&&(a.isArray(e.fx)?(k=e.fx[0],l=e.fx[1]):k=l=e.fx);var n=l?function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.hide().removeClass("ui-tabs-hide").animate(l,l.duration||"normal",function(){m(c,l),d._trigger("show",null,d._ui(b,c[0]))})}:function(b,c){a(b).closest("li").addClass("ui-tabs-selected ui-state-active"),c.removeClass("ui-tabs-hide"),d._trigger("show",null,d._ui(b,c[0]))},o=k?function(a,b){b.animate(k,k.duration||"normal",function(){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),m(b,k),d.element.dequeue("tabs")})}:function(a,b,c){d.lis.removeClass("ui-tabs-selected ui-state-active"),b.addClass("ui-tabs-hide"),d.element.dequeue("tabs")};this.anchors.bind(e.event+".tabs",function(){var b=this,c=a(b).closest("li"),f=d.panels.filter(":not(.ui-tabs-hide)"),g=d.element.find(d._sanitizeSelector(b.hash));if(c.hasClass("ui-tabs-selected")&&!e.collapsible||c.hasClass("ui-state-disabled")||c.hasClass("ui-state-processing")||d.panels.filter(":animated").length||d._trigger("select",null,d._ui(this,g[0]))===!1)return this.blur(),!1;e.selected=d.anchors.index(this),d.abort();if(e.collapsible){if(c.hasClass("ui-tabs-selected"))return e.selected=-1,e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){o(b,f)}).dequeue("tabs"),this.blur(),!1;if(!f.length)return e.cookie&&d._cookie(e.selected,e.cookie),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this)),this.blur(),!1}e.cookie&&d._cookie(e.selected,e.cookie);if(g.length)f.length&&d.element.queue("tabs",function(){o(b,f)}),d.element.queue("tabs",function(){n(b,g)}),d.load(d.anchors.index(this));else throw"jQuery UI Tabs: Mismatching fragment identifier.";a.browser.msie&&this.blur()}),this.anchors.bind("click.tabs",function(){return!1})},_getIndex:function(a){return typeof a=="string"&&(a=this.anchors.index(this.anchors.filter("[href$='"+a+"']"))),a},destroy:function(){var b=this.options;return this.abort(),this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs"),this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all"),this.anchors.each(function(){var b=a.data(this,"href.tabs");b&&(this.href=b);var c=a(this).unbind(".tabs");a.each(["href","load","cache"],function(a,b){c.removeData(b+".tabs")})}),this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass(["ui-state-default","ui-corner-top","ui-tabs-selected","ui-state-active","ui-state-hover","ui-state-focus","ui-state-disabled","ui-tabs-panel","ui-widget-content","ui-corner-bottom","ui-tabs-hide"].join(" "))}),b.cookie&&this._cookie(null,b.cookie),this},add:function(c,d,e){e===b&&(e=this.anchors.length);var f=this,g=this.options,h=a(g.tabTemplate.replace(/#\{href\}/g,c).replace(/#\{label\}/g,d)),i=c.indexOf("#")?this._tabId(a("a",h)[0]):c.replace("#","");h.addClass("ui-state-default ui-corner-top").data("destroy.tabs",!0);var j=f.element.find("#"+i);return j.length||(j=a(g.panelTemplate).attr("id",i).data("destroy.tabs",!0)),j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide"),e>=this.lis.length?(h.appendTo(this.list),j.appendTo(this.list[0].parentNode)):(h.insertBefore(this.lis[e]),j.insertBefore(this.panels[e])),g.disabled=a.map(g.disabled,function(a,b){return a>=e?++a:a}),this._tabify(),this.anchors.length==1&&(g.selected=0,h.addClass("ui-tabs-selected ui-state-active"),j.removeClass("ui-tabs-hide"),this.element.queue("tabs",function(){f._trigger("show",null,f._ui(f.anchors[0],f.panels[0]))}),this.load(0)),this._trigger("add",null,this._ui(this.anchors[e],this.panels[e])),this},remove:function(b){b=this._getIndex(b);var c=this.options,d=this.lis.eq(b).remove(),e=this.panels.eq(b).remove();return d.hasClass("ui-tabs-selected")&&this.anchors.length>1&&this.select(b+(b+1=b?--a:a}),this._tabify(),this._trigger("remove",null,this._ui(d.find("a")[0],e[0])),this},enable:function(b){b=this._getIndex(b);var c=this.options;if(a.inArray(b,c.disabled)==-1)return;return this.lis.eq(b).removeClass("ui-state-disabled"),c.disabled=a.grep(c.disabled,function(a,c){return a!=b}),this._trigger("enable",null,this._ui(this.anchors[b],this.panels[b])),this},disable:function(a){a=this._getIndex(a);var b=this,c=this.options;return a!=c.selected&&(this.lis.eq(a).addClass("ui-state-disabled"),c.disabled.push(a),c.disabled.sort(),this._trigger("disable",null,this._ui(this.anchors[a],this.panels[a]))),this},select:function(a){a=this._getIndex(a);if(a==-1)if(this.options.collapsible&&this.options.selected!=-1)a=this.options.selected;else return this;return this.anchors.eq(a).trigger(this.options.event+".tabs"),this},load:function(b){b=this._getIndex(b);var c=this,d=this.options,e=this.anchors.eq(b)[0],f=a.data(e,"load.tabs");this.abort();if(!f||this.element.queue("tabs").length!==0&&a.data(e,"cache.tabs")){this.element.dequeue("tabs");return}this.lis.eq(b).addClass("ui-state-processing");if(d.spinner){var g=a("span",e);g.data("label.tabs",g.html()).html(d.spinner)}return this.xhr=a.ajax(a.extend({},d.ajaxOptions,{url:f,success:function(f,g){c.element.find(c._sanitizeSelector(e.hash)).html(f),c._cleanup(),d.cache&&a.data(e,"cache.tabs",!0),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.success(f,g)}catch(h){}},error:function(a,f,g){c._cleanup(),c._trigger("load",null,c._ui(c.anchors[b],c.panels[b]));try{d.ajaxOptions.error(a,f,b,e)}catch(g){}}})),c.element.dequeue("tabs"),this},abort:function(){return this.element.queue([]),this.panels.stop(!1,!0),this.element.queue("tabs",this.element.queue("tabs").splice(-2,2)),this.xhr&&(this.xhr.abort(),delete this.xhr),this._cleanup(),this},url:function(a,b){return this.anchors.eq(a).removeData("cache.tabs").data("load.tabs",b),this},length:function(){return this.anchors.length}}),a.extend(a.ui.tabs,{version:"1.8.21"}),a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(a,b){var c=this,d=this.options,e=c._rotate||(c._rotate=function(b){clearTimeout(c.rotation),c.rotation=setTimeout(function(){var a=d.selected;c.select(++a - - Mouse Keyword Testbed - - -
    - - - + + + Mouse Keyword Testbed + + +
    +
    +
    +
    +
    +
    + + \ No newline at end of file diff --git a/test/resources/html/tables/tables.html b/test/resources/html/tables/tables.html index 1f4019c76..ca37a6ef0 100644 --- a/test/resources/html/tables/tables.html +++ b/test/resources/html/tables/tables.html @@ -1,226 +1,226 @@ - - - - - -Tables - - -

    Simple Table

    - - - - - - - - - - - - - - - - -
    simpleTable_A1simpleTable_B1simpleTable_C1
    simpleTable_A2simpleTable_B2simpleTable_C2
    simpleTable_A3simpleTable_B3simpleTable_C3
    -

    Simple Table by Name

    - - - - - - - - - - - - - - - - -
    simpleTableName_A1simpleTableName_B1simpleTableName_C1
    simpleTableName_A2simpleTableName_B2simpleTableName_C2
    simpleTableName_A3simpleTableName_B3simpleTableName_C3
    - -

    Simple Table With Nested Table

    - - - - - - - - - - - - - - - - -
    simpleWithNested_A1simpleWithNested_B1simpleWithNested_C1
    simpleWithNested_A2 - - - - - - - - - - - - - - - -
    nestedTable_A1nestedTable_B1nestedTable_C1
    nestedTable_A2nestedTable_B2nestedTable_C2
    nestedTable_A3nestedTable_B3nestedTable_C3
    simpleWithNested_C2
    simpleWithNested_A3simpleWithNested_B3simpleWithNested_C3
    - -

    Simple Table With Header

    - - - - - - - - - - - - - - - - -
    tableWithSingleHeader_A1tableWithSingleHeader_B1tableWithSingleHeader_C1
    tableWithSingleHeader_A2tableWithSingleHeader_B2tableWithSingleHeader_C2
    tableWithSingleHeader_A3tableWithSingleHeader_B3tableWithSingleHeader_C3
    - -

    Simple Table With Two Header Rows

    - - - - - - - - - - - - - - - - - - - - - -
    tableWithTwoHeaders_A1tableWithTwoHeaders_B1tableWithTwoHeaders_C1
    tableWithTwoHeaders_A2tableWithTwoHeaders_B2tableWithTwoHeaders_C2
    tableWithTwoHeaders_A3tableWithTwoHeaders_B3tableWithTwoHeaders_C3
    tableWithTwoHeaders_A4tableWithTwoHeaders_B4tableWithTwoHeaders_C4
    - -

    Table with thead, tfoot and tbody sections

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    withHeadAndFoot_AH1withHeadAndFoot_BH1withHeadAndFoot_CH1
    withHeadAndFoot_AH2withHeadAndFoot_BH2withHeadAndFoot_CH2
    withHeadAndFoot_AF1withHeadAndFoot_BF1withHeadAndFoot_CF1
    withHeadAndFoot_AF2withHeadAndFoot_BF2withHeadAndFoot_CF2
    withHeadAndFoot_A1withHeadAndFoot_B1withHeadAndFoot_C1
    withHeadAndFoot_A2withHeadAndFoot_B2withHeadAndFoot_C2
    withHeadAndFoot_A3withHeadAndFoot_B3withHeadAndFoot_C3
    - -

    Table With Merged Cells In a Row

    - - - - - - - - - - - - - - - -
    mergedRows_A1mergedRows_B1mergedRows_C1mergedRows_D1
    mergedRows_B2mergedRows_C2
    mergedRows_A3mergedRows_C3
    - -

    Table With Merged Cells In a Column

    - - - - - - - - - - - - - - - - - -
    mergedCols_A1mergedCols_C1
    mergedCols_A2mergedCols_B2
    mergedCols_A3mergedCols_B3mergedCols_C3
    mergedCols_D1
    - -

    Table With Formatting and Unicode

    -
    dummy Table
    -
    dummy Table
    - - - - - - - - - - - - - -
    formattedTable_A1formattedTable_B1formattedTable_C1formattedTable_D1

    formattedTable_A2

    formattedTable_B2formattedTable_ÄÖÜäöüßäöü€&äöü€&
    - - + + + + + +Tables + + +

    Simple Table

    + + + + + + + + + + + + + + + + +
    simpleTable_A1simpleTable_B1simpleTable_C1
    simpleTable_A2simpleTable_B2simpleTable_C2
    simpleTable_A3simpleTable_B3simpleTable_C3
    +

    Simple Table by Name

    + + + + + + + + + + + + + + + + +
    simpleTableName_A1simpleTableName_B1simpleTableName_C1
    simpleTableName_A2simpleTableName_B2simpleTableName_C2
    simpleTableName_A3simpleTableName_B3simpleTableName_C3
    + +

    Simple Table With Nested Table

    + + + + + + + + + + + + + + + + +
    simpleWithNested_A1simpleWithNested_B1simpleWithNested_C1
    simpleWithNested_A2 + + + + + + + + + + + + + + + +
    nestedTable_A1nestedTable_B1nestedTable_C1
    nestedTable_A2nestedTable_B2nestedTable_C2
    nestedTable_A3nestedTable_B3nestedTable_C3
    simpleWithNested_C2
    simpleWithNested_A3simpleWithNested_B3simpleWithNested_C3
    + +

    Simple Table With Header

    + + + + + + + + + + + + + + + + +
    tableWithSingleHeader_A1tableWithSingleHeader_B1tableWithSingleHeader_C1
    tableWithSingleHeader_A2tableWithSingleHeader_B2tableWithSingleHeader_C2
    tableWithSingleHeader_A3tableWithSingleHeader_B3tableWithSingleHeader_C3
    + +

    Simple Table With Two Header Rows

    + + + + + + + + + + + + + + + + + + + + + +
    tableWithTwoHeaders_A1tableWithTwoHeaders_B1tableWithTwoHeaders_C1
    tableWithTwoHeaders_A2tableWithTwoHeaders_B2tableWithTwoHeaders_C2
    tableWithTwoHeaders_A3tableWithTwoHeaders_B3tableWithTwoHeaders_C3
    tableWithTwoHeaders_A4tableWithTwoHeaders_B4tableWithTwoHeaders_C4
    + +

    Table with thead, tfoot and tbody sections

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    withHeadAndFoot_AH1withHeadAndFoot_BH1withHeadAndFoot_CH1
    withHeadAndFoot_AH2withHeadAndFoot_BH2withHeadAndFoot_CH2
    withHeadAndFoot_AF1withHeadAndFoot_BF1withHeadAndFoot_CF1
    withHeadAndFoot_AF2withHeadAndFoot_BF2withHeadAndFoot_CF2
    withHeadAndFoot_A1withHeadAndFoot_B1withHeadAndFoot_C1
    withHeadAndFoot_A2withHeadAndFoot_B2withHeadAndFoot_C2
    withHeadAndFoot_A3withHeadAndFoot_B3withHeadAndFoot_C3
    + +

    Table With Merged Cells In a Row

    + + + + + + + + + + + + + + + +
    mergedRows_A1mergedRows_B1mergedRows_C1mergedRows_D1
    mergedRows_B2mergedRows_C2
    mergedRows_A3mergedRows_C3
    + +

    Table With Merged Cells In a Column

    + + + + + + + + + + + + + + + + + +
    mergedCols_A1mergedCols_C1
    mergedCols_A2mergedCols_B2
    mergedCols_A3mergedCols_B3mergedCols_C3
    mergedCols_D1
    + +

    Table With Formatting and Unicode

    +
    dummy Table
    +
    dummy Table
    + + + + + + + + + + + + + +
    formattedTable_A1formattedTable_B1formattedTable_C1formattedTable_D1

    formattedTable_A2

    formattedTable_B2formattedTable_ÄÖÜäöüßäöü€&äöü€&
    + + \ No newline at end of file diff --git a/test/resources/html/visibility.html b/test/resources/html/visibility.html index d4e15fd3e..7f2efb5b2 100644 --- a/test/resources/html/visibility.html +++ b/test/resources/html/visibility.html @@ -1,9 +1,9 @@ - - - Visibility Keyword Testbed - - -
    nothing special
    - - + + + Visibility Keyword Testbed + + +
    nothing special
    + + \ No newline at end of file diff --git a/test/resources/statuschecker.py b/test/resources/statuschecker.py index 09f70cc47..20b6a849d 100755 --- a/test/resources/statuschecker.py +++ b/test/resources/statuschecker.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# Copyright 2008-2010 Nokia Siemens Networks Oyj +# Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. - """Robot Framework Test Status Checker Usage: statuschecker.py infile [outfile] @@ -22,50 +21,51 @@ This tool processes Robot Framework output XML files and checks that test case statuses and messages are as expected. Main use case is post-processing output files got when testing Robot Framework test libraries using Robot Framework -itself. +itself. -If output file is not given, the input file is considered to be also output +If output file is not given, the input file is considered to be also output file and it is edited in place. By default all test cases are expected to 'PASS' and have no message. Changing the expected status to 'FAIL' is done by having word 'FAIL' (in uppercase) somewhere in the test case documentation. Expected error message must then be given after 'FAIL'. Error message can also be specified as a regular -expression by prefixing it with string 'REGEXP:'. +expression by prefixing it with string 'REGEXP:'. Testing only the beginning +of the message is possible with 'STARTS:' prefix. This tool also allows testing the created log messages. They are specified -using a syntax 'LOG x.y:z LEVEL Actual message', which is described in the -tool documentation. +using a syntax 'LOG x.y:z LEVEL Actual message', which is described in detail +detail in the tool documentation. """ import re -from robot.output import TestSuite - - +from robot.result import ExecutionResult + + def process_output(inpath, outpath=None): - suite = TestSuite(inpath) - _process_suite(suite) - suite.write_to_file(outpath) - return suite.critical_stats.failed + result = ExecutionResult(inpath) + _process_suite(result.suite) + result.save(outpath) + return result.return_code def _process_suite(suite): for subsuite in suite.suites: _process_suite(subsuite) for test in suite.tests: _process_test(test) - + def _process_test(test): exp = _Expected(test.doc) _check_status(test, exp) if test.status == 'PASS': _check_logs(test, exp) - + def _check_status(test, exp): if exp.status != test.status: test.status = 'FAIL' if exp.status == 'PASS': - test.message = ("Test was expected to PASS but it FAILED. " + test.message = ("Test was expected to PASS but it FAILED. " "Error message:\n") + test.message else: test.message = ("Test was expected to FAIL but it PASSED. " @@ -77,14 +77,18 @@ def _check_status(test, exp): elif test.status == 'FAIL': test.status = 'PASS' test.message = 'Original test failed as expected.' - -def _message_matches(actual, expected): + +def _message_matches(actual, expected): if actual == expected: return True if expected.startswith('REGEXP:'): pattern = '^%s$' % expected.replace('REGEXP:', '', 1).strip() if re.match(pattern, actual, re.DOTALL): return True + if expected.startswith('STARTS:'): + start = expected.replace('STARTS:', '', 1).strip() + if actual.startswith(start): + return True return False def _check_logs(test, exp): @@ -94,12 +98,11 @@ def _check_logs(test, exp): for index in kw_indices[1:]: kw = kw.keywords[index] except IndexError: - indices = '.'.join([ str(i+1) for i in kw_indices ]) + indices = '.'.join(str(i+1) for i in kw_indices) test.status = 'FAIL' test.message = ("Test '%s' does not have keyword with index '%s'" % (test.name, indices)) return - if len(kw.messages) <= msg_index: if message != 'NONE': test.status = 'FAIL' @@ -115,8 +118,9 @@ def _check_log_level(expected, test, kw, index): return True test.status = 'FAIL' test.message = ("Wrong level for message %d of keyword '%s'.\n\n" - "Expected: %s\nActual: %s.\n%s" - % (index+1, kw.name, expected, actual, kw.messages[index].message)) + "Expected: %s\nActual: %s.\n%s" + % (index+1, kw.name, expected, + actual, kw.messages[index].message)) return False def _check_log_message(expected, test, kw, index): @@ -125,39 +129,39 @@ def _check_log_message(expected, test, kw, index): return True test.status = 'FAIL' test.message = ("Wrong content for message %d of keyword '%s'.\n\n" - "Expected:\n%s\n\nActual:\n%s" + "Expected:\n%s\n\nActual:\n%s" % (index+1, kw.name, expected, actual)) return False class _Expected: - + def __init__(self, doc): self.status, self.message = self._get_status_and_message(doc) self.logs = self._get_logs(doc) - + def _get_status_and_message(self, doc): if 'FAIL' in doc: return 'FAIL', doc.split('FAIL', 1)[1].split('LOG', 1)[0].strip() return 'PASS', '' - + def _get_logs(self, doc): logs = [] for item in doc.split('LOG')[1:]: index_str, msg_str = item.strip().split(' ', 1) kw_indices, msg_index = self._get_indices(index_str) level, message = self._get_log_message(msg_str) - logs.append((kw_indices, msg_index, level, message)) + logs.append((kw_indices, msg_index, level, message)) return logs - + def _get_indices(self, index_str): try: kw_indices, msg_index = index_str.split(':') except ValueError: kw_indices, msg_index = index_str, '1' - kw_indices = [ int(index) - 1 for index in kw_indices.split('.') ] + kw_indices = [int(index) - 1 for index in kw_indices.split('.')] return kw_indices, int(msg_index) - 1 - + def _get_log_message(self, msg_str): try: level, message = msg_str.split(' ', 1) @@ -167,20 +171,20 @@ def _get_log_message(self, msg_str): level, message = 'INFO', msg_str return level, message - + if __name__=='__main__': import sys import os if not 2 <= len(sys.argv) <= 3 or '--help' in sys.argv: - print __doc__ + print __doc__ sys.exit(1) infile = sys.argv[1] - outfile = len(sys.argv) == 3 and sys.argv[2] or None + outfile = sys.argv[2] if len(sys.argv) == 3 else None print "Checking %s" % os.path.abspath(infile) rc = process_output(infile, outfile) if outfile: - print "Output %s" % os.path.abspath(outfile) + print "Output: %s" % os.path.abspath(outfile) if rc > 255: rc = 255 sys.exit(rc) diff --git a/test/resources/testserver/testserver.py b/test/resources/testserver/testserver.py index 2b9e78524..f476946d9 100644 --- a/test/resources/testserver/testserver.py +++ b/test/resources/testserver/testserver.py @@ -80,13 +80,13 @@ def serve_forever(self): while not self.stop: self.handle_request() -def stop_server(port=7272): +def stop_server(port=7000): """send QUIT request to http server running on localhost:""" conn = httplib.HTTPConnection("localhost:%d" % port) conn.request("QUIT", "/") conn.getresponse() -def start_server(port=7272): +def start_server(port=7000): import os os.chdir(os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), '..')) server = StoppableHttpServer(('', port), StoppableHttpRequestHandler) diff --git a/test/run_tests.py b/test/run_tests.py index 2ce1c1727..8299106a6 100755 --- a/test/run_tests.py +++ b/test/run_tests.py @@ -15,7 +15,7 @@ '--escape', 'space:SP', '--report', 'none', '--log', 'none', - #'--suite', 'Acceptance.Open And Close', + #'--suite', 'Acceptance.Keywords.Textfields', '--loglevel', 'DEBUG', '--pythonpath', '%(pythonpath)s', ] @@ -57,8 +57,9 @@ def stop_http_server(): def process_output(): print - call(['python', os.path.join(env.RESOURCES_DIR, 'statuschecker.py'), - os.path.join(env.RESULTS_DIR, 'output.xml')]) + if _has_robot_27(): + call(['python', os.path.join(env.RESOURCES_DIR, 'statuschecker.py'), + os.path.join(env.RESULTS_DIR, 'output.xml')]) rebot = 'rebot' if os.sep == '/' else 'rebot.bat' rebot_cmd = [rebot] + [ arg % ARG_VALUES for arg in REBOT_ARGS ] + \ [os.path.join(ARG_VALUES['outdir'], 'output.xml') ] @@ -69,6 +70,13 @@ def process_output(): print '%d critical test%s failed' % (rc, 's' if rc != 1 else '') return rc +def _has_robot_27(): + try: + from robot.result import ExecutionResult + except: + return False + return True + def _exit(rc): sys.exit(rc) diff --git a/test/run_unit_tests.py b/test/run_unit_tests.py old mode 100644 new mode 100755 diff --git a/src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/opera/__init__.py b/test/unit/keywords/__init__.py similarity index 100% rename from src/Selenium2Library/lib/selenium-2.8.1/py/selenium/webdriver/opera/__init__.py rename to test/unit/keywords/__init__.py diff --git a/test/unit/keywords/test_browsermanagement.py b/test/unit/keywords/test_browsermanagement.py new file mode 100644 index 000000000..6d83ad074 --- /dev/null +++ b/test/unit/keywords/test_browsermanagement.py @@ -0,0 +1,77 @@ +import unittest +from Selenium2Library.keywords._browsermanagement import _BrowserManagementKeywords +from selenium import webdriver + +class BrowserManagementTests(unittest.TestCase): + + + def test_create_firefox_browser(self): + test_browsers = ((webdriver.Firefox, "ff"), (webdriver.Firefox, "firEfOx")) + + for test_browser in test_browsers: + self.verify_browser(*test_browser) + + def mock_createProfile(self, profile_directory=None): + self.ff_profile_dir = profile_directory + return self.old_profile_init(profile_directory) + + def test_create_ie_browser(self): + test_browsers = ((webdriver.Ie, "ie"), (webdriver.Ie, "Internet Explorer")) + + for test_browser in test_browsers: + self.verify_browser(*test_browser) + + def test_create_chrome_browser(self): + test_browsers = ((webdriver.Chrome, "gOOglEchrOmE"),(webdriver.Chrome,"gc"), + (webdriver.Chrome, "chrome")) + + for test_browser in test_browsers: + self.verify_browser(*test_browser) + + def test_create_opera_browser(self): + self.verify_browser(webdriver.Opera, "OPERA") + + def test_create_remote_browser(self): + self.verify_browser(webdriver.Remote, "chrome", remote="http://127.0.0.1/wd/hub") + + def test_create_htmlunit_browser(self): + self.verify_browser(webdriver.Remote, "htmlunit") + + def test_create_htmlunitwihtjs_browser(self): + self.verify_browser(webdriver.Remote, "htmlunitwithjs") + + def test_create_desired_capabilities(self): + bm = _BrowserManagementKeywords() + expected_caps = "key1:val1,key2:val2" + capabilities = bm._create_desired_capabilities(webdriver.DesiredCapabilities.CHROME, expected_caps) + self.assertTrue(type(capabilities), webdriver.DesiredCapabilities.CHROME) + self.assertTrue("val1", capabilities["key1"]) + self.assertTrue("val2", capabilities["key2"]) + self.assertTrue(2, len(capabilities)) + + def test_create_remote_browser_with_desired_prefs(self): + expected_caps = "key1:val1,key2:val2" + self.verify_browser(webdriver.Remote, "chrome", remote="http://127.0.0.1/wd/hub", + desired_capabilities=expected_caps) + + + def verify_browser(self , webdriver_type , browser_name, **kw): + #todo try lambda *x: was_called = true + bm = _BrowserManagementKeywords() + old_init = webdriver_type.__init__ + webdriver_type.__init__ = self.mock_init + + try: + self.was_called = False + bm._make_browser(browser_name, **kw) + except AttributeError: + pass #kinda dangerous but I'm too lazy to mock out all the set_timeout calls + finally: + webdriver_type.__init__ = old_init + self.assertTrue(self.was_called) + + def mock_init(self, *args, **kw): + self.was_called = True + + + diff --git a/test/unit/locators/test_elementfinder.py b/test/unit/locators/test_elementfinder.py index 554c2c6b0..e3cc2fbe9 100644 --- a/test/unit/locators/test_elementfinder.py +++ b/test/unit/locators/test_elementfinder.py @@ -1,327 +1,339 @@ -import unittest +import unittest import os -from Selenium2Library.locators import ElementFinder -from mockito import * - -class ElementFinderTests(unittest.TestCase): - - def test_find_with_invalid_prefix(self): - finder = ElementFinder() - browser = mock() - with self.assertRaises(ValueError) as context: - finder.find(browser, "something=test1") - self.assertEqual(context.exception.message, "Element locator with prefix 'something' is not supported") - - def test_find_with_null_browser(self): - finder = ElementFinder() - with self.assertRaises(AssertionError): - finder.find(None, "id=test1") - - def test_find_with_null_locator(self): - finder = ElementFinder() - browser = mock() - with self.assertRaises(AssertionError): - finder.find(browser, None) - - def test_find_with_empty_locator(self): - finder = ElementFinder() - browser = mock() - with self.assertRaises(AssertionError): - finder.find(browser, "") - - def test_find_with_no_tag(self): - finder = ElementFinder() - browser = mock() - finder.find(browser, "test1") - verify(browser).find_elements_by_xpath("//*[(@id='test1' or @name='test1')]") - - def test_find_with_tag(self): - finder = ElementFinder() - browser = mock() - finder.find(browser, "test1", tag='div') - verify(browser).find_elements_by_xpath("//div[(@id='test1' or @name='test1')]") - - def test_find_with_locator_with_apos(self): - finder = ElementFinder() - browser = mock() - finder.find(browser, "test '1'") - verify(browser).find_elements_by_xpath("//*[(@id=\"test '1'\" or @name=\"test '1'\")]") - - def test_find_with_locator_with_quote(self): - finder = ElementFinder() - browser = mock() - finder.find(browser, "test \"1\"") - verify(browser).find_elements_by_xpath("//*[(@id='test \"1\"' or @name='test \"1\"')]") - - def test_find_with_locator_with_quote_and_apos(self): - finder = ElementFinder() - browser = mock() - finder.find(browser, "test \"1\" and '2'") - verify(browser).find_elements_by_xpath( - "//*[(@id=concat('test \"1\" and ', \"'\", '2', \"'\", '') or @name=concat('test \"1\" and ', \"'\", '2', \"'\", ''))]") - - def test_find_with_a(self): - finder = ElementFinder() - browser = mock() - when(browser).get_current_url().thenReturn("http://localhost/mypage.html") - finder.find(browser, "test1", tag='a') - verify(browser).find_elements_by_xpath( - "//a[(@id='test1' or @name='test1' or @href='test1' or normalize-space(descendant-or-self::text())='test1' or @href='http://localhost/test1')]") - - def test_find_with_link_synonym(self): - finder = ElementFinder() - browser = mock() - when(browser).get_current_url().thenReturn("http://localhost/mypage.html") - finder.find(browser, "test1", tag='link') - verify(browser).find_elements_by_xpath( - "//a[(@id='test1' or @name='test1' or @href='test1' or normalize-space(descendant-or-self::text())='test1' or @href='http://localhost/test1')]") - - def test_find_with_img(self): - finder = ElementFinder() - browser = mock() - when(browser).get_current_url().thenReturn("http://localhost/mypage.html") - finder.find(browser, "test1", tag='img') - verify(browser).find_elements_by_xpath( - "//img[(@id='test1' or @name='test1' or @src='test1' or @alt='test1' or @src='http://localhost/test1')]") - - def test_find_with_image_synonym(self): - finder = ElementFinder() - browser = mock() - when(browser).get_current_url().thenReturn("http://localhost/mypage.html") - finder.find(browser, "test1", tag='image') - verify(browser).find_elements_by_xpath( - "//img[(@id='test1' or @name='test1' or @src='test1' or @alt='test1' or @src='http://localhost/test1')]") - - def test_find_with_input(self): - finder = ElementFinder() - browser = mock() - when(browser).get_current_url().thenReturn("http://localhost/mypage.html") - finder.find(browser, "test1", tag='input') - verify(browser).find_elements_by_xpath( - "//input[(@id='test1' or @name='test1' or @value='test1' or @src='test1' or @src='http://localhost/test1')]") - - def test_find_with_radio_button_synonym(self): - finder = ElementFinder() - browser = mock() - when(browser).get_current_url().thenReturn("http://localhost/mypage.html") - finder.find(browser, "test1", tag='radio button') - verify(browser).find_elements_by_xpath( - "//input[@type='radio' and (@id='test1' or @name='test1' or @value='test1' or @src='test1' or @src='http://localhost/test1')]") - - def test_find_with_checkbox_synonym(self): - finder = ElementFinder() - browser = mock() - when(browser).get_current_url().thenReturn("http://localhost/mypage.html") - finder.find(browser, "test1", tag='checkbox') - verify(browser).find_elements_by_xpath( - "//input[@type='checkbox' and (@id='test1' or @name='test1' or @value='test1' or @src='test1' or @src='http://localhost/test1')]") - - def test_find_with_file_upload_synonym(self): - finder = ElementFinder() - browser = mock() - when(browser).get_current_url().thenReturn("http://localhost/mypage.html") - finder.find(browser, "test1", tag='file upload') - verify(browser).find_elements_by_xpath( - "//input[@type='file' and (@id='test1' or @name='test1' or @value='test1' or @src='test1' or @src='http://localhost/test1')]") - - def test_find_with_text_field_synonym(self): - finder = ElementFinder() - browser = mock() - when(browser).get_current_url().thenReturn("http://localhost/mypage.html") - finder.find(browser, "test1", tag='text field') - verify(browser).find_elements_by_xpath( - "//input[@type='text' and (@id='test1' or @name='test1' or @value='test1' or @src='test1' or @src='http://localhost/test1')]") - - def test_find_with_button(self): - finder = ElementFinder() - browser = mock() - finder.find(browser, "test1", tag='button') - verify(browser).find_elements_by_xpath( - "//button[(@id='test1' or @name='test1' or @value='test1' or normalize-space(descendant-or-self::text())='test1')]") - - def test_find_with_select(self): - finder = ElementFinder() - browser = mock() - finder.find(browser, "test1", tag='select') - verify(browser).find_elements_by_xpath( - "//select[(@id='test1' or @name='test1')]") - - def test_find_with_list_synonym(self): - finder = ElementFinder() - browser = mock() - finder.find(browser, "test1", tag='list') - verify(browser).find_elements_by_xpath( - "//select[(@id='test1' or @name='test1')]") - - def test_find_with_implicit_xpath(self): - finder = ElementFinder() - browser = mock() - - elements = self._make_mock_elements('div', 'a', 'span', 'a') - when(browser).find_elements_by_xpath("//*[(@test='1')]").thenReturn(elements) - - result = finder.find(browser, "//*[(@test='1')]") - self.assertEqual(result, elements) - result = finder.find(browser, "//*[(@test='1')]", tag='a') - self.assertEqual(result, [elements[1], elements[3]]) - - def test_find_by_identifier(self): - finder = ElementFinder() - browser = mock() - - id_elements = self._make_mock_elements('div', 'a') - name_elements = self._make_mock_elements('span', 'a') - when(browser).find_elements_by_id("test1").thenReturn(list(id_elements)).thenReturn(list(id_elements)) - when(browser).find_elements_by_name("test1").thenReturn(list(name_elements)).thenReturn(list(name_elements)) - - all_elements = list(id_elements) - all_elements.extend(name_elements) - - result = finder.find(browser, "identifier=test1") - self.assertEqual(result, all_elements) - result = finder.find(browser, "identifier=test1", tag='a') - self.assertEqual(result, [id_elements[1], name_elements[1]]) - - def test_find_by_id(self): - finder = ElementFinder() - browser = mock() - - elements = self._make_mock_elements('div', 'a', 'span', 'a') - when(browser).find_elements_by_id("test1").thenReturn(elements) - - result = finder.find(browser, "id=test1") - self.assertEqual(result, elements) - result = finder.find(browser, "id=test1", tag='a') - self.assertEqual(result, [elements[1], elements[3]]) - - def test_find_by_name(self): - finder = ElementFinder() - browser = mock() - - elements = self._make_mock_elements('div', 'a', 'span', 'a') - when(browser).find_elements_by_name("test1").thenReturn(elements) - - result = finder.find(browser, "name=test1") - self.assertEqual(result, elements) - result = finder.find(browser, "name=test1", tag='a') - self.assertEqual(result, [elements[1], elements[3]]) - - def test_find_by_xpath(self): - finder = ElementFinder() - browser = mock() - - elements = self._make_mock_elements('div', 'a', 'span', 'a') - when(browser).find_elements_by_xpath("//*[(@test='1')]").thenReturn(elements) - - result = finder.find(browser, "xpath=//*[(@test='1')]") - self.assertEqual(result, elements) - result = finder.find(browser, "xpath=//*[(@test='1')]", tag='a') - self.assertEqual(result, [elements[1], elements[3]]) - - def test_find_by_link_text(self): - finder = ElementFinder() - browser = mock() - - elements = self._make_mock_elements('div', 'a', 'span', 'a') - when(browser).find_elements_by_link_text("my link").thenReturn(elements) - - result = finder.find(browser, "link=my link") - self.assertEqual(result, elements) - result = finder.find(browser, "link=my link", tag='a') - self.assertEqual(result, [elements[1], elements[3]]) - - def test_find_by_css_selector(self): - finder = ElementFinder() - browser = mock() - - elements = self._make_mock_elements('div', 'a', 'span', 'a') - when(browser).find_elements_by_css_selector("#test1").thenReturn(elements) - - result = finder.find(browser, "css=#test1") - self.assertEqual(result, elements) - result = finder.find(browser, "css=#test1", tag='a') - self.assertEqual(result, [elements[1], elements[3]]) - - def test_find_by_tag_name(self): - finder = ElementFinder() - browser = mock() - - elements = self._make_mock_elements('div', 'a', 'span', 'a') - when(browser).find_elements_by_tag_name("div").thenReturn(elements) - - result = finder.find(browser, "tag=div") - self.assertEqual(result, elements) - result = finder.find(browser, "tag=div", tag='a') - self.assertEqual(result, [elements[1], elements[3]]) - - def test_find_with_sloppy_prefix(self): - finder = ElementFinder() - browser = mock() - - elements = self._make_mock_elements('div', 'a', 'span', 'a') - when(browser).find_elements_by_id("test1").thenReturn(elements) - - result = finder.find(browser, "ID=test1") - self.assertEqual(result, elements) - result = finder.find(browser, "iD=test1") - self.assertEqual(result, elements) - result = finder.find(browser, "id=test1") - self.assertEqual(result, elements) - result = finder.find(browser, " id =test1") - self.assertEqual(result, elements) - - def test_find_with_sloppy_criteria(self): - finder = ElementFinder() - browser = mock() - - elements = self._make_mock_elements('div', 'a', 'span', 'a') - when(browser).find_elements_by_id("test1").thenReturn(elements) - - result = finder.find(browser, "id= test1 ") - self.assertEqual(result, elements) - - def test_find_by_id_with_synonym_and_constraints(self): - finder = ElementFinder() - browser = mock() - - elements = self._make_mock_elements('div', 'input', 'span', 'input', 'a', 'input', 'div', 'input') - elements[1].set_attribute('type', 'radio') - elements[3].set_attribute('type', 'checkbox') - elements[5].set_attribute('type', 'text') - elements[7].set_attribute('type', 'file') - when(browser).find_elements_by_id("test1").thenReturn(elements) - - result = finder.find(browser, "id=test1") - self.assertEqual(result, elements) - result = finder.find(browser, "id=test1", tag='input') - self.assertEqual(result, [elements[1], elements[3], elements[5], elements[7]]) - result = finder.find(browser, "id=test1", tag='radio button') - self.assertEqual(result, [elements[1]]) - result = finder.find(browser, "id=test1", tag='checkbox') - self.assertEqual(result, [elements[3]]) - result = finder.find(browser, "id=test1", tag='text field') - self.assertEqual(result, [elements[5]]) - result = finder.find(browser, "id=test1", tag='file upload') - self.assertEqual(result, [elements[7]]) - - def _make_mock_elements(self, *tags): - elements = [] - for tag in tags: - element = self._make_mock_element(tag) - elements.append(element) - return elements - - def _make_mock_element(self, tag): - element = mock() - element.tag_name = tag - element.attributes = {} - - def set_attribute(name, value): - element.attributes[name] = value - element.set_attribute = set_attribute - - def get_attribute(name): - return element.attributes[name] - element.get_attribute = get_attribute - - return element +from Selenium2Library.locators import ElementFinder +from mockito import * + +class ElementFinderTests(unittest.TestCase): + + def test_find_with_invalid_prefix(self): + finder = ElementFinder() + browser = mock() + try: + self.assertRaises(ValueError, finder.find, browser, "something=test1") + except ValueError as e: + self.assertEqual(e.message, "Element locator with prefix 'something' is not supported") + + def test_find_with_null_browser(self): + finder = ElementFinder() + self.assertRaises(AssertionError, + finder.find, None, "id=test1") + + def test_find_with_null_locator(self): + finder = ElementFinder() + browser = mock() + self.assertRaises(AssertionError, + finder.find, browser, None) + + def test_find_with_empty_locator(self): + finder = ElementFinder() + browser = mock() + self.assertRaises(AssertionError, + finder.find, browser, "") + + def test_find_with_no_tag(self): + finder = ElementFinder() + browser = mock() + finder.find(browser, "test1") + verify(browser).find_elements_by_xpath("//*[(@id='test1' or @name='test1')]") + + def test_find_with_tag(self): + finder = ElementFinder() + browser = mock() + finder.find(browser, "test1", tag='div') + verify(browser).find_elements_by_xpath("//div[(@id='test1' or @name='test1')]") + + def test_find_with_locator_with_apos(self): + finder = ElementFinder() + browser = mock() + finder.find(browser, "test '1'") + verify(browser).find_elements_by_xpath("//*[(@id=\"test '1'\" or @name=\"test '1'\")]") + + def test_find_with_locator_with_quote(self): + finder = ElementFinder() + browser = mock() + finder.find(browser, "test \"1\"") + verify(browser).find_elements_by_xpath("//*[(@id='test \"1\"' or @name='test \"1\"')]") + + def test_find_with_locator_with_quote_and_apos(self): + finder = ElementFinder() + browser = mock() + finder.find(browser, "test \"1\" and '2'") + verify(browser).find_elements_by_xpath( + "//*[(@id=concat('test \"1\" and ', \"'\", '2', \"'\", '') or @name=concat('test \"1\" and ', \"'\", '2', \"'\", ''))]") + + def test_find_with_a(self): + finder = ElementFinder() + browser = mock() + when(browser).get_current_url().thenReturn("http://localhost/mypage.html") + finder.find(browser, "test1", tag='a') + verify(browser).find_elements_by_xpath( + "//a[(@id='test1' or @name='test1' or @href='test1' or normalize-space(descendant-or-self::text())='test1' or @href='http://localhost/test1')]") + + def test_find_with_link_synonym(self): + finder = ElementFinder() + browser = mock() + when(browser).get_current_url().thenReturn("http://localhost/mypage.html") + finder.find(browser, "test1", tag='link') + verify(browser).find_elements_by_xpath( + "//a[(@id='test1' or @name='test1' or @href='test1' or normalize-space(descendant-or-self::text())='test1' or @href='http://localhost/test1')]") + + def test_find_with_img(self): + finder = ElementFinder() + browser = mock() + when(browser).get_current_url().thenReturn("http://localhost/mypage.html") + finder.find(browser, "test1", tag='img') + verify(browser).find_elements_by_xpath( + "//img[(@id='test1' or @name='test1' or @src='test1' or @alt='test1' or @src='http://localhost/test1')]") + + def test_find_with_image_synonym(self): + finder = ElementFinder() + browser = mock() + when(browser).get_current_url().thenReturn("http://localhost/mypage.html") + finder.find(browser, "test1", tag='image') + verify(browser).find_elements_by_xpath( + "//img[(@id='test1' or @name='test1' or @src='test1' or @alt='test1' or @src='http://localhost/test1')]") + + def test_find_with_input(self): + finder = ElementFinder() + browser = mock() + when(browser).get_current_url().thenReturn("http://localhost/mypage.html") + finder.find(browser, "test1", tag='input') + verify(browser).find_elements_by_xpath( + "//input[(@id='test1' or @name='test1' or @value='test1' or @src='test1' or @src='http://localhost/test1')]") + + def test_find_with_radio_button_synonym(self): + finder = ElementFinder() + browser = mock() + when(browser).get_current_url().thenReturn("http://localhost/mypage.html") + finder.find(browser, "test1", tag='radio button') + verify(browser).find_elements_by_xpath( + "//input[@type='radio' and (@id='test1' or @name='test1' or @value='test1' or @src='test1' or @src='http://localhost/test1')]") + + def test_find_with_checkbox_synonym(self): + finder = ElementFinder() + browser = mock() + when(browser).get_current_url().thenReturn("http://localhost/mypage.html") + finder.find(browser, "test1", tag='checkbox') + verify(browser).find_elements_by_xpath( + "//input[@type='checkbox' and (@id='test1' or @name='test1' or @value='test1' or @src='test1' or @src='http://localhost/test1')]") + + def test_find_with_file_upload_synonym(self): + finder = ElementFinder() + browser = mock() + when(browser).get_current_url().thenReturn("http://localhost/mypage.html") + finder.find(browser, "test1", tag='file upload') + verify(browser).find_elements_by_xpath( + "//input[@type='file' and (@id='test1' or @name='test1' or @value='test1' or @src='test1' or @src='http://localhost/test1')]") + + def test_find_with_text_field_synonym(self): + finder = ElementFinder() + browser = mock() + when(browser).get_current_url().thenReturn("http://localhost/mypage.html") + finder.find(browser, "test1", tag='text field') + verify(browser).find_elements_by_xpath( + "//input[@type='text' and (@id='test1' or @name='test1' or @value='test1' or @src='test1' or @src='http://localhost/test1')]") + + def test_find_with_button(self): + finder = ElementFinder() + browser = mock() + finder.find(browser, "test1", tag='button') + verify(browser).find_elements_by_xpath( + "//button[(@id='test1' or @name='test1' or @value='test1' or normalize-space(descendant-or-self::text())='test1')]") + + def test_find_with_select(self): + finder = ElementFinder() + browser = mock() + finder.find(browser, "test1", tag='select') + verify(browser).find_elements_by_xpath( + "//select[(@id='test1' or @name='test1')]") + + def test_find_with_list_synonym(self): + finder = ElementFinder() + browser = mock() + finder.find(browser, "test1", tag='list') + verify(browser).find_elements_by_xpath( + "//select[(@id='test1' or @name='test1')]") + + def test_find_with_implicit_xpath(self): + finder = ElementFinder() + browser = mock() + + elements = self._make_mock_elements('div', 'a', 'span', 'a') + when(browser).find_elements_by_xpath("//*[(@test='1')]").thenReturn(elements) + + result = finder.find(browser, "//*[(@test='1')]") + self.assertEqual(result, elements) + result = finder.find(browser, "//*[(@test='1')]", tag='a') + self.assertEqual(result, [elements[1], elements[3]]) + + def test_find_by_identifier(self): + finder = ElementFinder() + browser = mock() + + id_elements = self._make_mock_elements('div', 'a') + name_elements = self._make_mock_elements('span', 'a') + when(browser).find_elements_by_id("test1").thenReturn(list(id_elements)).thenReturn(list(id_elements)) + when(browser).find_elements_by_name("test1").thenReturn(list(name_elements)).thenReturn(list(name_elements)) + + all_elements = list(id_elements) + all_elements.extend(name_elements) + + result = finder.find(browser, "identifier=test1") + self.assertEqual(result, all_elements) + result = finder.find(browser, "identifier=test1", tag='a') + self.assertEqual(result, [id_elements[1], name_elements[1]]) + + def test_find_by_id(self): + finder = ElementFinder() + browser = mock() + + elements = self._make_mock_elements('div', 'a', 'span', 'a') + when(browser).find_elements_by_id("test1").thenReturn(elements) + + result = finder.find(browser, "id=test1") + self.assertEqual(result, elements) + result = finder.find(browser, "id=test1", tag='a') + self.assertEqual(result, [elements[1], elements[3]]) + + def test_find_by_name(self): + finder = ElementFinder() + browser = mock() + + elements = self._make_mock_elements('div', 'a', 'span', 'a') + when(browser).find_elements_by_name("test1").thenReturn(elements) + + result = finder.find(browser, "name=test1") + self.assertEqual(result, elements) + result = finder.find(browser, "name=test1", tag='a') + self.assertEqual(result, [elements[1], elements[3]]) + + def test_find_by_xpath(self): + finder = ElementFinder() + browser = mock() + + elements = self._make_mock_elements('div', 'a', 'span', 'a') + when(browser).find_elements_by_xpath("//*[(@test='1')]").thenReturn(elements) + + result = finder.find(browser, "xpath=//*[(@test='1')]") + self.assertEqual(result, elements) + result = finder.find(browser, "xpath=//*[(@test='1')]", tag='a') + self.assertEqual(result, [elements[1], elements[3]]) + + def test_find_by_dom(self): + finder = ElementFinder() + browser = mock() + + elements = self._make_mock_elements('div', 'a', 'span', 'a') + when(browser).execute_script("return document.getElementsByTagName('a');").thenReturn( + [elements[1], elements[3]]) + + result = finder.find(browser, "dom=document.getElementsByTagName('a')") + self.assertEqual(result, [elements[1], elements[3]]) + + def test_find_by_link_text(self): + finder = ElementFinder() + browser = mock() + + elements = self._make_mock_elements('div', 'a', 'span', 'a') + when(browser).find_elements_by_link_text("my link").thenReturn(elements) + + result = finder.find(browser, "link=my link") + self.assertEqual(result, elements) + result = finder.find(browser, "link=my link", tag='a') + self.assertEqual(result, [elements[1], elements[3]]) + + def test_find_by_css_selector(self): + finder = ElementFinder() + browser = mock() + + elements = self._make_mock_elements('div', 'a', 'span', 'a') + when(browser).find_elements_by_css_selector("#test1").thenReturn(elements) + + result = finder.find(browser, "css=#test1") + self.assertEqual(result, elements) + result = finder.find(browser, "css=#test1", tag='a') + self.assertEqual(result, [elements[1], elements[3]]) + + def test_find_by_tag_name(self): + finder = ElementFinder() + browser = mock() + + elements = self._make_mock_elements('div', 'a', 'span', 'a') + when(browser).find_elements_by_tag_name("div").thenReturn(elements) + + result = finder.find(browser, "tag=div") + self.assertEqual(result, elements) + result = finder.find(browser, "tag=div", tag='a') + self.assertEqual(result, [elements[1], elements[3]]) + + def test_find_with_sloppy_prefix(self): + finder = ElementFinder() + browser = mock() + + elements = self._make_mock_elements('div', 'a', 'span', 'a') + when(browser).find_elements_by_id("test1").thenReturn(elements) + + result = finder.find(browser, "ID=test1") + self.assertEqual(result, elements) + result = finder.find(browser, "iD=test1") + self.assertEqual(result, elements) + result = finder.find(browser, "id=test1") + self.assertEqual(result, elements) + result = finder.find(browser, " id =test1") + self.assertEqual(result, elements) + + def test_find_with_sloppy_criteria(self): + finder = ElementFinder() + browser = mock() + + elements = self._make_mock_elements('div', 'a', 'span', 'a') + when(browser).find_elements_by_id("test1").thenReturn(elements) + + result = finder.find(browser, "id= test1 ") + self.assertEqual(result, elements) + + def test_find_by_id_with_synonym_and_constraints(self): + finder = ElementFinder() + browser = mock() + + elements = self._make_mock_elements('div', 'input', 'span', 'input', 'a', 'input', 'div', 'input') + elements[1].set_attribute('type', 'radio') + elements[3].set_attribute('type', 'checkbox') + elements[5].set_attribute('type', 'text') + elements[7].set_attribute('type', 'file') + when(browser).find_elements_by_id("test1").thenReturn(elements) + + result = finder.find(browser, "id=test1") + self.assertEqual(result, elements) + result = finder.find(browser, "id=test1", tag='input') + self.assertEqual(result, [elements[1], elements[3], elements[5], elements[7]]) + result = finder.find(browser, "id=test1", tag='radio button') + self.assertEqual(result, [elements[1]]) + result = finder.find(browser, "id=test1", tag='checkbox') + self.assertEqual(result, [elements[3]]) + result = finder.find(browser, "id=test1", tag='text field') + self.assertEqual(result, [elements[5]]) + result = finder.find(browser, "id=test1", tag='file upload') + self.assertEqual(result, [elements[7]]) + + def _make_mock_elements(self, *tags): + elements = [] + for tag in tags: + element = self._make_mock_element(tag) + elements.append(element) + return elements + + def _make_mock_element(self, tag): + element = mock() + element.tag_name = tag + element.attributes = {} + + def set_attribute(name, value): + element.attributes[name] = value + element.set_attribute = set_attribute + + def get_attribute(name): + return element.attributes[name] + element.get_attribute = get_attribute + + return element diff --git a/test/unit/locators/test_tableelementfinder.py b/test/unit/locators/test_tableelementfinder.py index 16801bcf4..649c49fdf 100644 --- a/test/unit/locators/test_tableelementfinder.py +++ b/test/unit/locators/test_tableelementfinder.py @@ -1,179 +1,179 @@ -import unittest -from Selenium2Library.locators import TableElementFinder -from mockito import * - -class ElementFinderTests(unittest.TestCase): - - def test_find_with_implicit_css_locator(self): - finder = TableElementFinder() - browser = mock() - when(browser).find_elements_by_css_selector("table#test1").thenReturn([]) - - finder.find(browser, "test1") - - verify(browser).find_elements_by_css_selector("table#test1") - - def test_find_with_css_selector(self): - finder = TableElementFinder() - browser = mock() - elements = self._make_mock_elements('table', 'table', 'table') - when(browser).find_elements_by_css_selector("table#test1").thenReturn(elements) - - self.assertEqual( - finder.find(browser, "css=table#test1"), - elements[0]) - - verify(browser).find_elements_by_css_selector("table#test1") - - def test_find_with_xpath_selector(self): - finder = TableElementFinder() - browser = mock() - elements = self._make_mock_elements('table', 'table', 'table') - when(browser).find_elements_by_xpath("//table[@id='test1']").thenReturn(elements) - - self.assertEqual( - finder.find(browser, "xpath=//table[@id='test1']"), - elements[0]) - - verify(browser).find_elements_by_xpath("//table[@id='test1']") - - def test_find_with_content_constraint(self): - finder = TableElementFinder() - browser = mock() - elements = self._make_mock_elements('td', 'td', 'td') - elements[1].text = 'hi' - when(browser).find_elements_by_css_selector("table#test1").thenReturn(elements) - - self.assertEqual( - finder.find_by_content(browser, "test1", 'hi'), - elements[1]) - - verify(browser).find_elements_by_css_selector("table#test1") - - def test_find_with_null_content_constraint(self): - finder = TableElementFinder() - browser = mock() - elements = self._make_mock_elements('td', 'td', 'td') - elements[1].text = 'hi' - when(browser).find_elements_by_css_selector("table#test1").thenReturn(elements) - - self.assertEqual( - finder.find_by_content(browser, "test1", None), - elements[0]) - - verify(browser).find_elements_by_css_selector("table#test1") - - def test_find_by_content_with_css_locator(self): - finder = TableElementFinder() - browser = mock() - when(browser).find_elements_by_css_selector("table#test1").thenReturn([]) - - finder.find_by_content(browser, "css=table#test1", 'hi') - - verify(browser).find_elements_by_css_selector("table#test1") - - def test_find_by_content_with_xpath_locator(self): - finder = TableElementFinder() - browser = mock() - when(browser).find_elements_by_xpath("//table[@id='test1']//*").thenReturn([]) - - finder.find_by_content(browser, "xpath=//table[@id='test1']", 'hi') - - verify(browser).find_elements_by_xpath("//table[@id='test1']//*") - - def test_find_by_header_with_css_locator(self): - finder = TableElementFinder() - browser = mock() - when(browser).find_elements_by_css_selector("table#test1 th").thenReturn([]) - - finder.find_by_header(browser, "css=table#test1", 'hi') - - verify(browser).find_elements_by_css_selector("table#test1 th") - - def test_find_by_header_with_xpath_locator(self): - finder = TableElementFinder() - browser = mock() - when(browser).find_elements_by_xpath("//table[@id='test1']//th").thenReturn([]) - - finder.find_by_header(browser, "xpath=//table[@id='test1']", 'hi') - - verify(browser).find_elements_by_xpath("//table[@id='test1']//th") - - def test_find_by_footer_with_css_locator(self): - finder = TableElementFinder() - browser = mock() - when(browser).find_elements_by_css_selector("table#test1 tfoot td").thenReturn([]) - - finder.find_by_footer(browser, "css=table#test1", 'hi') - - verify(browser).find_elements_by_css_selector("table#test1 tfoot td") - - def test_find_by_footer_with_xpath_locator(self): - finder = TableElementFinder() - browser = mock() - when(browser).find_elements_by_xpath("//table[@id='test1']//tfoot//td").thenReturn([]) - - finder.find_by_footer(browser, "xpath=//table[@id='test1']", 'hi') - - verify(browser).find_elements_by_xpath("//table[@id='test1']//tfoot//td") - - def test_find_by_row_with_css_locator(self): - finder = TableElementFinder() - browser = mock() - when(browser).find_elements_by_css_selector("table#test1 tr:nth-child(2)").thenReturn([]) - - finder.find_by_row(browser, "css=table#test1", 2, 'hi') - - verify(browser).find_elements_by_css_selector("table#test1 tr:nth-child(2)") - - def test_find_by_row_with_xpath_locator(self): - finder = TableElementFinder() - browser = mock() - when(browser).find_elements_by_xpath("//table[@id='test1']//tr[2]//*").thenReturn([]) - - finder.find_by_row(browser, "xpath=//table[@id='test1']", 2, 'hi') - - verify(browser).find_elements_by_xpath("//table[@id='test1']//tr[2]//*") - - def test_find_by_col_with_css_locator(self): - finder = TableElementFinder() - browser = mock() - when(browser).find_elements_by_css_selector("table#test1 tr td:nth-child(2)").thenReturn([]) - when(browser).find_elements_by_css_selector("table#test1 tr th:nth-child(2)").thenReturn([]) - - finder.find_by_col(browser, "css=table#test1", 2, 'hi') - - verify(browser).find_elements_by_css_selector("table#test1 tr td:nth-child(2)") - verify(browser).find_elements_by_css_selector("table#test1 tr th:nth-child(2)") - - def test_find_by_col_with_xpath_locator(self): - finder = TableElementFinder() - browser = mock() - when(browser).find_elements_by_xpath("//table[@id='test1']//tr//*[self::td or self::th][2]").thenReturn([]) - - finder.find_by_col(browser, "xpath=//table[@id='test1']", 2, 'hi') - - verify(browser).find_elements_by_xpath("//table[@id='test1']//tr//*[self::td or self::th][2]") - - def _make_mock_elements(self, *tags): - elements = [] - for tag in tags: - element = self._make_mock_element(tag) - elements.append(element) - return elements - - def _make_mock_element(self, tag): - element = mock() - element.tag_name = tag - element.attributes = {} - element.text = None - - def set_attribute(name, value): - element.attributes[name] = value - element.set_attribute = set_attribute - - def get_attribute(name): - return element.attributes[name] - element.get_attribute = get_attribute - - return element +import unittest +from Selenium2Library.locators import TableElementFinder +from mockito import * + +class ElementFinderTests(unittest.TestCase): + + def test_find_with_implicit_css_locator(self): + finder = TableElementFinder() + browser = mock() + when(browser).find_elements_by_css_selector("table#test1").thenReturn([]) + + finder.find(browser, "test1") + + verify(browser).find_elements_by_css_selector("table#test1") + + def test_find_with_css_selector(self): + finder = TableElementFinder() + browser = mock() + elements = self._make_mock_elements('table', 'table', 'table') + when(browser).find_elements_by_css_selector("table#test1").thenReturn(elements) + + self.assertEqual( + finder.find(browser, "css=table#test1"), + elements[0]) + + verify(browser).find_elements_by_css_selector("table#test1") + + def test_find_with_xpath_selector(self): + finder = TableElementFinder() + browser = mock() + elements = self._make_mock_elements('table', 'table', 'table') + when(browser).find_elements_by_xpath("//table[@id='test1']").thenReturn(elements) + + self.assertEqual( + finder.find(browser, "xpath=//table[@id='test1']"), + elements[0]) + + verify(browser).find_elements_by_xpath("//table[@id='test1']") + + def test_find_with_content_constraint(self): + finder = TableElementFinder() + browser = mock() + elements = self._make_mock_elements('td', 'td', 'td') + elements[1].text = 'hi' + when(browser).find_elements_by_css_selector("table#test1").thenReturn(elements) + + self.assertEqual( + finder.find_by_content(browser, "test1", 'hi'), + elements[1]) + + verify(browser).find_elements_by_css_selector("table#test1") + + def test_find_with_null_content_constraint(self): + finder = TableElementFinder() + browser = mock() + elements = self._make_mock_elements('td', 'td', 'td') + elements[1].text = 'hi' + when(browser).find_elements_by_css_selector("table#test1").thenReturn(elements) + + self.assertEqual( + finder.find_by_content(browser, "test1", None), + elements[0]) + + verify(browser).find_elements_by_css_selector("table#test1") + + def test_find_by_content_with_css_locator(self): + finder = TableElementFinder() + browser = mock() + when(browser).find_elements_by_css_selector("table#test1").thenReturn([]) + + finder.find_by_content(browser, "css=table#test1", 'hi') + + verify(browser).find_elements_by_css_selector("table#test1") + + def test_find_by_content_with_xpath_locator(self): + finder = TableElementFinder() + browser = mock() + when(browser).find_elements_by_xpath("//table[@id='test1']//*").thenReturn([]) + + finder.find_by_content(browser, "xpath=//table[@id='test1']", 'hi') + + verify(browser).find_elements_by_xpath("//table[@id='test1']//*") + + def test_find_by_header_with_css_locator(self): + finder = TableElementFinder() + browser = mock() + when(browser).find_elements_by_css_selector("table#test1 th").thenReturn([]) + + finder.find_by_header(browser, "css=table#test1", 'hi') + + verify(browser).find_elements_by_css_selector("table#test1 th") + + def test_find_by_header_with_xpath_locator(self): + finder = TableElementFinder() + browser = mock() + when(browser).find_elements_by_xpath("//table[@id='test1']//th").thenReturn([]) + + finder.find_by_header(browser, "xpath=//table[@id='test1']", 'hi') + + verify(browser).find_elements_by_xpath("//table[@id='test1']//th") + + def test_find_by_footer_with_css_locator(self): + finder = TableElementFinder() + browser = mock() + when(browser).find_elements_by_css_selector("table#test1 tfoot td").thenReturn([]) + + finder.find_by_footer(browser, "css=table#test1", 'hi') + + verify(browser).find_elements_by_css_selector("table#test1 tfoot td") + + def test_find_by_footer_with_xpath_locator(self): + finder = TableElementFinder() + browser = mock() + when(browser).find_elements_by_xpath("//table[@id='test1']//tfoot//td").thenReturn([]) + + finder.find_by_footer(browser, "xpath=//table[@id='test1']", 'hi') + + verify(browser).find_elements_by_xpath("//table[@id='test1']//tfoot//td") + + def test_find_by_row_with_css_locator(self): + finder = TableElementFinder() + browser = mock() + when(browser).find_elements_by_css_selector("table#test1 tr:nth-child(2)").thenReturn([]) + + finder.find_by_row(browser, "css=table#test1", 2, 'hi') + + verify(browser).find_elements_by_css_selector("table#test1 tr:nth-child(2)") + + def test_find_by_row_with_xpath_locator(self): + finder = TableElementFinder() + browser = mock() + when(browser).find_elements_by_xpath("//table[@id='test1']//tr[2]//*").thenReturn([]) + + finder.find_by_row(browser, "xpath=//table[@id='test1']", 2, 'hi') + + verify(browser).find_elements_by_xpath("//table[@id='test1']//tr[2]//*") + + def test_find_by_col_with_css_locator(self): + finder = TableElementFinder() + browser = mock() + when(browser).find_elements_by_css_selector("table#test1 tr td:nth-child(2)").thenReturn([]) + when(browser).find_elements_by_css_selector("table#test1 tr th:nth-child(2)").thenReturn([]) + + finder.find_by_col(browser, "css=table#test1", 2, 'hi') + + verify(browser).find_elements_by_css_selector("table#test1 tr td:nth-child(2)") + verify(browser).find_elements_by_css_selector("table#test1 tr th:nth-child(2)") + + def test_find_by_col_with_xpath_locator(self): + finder = TableElementFinder() + browser = mock() + when(browser).find_elements_by_xpath("//table[@id='test1']//tr//*[self::td or self::th][2]").thenReturn([]) + + finder.find_by_col(browser, "xpath=//table[@id='test1']", 2, 'hi') + + verify(browser).find_elements_by_xpath("//table[@id='test1']//tr//*[self::td or self::th][2]") + + def _make_mock_elements(self, *tags): + elements = [] + for tag in tags: + element = self._make_mock_element(tag) + elements.append(element) + return elements + + def _make_mock_element(self, tag): + element = mock() + element.tag_name = tag + element.attributes = {} + element.text = None + + def set_attribute(name, value): + element.attributes[name] = value + element.set_attribute = set_attribute + + def get_attribute(name): + return element.attributes[name] + element.get_attribute = get_attribute + + return element diff --git a/test/unit/locators/test_windowmanager.py b/test/unit/locators/test_windowmanager.py index 2b7b6df54..7858343a2 100644 --- a/test/unit/locators/test_windowmanager.py +++ b/test/unit/locators/test_windowmanager.py @@ -1,279 +1,318 @@ -import unittest +import unittest import os -from Selenium2Library.locators import WindowManager -from mockito import * +from Selenium2Library.locators import WindowManager +from mockito import * import uuid -from selenium.common.exceptions import NoSuchWindowException - -class WindowManagerTests(unittest.TestCase): - - def test_select_with_invalid_prefix(self): - manager = WindowManager() - browser = mock() - with self.assertRaises(ValueError) as context: - manager.select(browser, "something=test1") - self.assertEqual(context.exception.message, "Window locator with prefix 'something' is not supported") - - def test_select_with_null_browser(self): - manager = WindowManager() - with self.assertRaises(AssertionError): - manager.select(None, "name=test1") - - def test_select_by_title(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, - { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) - - manager.select(browser, "title=Title 2") - self.assertEqual(browser.current_window.name, 'win2') - - def test_select_by_title_sloppy_match(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, - { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) - - manager.select(browser, "title= tItLe 2 ") - self.assertEqual(browser.current_window.name, 'win2') - - def test_select_by_title_with_multiple_matches(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2a', 'title': "Title 2", 'url': 'http://localhost/page2a.html' }, - { 'name': 'win2b', 'title': "Title 2", 'url': 'http://localhost/page2b.html' }) - - manager.select(browser, "title=Title 2") - self.assertEqual(browser.current_window.name, 'win2a') - - def test_select_by_title_no_match(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, - { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) - - with self.assertRaises(ValueError) as context: - manager.select(browser, "title=Title -1") - self.assertEqual(context.exception.message, "Unable to locate window with title 'Title -1'") - - def test_select_by_name(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, - { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) - - manager.select(browser, "name=win2") - self.assertEqual(browser.current_window.name, 'win2') - - def test_select_by_name_sloppy_match(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, - { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) - - manager.select(browser, "name= win2 ") - self.assertEqual(browser.current_window.name, 'win2') - - def test_select_by_name_with_bad_case(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, - { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) - - with self.assertRaises(ValueError) as context: - manager.select(browser, "name=Win2") - self.assertEqual(context.exception.message, "Unable to locate window with name 'Win2'") - - def test_select_by_name_no_match(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, - { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) - - with self.assertRaises(ValueError) as context: - manager.select(browser, "name=win-1") - self.assertEqual(context.exception.message, "Unable to locate window with name 'win-1'") - - def test_select_by_url(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, - { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) - - manager.select(browser, "url=http://localhost/page2.html") - self.assertEqual(browser.current_window.name, 'win2') - - def test_select_by_url_sloppy_match(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, - { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) - - manager.select(browser, "url= http://LOCALHOST/page2.html ") - self.assertEqual(browser.current_window.name, 'win2') - - def test_select_by_url_with_multiple_matches(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2a', 'title': "Title 2a", 'url': 'http://localhost/page2.html' }, - { 'name': 'win2b', 'title': "Title 2b", 'url': 'http://localhost/page2.html' }) - - manager.select(browser, "url=http://localhost/page2.html") - self.assertEqual(browser.current_window.name, 'win2a') - - def test_select_by_url_no_match(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, - { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) - - with self.assertRaises(ValueError) as context: - manager.select(browser, "url=http://localhost/page-1.html") - self.assertEqual(context.exception.message, "Unable to locate window with URL 'http://localhost/page-1.html'") - - def test_select_with_null_locator(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, - { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) - - manager.select(browser, "name=win2") - self.assertEqual(browser.current_window.name, 'win2') - manager.select(browser, None) - self.assertEqual(browser.current_window.name, 'win1') - - def test_select_with_null_string_locator(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, - { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) - - manager.select(browser, "name=win2") - self.assertEqual(browser.current_window.name, 'win2') - manager.select(browser, "null") - self.assertEqual(browser.current_window.name, 'win1') - - def test_select_with_empty_locator(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, - { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) - - manager.select(browser, "name=win2") - self.assertEqual(browser.current_window.name, 'win2') - manager.select(browser, "") - self.assertEqual(browser.current_window.name, 'win1') - - def test_select_by_default_with_name(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, - { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) - - manager.select(browser, "win2") - self.assertEqual(browser.current_window.name, 'win2') - - def test_select_by_default_with_title(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, - { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) - - manager.select(browser, "Title 2") - self.assertEqual(browser.current_window.name, 'win2') - - def test_select_by_default_no_match(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, - { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) - - with self.assertRaises(ValueError) as context: - manager.select(browser, "win-1") - self.assertEqual(context.exception.message, "Unable to locate window with name or title 'win-1'") - - def test_select_with_sloppy_prefix(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, - { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) - - manager.select(browser, "name=win2") - self.assertEqual(browser.current_window.name, 'win2') - manager.select(browser, "nAmE=win2") - self.assertEqual(browser.current_window.name, 'win2') - manager.select(browser, " name =win2") - self.assertEqual(browser.current_window.name, 'win2') - - def test_get_window_handles(self): - manager = WindowManager() - browser = self._make_mock_browser( - { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, - { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, - { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) - - window_handles = manager.get_window_handles(browser) - self.assertEqual(len(window_handles), 3) - manager.select(browser, window_handles[1]) - self.assertEqual(browser.current_window.name, 'win2') - manager.select(browser, window_handles[2]) - self.assertEqual(browser.current_window.name, 'win3') - manager.select(browser, window_handles[0]) - self.assertEqual(browser.current_window.name, 'win1') - - def _make_mock_browser(self, *window_specs): - browser = mock() - - windows = [] - window_handles = [] - first_window = None - for window_spec in window_specs: - window = mock() - window.handle = uuid.uuid4().hex - window.name = window_spec['name'] - window.title = window_spec['title'] - window.url = window_spec['url'] - - windows.append(window) - window_handles.append(window.handle) - - if first_window is None: - first_window = window - - def switch_to_window(handle_or_name): - if handle_or_name == '': - browser.current_window = first_window - return - for window in windows: - if window.handle == handle_or_name or window.name == handle_or_name: - browser.current_window = window - return - raise NoSuchWindowException(u'Unable to locate window "' + handle_or_name + '"') - - browser.current_window = first_window - browser.get_current_window_handle = lambda: browser.current_window.handle - browser.get_title = lambda: browser.current_window.title - browser.get_current_url = lambda: browser.current_window.url - browser.get_window_handles = lambda: window_handles - browser.switch_to_window = switch_to_window - - return browser +from selenium.common.exceptions import NoSuchWindowException + +class WindowManagerTests(unittest.TestCase): + + def test_select_with_invalid_prefix(self): + manager = WindowManager() + browser = mock() + try: + self.assertRaises(ValueError, manager.select, browser, "something=test1") + except ValueError as e: + self.assertEqual(e.message, "Window locator with prefix 'something' is not supported") + + def test_select_with_null_browser(self): + manager = WindowManager() + self.assertRaises(AssertionError, + manager.select, None, "name=test1") + + def test_select_by_title(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + manager.select(browser, "title=Title 2") + self.assertEqual(browser.current_window.name, 'win2') + + def test_select_by_title_sloppy_match(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + manager.select(browser, "title= tItLe 2 ") + self.assertEqual(browser.current_window.name, 'win2') + + def test_select_by_title_with_multiple_matches(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2a', 'title': "Title 2", 'url': 'http://localhost/page2a.html' }, + { 'name': 'win2b', 'title': "Title 2", 'url': 'http://localhost/page2b.html' }) + + manager.select(browser, "title=Title 2") + self.assertEqual(browser.current_window.name, 'win2a') + + def test_select_by_title_no_match(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + try: + self.assertRaises(ValueError, manager.select, browser, "title=Title -1") + except ValueError as e: + self.assertEqual(e.message, "Unable to locate window with title 'Title -1'") + + def test_select_by_name(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + manager.select(browser, "name=win2") + self.assertEqual(browser.current_window.name, 'win2') + + def test_select_by_name_sloppy_match(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + manager.select(browser, "name= win2 ") + self.assertEqual(browser.current_window.name, 'win2') + + def test_select_by_name_with_bad_case(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + manager.select(browser, "name=Win2") + self.assertEqual(browser.current_window.name, 'win2') + + def test_select_by_name_no_match(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + try: + self.assertRaises(ValueError, manager.select, browser, "name=win-1") + except ValueError as e: + self.assertEqual(e.message, "Unable to locate window with name 'win-1'") + + def test_select_by_url(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + manager.select(browser, "url=http://localhost/page2.html") + self.assertEqual(browser.current_window.name, 'win2') + + def test_select_by_url_sloppy_match(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + manager.select(browser, "url= http://LOCALHOST/page2.html ") + self.assertEqual(browser.current_window.name, 'win2') + + def test_select_by_url_with_multiple_matches(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2a', 'title': "Title 2a", 'url': 'http://localhost/page2.html' }, + { 'name': 'win2b', 'title': "Title 2b", 'url': 'http://localhost/page2.html' }) + + manager.select(browser, "url=http://localhost/page2.html") + self.assertEqual(browser.current_window.name, 'win2a') + + def test_select_by_url_no_match(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + try: + self.assertRaises(ValueError, manager.select, browser, "url=http://localhost/page-1.html") + except ValueError as e: + self.assertEqual(e.message, "Unable to locate window with URL 'http://localhost/page-1.html'") + + def test_select_with_null_locator(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + manager.select(browser, "name=win2") + self.assertEqual(browser.current_window.name, 'win2') + manager.select(browser, None) + self.assertEqual(browser.current_window.name, 'win1') + + def test_select_with_null_string_locator(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + manager.select(browser, "name=win2") + self.assertEqual(browser.current_window.name, 'win2') + manager.select(browser, "null") + self.assertEqual(browser.current_window.name, 'win1') + + def test_select_with_empty_locator(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + manager.select(browser, "name=win2") + self.assertEqual(browser.current_window.name, 'win2') + manager.select(browser, "") + self.assertEqual(browser.current_window.name, 'win1') + + def test_select_with_main_constant_locator(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + manager.select(browser, "name=win2") + self.assertEqual(browser.current_window.name, 'win2') + manager.select(browser, "main") + self.assertEqual(browser.current_window.name, 'win1') + + def test_select_by_default_with_name(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + manager.select(browser, "win2") + self.assertEqual(browser.current_window.name, 'win2') + + def test_select_by_default_with_title(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + manager.select(browser, "Title 2") + self.assertEqual(browser.current_window.name, 'win2') + + def test_select_by_default_no_match(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + try: + self.assertRaises(ValueError, manager.select, browser, "win-1") + except ValueError as e: + self.assertEqual(context.exception.message, "Unable to locate window with name or title 'win-1'") + + def test_select_with_sloppy_prefix(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + manager.select(browser, "name=win2") + self.assertEqual(browser.current_window.name, 'win2') + manager.select(browser, "nAmE=win2") + self.assertEqual(browser.current_window.name, 'win2') + manager.select(browser, " name =win2") + self.assertEqual(browser.current_window.name, 'win2') + + def test_get_window_ids(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'id': 'win1', 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'id': 'win2', 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + self.assertEqual( + manager.get_window_ids(browser), + [ 'win1', 'win2', 'undefined' ]) + + def test_get_window_names(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + self.assertEqual( + manager.get_window_names(browser), + [ 'win1', 'win2', 'win3' ]) + + def test_get_window_titles(self): + manager = WindowManager() + browser = self._make_mock_browser( + { 'name': 'win1', 'title': "Title 1", 'url': 'http://localhost/page1.html' }, + { 'name': 'win2', 'title': "Title 2", 'url': 'http://localhost/page2.html' }, + { 'name': 'win3', 'title': "Title 3", 'url': 'http://localhost/page3.html' }) + + self.assertEqual( + manager.get_window_titles(browser), + [ 'Title 1', 'Title 2', 'Title 3' ]) + + def _make_mock_browser(self, *window_specs): + browser = mock() + + windows = [] + window_handles = [] + first_window = None + for window_spec in window_specs: + window = mock() + window.handle = uuid.uuid4().hex + window.id = window_spec.get('id') + if window.id is None: + window.id = 'undefined' + window.name = window_spec['name'] + window.title = window_spec['title'] + window.url = window_spec['url'] + + windows.append(window) + window_handles.append(window.handle) + + if first_window is None: + first_window = window + + def switch_to_window(handle_or_name): + if handle_or_name == '': + browser.current_window = first_window + return + for window in windows: + if window.handle == handle_or_name or window.name == handle_or_name: + browser.current_window = window + return + raise NoSuchWindowException(u'Unable to locate window "' + handle_or_name + '"') + + browser.current_window = first_window + browser.get_current_window_handle = lambda: browser.current_window.handle + browser.get_title = lambda: browser.current_window.title + browser.get_current_url = lambda: browser.current_window.url + browser.get_window_handles = lambda: window_handles + browser.switch_to_window = switch_to_window + browser.get_current_window_info = lambda: ( + browser.current_window.handle, browser.current_window.id, browser.current_window.name, + browser.current_window.title, browser.current_window.url) + + return browser diff --git a/test/unit/utils/test_browsercache.py b/test/unit/utils/test_browsercache.py index afa7de511..50abcbd7b 100644 --- a/test/unit/utils/test_browsercache.py +++ b/test/unit/utils/test_browsercache.py @@ -1,79 +1,80 @@ -import unittest +import unittest import os -from Selenium2Library.utils import BrowserCache -from mockito import * - -class BrowserCacheTests(unittest.TestCase): - - def test_no_current_message(self): - cache = BrowserCache() - with self.assertRaises(RuntimeError) as context: - cache.current.anyMember() - self.assertEqual(context.exception.message, "No current browser") - - def test_browsers_property(self): - cache = BrowserCache() - - browser1 = mock() - browser2 = mock() - browser3 = mock() - - cache.register(browser1) - cache.register(browser2) - cache.register(browser3) - - self.assertEqual(len(cache.browsers), 3) - self.assertEqual(cache.browsers[0], browser1) - self.assertEqual(cache.browsers[1], browser2) - self.assertEqual(cache.browsers[2], browser3) - - def test_get_open_browsers(self): - cache = BrowserCache() - - browser1 = mock() - browser2 = mock() - browser3 = mock() - - cache.register(browser1) - cache.register(browser2) - cache.register(browser3) - - browsers = cache.get_open_browsers() - self.assertEqual(len(browsers), 3) - self.assertEqual(browsers[0], browser1) - self.assertEqual(browsers[1], browser2) - self.assertEqual(browsers[2], browser3) - - cache.close() - browsers = cache.get_open_browsers() - self.assertEqual(len(browsers), 2) - self.assertEqual(browsers[0], browser1) - self.assertEqual(browsers[1], browser2) - - def test_close(self): - cache = BrowserCache() - browser = mock() - cache.register(browser) - - verify(browser, times=0).quit() # sanity check - cache.close() - verify(browser, times=1).quit() - - def test_close_only_called_once(self): - cache = BrowserCache() - - browser1 = mock() - browser2 = mock() - browser3 = mock() - - cache.register(browser1) - cache.register(browser2) - cache.register(browser3) - - cache.close() - verify(browser3, times=1).quit() - - cache.close_all() - verify(browser1, times=1).quit() - verify(browser2, times=1).quit() - verify(browser3, times=1).quit() +from Selenium2Library.utils import BrowserCache +from mockito import * + +class BrowserCacheTests(unittest.TestCase): + + def test_no_current_message(self): + cache = BrowserCache() + try: + self.assertRaises(RuntimeError, cache.current.anyMember()) + except RuntimeError as e: + self.assertEqual(e.message, "No current browser") + + def test_browsers_property(self): + cache = BrowserCache() + + browser1 = mock() + browser2 = mock() + browser3 = mock() + + cache.register(browser1) + cache.register(browser2) + cache.register(browser3) + + self.assertEqual(len(cache.browsers), 3) + self.assertEqual(cache.browsers[0], browser1) + self.assertEqual(cache.browsers[1], browser2) + self.assertEqual(cache.browsers[2], browser3) + + def test_get_open_browsers(self): + cache = BrowserCache() + + browser1 = mock() + browser2 = mock() + browser3 = mock() + + cache.register(browser1) + cache.register(browser2) + cache.register(browser3) + + browsers = cache.get_open_browsers() + self.assertEqual(len(browsers), 3) + self.assertEqual(browsers[0], browser1) + self.assertEqual(browsers[1], browser2) + self.assertEqual(browsers[2], browser3) + + cache.close() + browsers = cache.get_open_browsers() + self.assertEqual(len(browsers), 2) + self.assertEqual(browsers[0], browser1) + self.assertEqual(browsers[1], browser2) + + def test_close(self): + cache = BrowserCache() + browser = mock() + cache.register(browser) + + verify(browser, times=0).quit() # sanity check + cache.close() + verify(browser, times=1).quit() + + def test_close_only_called_once(self): + cache = BrowserCache() + + browser1 = mock() + browser2 = mock() + browser3 = mock() + + cache.register(browser1) + cache.register(browser2) + cache.register(browser3) + + cache.close() + verify(browser3, times=1).quit() + + cache.close_all() + verify(browser1, times=1).quit() + verify(browser2, times=1).quit() + verify(browser3, times=1).quit() diff --git a/test/unit/utils/test_package.py b/test/unit/utils/test_package.py index 4a4caa673..f3c10e5aa 100644 --- a/test/unit/utils/test_package.py +++ b/test/unit/utils/test_package.py @@ -1,19 +1,19 @@ -import unittest -from Selenium2Library import utils - -class UtilsPackageTests(unittest.TestCase): - - def test_escape_xpath_value_with_apos(self): - self.assertEqual( - utils.escape_xpath_value("test '1'"), - "\"test '1'\"") - - def test_escape_xpath_value_with_quote(self): - self.assertEqual( - utils.escape_xpath_value("test \"1\""), - "'test \"1\"'") - - def test_escape_xpath_value_with_quote_and_apos(self): - self.assertEqual( - utils.escape_xpath_value("test \"1\" and '2'"), - "concat('test \"1\" and ', \"'\", '2', \"'\", '')") +import unittest +from Selenium2Library import utils + +class UtilsPackageTests(unittest.TestCase): + + def test_escape_xpath_value_with_apos(self): + self.assertEqual( + utils.escape_xpath_value("test '1'"), + "\"test '1'\"") + + def test_escape_xpath_value_with_quote(self): + self.assertEqual( + utils.escape_xpath_value("test \"1\""), + "'test \"1\"'") + + def test_escape_xpath_value_with_quote_and_apos(self): + self.assertEqual( + utils.escape_xpath_value("test \"1\" and '2'"), + "concat('test \"1\" and ', \"'\", '2', \"'\", '')")