browsercms 3.1.5 → 3.3.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/cms/base_controller.rb +3 -3
- data/app/controllers/cms/content_block_controller.rb +2 -2
- data/app/controllers/cms/content_controller.rb +5 -4
- data/app/controllers/cms/error_handling.rb +1 -1
- data/app/controllers/cms/routes_controller.rb +4 -5
- data/app/controllers/cms/section_nodes_controller.rb +1 -6
- data/app/controllers/cms/sections_controller.rb +2 -3
- data/app/controllers/cms/tasks_controller.rb +3 -0
- data/app/controllers/cms/users_controller.rb +1 -1
- data/app/helpers/cms/application_helper.rb +137 -34
- data/app/helpers/cms/form_builder.rb +33 -21
- data/app/helpers/cms/page_helper.rb +43 -10
- data/app/helpers/cms/path_helper.rb +1 -1
- data/app/helpers/cms/rendering_helper.rb +3 -4
- data/app/helpers/cms/section_nodes_helper.rb +5 -43
- data/app/models/abstract_file_block.rb +1 -16
- data/app/models/attachment.rb +57 -22
- data/app/models/category.rb +4 -4
- data/app/models/category_type.rb +2 -2
- data/app/models/cms/view_context.rb +46 -0
- data/app/models/connector.rb +7 -6
- data/app/models/content_type.rb +3 -3
- data/app/models/dynamic_view.rb +1 -1
- data/app/models/email_message.rb +2 -2
- data/app/models/file_block.rb +12 -0
- data/app/models/group.rb +4 -4
- data/app/models/group_type.rb +4 -4
- data/app/models/html_block.rb +1 -1
- data/app/models/image_block.rb +12 -0
- data/app/models/link.rb +22 -5
- data/app/models/page.rb +87 -46
- data/app/models/page_route.rb +61 -6
- data/app/models/permission.rb +1 -1
- data/app/models/portlet.rb +14 -4
- data/app/models/section.rb +48 -86
- data/app/models/section_node.rb +25 -40
- data/app/models/site.rb +1 -1
- data/app/models/tag.rb +1 -1
- data/app/models/task.rb +8 -7
- data/app/models/user.rb +2 -7
- data/app/portlets/forgot_password_portlet.rb +6 -2
- data/app/portlets/reset_password_portlet.rb +1 -1
- data/app/views/cms/blocks/_toolbar.html.erb +1 -1
- data/app/views/cms/blocks/_toolbar_for_collection.html.erb +3 -6
- data/app/views/cms/blocks/_toolbar_for_member.html.erb +3 -5
- data/app/views/cms/blocks/edit.html.erb +4 -4
- data/app/views/cms/blocks/index.html.erb +7 -7
- data/app/views/cms/blocks/new.html.erb +4 -4
- data/app/views/cms/blocks/show.html.erb +2 -2
- data/app/views/cms/blocks/usages.html.erb +2 -2
- data/app/views/cms/blocks/versions.html.erb +4 -4
- data/app/views/cms/cache/show.html.erb +2 -2
- data/app/views/cms/categories/_form.html.erb +2 -2
- data/app/views/cms/connectors/new.html.erb +6 -8
- data/app/views/cms/content/no_page.html.erb +1 -1
- data/app/views/cms/content/show.html.erb +2 -7
- data/app/views/cms/dashboard/_page_drafts.html.erb +1 -1
- data/app/views/cms/dashboard/_tasks.html.erb +1 -1
- data/app/views/cms/dashboard/index.html.erb +1 -1
- data/app/views/cms/dynamic_views/_form.html.erb +2 -2
- data/app/views/cms/dynamic_views/index.html.erb +7 -10
- data/app/views/cms/email_messages/show.html.erb +2 -2
- data/app/views/cms/file_blocks/_form.html.erb +4 -4
- data/app/views/cms/form_builder/_cms_fancy_drop_down.html.erb +2 -2
- data/app/views/cms/form_builder/_cms_file_field.html.erb +2 -2
- data/app/views/cms/form_builder/_cms_tag_list.html.erb +2 -2
- data/app/views/cms/form_builder/_cms_text_editor.html.erb +2 -2
- data/app/views/cms/groups/_form.html.erb +5 -5
- data/app/views/cms/groups/_permissions.html.erb +4 -4
- data/app/views/cms/groups/_sections.html.erb +1 -2
- data/app/views/cms/groups/index.html.erb +1 -1
- data/app/views/cms/html_blocks/render.html.erb +1 -1
- data/app/views/cms/image_blocks/_form.html.erb +4 -5
- data/app/views/cms/links/_form.html.erb +1 -1
- data/app/views/cms/links/edit.html.erb +2 -2
- data/app/views/cms/links/new.html.erb +2 -2
- data/app/views/cms/page_routes/_form.html.erb +2 -2
- data/app/views/cms/page_routes/index.html.erb +6 -9
- data/app/views/cms/page_routes/show.html.erb +5 -8
- data/app/views/cms/pages/_edit_connector.html.erb +1 -1
- data/app/views/cms/pages/_form.html.erb +3 -3
- data/app/views/cms/pages/edit.html.erb +2 -2
- data/app/views/cms/pages/new.html.erb +7 -7
- data/app/views/cms/pages/versions.html.erb +4 -4
- data/app/views/cms/redirects/_form.html.erb +2 -2
- data/app/views/cms/redirects/index.html.erb +8 -7
- data/app/views/cms/routes/index.html.erb +2 -2
- data/app/views/cms/section_nodes/_link.html.erb +3 -6
- data/app/views/cms/section_nodes/_node.html.erb +4 -13
- data/app/views/cms/section_nodes/_page.html.erb +7 -13
- data/app/views/cms/section_nodes/_section.html.erb +8 -24
- data/app/views/cms/section_nodes/_section_node.html.erb +10 -0
- data/app/views/cms/section_nodes/index.html.erb +18 -30
- data/app/views/cms/sections/_form.html.erb +4 -6
- data/app/views/cms/sections/edit.html.erb +2 -2
- data/app/views/cms/sections/index.html.erb +3 -3
- data/app/views/cms/sections/new.html.erb +3 -3
- data/app/views/cms/sessions/new.html.erb +3 -3
- data/app/views/cms/shared/_pagination.html.erb +1 -1
- data/app/views/cms/shared/error.html.erb +1 -1
- data/app/views/cms/tags/render.html.erb +2 -2
- data/app/views/cms/tasks/new.html.erb +4 -4
- data/app/views/cms/users/_form.html.erb +3 -3
- data/app/views/cms/users/_toolbar.html.erb +3 -3
- data/app/views/cms/users/change_password.html.erb +5 -5
- data/app/views/cms/users/edit.html.erb +2 -2
- data/app/views/cms/users/index.html.erb +4 -4
- data/app/views/cms/users/new.html.erb +2 -2
- data/app/views/cms/users/show.html.erb +16 -16
- data/app/views/layouts/_cms_toolbar.html.erb +5 -5
- data/app/views/layouts/_page_toolbar.html.erb +11 -11
- data/app/views/layouts/cms/_footer.erb +1 -1
- data/app/views/layouts/cms/_head.html.erb +2 -6
- data/app/views/layouts/cms/administration.html.erb +32 -32
- data/app/views/layouts/cms/content_library.html.erb +5 -5
- data/app/views/layouts/cms/toolbar.html.erb +1 -1
- data/app/views/portlets/email_page/render.html.erb +2 -2
- data/app/views/portlets/forgot_password/render.html.erb +1 -1
- data/app/views/portlets/login/render.html.erb +4 -2
- data/app/views/portlets/reset_password/render.html.erb +1 -1
- data/app/views/tests/pretend/open_with_layout.html.erb +1 -1
- data/bin/bcms +0 -0
- data/bin/bcms-upgrade +232 -0
- data/bin/browsercms +2 -2
- data/browsercms.gemspec +16 -14
- data/db/migrate/20100705083859_browsercms_3_3_0.rb +56 -0
- data/db/seeds.rb +58 -0
- data/doc/guides/html/authentication.html +448 -192
- data/doc/guides/html/build_it_yourself.html +454 -175
- data/doc/guides/html/building_modules.html +451 -220
- data/doc/guides/html/building_templates.html +448 -498
- data/doc/guides/html/content_blocks.html +450 -470
- data/doc/guides/html/customizing_browsercms.html +453 -169
- data/doc/guides/html/deployment_guide.html +443 -82
- data/doc/guides/html/files/bcmsorg.js +28 -0
- data/doc/guides/html/files/clearfix.css +8 -0
- data/doc/guides/html/files/cufon.js +7 -0
- data/doc/guides/html/files/global.css +190 -0
- data/doc/guides/html/files/helvetica.js +91 -0
- data/doc/guides/html/files/jquery.js +11 -0
- data/doc/guides/html/getting_started.html +454 -213
- data/doc/guides/html/index.html +454 -174
- data/doc/guides/html/installing_modules.html +454 -186
- data/doc/guides/html/portlets.html +451 -232
- data/doc/guides/html/user_guide.html +452 -270
- data/doc/guides/html/writing_guides.html +454 -161
- data/lib/acts_as_list.rb +1 -1
- data/lib/browsercms.rb +10 -6
- data/lib/cms/acts.rb +7 -0
- data/lib/cms/authentication.rb +4 -0
- data/lib/cms/authentication/controller.rb +1 -1
- data/lib/cms/behaviors.rb +1 -1
- data/lib/cms/behaviors/archiving.rb +2 -2
- data/lib/cms/behaviors/attaching.rb +28 -43
- data/lib/cms/behaviors/categorizing.rb +1 -1
- data/lib/cms/behaviors/connecting.rb +27 -12
- data/lib/cms/behaviors/dynamic_attributes.rb +8 -5
- data/lib/cms/behaviors/hiding.rb +2 -2
- data/lib/cms/behaviors/publishing.rb +32 -22
- data/lib/cms/behaviors/rendering.rb +41 -18
- data/lib/cms/behaviors/searching.rb +1 -1
- data/lib/cms/behaviors/soft_deleting.rb +58 -29
- data/lib/cms/behaviors/taggable.rb +1 -1
- data/lib/cms/behaviors/userstamping.rb +5 -4
- data/lib/cms/behaviors/versioning.rb +192 -111
- data/lib/cms/content_rendering_support.rb +3 -3
- data/lib/cms/date_picker.rb +23 -0
- data/lib/cms/engine.rb +46 -0
- data/lib/cms/extensions.rb +1 -1
- data/lib/cms/extensions/active_record/errors.rb +2 -2
- data/lib/cms/extensions/hash.rb +4 -2
- data/lib/cms/extensions/string.rb +7 -2
- data/lib/cms/init.rb +32 -21
- data/lib/cms/module.rb +22 -0
- data/lib/cms/module_installation.rb +38 -0
- data/lib/cms/routes.rb +127 -115
- data/lib/cms/version.rb +2 -2
- data/lib/generators/browser_cms.rb +12 -0
- data/lib/generators/browser_cms/cms/USAGE +2 -0
- data/lib/generators/browser_cms/cms/cms_generator.rb +36 -0
- data/{rails_generators/browser_cms → lib/generators/browser_cms/cms}/templates/README +0 -0
- data/{rails_generators/browser_cms_demo_site → lib/generators/browser_cms/demo_site}/USAGE +0 -0
- data/lib/generators/browser_cms/demo_site/demo_site_generator.rb +138 -0
- data/lib/generators/browser_cms/demo_site/templates/demo_site.rake +11 -0
- data/{rails_generators/browser_cms_demo_site/templates/migration.rb → lib/generators/browser_cms/demo_site/templates/migration.erb} +2 -8
- data/lib/generators/cms/content_block/USAGE +22 -0
- data/lib/generators/cms/content_block/content_block_generator.rb +55 -0
- data/{rails_generators → lib/generators/cms}/content_block/templates/_form.html.erb +0 -0
- data/{rails_generators → lib/generators/cms}/content_block/templates/content_block.rb +0 -0
- data/{rails_generators → lib/generators/cms}/content_block/templates/controller.rb +0 -0
- data/{rails_generators → lib/generators/cms}/content_block/templates/functional_test.erb +0 -0
- data/{rails_generators/content_block/templates/migration.rb → lib/generators/cms/content_block/templates/migration.erb} +1 -1
- data/{rails_generators → lib/generators/cms}/content_block/templates/render.html.erb +0 -0
- data/{rails_generators → lib/generators/cms}/content_block/templates/unit_test.erb +0 -0
- data/lib/generators/cms/install/USAGE +8 -0
- data/lib/generators/cms/install/install_generator.rb +20 -0
- data/{rails_generators → lib/generators/cms}/portlet/USAGE +3 -16
- data/lib/generators/cms/portlet/portlet_generator.rb +38 -0
- data/{rails_generators → lib/generators/cms}/portlet/templates/_form.html.erb +0 -0
- data/{rails_generators → lib/generators/cms}/portlet/templates/portlet.rb +0 -0
- data/{rails_generators → lib/generators/cms}/portlet/templates/portlet_helper.rb +0 -0
- data/{rails_generators → lib/generators/cms}/portlet/templates/render.html.erb +0 -0
- data/{rails_generators → lib/generators/cms}/portlet/templates/unit_test.erb +0 -0
- data/{rails_generators → lib/generators/cms}/template/USAGE +1 -1
- data/lib/generators/cms/template/template_generator.rb +18 -0
- data/lib/generators/cms/template/templates/template.erb +2 -0
- data/lib/generators/cms/upgrade_module/README.txt +3 -0
- data/lib/generators/cms/upgrade_module/templates/20100705083859_browsercms_3_3_0.rb +56 -0
- data/lib/generators/cms/upgrade_module/templates/README +1 -0
- data/lib/generators/cms/upgrade_module/templates/USAGE.erb +10 -0
- data/lib/generators/cms/upgrade_module/templates/build_gem.rake +5 -0
- data/lib/generators/cms/upgrade_module/templates/engine.erb +7 -0
- data/lib/generators/cms/upgrade_module/templates/gemspec.erb +25 -0
- data/lib/generators/cms/upgrade_module/templates/gitignore.erb +11 -0
- data/lib/generators/cms/upgrade_module/templates/install.erb +9 -0
- data/lib/generators/cms/upgrade_module/templates/module_file.erb +3 -0
- data/lib/generators/cms/upgrade_module/templates/routes.erb +7 -0
- data/lib/generators/cms/upgrade_module/upgrade_module_generator.rb +61 -0
- data/lib/tasks/build_gem.rake +1 -0
- data/lib/tasks/cms.rake +34 -6
- data/lib/tasks/cucumber.rake +53 -0
- data/lib/tasks/db.rake +2 -2
- data/public/javascripts/cms/application.js +144 -135
- data/public/javascripts/cms/sitemap.js +383 -357
- data/public/javascripts/jquery-ui.js +782 -591
- data/public/javascripts/jquery.cookie.js +38 -43
- data/public/javascripts/jquery.js +13 -8
- data/public/javascripts/jquery.taglist.js +7 -0
- data/public/stylesheets/cms/date_picker.css +49 -40
- data/rails/init.rb +2 -3
- data/templates/blank.rb +13 -7
- data/templates/demo.rb +15 -7
- data/templates/module.rb +12 -75
- metadata +87 -407
- data/app/helpers/cms/content_block_helper.rb +0 -27
- data/app/views/layouts/cms/thickbox.html.erb +0 -24
- data/db/migrate/20120117144039_browsercms315.rb +0 -94
- data/db/migrate/20121114172307_load_seeds.rb +0 -70
- data/lib/cms/addressable.rb +0 -83
- data/lib/cms/error_pages.rb +0 -8
- data/public/images/cms/thickbox/loadingAnimation.gif +0 -0
- data/public/images/cms/thickbox/macFFBgHack.png +0 -0
- data/public/javascripts/jquery.contextMenu.js +0 -211
- data/public/javascripts/jquery.dimensions.js +0 -119
- data/public/javascripts/jquery.thickbox.js +0 -10
- data/public/stylesheets/cms/jquery.contextMenu.css +0 -61
- data/public/stylesheets/cms/thickbox.css +0 -163
- data/rails_generators/browser_cms/USAGE +0 -2
- data/rails_generators/browser_cms/browser_cms_generator.rb +0 -35
- data/rails_generators/browser_cms_demo_site/browser_cms_demo_site_generator.rb +0 -63
- data/rails_generators/content_block/USAGE +0 -32
- data/rails_generators/content_block/content_block_generator.rb +0 -69
- data/rails_generators/portlet/portlet_generator.rb +0 -35
- data/rails_generators/template/template_generator.rb +0 -18
- data/rails_generators/template/templates/template.erb +0 -3
- data/test/custom_assertions.rb +0 -74
- data/test/factories.rb +0 -111
- data/test/factories/sitemap_factories.rb +0 -28
- data/test/fixtures/connectors.yml +0 -97
- data/test/fixtures/content_type_groups.yml +0 -13
- data/test/fixtures/content_types.yml +0 -50
- data/test/fixtures/dynamic_view_versions.yml +0 -26
- data/test/fixtures/dynamic_views.yml +0 -26
- data/test/fixtures/group_permissions.yml +0 -16
- data/test/fixtures/group_sections.yml +0 -31
- data/test/fixtures/group_type_permissions.yml +0 -11
- data/test/fixtures/group_types.yml +0 -25
- data/test/fixtures/groups.yml +0 -25
- data/test/fixtures/html_block_versions.yml +0 -67
- data/test/fixtures/html_blocks.yml +0 -63
- data/test/fixtures/page_versions.yml +0 -265
- data/test/fixtures/pages.yml +0 -85
- data/test/fixtures/permissions.yml +0 -28
- data/test/fixtures/section_nodes.yml +0 -46
- data/test/fixtures/sections.yml +0 -19
- data/test/fixtures/sites.yml +0 -9
- data/test/fixtures/user_group_memberships.yml +0 -11
- data/test/fixtures/users.yml +0 -15
- data/test/functional/cms/cache_controller_test.rb +0 -14
- data/test/functional/cms/categories_controller_test.rb +0 -25
- data/test/functional/cms/connectors_controller_test.rb +0 -60
- data/test/functional/cms/content_block_controller_test.rb +0 -120
- data/test/functional/cms/content_controller_test.rb +0 -439
- data/test/functional/cms/content_types_controller_test.rb +0 -18
- data/test/functional/cms/dashboard_controller_test.rb +0 -16
- data/test/functional/cms/dynamic_views_controller_test.rb +0 -52
- data/test/functional/cms/file_blocks_controller_test.rb +0 -52
- data/test/functional/cms/groups_controller_test.rb +0 -50
- data/test/functional/cms/home_controller_test.rb +0 -156
- data/test/functional/cms/html_blocks_controller_test.rb +0 -164
- data/test/functional/cms/image_blocks_controller_test.rb +0 -82
- data/test/functional/cms/links_controller_test.rb +0 -148
- data/test/functional/cms/pages_controller_test.rb +0 -227
- data/test/functional/cms/portlets_controller_test.rb +0 -67
- data/test/functional/cms/section_nodes_controller_test.rb +0 -112
- data/test/functional/cms/sections_controller_test.rb +0 -227
- data/test/functional/cms/sessions_controller_test.rb +0 -76
- data/test/functional/cms/toolbar_controller_test.rb +0 -64
- data/test/functional/cms/users_controller_test.rb +0 -231
- data/test/functional/tests/pretend_controller_test.rb +0 -57
- data/test/integration/cms/ckeditor_test.rb +0 -30
- data/test/integration/cms/password_management_test.rb +0 -56
- data/test/integration/login_test.rb +0 -14
- data/test/integration/sitemap_performance_test.rb +0 -26
- data/test/selenium-core/Blank.html +0 -7
- data/test/selenium-core/InjectedRemoteRunner.html +0 -8
- data/test/selenium-core/RemoteRunner.html +0 -110
- data/test/selenium-core/SeleniumLog.html +0 -109
- data/test/selenium-core/TestPrompt.html +0 -145
- data/test/selenium-core/TestRunner-splash.html +0 -55
- data/test/selenium-core/TestRunner.hta +0 -176
- data/test/selenium-core/TestRunner.html +0 -176
- data/test/selenium-core/domviewer/butmin.gif +0 -0
- data/test/selenium-core/domviewer/butplus.gif +0 -0
- data/test/selenium-core/domviewer/domviewer.css +0 -298
- data/test/selenium-core/domviewer/domviewer.html +0 -16
- data/test/selenium-core/domviewer/selenium-domviewer.js +0 -205
- data/test/selenium-core/icons/all.png +0 -0
- data/test/selenium-core/icons/continue.png +0 -0
- data/test/selenium-core/icons/continue_disabled.png +0 -0
- data/test/selenium-core/icons/pause.png +0 -0
- data/test/selenium-core/icons/pause_disabled.png +0 -0
- data/test/selenium-core/icons/selected.png +0 -0
- data/test/selenium-core/icons/step.png +0 -0
- data/test/selenium-core/icons/step_disabled.png +0 -0
- data/test/selenium-core/iedoc-core.xml +0 -1515
- data/test/selenium-core/iedoc.xml +0 -1469
- data/test/selenium-core/lib/cssQuery/cssQuery-p.js +0 -6
- data/test/selenium-core/lib/cssQuery/src/cssQuery-level2.js +0 -142
- data/test/selenium-core/lib/cssQuery/src/cssQuery-level3.js +0 -150
- data/test/selenium-core/lib/cssQuery/src/cssQuery-standard.js +0 -53
- data/test/selenium-core/lib/cssQuery/src/cssQuery.js +0 -356
- data/test/selenium-core/lib/prototype.js +0 -2006
- data/test/selenium-core/lib/scriptaculous/builder.js +0 -101
- data/test/selenium-core/lib/scriptaculous/controls.js +0 -815
- data/test/selenium-core/lib/scriptaculous/dragdrop.js +0 -915
- data/test/selenium-core/lib/scriptaculous/effects.js +0 -958
- data/test/selenium-core/lib/scriptaculous/scriptaculous.js +0 -47
- data/test/selenium-core/lib/scriptaculous/slider.js +0 -283
- data/test/selenium-core/lib/scriptaculous/unittest.js +0 -383
- data/test/selenium-core/scripts/find_matching_child.js +0 -69
- data/test/selenium-core/scripts/htmlutils.js +0 -894
- data/test/selenium-core/scripts/injection.html +0 -72
- data/test/selenium-core/scripts/js2html.js +0 -70
- data/test/selenium-core/scripts/narcissus-defs.js +0 -175
- data/test/selenium-core/scripts/narcissus-exec.js +0 -1054
- data/test/selenium-core/scripts/narcissus-parse.js +0 -1003
- data/test/selenium-core/scripts/se2html.js +0 -63
- data/test/selenium-core/scripts/selenium-api.js +0 -2409
- data/test/selenium-core/scripts/selenium-browserbot.js +0 -2203
- data/test/selenium-core/scripts/selenium-browserdetect.js +0 -150
- data/test/selenium-core/scripts/selenium-commandhandlers.js +0 -377
- data/test/selenium-core/scripts/selenium-executionloop.js +0 -175
- data/test/selenium-core/scripts/selenium-logging.js +0 -147
- data/test/selenium-core/scripts/selenium-remoterunner.js +0 -571
- data/test/selenium-core/scripts/selenium-testrunner.js +0 -1333
- data/test/selenium-core/scripts/selenium-version.js +0 -5
- data/test/selenium-core/scripts/user-extensions.js +0 -3
- data/test/selenium-core/scripts/user-extensions.js.sample +0 -75
- data/test/selenium-core/scripts/xmlextras.js +0 -153
- data/test/selenium-core/selenium-logo.png +0 -0
- data/test/selenium-core/selenium-test.css +0 -43
- data/test/selenium-core/selenium.css +0 -299
- data/test/selenium-core/xpath/dom.js +0 -428
- data/test/selenium-core/xpath/misc.js +0 -252
- data/test/selenium-core/xpath/xpath.js +0 -2223
- data/test/selenium/_login_as_cmsadmin.rsel +0 -4
- data/test/selenium/dashboard.rsel +0 -5
- data/test/selenium/html_blocks.rsel +0 -4
- data/test/selenium/login/failed_login.rsel +0 -8
- data/test/selenium/login/successful_login.rsel +0 -9
- data/test/selenium/page_templates.rsel +0 -12
- data/test/selenium/pages/edit_properties.rsel +0 -5
- data/test/selenium/site/view_home_page.rsel +0 -4
- data/test/selenium/sitemap/move_page.rsel +0 -9
- data/test/selenium/sitemap/open_section.rsel +0 -6
- data/test/selenium/sitemap/select_page.rsel +0 -12
- data/test/selenium/sitemap/select_section.rsel +0 -17
- data/test/test_helper.rb +0 -193
- data/test/test_logging.rb +0 -67
- data/test/unit/behaviors/attaching_test.rb +0 -357
- data/test/unit/behaviors/connectable_test.rb +0 -29
- data/test/unit/behaviors/dynamic_attributes_test.rb +0 -38
- data/test/unit/behaviors/publishable_test.rb +0 -84
- data/test/unit/behaviors/searching_test.rb +0 -102
- data/test/unit/behaviors/taggable_test.rb +0 -109
- data/test/unit/behaviors/versioning_test.rb +0 -36
- data/test/unit/extensions/active_record/base_test.rb +0 -10
- data/test/unit/extensions/hash_test.rb +0 -17
- data/test/unit/extensions/integer_test.rb +0 -10
- data/test/unit/helpers/application_helper_test.rb +0 -77
- data/test/unit/helpers/form_builder_test.rb +0 -36
- data/test/unit/helpers/menu_helper_test.rb +0 -242
- data/test/unit/helpers/page_helper_test.rb +0 -67
- data/test/unit/helpers/path_helper_test.rb +0 -57
- data/test/unit/lib/acts_as_content_page_test.rb +0 -72
- data/test/unit/lib/cms/authentication/controller_test.rb +0 -20
- data/test/unit/lib/cms/sitemap_test.rb +0 -206
- data/test/unit/lib/cms_domain_support_test.rb +0 -43
- data/test/unit/lib/command_line_test.rb +0 -70
- data/test/unit/lib/content_block_test.rb +0 -203
- data/test/unit/lib/content_rendering_support_test.rb +0 -40
- data/test/unit/lib/generators_test.rb +0 -40
- data/test/unit/lib/routes_test.rb +0 -57
- data/test/unit/models/attachment_test.rb +0 -116
- data/test/unit/models/category_test.rb +0 -40
- data/test/unit/models/category_type_test.rb +0 -8
- data/test/unit/models/connector_test.rb +0 -152
- data/test/unit/models/content_type_test.rb +0 -56
- data/test/unit/models/email_page_portlet_test.rb +0 -14
- data/test/unit/models/file_block_test.rb +0 -230
- data/test/unit/models/group_test.rb +0 -13
- data/test/unit/models/html_block_test.rb +0 -102
- data/test/unit/models/link_test.rb +0 -52
- data/test/unit/models/page_partial_test.rb +0 -29
- data/test/unit/models/page_route_test.rb +0 -29
- data/test/unit/models/page_template_test.rb +0 -40
- data/test/unit/models/page_test.rb +0 -792
- data/test/unit/models/permission_test.rb +0 -10
- data/test/unit/models/portlet_test.rb +0 -69
- data/test/unit/models/sections_test.rb +0 -264
- data/test/unit/models/site_test.rb +0 -50
- data/test/unit/models/task_test.rb +0 -141
- data/test/unit/models/user_test.rb +0 -352
- data/test/unit/schema_statements_test.rb +0 -41
@@ -1,1469 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
|
3
|
-
<apidoc>
|
4
|
-
|
5
|
-
<top>Defines an object that runs Selenium commands.
|
6
|
-
|
7
|
-
<h3><a name="locators"></a>Element Locators</h3>
|
8
|
-
<p>
|
9
|
-
Element Locators tell Selenium which HTML element a command refers to.
|
10
|
-
The format of a locator is:</p>
|
11
|
-
<blockquote>
|
12
|
-
<em>locatorType</em><strong>=</strong><em>argument</em>
|
13
|
-
</blockquote>
|
14
|
-
|
15
|
-
<p>
|
16
|
-
We support the following strategies for locating elements:
|
17
|
-
</p>
|
18
|
-
|
19
|
-
<ul>
|
20
|
-
<li><strong>identifier</strong>=<em>id</em>:
|
21
|
-
Select the element with the specified @id attribute. If no match is
|
22
|
-
found, select the first element whose @name attribute is <em>id</em>.
|
23
|
-
(This is normally the default; see below.)</li>
|
24
|
-
<li><strong>id</strong>=<em>id</em>:
|
25
|
-
Select the element with the specified @id attribute.</li>
|
26
|
-
|
27
|
-
<li><strong>name</strong>=<em>name</em>:
|
28
|
-
Select the first element with the specified @name attribute.
|
29
|
-
<ul class="first last simple">
|
30
|
-
<li>username</li>
|
31
|
-
<li>name=username</li>
|
32
|
-
</ul>
|
33
|
-
|
34
|
-
<p>The name may optionally be followed by one or more <em>element-filters</em>, separated from the name by whitespace. If the <em>filterType</em> is not specified, <strong>value</strong> is assumed.</p>
|
35
|
-
|
36
|
-
<ul class="first last simple">
|
37
|
-
<li>name=flavour value=chocolate</li>
|
38
|
-
</ul>
|
39
|
-
</li>
|
40
|
-
<li><strong>dom</strong>=<em>javascriptExpression</em>:
|
41
|
-
|
42
|
-
Find an element by evaluating the specified string. This allows you to traverse the HTML Document Object
|
43
|
-
Model using JavaScript. Note that you must not return a value in this string; simply make it the last expression in the block.
|
44
|
-
<ul class="first last simple">
|
45
|
-
<li>dom=document.forms['myForm'].myDropdown</li>
|
46
|
-
<li>dom=document.images[56]</li>
|
47
|
-
<li>dom=function foo() { return document.links[1]; }; foo();</li>
|
48
|
-
</ul>
|
49
|
-
|
50
|
-
</li>
|
51
|
-
|
52
|
-
<li><strong>xpath</strong>=<em>xpathExpression</em>:
|
53
|
-
Locate an element using an XPath expression.
|
54
|
-
<ul class="first last simple">
|
55
|
-
<li>xpath=//img[@alt='The image alt text']</li>
|
56
|
-
<li>xpath=//table[@id='table1']//tr[4]/td[2]</li>
|
57
|
-
<li>xpath=//a[contains(@href,'#id1')]</li>
|
58
|
-
<li>xpath=//a[contains(@href,'#id1')]/@class</li>
|
59
|
-
<li>xpath=(//table[@class='stylee'])//th[text()='theHeaderText']/../td</li>
|
60
|
-
<li>xpath=//input[@name='name2' and @value='yes']</li>
|
61
|
-
<li>xpath=//*[text()="right"]</li>
|
62
|
-
|
63
|
-
</ul>
|
64
|
-
</li>
|
65
|
-
<li><strong>link</strong>=<em>textPattern</em>:
|
66
|
-
Select the link (anchor) element which contains text matching the
|
67
|
-
specified <em>pattern</em>.
|
68
|
-
<ul class="first last simple">
|
69
|
-
<li>link=The link text</li>
|
70
|
-
</ul>
|
71
|
-
|
72
|
-
</li>
|
73
|
-
|
74
|
-
<li><strong>css</strong>=<em>cssSelectorSyntax</em>:
|
75
|
-
Select the element using css selectors. Please refer to <a href="http://www.w3.org/TR/REC-CSS2/selector.html">CSS2 selectors</a>, <a href="http://www.w3.org/TR/2001/CR-css3-selectors-20011113/">CSS3 selectors</a> 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.
|
76
|
-
<ul class="first last simple">
|
77
|
-
<li>css=a[href="#id3"]</li>
|
78
|
-
<li>css=span#firstChild + span</li>
|
79
|
-
</ul>
|
80
|
-
<p>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). </p>
|
81
|
-
</li>
|
82
|
-
</ul>
|
83
|
-
|
84
|
-
<p>
|
85
|
-
Without an explicit locator prefix, Selenium uses the following default
|
86
|
-
strategies:
|
87
|
-
</p>
|
88
|
-
|
89
|
-
<ul class="simple">
|
90
|
-
<li><strong>dom</strong>, for locators starting with "document."</li>
|
91
|
-
<li><strong>xpath</strong>, for locators starting with "//"</li>
|
92
|
-
<li><strong>identifier</strong>, otherwise</li>
|
93
|
-
</ul>
|
94
|
-
|
95
|
-
<h3><a name="element-filters">Element Filters</a></h3>
|
96
|
-
<blockquote>
|
97
|
-
<p>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.</p>
|
98
|
-
<p>Filters look much like locators, ie.</p>
|
99
|
-
<blockquote>
|
100
|
-
<em>filterType</em><strong>=</strong><em>argument</em></blockquote>
|
101
|
-
|
102
|
-
<p>Supported element-filters are:</p>
|
103
|
-
<p><strong>value=</strong><em>valuePattern</em></p>
|
104
|
-
<blockquote>
|
105
|
-
Matches elements based on their values. This is particularly useful for refining a list of similarly-named toggle-buttons.</blockquote>
|
106
|
-
<p><strong>index=</strong><em>index</em></p>
|
107
|
-
<blockquote>
|
108
|
-
Selects a single element based on its position in the list (offset from zero).</blockquote>
|
109
|
-
</blockquote>
|
110
|
-
|
111
|
-
<h3><a name="patterns"></a>String-match Patterns</h3>
|
112
|
-
|
113
|
-
<p>
|
114
|
-
Various Pattern syntaxes are available for matching string values:
|
115
|
-
</p>
|
116
|
-
<ul>
|
117
|
-
<li><strong>glob:</strong><em>pattern</em>:
|
118
|
-
Match a string against a "glob" (aka "wildmat") pattern. "Glob" is a
|
119
|
-
kind of limited regular-expression syntax typically used in command-line
|
120
|
-
shells. In a glob pattern, "*" represents any sequence of characters, and "?"
|
121
|
-
represents any single character. Glob patterns match against the entire
|
122
|
-
string.</li>
|
123
|
-
<li><strong>regexp:</strong><em>regexp</em>:
|
124
|
-
Match a string using a regular-expression. The full power of JavaScript
|
125
|
-
regular-expressions is available.</li>
|
126
|
-
<li><strong>exact:</strong><em>string</em>:
|
127
|
-
|
128
|
-
Match a string exactly, verbatim, without any of that fancy wildcard
|
129
|
-
stuff.</li>
|
130
|
-
</ul>
|
131
|
-
<p>
|
132
|
-
If no pattern prefix is specified, Selenium assumes that it's a "glob"
|
133
|
-
pattern.
|
134
|
-
</p></top>
|
135
|
-
|
136
|
-
<function name="click">
|
137
|
-
|
138
|
-
<param name="locator">an element locator</param>
|
139
|
-
|
140
|
-
<comment>Clicks on a link, button, checkbox or radio button. If the click action
|
141
|
-
causes a new page to load (like a link usually does), call
|
142
|
-
waitForPageToLoad.</comment>
|
143
|
-
|
144
|
-
</function>
|
145
|
-
|
146
|
-
<function name="doubleClick">
|
147
|
-
|
148
|
-
<param name="locator">an element locator</param>
|
149
|
-
|
150
|
-
<comment>Double clicks on a link, button, checkbox or radio button. If the double click action
|
151
|
-
causes a new page to load (like a link usually does), call
|
152
|
-
waitForPageToLoad.</comment>
|
153
|
-
|
154
|
-
</function>
|
155
|
-
|
156
|
-
<function name="clickAt">
|
157
|
-
|
158
|
-
<param name="locator">an element locator</param>
|
159
|
-
|
160
|
-
<param name="coordString">specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.</param>
|
161
|
-
|
162
|
-
<comment>Clicks on a link, button, checkbox or radio button. If the click action
|
163
|
-
causes a new page to load (like a link usually does), call
|
164
|
-
waitForPageToLoad.</comment>
|
165
|
-
|
166
|
-
</function>
|
167
|
-
|
168
|
-
<function name="doubleClickAt">
|
169
|
-
|
170
|
-
<param name="locator">an element locator</param>
|
171
|
-
|
172
|
-
<param name="coordString">specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.</param>
|
173
|
-
|
174
|
-
<comment>Doubleclicks on a link, button, checkbox or radio button. If the action
|
175
|
-
causes a new page to load (like a link usually does), call
|
176
|
-
waitForPageToLoad.</comment>
|
177
|
-
|
178
|
-
</function>
|
179
|
-
|
180
|
-
<function name="fireEvent">
|
181
|
-
|
182
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
183
|
-
|
184
|
-
<param name="eventName">the event name, e.g. "focus" or "blur"</param>
|
185
|
-
|
186
|
-
<comment>Explicitly simulate an event, to trigger the corresponding "on<em>event</em>"
|
187
|
-
handler.</comment>
|
188
|
-
|
189
|
-
</function>
|
190
|
-
|
191
|
-
<function name="keyPress">
|
192
|
-
|
193
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
194
|
-
|
195
|
-
<param name="keySequence">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".</param>
|
196
|
-
|
197
|
-
<comment>Simulates a user pressing and releasing a key.</comment>
|
198
|
-
|
199
|
-
</function>
|
200
|
-
|
201
|
-
<function name="shiftKeyDown">
|
202
|
-
|
203
|
-
<comment>Press the shift key and hold it down until doShiftUp() is called or a new page is loaded.</comment>
|
204
|
-
|
205
|
-
</function>
|
206
|
-
|
207
|
-
<function name="shiftKeyUp">
|
208
|
-
|
209
|
-
<comment>Release the shift key.</comment>
|
210
|
-
|
211
|
-
</function>
|
212
|
-
|
213
|
-
<function name="metaKeyDown">
|
214
|
-
|
215
|
-
<comment>Press the meta key and hold it down until doMetaUp() is called or a new page is loaded.</comment>
|
216
|
-
|
217
|
-
</function>
|
218
|
-
|
219
|
-
<function name="metaKeyUp">
|
220
|
-
|
221
|
-
<comment>Release the meta key.</comment>
|
222
|
-
|
223
|
-
</function>
|
224
|
-
|
225
|
-
<function name="altKeyDown">
|
226
|
-
|
227
|
-
<comment>Press the alt key and hold it down until doAltUp() is called or a new page is loaded.</comment>
|
228
|
-
|
229
|
-
</function>
|
230
|
-
|
231
|
-
<function name="altKeyUp">
|
232
|
-
|
233
|
-
<comment>Release the alt key.</comment>
|
234
|
-
|
235
|
-
</function>
|
236
|
-
|
237
|
-
<function name="controlKeyDown">
|
238
|
-
|
239
|
-
<comment>Press the control key and hold it down until doControlUp() is called or a new page is loaded.</comment>
|
240
|
-
|
241
|
-
</function>
|
242
|
-
|
243
|
-
<function name="controlKeyUp">
|
244
|
-
|
245
|
-
<comment>Release the control key.</comment>
|
246
|
-
|
247
|
-
</function>
|
248
|
-
|
249
|
-
<function name="keyDown">
|
250
|
-
|
251
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
252
|
-
|
253
|
-
<param name="keySequence">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".</param>
|
254
|
-
|
255
|
-
<comment>Simulates a user pressing a key (without releasing it yet).</comment>
|
256
|
-
|
257
|
-
</function>
|
258
|
-
|
259
|
-
<function name="keyUp">
|
260
|
-
|
261
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
262
|
-
|
263
|
-
<param name="keySequence">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".</param>
|
264
|
-
|
265
|
-
<comment>Simulates a user releasing a key.</comment>
|
266
|
-
|
267
|
-
</function>
|
268
|
-
|
269
|
-
<function name="mouseOver">
|
270
|
-
|
271
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
272
|
-
|
273
|
-
<comment>Simulates a user hovering a mouse over the specified element.</comment>
|
274
|
-
|
275
|
-
</function>
|
276
|
-
|
277
|
-
<function name="mouseOut">
|
278
|
-
|
279
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
280
|
-
|
281
|
-
<comment>Simulates a user moving the mouse pointer away from the specified element.</comment>
|
282
|
-
|
283
|
-
</function>
|
284
|
-
|
285
|
-
<function name="mouseDown">
|
286
|
-
|
287
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
288
|
-
|
289
|
-
<comment>Simulates a user pressing the mouse button (without releasing it yet) on
|
290
|
-
the specified element.</comment>
|
291
|
-
|
292
|
-
</function>
|
293
|
-
|
294
|
-
<function name="mouseDownAt">
|
295
|
-
|
296
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
297
|
-
|
298
|
-
<param name="coordString">specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.</param>
|
299
|
-
|
300
|
-
<comment>Simulates a user pressing the mouse button (without releasing it yet) at
|
301
|
-
the specified location.</comment>
|
302
|
-
|
303
|
-
</function>
|
304
|
-
|
305
|
-
<function name="mouseUp">
|
306
|
-
|
307
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
308
|
-
|
309
|
-
<comment>Simulates the event that occurs when the user releases the mouse button (i.e., stops
|
310
|
-
holding the button down) on the specified element.</comment>
|
311
|
-
|
312
|
-
</function>
|
313
|
-
|
314
|
-
<function name="mouseUpAt">
|
315
|
-
|
316
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
317
|
-
|
318
|
-
<param name="coordString">specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.</param>
|
319
|
-
|
320
|
-
<comment>Simulates the event that occurs when the user releases the mouse button (i.e., stops
|
321
|
-
holding the button down) at the specified location.</comment>
|
322
|
-
|
323
|
-
</function>
|
324
|
-
|
325
|
-
<function name="mouseMove">
|
326
|
-
|
327
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
328
|
-
|
329
|
-
<comment>Simulates a user pressing the mouse button (without releasing it yet) on
|
330
|
-
the specified element.</comment>
|
331
|
-
|
332
|
-
</function>
|
333
|
-
|
334
|
-
<function name="mouseMoveAt">
|
335
|
-
|
336
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
337
|
-
|
338
|
-
<param name="coordString">specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.</param>
|
339
|
-
|
340
|
-
<comment>Simulates a user pressing the mouse button (without releasing it yet) on
|
341
|
-
the specified element.</comment>
|
342
|
-
|
343
|
-
</function>
|
344
|
-
|
345
|
-
<function name="type">
|
346
|
-
|
347
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
348
|
-
|
349
|
-
<param name="value">the value to type</param>
|
350
|
-
|
351
|
-
<comment>Sets the value of an input field, as though you typed it in.
|
352
|
-
|
353
|
-
<p>Can also be used to set the value of combo boxes, check boxes, etc. In these cases,
|
354
|
-
value should be the value of the option selected, not the visible text.</p></comment>
|
355
|
-
|
356
|
-
</function>
|
357
|
-
|
358
|
-
<function name="typeKeys">
|
359
|
-
|
360
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
361
|
-
|
362
|
-
<param name="value">the value to type</param>
|
363
|
-
|
364
|
-
<comment>Simulates keystroke events on the specified element, as though you typed the value key-by-key.
|
365
|
-
|
366
|
-
<p>This is a convenience method for calling keyDown, keyUp, keyPress for every character in the specified string;
|
367
|
-
this is useful for dynamic UI widgets (like auto-completing combo boxes) that require explicit key events.</p>
|
368
|
-
|
369
|
-
<p>Unlike the simple "type" command, which forces the specified value into the page directly, this command
|
370
|
-
may or may not have any visible effect, even in cases where typing keys would normally have a visible effect.
|
371
|
-
For example, if you use "typeKeys" on a form element, you may or may not see the results of what you typed in
|
372
|
-
the field.</p>
|
373
|
-
<p>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
|
374
|
-
send the keystroke events corresponding to what you just typed.</p></comment>
|
375
|
-
|
376
|
-
</function>
|
377
|
-
|
378
|
-
<function name="setSpeed">
|
379
|
-
|
380
|
-
<param name="value">the number of milliseconds to pause after operation</param>
|
381
|
-
|
382
|
-
<comment>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.,
|
383
|
-
the delay is 0 milliseconds.</comment>
|
384
|
-
|
385
|
-
</function>
|
386
|
-
|
387
|
-
<function name="getSpeed">
|
388
|
-
|
389
|
-
<comment>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.,
|
390
|
-
the delay is 0 milliseconds.
|
391
|
-
|
392
|
-
See also setSpeed.</comment>
|
393
|
-
|
394
|
-
</function>
|
395
|
-
|
396
|
-
<function name="check">
|
397
|
-
|
398
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
399
|
-
|
400
|
-
<comment>Check a toggle-button (checkbox/radio)</comment>
|
401
|
-
|
402
|
-
</function>
|
403
|
-
|
404
|
-
<function name="uncheck">
|
405
|
-
|
406
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
407
|
-
|
408
|
-
<comment>Uncheck a toggle-button (checkbox/radio)</comment>
|
409
|
-
|
410
|
-
</function>
|
411
|
-
|
412
|
-
<function name="select">
|
413
|
-
|
414
|
-
<param name="selectLocator">an <a href="#locators">element locator</a> identifying a drop-down menu</param>
|
415
|
-
|
416
|
-
<param name="optionLocator">an option locator (a label by default)</param>
|
417
|
-
|
418
|
-
<comment>Select an option from a drop-down using an option locator.
|
419
|
-
|
420
|
-
<p>
|
421
|
-
Option locators provide different ways of specifying options of an HTML
|
422
|
-
Select element (e.g. for selecting a specific option, or for asserting
|
423
|
-
that the selected option satisfies a specification). There are several
|
424
|
-
forms of Select Option Locator.
|
425
|
-
</p>
|
426
|
-
<ul>
|
427
|
-
<li><strong>label</strong>=<em>labelPattern</em>:
|
428
|
-
matches options based on their labels, i.e. the visible text. (This
|
429
|
-
is the default.)
|
430
|
-
<ul class="first last simple">
|
431
|
-
<li>label=regexp:^[Oo]ther</li>
|
432
|
-
</ul>
|
433
|
-
</li>
|
434
|
-
<li><strong>value</strong>=<em>valuePattern</em>:
|
435
|
-
matches options based on their values.
|
436
|
-
<ul class="first last simple">
|
437
|
-
<li>value=other</li>
|
438
|
-
</ul>
|
439
|
-
|
440
|
-
|
441
|
-
</li>
|
442
|
-
<li><strong>id</strong>=<em>id</em>:
|
443
|
-
|
444
|
-
matches options based on their ids.
|
445
|
-
<ul class="first last simple">
|
446
|
-
<li>id=option1</li>
|
447
|
-
</ul>
|
448
|
-
</li>
|
449
|
-
<li><strong>index</strong>=<em>index</em>:
|
450
|
-
matches an option based on its index (offset from zero).
|
451
|
-
<ul class="first last simple">
|
452
|
-
|
453
|
-
<li>index=2</li>
|
454
|
-
</ul>
|
455
|
-
</li>
|
456
|
-
</ul>
|
457
|
-
<p>
|
458
|
-
If no option locator prefix is provided, the default behaviour is to match on <strong>label</strong>.
|
459
|
-
</p></comment>
|
460
|
-
|
461
|
-
</function>
|
462
|
-
|
463
|
-
<function name="addSelection">
|
464
|
-
|
465
|
-
<param name="locator">an <a href="#locators">element locator</a> identifying a multi-select box</param>
|
466
|
-
|
467
|
-
<param name="optionLocator">an option locator (a label by default)</param>
|
468
|
-
|
469
|
-
<comment>Add a selection to the set of selected options in a multi-select element using an option locator.
|
470
|
-
|
471
|
-
@see #doSelect for details of option locators</comment>
|
472
|
-
|
473
|
-
</function>
|
474
|
-
|
475
|
-
<function name="removeSelection">
|
476
|
-
|
477
|
-
<param name="locator">an <a href="#locators">element locator</a> identifying a multi-select box</param>
|
478
|
-
|
479
|
-
<param name="optionLocator">an option locator (a label by default)</param>
|
480
|
-
|
481
|
-
<comment>Remove a selection from the set of selected options in a multi-select element using an option locator.
|
482
|
-
|
483
|
-
@see #doSelect for details of option locators</comment>
|
484
|
-
|
485
|
-
</function>
|
486
|
-
|
487
|
-
<function name="removeAllSelections">
|
488
|
-
|
489
|
-
<param name="locator">an <a href="#locators">element locator</a> identifying a multi-select box</param>
|
490
|
-
|
491
|
-
<comment>Unselects all of the selected options in a multi-select element.</comment>
|
492
|
-
|
493
|
-
</function>
|
494
|
-
|
495
|
-
<function name="submit">
|
496
|
-
|
497
|
-
<param name="formLocator">an <a href="#locators">element locator</a> for the form you want to submit</param>
|
498
|
-
|
499
|
-
<comment>Submit the specified form. This is particularly useful for forms without
|
500
|
-
submit buttons, e.g. single-input "Search" forms.</comment>
|
501
|
-
|
502
|
-
</function>
|
503
|
-
|
504
|
-
<function name="open">
|
505
|
-
|
506
|
-
<param name="url">the URL to open; may be relative or absolute</param>
|
507
|
-
|
508
|
-
<comment>Opens an URL in the test frame. This accepts both relative and absolute
|
509
|
-
URLs.
|
510
|
-
|
511
|
-
The "open" command waits for the page to load before proceeding,
|
512
|
-
ie. the "AndWait" suffix is implicit.
|
513
|
-
|
514
|
-
<em>Note</em>: The URL must be on the same domain as the runner HTML
|
515
|
-
due to security restrictions in the browser (Same Origin Policy). If you
|
516
|
-
need to open an URL on another domain, use the Selenium Server to start a
|
517
|
-
new browser session on that domain.</comment>
|
518
|
-
|
519
|
-
</function>
|
520
|
-
|
521
|
-
<function name="openWindow">
|
522
|
-
|
523
|
-
<param name="url">the URL to open, which can be blank</param>
|
524
|
-
|
525
|
-
<param name="windowID">the JavaScript window ID of the window to select</param>
|
526
|
-
|
527
|
-
<comment>Opens a popup window (if a window with that ID isn't already open).
|
528
|
-
After opening the window, you'll need to select it using the selectWindow
|
529
|
-
command.
|
530
|
-
|
531
|
-
<p>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).
|
532
|
-
In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using
|
533
|
-
an empty (blank) url, like this: openWindow("", "myFunnyWindow").</p></comment>
|
534
|
-
|
535
|
-
</function>
|
536
|
-
|
537
|
-
<function name="selectWindow">
|
538
|
-
|
539
|
-
<param name="windowID">the JavaScript window ID of the window to select</param>
|
540
|
-
|
541
|
-
<comment>Selects a popup window; once a popup window has been selected, all
|
542
|
-
commands go to that window. To select the main window again, use null
|
543
|
-
as the target.
|
544
|
-
|
545
|
-
<p>Note that there is a big difference between a window's internal JavaScript "name" property
|
546
|
-
and the "title" of a given window's document (which is normally what you actually see, as an end user,
|
547
|
-
in the title bar of the window). The "name" is normally invisible to the end-user; it's the second
|
548
|
-
parameter "windowName" passed to the JavaScript method window.open(url, windowName, windowFeatures, replaceFlag)
|
549
|
-
(which selenium intercepts).</p>
|
550
|
-
|
551
|
-
<p>Selenium has several strategies for finding the window object referred to by the "windowID" parameter.</p>
|
552
|
-
|
553
|
-
<p>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).</p>
|
554
|
-
<p>2.) if the value of the "windowID" parameter is a JavaScript variable name in the current application window, then it is assumed
|
555
|
-
that this variable contains the return value from a call to the JavaScript window.open() method.</p>
|
556
|
-
<p>3.) Otherwise, selenium looks in a hash it maintains that maps string names to window "names".</p>
|
557
|
-
<p>4.) If <i>that</i> fails, we'll try looping over all of the known windows to try to find the appropriate "title".
|
558
|
-
Since "title" is not necessarily unique, this may have unexpected behavior.</p>
|
559
|
-
|
560
|
-
<p>If you're having trouble figuring out what is the name of a window that you want to manipulate, look at the selenium log messages
|
561
|
-
which identify the names of windows created via window.open (and therefore intercepted by selenium). You will see messages
|
562
|
-
like the following for each window as it is opened:</p>
|
563
|
-
|
564
|
-
<p><code>debug: window.open call intercepted; window ID (which you can use with selectWindow()) is "myNewWindow"</code></p>
|
565
|
-
|
566
|
-
<p>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).
|
567
|
-
(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
|
568
|
-
an empty (blank) url, like this: openWindow("", "myFunnyWindow").</p></comment>
|
569
|
-
|
570
|
-
</function>
|
571
|
-
|
572
|
-
<function name="selectFrame">
|
573
|
-
|
574
|
-
<param name="locator">an <a href="#locators">element locator</a> identifying a frame or iframe</param>
|
575
|
-
|
576
|
-
<comment>Selects a frame within the current window. (You may invoke this command
|
577
|
-
multiple times to select nested frames.) To select the parent frame, use
|
578
|
-
"relative=parent" as a locator; to select the top frame, use "relative=top".
|
579
|
-
You can also select a frame by its 0-based index number; select the first frame with
|
580
|
-
"index=0", or the third frame with "index=2".
|
581
|
-
|
582
|
-
<p>You may also use a DOM expression to identify the frame you want directly,
|
583
|
-
like this: <code>dom=frames["main"].frames["subframe"]</code></p></comment>
|
584
|
-
|
585
|
-
</function>
|
586
|
-
|
587
|
-
<function name="getWhetherThisFrameMatchFrameExpression">
|
588
|
-
|
589
|
-
<return type="boolean">true if the new frame is this code's window</return>
|
590
|
-
|
591
|
-
<param name="currentFrameString">starting frame</param>
|
592
|
-
|
593
|
-
<param name="target">new frame (which might be relative to the current one)</param>
|
594
|
-
|
595
|
-
<comment>Determine whether current/locator identify the frame containing this running code.
|
596
|
-
|
597
|
-
<p>This is useful in proxy injection mode, where this code runs in every
|
598
|
-
browser frame and window, and sometimes the selenium server needs to identify
|
599
|
-
the "current" frame. In this case, when the test calls selectFrame, this
|
600
|
-
routine is called for each frame to figure out which one has been selected.
|
601
|
-
The selected frame will return true, while all others will return false.</p></comment>
|
602
|
-
|
603
|
-
</function>
|
604
|
-
|
605
|
-
<function name="getWhetherThisWindowMatchWindowExpression">
|
606
|
-
|
607
|
-
<return type="boolean">true if the new window is this code's window</return>
|
608
|
-
|
609
|
-
<param name="currentWindowString">starting window</param>
|
610
|
-
|
611
|
-
<param name="target">new window (which might be relative to the current one, e.g., "_parent")</param>
|
612
|
-
|
613
|
-
<comment>Determine whether currentWindowString plus target identify the window containing this running code.
|
614
|
-
|
615
|
-
<p>This is useful in proxy injection mode, where this code runs in every
|
616
|
-
browser frame and window, and sometimes the selenium server needs to identify
|
617
|
-
the "current" window. In this case, when the test calls selectWindow, this
|
618
|
-
routine is called for each window to figure out which one has been selected.
|
619
|
-
The selected window will return true, while all others will return false.</p></comment>
|
620
|
-
|
621
|
-
</function>
|
622
|
-
|
623
|
-
<function name="waitForPopUp">
|
624
|
-
|
625
|
-
<param name="windowID">the JavaScript window ID of the window that will appear</param>
|
626
|
-
|
627
|
-
<param name="timeout">a timeout in milliseconds, after which the action will return with an error</param>
|
628
|
-
|
629
|
-
<comment>Waits for a popup window to appear and load up.</comment>
|
630
|
-
|
631
|
-
</function>
|
632
|
-
|
633
|
-
<function name="chooseCancelOnNextConfirmation">
|
634
|
-
|
635
|
-
<comment>By default, Selenium's overridden window.confirm() function will
|
636
|
-
return true, as if the user had manually clicked OK; after running
|
637
|
-
this command, the next call to confirm() will return false, as if
|
638
|
-
the user had clicked Cancel. Selenium will then resume using the
|
639
|
-
default behavior for future confirmations, automatically returning
|
640
|
-
true (OK) unless/until you explicitly call this command for each
|
641
|
-
confirmation.</comment>
|
642
|
-
|
643
|
-
</function>
|
644
|
-
|
645
|
-
<function name="chooseOkOnNextConfirmation">
|
646
|
-
|
647
|
-
<comment>Undo the effect of calling chooseCancelOnNextConfirmation. Note
|
648
|
-
that Selenium's overridden window.confirm() function will normally automatically
|
649
|
-
return true, as if the user had manually clicked OK, so you shouldn't
|
650
|
-
need to use this command unless for some reason you need to change
|
651
|
-
your mind prior to the next confirmation. After any confirmation, Selenium will resume using the
|
652
|
-
default behavior for future confirmations, automatically returning
|
653
|
-
true (OK) unless/until you explicitly call chooseCancelOnNextConfirmation for each
|
654
|
-
confirmation.</comment>
|
655
|
-
|
656
|
-
</function>
|
657
|
-
|
658
|
-
<function name="answerOnNextPrompt">
|
659
|
-
|
660
|
-
<param name="answer">the answer to give in response to the prompt pop-up</param>
|
661
|
-
|
662
|
-
<comment>Instructs Selenium to return the specified answer string in response to
|
663
|
-
the next JavaScript prompt [window.prompt()].</comment>
|
664
|
-
|
665
|
-
</function>
|
666
|
-
|
667
|
-
<function name="goBack">
|
668
|
-
|
669
|
-
<comment>Simulates the user clicking the "back" button on their browser.</comment>
|
670
|
-
|
671
|
-
</function>
|
672
|
-
|
673
|
-
<function name="refresh">
|
674
|
-
|
675
|
-
<comment>Simulates the user clicking the "Refresh" button on their browser.</comment>
|
676
|
-
|
677
|
-
</function>
|
678
|
-
|
679
|
-
<function name="close">
|
680
|
-
|
681
|
-
<comment>Simulates the user clicking the "close" button in the titlebar of a popup
|
682
|
-
window or tab.</comment>
|
683
|
-
|
684
|
-
</function>
|
685
|
-
|
686
|
-
<function name="isAlertPresent">
|
687
|
-
|
688
|
-
<return type="boolean">true if there is an alert</return>
|
689
|
-
|
690
|
-
<comment>Has an alert occurred?
|
691
|
-
|
692
|
-
<p>
|
693
|
-
This function never throws an exception
|
694
|
-
</p></comment>
|
695
|
-
|
696
|
-
</function>
|
697
|
-
|
698
|
-
<function name="isPromptPresent">
|
699
|
-
|
700
|
-
<return type="boolean">true if there is a pending prompt</return>
|
701
|
-
|
702
|
-
<comment>Has a prompt occurred?
|
703
|
-
|
704
|
-
<p>
|
705
|
-
This function never throws an exception
|
706
|
-
</p></comment>
|
707
|
-
|
708
|
-
</function>
|
709
|
-
|
710
|
-
<function name="isConfirmationPresent">
|
711
|
-
|
712
|
-
<return type="boolean">true if there is a pending confirmation</return>
|
713
|
-
|
714
|
-
<comment>Has confirm() been called?
|
715
|
-
|
716
|
-
<p>
|
717
|
-
This function never throws an exception
|
718
|
-
</p></comment>
|
719
|
-
|
720
|
-
</function>
|
721
|
-
|
722
|
-
<function name="getAlert">
|
723
|
-
|
724
|
-
<return type="string">The message of the most recent JavaScript alert</return>
|
725
|
-
|
726
|
-
<comment>Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts.
|
727
|
-
|
728
|
-
<p>Getting an alert has the same effect as manually clicking OK. If an
|
729
|
-
alert is generated but you do not get/verify it, the next Selenium action
|
730
|
-
will fail.</p>
|
731
|
-
|
732
|
-
<p>NOTE: under Selenium, JavaScript alerts will NOT pop up a visible alert
|
733
|
-
dialog.</p>
|
734
|
-
|
735
|
-
<p>NOTE: Selenium does NOT support JavaScript alerts that are generated in a
|
736
|
-
page's onload() event handler. In this case a visible dialog WILL be
|
737
|
-
generated and Selenium will hang until someone manually clicks OK.</p></comment>
|
738
|
-
|
739
|
-
</function>
|
740
|
-
|
741
|
-
<function name="getConfirmation">
|
742
|
-
|
743
|
-
<return type="string">the message of the most recent JavaScript confirmation dialog</return>
|
744
|
-
|
745
|
-
<comment>Retrieves the message of a JavaScript confirmation dialog generated during
|
746
|
-
the previous action.
|
747
|
-
|
748
|
-
<p>
|
749
|
-
By default, the confirm function will return true, having the same effect
|
750
|
-
as manually clicking OK. This can be changed by prior execution of the
|
751
|
-
chooseCancelOnNextConfirmation command. If an confirmation is generated
|
752
|
-
but you do not get/verify it, the next Selenium action will fail.
|
753
|
-
</p>
|
754
|
-
|
755
|
-
<p>
|
756
|
-
NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible
|
757
|
-
dialog.
|
758
|
-
</p>
|
759
|
-
|
760
|
-
<p>
|
761
|
-
NOTE: Selenium does NOT support JavaScript confirmations that are
|
762
|
-
generated in a page's onload() event handler. In this case a visible
|
763
|
-
dialog WILL be generated and Selenium will hang until you manually click
|
764
|
-
OK.
|
765
|
-
</p></comment>
|
766
|
-
|
767
|
-
</function>
|
768
|
-
|
769
|
-
<function name="getPrompt">
|
770
|
-
|
771
|
-
<return type="string">the message of the most recent JavaScript question prompt</return>
|
772
|
-
|
773
|
-
<comment>Retrieves the message of a JavaScript question prompt dialog generated during
|
774
|
-
the previous action.
|
775
|
-
|
776
|
-
<p>Successful handling of the prompt requires prior execution of the
|
777
|
-
answerOnNextPrompt command. If a prompt is generated but you
|
778
|
-
do not get/verify it, the next Selenium action will fail.</p>
|
779
|
-
|
780
|
-
<p>NOTE: under Selenium, JavaScript prompts will NOT pop up a visible
|
781
|
-
dialog.</p>
|
782
|
-
|
783
|
-
<p>NOTE: Selenium does NOT support JavaScript prompts that are generated in a
|
784
|
-
page's onload() event handler. In this case a visible dialog WILL be
|
785
|
-
generated and Selenium will hang until someone manually clicks OK.</p></comment>
|
786
|
-
|
787
|
-
</function>
|
788
|
-
|
789
|
-
<function name="getLocation">
|
790
|
-
|
791
|
-
<return type="string">the absolute URL of the current page</return>
|
792
|
-
|
793
|
-
<comment>Gets the absolute URL of the current page.</comment>
|
794
|
-
|
795
|
-
</function>
|
796
|
-
|
797
|
-
<function name="getTitle">
|
798
|
-
|
799
|
-
<return type="string">the title of the current page</return>
|
800
|
-
|
801
|
-
<comment>Gets the title of the current page.</comment>
|
802
|
-
|
803
|
-
</function>
|
804
|
-
|
805
|
-
<function name="getBodyText">
|
806
|
-
|
807
|
-
<return type="string">the entire text of the page</return>
|
808
|
-
|
809
|
-
<comment>Gets the entire text of the page.</comment>
|
810
|
-
|
811
|
-
</function>
|
812
|
-
|
813
|
-
<function name="getValue">
|
814
|
-
|
815
|
-
<return type="string">the element value, or "on/off" for checkbox/radio elements</return>
|
816
|
-
|
817
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
818
|
-
|
819
|
-
<comment>Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter).
|
820
|
-
For checkbox/radio elements, the value will be "on" or "off" depending on
|
821
|
-
whether the element is checked or not.</comment>
|
822
|
-
|
823
|
-
</function>
|
824
|
-
|
825
|
-
<function name="getText">
|
826
|
-
|
827
|
-
<return type="string">the text of the element</return>
|
828
|
-
|
829
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
830
|
-
|
831
|
-
<comment>Gets the text of an element. This works for any element that contains
|
832
|
-
text. This command uses either the textContent (Mozilla-like browsers) or
|
833
|
-
the innerText (IE-like browsers) of the element, which is the rendered
|
834
|
-
text shown to the user.</comment>
|
835
|
-
|
836
|
-
</function>
|
837
|
-
|
838
|
-
<function name="highlight">
|
839
|
-
|
840
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
841
|
-
|
842
|
-
<comment>Briefly changes the backgroundColor of the specified element yellow. Useful for debugging.</comment>
|
843
|
-
|
844
|
-
</function>
|
845
|
-
|
846
|
-
<function name="getEval">
|
847
|
-
|
848
|
-
<return type="string">the results of evaluating the snippet</return>
|
849
|
-
|
850
|
-
<param name="script">the JavaScript snippet to run</param>
|
851
|
-
|
852
|
-
<comment>Gets the result of evaluating the specified JavaScript snippet. The snippet may
|
853
|
-
have multiple lines, but only the result of the last line will be returned.
|
854
|
-
|
855
|
-
<p>Note that, by default, the snippet will run in the context of the "selenium"
|
856
|
-
object itself, so <code>this</code> will refer to the Selenium object. Use <code>window</code> to
|
857
|
-
refer to the window of your application, e.g. <code>window.document.getElementById('foo')</code></p>
|
858
|
-
|
859
|
-
<p>If you need to use
|
860
|
-
a locator to refer to a single element in your application page, you can
|
861
|
-
use <code>this.browserbot.findElement("id=foo")</code> where "id=foo" is your locator.</p></comment>
|
862
|
-
|
863
|
-
</function>
|
864
|
-
|
865
|
-
<function name="isChecked">
|
866
|
-
|
867
|
-
<return type="boolean">true if the checkbox is checked, false otherwise</return>
|
868
|
-
|
869
|
-
<param name="locator">an <a href="#locators">element locator</a> pointing to a checkbox or radio button</param>
|
870
|
-
|
871
|
-
<comment>Gets whether a toggle-button (checkbox/radio) is checked. Fails if the specified element doesn't exist or isn't a toggle-button.</comment>
|
872
|
-
|
873
|
-
</function>
|
874
|
-
|
875
|
-
<function name="getTable">
|
876
|
-
|
877
|
-
<return type="string">the text from the specified cell</return>
|
878
|
-
|
879
|
-
<param name="tableCellAddress">a cell address, e.g. "foo.1.4"</param>
|
880
|
-
|
881
|
-
<comment>Gets the text from a cell of a table. The cellAddress syntax
|
882
|
-
tableLocator.row.column, where row and column start at 0.</comment>
|
883
|
-
|
884
|
-
</function>
|
885
|
-
|
886
|
-
<function name="getSelectedLabels">
|
887
|
-
|
888
|
-
<return type="string[]">an array of all selected option labels in the specified select drop-down</return>
|
889
|
-
|
890
|
-
<param name="selectLocator">an <a href="#locators">element locator</a> identifying a drop-down menu</param>
|
891
|
-
|
892
|
-
<comment>Gets all option labels (visible text) for selected options in the specified select or multi-select element.</comment>
|
893
|
-
|
894
|
-
</function>
|
895
|
-
|
896
|
-
<function name="getSelectedLabel">
|
897
|
-
|
898
|
-
<return type="string">the selected option label in the specified select drop-down</return>
|
899
|
-
|
900
|
-
<param name="selectLocator">an <a href="#locators">element locator</a> identifying a drop-down menu</param>
|
901
|
-
|
902
|
-
<comment>Gets option label (visible text) for selected option in the specified select element.</comment>
|
903
|
-
|
904
|
-
</function>
|
905
|
-
|
906
|
-
<function name="getSelectedValues">
|
907
|
-
|
908
|
-
<return type="string[]">an array of all selected option values in the specified select drop-down</return>
|
909
|
-
|
910
|
-
<param name="selectLocator">an <a href="#locators">element locator</a> identifying a drop-down menu</param>
|
911
|
-
|
912
|
-
<comment>Gets all option values (value attributes) for selected options in the specified select or multi-select element.</comment>
|
913
|
-
|
914
|
-
</function>
|
915
|
-
|
916
|
-
<function name="getSelectedValue">
|
917
|
-
|
918
|
-
<return type="string">the selected option value in the specified select drop-down</return>
|
919
|
-
|
920
|
-
<param name="selectLocator">an <a href="#locators">element locator</a> identifying a drop-down menu</param>
|
921
|
-
|
922
|
-
<comment>Gets option value (value attribute) for selected option in the specified select element.</comment>
|
923
|
-
|
924
|
-
</function>
|
925
|
-
|
926
|
-
<function name="getSelectedIndexes">
|
927
|
-
|
928
|
-
<return type="string[]">an array of all selected option indexes in the specified select drop-down</return>
|
929
|
-
|
930
|
-
<param name="selectLocator">an <a href="#locators">element locator</a> identifying a drop-down menu</param>
|
931
|
-
|
932
|
-
<comment>Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element.</comment>
|
933
|
-
|
934
|
-
</function>
|
935
|
-
|
936
|
-
<function name="getSelectedIndex">
|
937
|
-
|
938
|
-
<return type="string">the selected option index in the specified select drop-down</return>
|
939
|
-
|
940
|
-
<param name="selectLocator">an <a href="#locators">element locator</a> identifying a drop-down menu</param>
|
941
|
-
|
942
|
-
<comment>Gets option index (option number, starting at 0) for selected option in the specified select element.</comment>
|
943
|
-
|
944
|
-
</function>
|
945
|
-
|
946
|
-
<function name="getSelectedIds">
|
947
|
-
|
948
|
-
<return type="string[]">an array of all selected option IDs in the specified select drop-down</return>
|
949
|
-
|
950
|
-
<param name="selectLocator">an <a href="#locators">element locator</a> identifying a drop-down menu</param>
|
951
|
-
|
952
|
-
<comment>Gets all option element IDs for selected options in the specified select or multi-select element.</comment>
|
953
|
-
|
954
|
-
</function>
|
955
|
-
|
956
|
-
<function name="getSelectedId">
|
957
|
-
|
958
|
-
<return type="string">the selected option ID in the specified select drop-down</return>
|
959
|
-
|
960
|
-
<param name="selectLocator">an <a href="#locators">element locator</a> identifying a drop-down menu</param>
|
961
|
-
|
962
|
-
<comment>Gets option element ID for selected option in the specified select element.</comment>
|
963
|
-
|
964
|
-
</function>
|
965
|
-
|
966
|
-
<function name="isSomethingSelected">
|
967
|
-
|
968
|
-
<return type="boolean">true if some option has been selected, false otherwise</return>
|
969
|
-
|
970
|
-
<param name="selectLocator">an <a href="#locators">element locator</a> identifying a drop-down menu</param>
|
971
|
-
|
972
|
-
<comment>Determines whether some option in a drop-down menu is selected.</comment>
|
973
|
-
|
974
|
-
</function>
|
975
|
-
|
976
|
-
<function name="getSelectOptions">
|
977
|
-
|
978
|
-
<return type="string[]">an array of all option labels in the specified select drop-down</return>
|
979
|
-
|
980
|
-
<param name="selectLocator">an <a href="#locators">element locator</a> identifying a drop-down menu</param>
|
981
|
-
|
982
|
-
<comment>Gets all option labels in the specified select drop-down.</comment>
|
983
|
-
|
984
|
-
</function>
|
985
|
-
|
986
|
-
<function name="getAttribute">
|
987
|
-
|
988
|
-
<return type="string">the value of the specified attribute</return>
|
989
|
-
|
990
|
-
<param name="attributeLocator">an element locator followed by an @ sign and then the name of the attribute, e.g. "foo@bar"</param>
|
991
|
-
|
992
|
-
<comment>Gets the value of an element attribute.</comment>
|
993
|
-
|
994
|
-
</function>
|
995
|
-
|
996
|
-
<function name="isTextPresent">
|
997
|
-
|
998
|
-
<return type="boolean">true if the pattern matches the text, false otherwise</return>
|
999
|
-
|
1000
|
-
<param name="pattern">a <a href="#patterns">pattern</a> to match with the text of the page</param>
|
1001
|
-
|
1002
|
-
<comment>Verifies that the specified text pattern appears somewhere on the rendered page shown to the user.</comment>
|
1003
|
-
|
1004
|
-
</function>
|
1005
|
-
|
1006
|
-
<function name="isElementPresent">
|
1007
|
-
|
1008
|
-
<return type="boolean">true if the element is present, false otherwise</return>
|
1009
|
-
|
1010
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
1011
|
-
|
1012
|
-
<comment>Verifies that the specified element is somewhere on the page.</comment>
|
1013
|
-
|
1014
|
-
</function>
|
1015
|
-
|
1016
|
-
<function name="isVisible">
|
1017
|
-
|
1018
|
-
<return type="boolean">true if the specified element is visible, false otherwise</return>
|
1019
|
-
|
1020
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
1021
|
-
|
1022
|
-
<comment>Determines if the specified element is visible. An
|
1023
|
-
element can be rendered invisible by setting the CSS "visibility"
|
1024
|
-
property to "hidden", or the "display" property to "none", either for the
|
1025
|
-
element itself or one if its ancestors. This method will fail if
|
1026
|
-
the element is not present.</comment>
|
1027
|
-
|
1028
|
-
</function>
|
1029
|
-
|
1030
|
-
<function name="isEditable">
|
1031
|
-
|
1032
|
-
<return type="boolean">true if the input element is editable, false otherwise</return>
|
1033
|
-
|
1034
|
-
<param name="locator">an <a href="#locators">element locator</a></param>
|
1035
|
-
|
1036
|
-
<comment>Determines whether the specified input element is editable, ie hasn't been disabled.
|
1037
|
-
This method will fail if the specified element isn't an input element.</comment>
|
1038
|
-
|
1039
|
-
</function>
|
1040
|
-
|
1041
|
-
<function name="getAllButtons">
|
1042
|
-
|
1043
|
-
<return type="string[]">the IDs of all buttons on the page</return>
|
1044
|
-
|
1045
|
-
<comment>Returns the IDs of all buttons on the page.
|
1046
|
-
|
1047
|
-
<p>If a given button has no ID, it will appear as "" in this array.</p></comment>
|
1048
|
-
|
1049
|
-
</function>
|
1050
|
-
|
1051
|
-
<function name="getAllLinks">
|
1052
|
-
|
1053
|
-
<return type="string[]">the IDs of all links on the page</return>
|
1054
|
-
|
1055
|
-
<comment>Returns the IDs of all links on the page.
|
1056
|
-
|
1057
|
-
<p>If a given link has no ID, it will appear as "" in this array.</p></comment>
|
1058
|
-
|
1059
|
-
</function>
|
1060
|
-
|
1061
|
-
<function name="getAllFields">
|
1062
|
-
|
1063
|
-
<return type="string[]">the IDs of all field on the page</return>
|
1064
|
-
|
1065
|
-
<comment>Returns the IDs of all input fields on the page.
|
1066
|
-
|
1067
|
-
<p>If a given field has no ID, it will appear as "" in this array.</p></comment>
|
1068
|
-
|
1069
|
-
</function>
|
1070
|
-
|
1071
|
-
<function name="getAttributeFromAllWindows">
|
1072
|
-
|
1073
|
-
<return type="string[]">the set of values of this attribute from all known windows.</return>
|
1074
|
-
|
1075
|
-
<param name="attributeName">name of an attribute on the windows</param>
|
1076
|
-
|
1077
|
-
<comment>Returns every instance of some attribute from all known windows.</comment>
|
1078
|
-
|
1079
|
-
</function>
|
1080
|
-
|
1081
|
-
<function name="dragdrop">
|
1082
|
-
|
1083
|
-
<param name="locator">an element locator</param>
|
1084
|
-
|
1085
|
-
<param name="movementsString">offset in pixels from the current location to which the element should be moved, e.g., "+70,-300"</param>
|
1086
|
-
|
1087
|
-
<comment>deprecated - use dragAndDrop instead</comment>
|
1088
|
-
|
1089
|
-
</function>
|
1090
|
-
|
1091
|
-
<function name="setMouseSpeed">
|
1092
|
-
|
1093
|
-
<param name="pixels">the number of pixels between "mousemove" events</param>
|
1094
|
-
|
1095
|
-
<comment>Configure the number of pixels between "mousemove" events during dragAndDrop commands (default=10).
|
1096
|
-
<p>Setting this value to 0 means that we'll send a "mousemove" event to every single pixel
|
1097
|
-
in between the start location and the end location; that can be very slow, and may
|
1098
|
-
cause some browsers to force the JavaScript to timeout.</p>
|
1099
|
-
|
1100
|
-
<p>If the mouse speed is greater than the distance between the two dragged objects, we'll
|
1101
|
-
just send one "mousemove" at the start location and then one final one at the end location.</p></comment>
|
1102
|
-
|
1103
|
-
</function>
|
1104
|
-
|
1105
|
-
<function name="getMouseSpeed">
|
1106
|
-
|
1107
|
-
<return type="number">the number of pixels between "mousemove" events during dragAndDrop commands (default=10)</return>
|
1108
|
-
|
1109
|
-
<comment>Returns the number of pixels between "mousemove" events during dragAndDrop commands (default=10).</comment>
|
1110
|
-
|
1111
|
-
</function>
|
1112
|
-
|
1113
|
-
<function name="dragAndDrop">
|
1114
|
-
|
1115
|
-
<param name="locator">an element locator</param>
|
1116
|
-
|
1117
|
-
<param name="movementsString">offset in pixels from the current location to which the element should be moved, e.g., "+70,-300"</param>
|
1118
|
-
|
1119
|
-
<comment>Drags an element a certain distance and then drops it</comment>
|
1120
|
-
|
1121
|
-
</function>
|
1122
|
-
|
1123
|
-
<function name="dragAndDropToObject">
|
1124
|
-
|
1125
|
-
<param name="locatorOfObjectToBeDragged">an element to be dragged</param>
|
1126
|
-
|
1127
|
-
<param name="locatorOfDragDestinationObject">an element whose location (i.e., whose center-most pixel) will be the point where locatorOfObjectToBeDragged is dropped</param>
|
1128
|
-
|
1129
|
-
<comment>Drags an element and drops it on another element</comment>
|
1130
|
-
|
1131
|
-
</function>
|
1132
|
-
|
1133
|
-
<function name="windowFocus">
|
1134
|
-
|
1135
|
-
<comment>Gives focus to the currently selected window</comment>
|
1136
|
-
|
1137
|
-
</function>
|
1138
|
-
|
1139
|
-
<function name="windowMaximize">
|
1140
|
-
|
1141
|
-
<comment>Resize currently selected window to take up the entire screen</comment>
|
1142
|
-
|
1143
|
-
</function>
|
1144
|
-
|
1145
|
-
<function name="getAllWindowIds">
|
1146
|
-
|
1147
|
-
<return type="string[]">the IDs of all windows that the browser knows about.</return>
|
1148
|
-
|
1149
|
-
<comment>Returns the IDs of all windows that the browser knows about.</comment>
|
1150
|
-
|
1151
|
-
</function>
|
1152
|
-
|
1153
|
-
<function name="getAllWindowNames">
|
1154
|
-
|
1155
|
-
<return type="string[]">the names of all windows that the browser knows about.</return>
|
1156
|
-
|
1157
|
-
<comment>Returns the names of all windows that the browser knows about.</comment>
|
1158
|
-
|
1159
|
-
</function>
|
1160
|
-
|
1161
|
-
<function name="getAllWindowTitles">
|
1162
|
-
|
1163
|
-
<return type="string[]">the titles of all windows that the browser knows about.</return>
|
1164
|
-
|
1165
|
-
<comment>Returns the titles of all windows that the browser knows about.</comment>
|
1166
|
-
|
1167
|
-
</function>
|
1168
|
-
|
1169
|
-
<function name="getHtmlSource">
|
1170
|
-
|
1171
|
-
<return type="string">the entire HTML source</return>
|
1172
|
-
|
1173
|
-
<comment>Returns the entire HTML source between the opening and
|
1174
|
-
closing "html" tags.</comment>
|
1175
|
-
|
1176
|
-
</function>
|
1177
|
-
|
1178
|
-
<function name="setCursorPosition">
|
1179
|
-
|
1180
|
-
<param name="locator">an <a href="#locators">element locator</a> pointing to an input element or textarea</param>
|
1181
|
-
|
1182
|
-
<param name="position">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.</param>
|
1183
|
-
|
1184
|
-
<comment>Moves the text cursor to the specified position in the given input element or textarea.
|
1185
|
-
This method will fail if the specified element isn't an input element or textarea.</comment>
|
1186
|
-
|
1187
|
-
</function>
|
1188
|
-
|
1189
|
-
<function name="getElementIndex">
|
1190
|
-
|
1191
|
-
<return type="number">of relative index of the element to its parent (starting from 0)</return>
|
1192
|
-
|
1193
|
-
<param name="locator">an <a href="#locators">element locator</a> pointing to an element</param>
|
1194
|
-
|
1195
|
-
<comment>Get the relative index of an element to its parent (starting from 0). The comment node and empty text node
|
1196
|
-
will be ignored.</comment>
|
1197
|
-
|
1198
|
-
</function>
|
1199
|
-
|
1200
|
-
<function name="isOrdered">
|
1201
|
-
|
1202
|
-
<return type="boolean">true if element1 is the previous sibling of element2, false otherwise</return>
|
1203
|
-
|
1204
|
-
<param name="locator1">an <a href="#locators">element locator</a> pointing to the first element</param>
|
1205
|
-
|
1206
|
-
<param name="locator2">an <a href="#locators">element locator</a> pointing to the second element</param>
|
1207
|
-
|
1208
|
-
<comment>Check if these two elements have same parent and are ordered siblings in the DOM. Two same elements will
|
1209
|
-
not be considered ordered.</comment>
|
1210
|
-
|
1211
|
-
</function>
|
1212
|
-
|
1213
|
-
<function name="getElementPositionLeft">
|
1214
|
-
|
1215
|
-
<return type="number">of pixels from the edge of the frame.</return>
|
1216
|
-
|
1217
|
-
<param name="locator">an <a href="#locators">element locator</a> pointing to an element OR an element itself</param>
|
1218
|
-
|
1219
|
-
<comment>Retrieves the horizontal position of an element</comment>
|
1220
|
-
|
1221
|
-
</function>
|
1222
|
-
|
1223
|
-
<function name="getElementPositionTop">
|
1224
|
-
|
1225
|
-
<return type="number">of pixels from the edge of the frame.</return>
|
1226
|
-
|
1227
|
-
<param name="locator">an <a href="#locators">element locator</a> pointing to an element OR an element itself</param>
|
1228
|
-
|
1229
|
-
<comment>Retrieves the vertical position of an element</comment>
|
1230
|
-
|
1231
|
-
</function>
|
1232
|
-
|
1233
|
-
<function name="getElementWidth">
|
1234
|
-
|
1235
|
-
<return type="number">width of an element in pixels</return>
|
1236
|
-
|
1237
|
-
<param name="locator">an <a href="#locators">element locator</a> pointing to an element</param>
|
1238
|
-
|
1239
|
-
<comment>Retrieves the width of an element</comment>
|
1240
|
-
|
1241
|
-
</function>
|
1242
|
-
|
1243
|
-
<function name="getElementHeight">
|
1244
|
-
|
1245
|
-
<return type="number">height of an element in pixels</return>
|
1246
|
-
|
1247
|
-
<param name="locator">an <a href="#locators">element locator</a> pointing to an element</param>
|
1248
|
-
|
1249
|
-
<comment>Retrieves the height of an element</comment>
|
1250
|
-
|
1251
|
-
</function>
|
1252
|
-
|
1253
|
-
<function name="getCursorPosition">
|
1254
|
-
|
1255
|
-
<return type="number">the numerical position of the cursor in the field</return>
|
1256
|
-
|
1257
|
-
<param name="locator">an <a href="#locators">element locator</a> pointing to an input element or textarea</param>
|
1258
|
-
|
1259
|
-
<comment>Retrieves the text cursor position in the given input element or textarea; beware, this may not work perfectly on all browsers.
|
1260
|
-
|
1261
|
-
<p>Specifically, if the cursor/selection has been cleared by JavaScript, this command will tend to
|
1262
|
-
return the position of the last location of the cursor, even though the cursor is now gone from the page. This is filed as <a href="http://jira.openqa.org/browse/SEL-243">SEL-243</a>.</p>
|
1263
|
-
This method will fail if the specified element isn't an input element or textarea, or there is no cursor in the element.</comment>
|
1264
|
-
|
1265
|
-
</function>
|
1266
|
-
|
1267
|
-
<function name="getExpression">
|
1268
|
-
|
1269
|
-
<return type="string">the value passed in</return>
|
1270
|
-
|
1271
|
-
<param name="expression">the value to return</param>
|
1272
|
-
|
1273
|
-
<comment>Returns the specified expression.
|
1274
|
-
|
1275
|
-
<p>This is useful because of JavaScript preprocessing.
|
1276
|
-
It is used to generate commands like assertExpression and waitForExpression.</p></comment>
|
1277
|
-
|
1278
|
-
</function>
|
1279
|
-
|
1280
|
-
<function name="getXpathCount">
|
1281
|
-
|
1282
|
-
<return type="number">the number of nodes that match the specified xpath</return>
|
1283
|
-
|
1284
|
-
<param name="xpath">the xpath expression to evaluate. do NOT wrap this expression in a 'count()' function; we will do that for you.</param>
|
1285
|
-
|
1286
|
-
<comment>Returns the number of nodes that match the specified xpath, eg. "//table" would give
|
1287
|
-
the number of tables.</comment>
|
1288
|
-
|
1289
|
-
</function>
|
1290
|
-
|
1291
|
-
<function name="assignId">
|
1292
|
-
|
1293
|
-
<param name="locator">an <a href="#locators">element locator</a> pointing to an element</param>
|
1294
|
-
|
1295
|
-
<param name="identifier">a string to be used as the ID of the specified element</param>
|
1296
|
-
|
1297
|
-
<comment>Temporarily sets the "id" attribute of the specified element, so you can locate it in the future
|
1298
|
-
using its ID rather than a slow/complicated XPath. This ID will disappear once the page is
|
1299
|
-
reloaded.</comment>
|
1300
|
-
|
1301
|
-
</function>
|
1302
|
-
|
1303
|
-
<function name="allowNativeXpath">
|
1304
|
-
|
1305
|
-
<param name="allow">boolean, true means we'll prefer to use native XPath; false means we'll only use JS XPath</param>
|
1306
|
-
|
1307
|
-
<comment>Specifies whether Selenium should use the native in-browser implementation
|
1308
|
-
of XPath (if any native version is available); if you pass "false" to
|
1309
|
-
this function, we will always use our pure-JavaScript xpath library.
|
1310
|
-
Using the pure-JS xpath library can improve the consistency of xpath
|
1311
|
-
element locators between different browser vendors, but the pure-JS
|
1312
|
-
version is much slower than the native implementations.</comment>
|
1313
|
-
|
1314
|
-
</function>
|
1315
|
-
|
1316
|
-
<function name="waitForCondition">
|
1317
|
-
|
1318
|
-
<param name="script">the JavaScript snippet to run</param>
|
1319
|
-
|
1320
|
-
<param name="timeout">a timeout in milliseconds, after which this command will return with an error</param>
|
1321
|
-
|
1322
|
-
<comment>Runs the specified JavaScript snippet repeatedly until it evaluates to "true".
|
1323
|
-
The snippet may have multiple lines, but only the result of the last line
|
1324
|
-
will be considered.
|
1325
|
-
|
1326
|
-
<p>Note that, by default, the snippet will be run in the runner's test window, not in the window
|
1327
|
-
of your application. To get the window of your application, you can use
|
1328
|
-
the JavaScript snippet <code>selenium.browserbot.getCurrentWindow()</code>, and then
|
1329
|
-
run your JavaScript in there</p></comment>
|
1330
|
-
|
1331
|
-
</function>
|
1332
|
-
|
1333
|
-
<function name="setTimeout">
|
1334
|
-
|
1335
|
-
<param name="timeout">a timeout in milliseconds, after which the action will return with an error</param>
|
1336
|
-
|
1337
|
-
<comment>Specifies the amount of time that Selenium will wait for actions to complete.
|
1338
|
-
|
1339
|
-
<p>Actions that require waiting include "open" and the "waitFor*" actions.</p>
|
1340
|
-
The default timeout is 30 seconds.</comment>
|
1341
|
-
|
1342
|
-
</function>
|
1343
|
-
|
1344
|
-
<function name="waitForPageToLoad">
|
1345
|
-
|
1346
|
-
<param name="timeout">a timeout in milliseconds, after which this command will return with an error</param>
|
1347
|
-
|
1348
|
-
<comment>Waits for a new page to load.
|
1349
|
-
|
1350
|
-
<p>You can use this command instead of the "AndWait" suffixes, "clickAndWait", "selectAndWait", "typeAndWait" etc.
|
1351
|
-
(which are only available in the JS API).</p>
|
1352
|
-
|
1353
|
-
<p>Selenium constantly keeps track of new pages loading, and sets a "newPageLoaded"
|
1354
|
-
flag when it first notices a page load. Running any other Selenium command after
|
1355
|
-
turns the flag to false. Hence, if you want to wait for a page to load, you must
|
1356
|
-
wait immediately after a Selenium command that caused a page-load.</p></comment>
|
1357
|
-
|
1358
|
-
</function>
|
1359
|
-
|
1360
|
-
<function name="waitForFrameToLoad">
|
1361
|
-
|
1362
|
-
<param name="frameAddress">FrameAddress from the server side</param>
|
1363
|
-
|
1364
|
-
<param name="timeout">a timeout in milliseconds, after which this command will return with an error</param>
|
1365
|
-
|
1366
|
-
<comment>Waits for a new frame to load.
|
1367
|
-
|
1368
|
-
<p>Selenium constantly keeps track of new pages and frames loading,
|
1369
|
-
and sets a "newPageLoaded" flag when it first notices a page load.</p>
|
1370
|
-
|
1371
|
-
See waitForPageToLoad for more information.</comment>
|
1372
|
-
|
1373
|
-
</function>
|
1374
|
-
|
1375
|
-
<function name="getCookie">
|
1376
|
-
|
1377
|
-
<return type="string">all cookies of the current page under test</return>
|
1378
|
-
|
1379
|
-
<comment>Return all cookies of the current page under test.</comment>
|
1380
|
-
|
1381
|
-
</function>
|
1382
|
-
|
1383
|
-
<function name="createCookie">
|
1384
|
-
|
1385
|
-
<param name="nameValuePair">name and value of the cookie in a format "name=value"</param>
|
1386
|
-
|
1387
|
-
<param name="optionsString">options for the cookie. Currently supported options include 'path' and 'max_age'. the optionsString's format is "path=/path/, max_age=60". The order of options are irrelevant, the unit of the value of 'max_age' is second.</param>
|
1388
|
-
|
1389
|
-
<comment>Create a new cookie whose path and domain are same with those of current page
|
1390
|
-
under test, unless you specified a path for this cookie explicitly.</comment>
|
1391
|
-
|
1392
|
-
</function>
|
1393
|
-
|
1394
|
-
<function name="deleteCookie">
|
1395
|
-
|
1396
|
-
<param name="name">the name of the cookie to be deleted</param>
|
1397
|
-
|
1398
|
-
<param name="path">the path property of the cookie to be deleted</param>
|
1399
|
-
|
1400
|
-
<comment>Delete a named cookie with specified path.</comment>
|
1401
|
-
|
1402
|
-
</function>
|
1403
|
-
|
1404
|
-
<function name="setBrowserLogLevel">
|
1405
|
-
|
1406
|
-
<param name="logLevel">one of the following: "debug", "info", "warn", "error" or "off"</param>
|
1407
|
-
|
1408
|
-
<comment>Sets the threshold for browser-side logging messages; log messages beneath this threshold will be discarded.
|
1409
|
-
Valid logLevel strings are: "debug", "info", "warn", "error" or "off".
|
1410
|
-
To see the browser logs, you need to
|
1411
|
-
either show the log window in GUI mode, or enable browser-side logging in Selenium RC.</comment>
|
1412
|
-
|
1413
|
-
</function>
|
1414
|
-
|
1415
|
-
<function name="runScript">
|
1416
|
-
|
1417
|
-
<param name="script">the JavaScript snippet to run</param>
|
1418
|
-
|
1419
|
-
<comment>Creates a new "script" tag in the body of the current test window, and
|
1420
|
-
adds the specified text into the body of the command. Scripts run in
|
1421
|
-
this way can often be debugged more easily than scripts executed using
|
1422
|
-
Selenium's "getEval" command. Beware that JS exceptions thrown in these script
|
1423
|
-
tags aren't managed by Selenium, so you should probably wrap your script
|
1424
|
-
in try/catch blocks if there is any chance that the script will throw
|
1425
|
-
an exception.</comment>
|
1426
|
-
|
1427
|
-
</function>
|
1428
|
-
|
1429
|
-
<function name="addLocationStrategy">
|
1430
|
-
|
1431
|
-
<param name="strategyName">the name of the strategy to define; this should use only letters [a-zA-Z] with no spaces or other punctuation.</param>
|
1432
|
-
|
1433
|
-
<param name="functionDefinition">a string defining the body of a function in JavaScript. For example: <code>return inDocument.getElementById(locator);</code></param>
|
1434
|
-
|
1435
|
-
<comment>Defines a new function for Selenium to locate elements on the page.
|
1436
|
-
For example,
|
1437
|
-
if you define the strategy "foo", and someone runs click("foo=blah"), we'll
|
1438
|
-
run your function, passing you the string "blah", and click on the element
|
1439
|
-
that your function
|
1440
|
-
returns, or throw an "Element not found" error if your function returns null.
|
1441
|
-
|
1442
|
-
We'll pass three arguments to your function:
|
1443
|
-
<ul>
|
1444
|
-
<li>locator: the string the user passed in</li>
|
1445
|
-
<li>inWindow: the currently selected window</li>
|
1446
|
-
<li>inDocument: the currently selected document</li>
|
1447
|
-
</ul>
|
1448
|
-
The function must return null if the element can't be found.</comment>
|
1449
|
-
|
1450
|
-
</function>
|
1451
|
-
|
1452
|
-
<function name="setContext">
|
1453
|
-
|
1454
|
-
<param name="context">the message to be sent to the browser</param>
|
1455
|
-
|
1456
|
-
<comment>Writes a message to the status bar and adds a note to the browser-side
|
1457
|
-
log.</comment>
|
1458
|
-
|
1459
|
-
</function>
|
1460
|
-
|
1461
|
-
<function name="captureScreenshot">
|
1462
|
-
|
1463
|
-
<param name="filename">the absolute path to the file to be written, e.g. "c:\blah\screenshot.png"</param>
|
1464
|
-
|
1465
|
-
<comment>Captures a PNG screenshot to the specified file.</comment>
|
1466
|
-
|
1467
|
-
</function>
|
1468
|
-
|
1469
|
-
</apidoc>
|