Permalink
Browse files

Initial import

  • Loading branch information...
0 parents commit 4ab16a8a3a7d7385c406d7807357b4e567905aea @yanne yanne committed Apr 19, 2010
Showing with 14,958 additions and 0 deletions.
  1. +15 −0 COPYRIGHT.txt
  2. +38 −0 INSTALL.txt
  3. +202 −0 LICENSE.txt
  4. +9 −0 MANIFEST.in
  5. +56 −0 README.txt
  6. +14 −0 SELENIUM_COPYRIGHT.txt
  7. +52 −0 demo/README.txt
  8. +5 −0 demo/httpserver/html/buggy_login.js
  9. +21 −0 demo/httpserver/html/demo.css
  10. +12 −0 demo/httpserver/html/error.html
  11. +42 −0 demo/httpserver/html/index.html
  12. +6 −0 demo/httpserver/html/login.js
  13. +6 −0 demo/httpserver/html/orig_login.js
  14. +6 −0 demo/httpserver/html/valid_login.js
  15. +12 −0 demo/httpserver/html/welcome.html
  16. +104 −0 demo/httpserver/httpserver.py
  17. +40 −0 demo/login_tests/invalid_login.txt
  18. +39 −0 demo/login_tests/resource.txt
  19. +18 −0 demo/login_tests/valid_login.txt
  20. +34 −0 demo/package.py
  21. +76 −0 demo/rundemo.py
  22. +1,411 −0 doc/SeleniumLibrary.html
  23. BIN selenium.bmp
  24. +20 −0 setup.cfg
  25. +41 −0 setup.py
  26. +19 −0 src/README.txt
  27. +728 −0 src/SeleniumLibrary/__init__.py
  28. +325 −0 src/SeleniumLibrary/assertion.py
  29. +108 −0 src/SeleniumLibrary/button.py
  30. +93 −0 src/SeleniumLibrary/click.py
  31. +61 −0 src/SeleniumLibrary/element.py
  32. +196 −0 src/SeleniumLibrary/javascript.py
  33. BIN src/SeleniumLibrary/lib/selenium-server.jar
  34. +87 −0 src/SeleniumLibrary/screenshot.py
  35. +149 −0 src/SeleniumLibrary/select.py
  36. +2,073 −0 src/SeleniumLibrary/selenium.py
  37. +70 −0 src/SeleniumLibrary/xpath.py
  38. +59 −0 test/README.txt
  39. +8 −0 test/acceptance/__init__.txt
  40. +9 −0 test/acceptance/keywords/__init__.txt
  41. +57 −0 test/acceptance/keywords/checkbox_and_radio_buttons.txt
  42. +187 −0 test/acceptance/keywords/content_assertions.txt
  43. +25 −0 test/acceptance/keywords/cookies.txt
  44. +30 −0 test/acceptance/keywords/elements.txt
  45. +61 −0 test/acceptance/keywords/forms_and_buttons.txt
  46. +20 −0 test/acceptance/keywords/frames.txt
  47. +79 −0 test/acceptance/keywords/javascript.txt
  48. +85 −0 test/acceptance/keywords/lists.txt
  49. +87 −0 test/acceptance/keywords/navigation.txt
  50. +32 −0 test/acceptance/keywords/screenshots.txt
  51. +27 −0 test/acceptance/keywords/selenium_api.txt
  52. +40 −0 test/acceptance/keywords/textfields.txt
  53. +2 −0 test/acceptance/keywords/variables.py
  54. +44 −0 test/acceptance/keywords/windows.txt
  55. +44 −0 test/acceptance/multiple_browsers.txt
  56. +13 −0 test/acceptance/open_and_close.txt
  57. +31 −0 test/acceptance/resource.txt
  58. +22 −0 test/resources/html/broken.html
  59. +14 −0 test/resources/html/forms/buttons.html
  60. +26 −0 test/resources/html/forms/email_form.html
  61. +11 −0 test/resources/html/forms/file_upload_form.html
  62. +20 −0 test/resources/html/forms/form_with_image_submit.html
  63. +65 −0 test/resources/html/forms/form_with_special_characters_in_field_names.html
  64. +15 −0 test/resources/html/forms/form_without_name.html
  65. +26 −0 test/resources/html/forms/login.html
  66. +26 −0 test/resources/html/forms/named_email_form.html
  67. +12 −0 test/resources/html/forms/named_submit_buttons.html
  68. +79 −0 test/resources/html/forms/prefilled_email_form.html
  69. BIN test/resources/html/forms/robot.bmp
  70. +8 −0 test/resources/html/forms/submit.html
  71. +5 −0 test/resources/html/frames/bar.html
  72. +5 −0 test/resources/html/frames/foo.html
  73. +6 −0 test/resources/html/frames/frameset.html
  74. +16 −0 test/resources/html/frames/left.html
  75. +5 −0 test/resources/html/frames/right.html
  76. +5 −0 test/resources/html/frames/search_results.html
  77. BIN test/resources/html/image.jpg
  78. +11 −0 test/resources/html/index.html
  79. +9 −0 test/resources/html/javascript/alert.html
  80. +44 −0 test/resources/html/javascript/context_menu.html
  81. +33 −0 test/resources/html/javascript/delayed_events.html
  82. +34 −0 test/resources/html/javascript/dynamic_content.html
  83. +13 −0 test/resources/html/javascript/dynamiclinks.html
  84. +14 −0 test/resources/html/javascript/functions.js
  85. +62 −0 test/resources/html/javascript/jquery.contextMenu.css
  86. +211 −0 test/resources/html/javascript/jquery.contextMenu.js
  87. +6,078 −0 test/resources/html/javascript/jquery.js
  88. +27 −0 test/resources/html/javascript/mouse_events.html
  89. +24 −0 test/resources/html/javascript/popupwindow.html
  90. +55 −0 test/resources/html/javascript/script_block_contains_html_tags.html
  91. +29 −0 test/resources/html/javascript/security_alert.html
  92. +37 −0 test/resources/html/links.html
  93. +21 −0 test/resources/html/nested_divs.html
  94. BIN test/resources/html/robot.png
  95. +7 −0 test/resources/html/sub/index.html
  96. +22 −0 test/resources/html/tables/links.html
  97. +8 −0 test/resources/html/target/first.html
  98. +8 −0 test/resources/html/target/second.html
  99. +8 −0 test/resources/html/target/third.html
  100. +186 −0 test/resources/statuschecker.py
  101. +186 −0 test/resources/statuschecker/statuschecker.py
  102. +106 −0 test/resources/testserver/testserver.py
  103. +113 −0 test/run_tests.py
  104. +32 −0 test/run_unit_tests.py
  105. +32 −0 test/unit/test_seleniumlibrary.py
  106. +54 −0 test/unit/test_xpath_converter.py
@@ -0,0 +1,15 @@
+# Copyright 2008-2009 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.
+
+
@@ -0,0 +1,38 @@
+=============================
+Selenium Library Installation
+=============================
+
+Selenium Library distribution contains the actual library code, Selenium
+server as a JAR package and Selenium Python bindings.
+
+Preconditions
+-------------
+
+Selenium tool requires Java runtime version 1.5 or newer.
+
+Selenium Library 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/SeleniumLibrary`.
+
+Using Windows installer
+-----------------------
+
+Currently, Windows installer is the only available binary installer. It is
+enough to double-click the installer and follow the instructions.
+
+Selenium Library can be uninstalled using Add/Remove Programs utility from
+Control Panel.
@@ -0,0 +1,202 @@
+
+ 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 [yyyy] [name of copyright owner]
+
+ 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.
@@ -0,0 +1,9 @@
+include MANIFEST.in
+include *.txt
+include selenium.bmp
+
+include src/SeleniumLibrary/lib/*.jar
+
+recursive-include doc *.txt *.html
+recursive-include demo *.txt *.py *.sh *.bat *.html *.css *.js
+
@@ -0,0 +1,56 @@
+Selenium test library for Robot Framework
+=========================================
+
+Introduction
+------------
+
+SeleniumLibrary is a test library for Robot Framework that enables testing
+of web applications. As the name suggests, it uses Selenium_ via Selenium-RC_
+internally. Currently, not all features of Selenium are implemented in
+SeleniumLibrary, but most of them are quite trivial to implement when someone
+needs them.
+
+
+Usage
+-----
+
+To run tests with Robot Framework and SeleniumLibrary following things
+must be done
+
+- SeleniumLibrary must be taken into use in Robot test data.
+ See `Robot Framework user guide`__ for more information.
+- Selenium server must be started with command
+ ``java -jar [path_to_server]/selenium_server.jar``,
+ where [path_to_server] depends on platform. On Windows it will be
+ '[PythonDir]\\Lib\\site-packages\\SeleniumLibrary\\lib' and on Linux it is
+ '/usr/lib/python[version]/site-packages/SeleniumLibrary/lib'
+
+
+__ http://code.google.com/p/robotframework/wiki/UserGuide
+
+
+Installation
+------------
+
+See INSTALLATION.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/
+ Acceptance tests for keywords using Robot Framework.
+
+
+.. _Selenium: http://selenium.openqa.org
+.. _Selenium-RC: http://selenium-rc.openqa.org
+
@@ -0,0 +1,14 @@
+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.
+
@@ -0,0 +1,52 @@
+SeleniumLibrary Demo
+====================
+
+Introduction
+------------
+
+This directory contains an easily executable demo test suite for Robot
+Framework using SeleniumLibrary. ``httpserver`` directory contains a simple
+standalone HTTP server and even simpler application that is used as a system
+under test in the demo. Actual test case files are under ``login_tests``
+directory. A script for running the tests is also provided.
+
+Running The Demo
+----------------
+
+The demo needs to be run from command line. You must specify which test case
+file is to be executed by giving the file as an argument. To run all the
+tests, the directory can be given as an argument. For example::
+
+ python rundemo.py login_tests
+
+executes all test cases and::
+
+ python rundemo.py login_tests/simple_login.html
+
+executes only the specified test case file.
+
+By default, the tests cases are run using Firefox browser, this can be changed
+by using variable `browser` from command line, for example::
+
+ python rundemo.py --variable browser:*iexplore
+
+runs the test cases using Internet Explorer. Please refer to library
+documentation for a list of supported browsers.
+
+It is possible to add a delay between each keyword by giving a non-zero value
+for variable `delay` from command line, for example::
+
+ python rundemo.py --variable delay:2 login_tests
+
+
+
+Structure of the test cases
+---------------------------
+
+A few useful features of Robot Framework are demonstrated through these test
+cases. First, the test cases `Valid Login`, `Higher level valid login`, `Even
+higher level valid login` and `Highest level valid login` show how to use user
+keywords to create essentially same test case in more abstract terms. Second,
+the test cases in `invalid_login.html` demonstrate the use of keywords to do
+data-driven testing.
+
@@ -0,0 +1,5 @@
+// Buggy login function that leaves everyone in with an empty password
+
+function login(username, password) {
+ return password == ''
+}
Oops, something went wrong.

0 comments on commit 4ab16a8

Please sign in to comment.