From f6b8e6c4e2f19f33e9ffef9ae0f6633b48343d34 Mon Sep 17 00:00:00 2001 From: AutomatedTester Date: Tue, 11 Aug 2026 15:16:48 +0100 Subject: [PATCH 1/2] Upgrade Hugo to 0.164.0 and Docsy to 0.16.0 The repo was pinned to Hugo 0.148.2 and Docsy 0.10.0, six Docsy minor releases behind. Docsy 0.16.0 requires Hugo 0.160.1 or later and is validated against 0.164.0, so both move together. Docsy 0.16.0 breaking changes: - The theme moved into theme/, so the module import path becomes github.com/google/docsy/theme. - Bootstrap and Font Awesome are npm dependencies rather than Hugo modules, so github.com/google/docsy/dependencies is dropped and `hugo mod npm pack` generates packages/hugoautogen/. Re-run it, then `npm install`, whenever Docsy is updated. - PostCSS is opt-in for sites with no RTL language and no PostCSS config of their own, so autoprefixer, postcss, and postcss-cli are removed. - Docsy no longer ships default favicon artwork. Six of the ten icons the site linked came from Docsy, not this repository; the new default partial only discovers icons in static/, while ours live in static/favicons/. layouts/_partials/favicons.html keeps every existing icon URL and uses Selenium's own pwa-*.png in place of Docsy's. Hugo changes between 0.148.2 and 0.164.0: - Language config and template APIs were renamed in 0.158.0: languageName -> label, .Language.Lang -> .Language.Name, .Language.LanguageName -> .Language.Label. - .Site.Data was deprecated in 0.156.0 in favour of hugo.Data. - The gist and twitter/tweet shortcodes were removed in 0.156.0. tweet is replaced by the built-in x shortcode; gist is replaced by a local shortcode reproducing Hugo's removed template. - text/html content files are denied by default from 0.162.0, so security.allowContent explicitly allows the .html landing pages this site publishes. - The global imaging.quality setting was deprecated in 0.163.0. It was set to 75, already Hugo's default, so removing it changes no output. - .Render now fails the build on a missing view template instead of rendering nothing, which surfaced meetings/single.html calling the Docsy content view by its pre-0.16 name. Alias handling (Hugo 0.155.0, gohugoio/hugo#14388): Aliases on a page in a non-default language are now published relative to that language's site root rather than the publish root, because languages previously clobbered each other's aliases. Both alias styles in this repo had to move, and all 508 affected URLs still publish at their current paths: - 260 aliases already carrying their own language prefix would have been published twice-prefixed (/ja/ja/...). The prefix is now dropped from front matter and Hugo adds it. - 248 legacy /documentation//... aliases predate the 2021 restructure and sit at the site root, which is the English namespace. A translated page can no longer publish there, so they move to the English counterpart. The URLs keep working; they now resolve to the English page rather than the translated one. Verified against a 0.148.2 baseline build: llms.txt is byte-identical, tab rendering is unchanged, canonical and hreflang links are intact, and no non-print URL is lost. The 224 remaining differences are noindex meta-refresh stubs of print-format aliases, which Hugo no longer renders for unrendered pages. --- .github/workflows/deploy.yml | 2 +- .github/workflows/link-check.yml | 2 +- .github/workflows/test.yml | 2 +- .gitpod.yml | 6 +- README.md | 10 +- netlify.toml | 18 +- .../blog/2020/selenium-4-alpha-6-is-out.md | 14 +- .../blog/2021/new-look-for-selenium-site.md | 2 +- .../content/blog/2021/selenium-4-rc-1.md | 10 +- .../content/blog/2021/selenium-4-rc-2.md | 8 +- .../content/documentation/_index.en.md | 2 +- .../content/documentation/_index.ja.md | 1 - .../content/documentation/_index.pt-br.md | 1 - .../content/documentation/_index.zh-cn.md | 1 - .../content/documentation/about/_index.en.md | 10 +- .../content/documentation/about/_index.ja.md | 6 +- .../documentation/about/_index.pt-br.md | 6 +- .../documentation/about/_index.zh-cn.md | 6 +- .../documentation/about/contributing.en.md | 10 +- .../documentation/about/contributing.ja.md | 7 +- .../documentation/about/contributing.pt-br.md | 7 +- .../documentation/about/contributing.zh-cn.md | 6 +- .../documentation/about/copyright.en.md | 5 +- .../documentation/about/copyright.ja.md | 3 +- .../documentation/about/copyright.pt-br.md | 3 +- .../documentation/about/copyright.zh-cn.md | 3 +- .../content/documentation/grid/_index.en.md | 16 +- .../content/documentation/grid/_index.ja.md | 7 - .../documentation/grid/_index.pt-br.md | 7 - .../documentation/grid/_index.zh-cn.md | 7 - .../grid/advanced_features/_index.en.md | 2 +- .../grid/advanced_features/_index.ja.md | 1 - .../grid/advanced_features/_index.pt-br.md | 1 - .../grid/advanced_features/_index.zh-cn.md | 1 - .../grid/advanced_features/endpoints.en.md | 5 +- .../grid/advanced_features/endpoints.ja.md | 3 +- .../grid/advanced_features/endpoints.pt-br.md | 3 +- .../grid/advanced_features/endpoints.zh-cn.md | 3 +- .../advanced_features/graphql_support.en.md | 2 +- .../advanced_features/graphql_support.ja.md | 1 - .../graphql_support.pt-br.md | 1 - .../graphql_support.zh-cn.md | 1 - .../advanced_features/observability.en.md | 2 +- .../advanced_features/observability.ja.md | 1 - .../advanced_features/observability.pt-br.md | 1 - .../advanced_features/observability.zh-cn.md | 1 - .../documentation/grid/applicability.en.md | 5 +- .../documentation/grid/applicability.ja.md | 3 +- .../documentation/grid/applicability.pt-br.md | 3 +- .../documentation/grid/applicability.zh-cn.md | 3 +- .../documentation/grid/architecture.ja.md | 2 +- .../documentation/grid/architecture.pt-br.md | 2 +- .../documentation/grid/architecture.zh-cn.md | 2 +- .../documentation/grid/components.en.md | 5 +- .../documentation/grid/components.ja.md | 3 +- .../documentation/grid/components.pt-br.md | 3 +- .../documentation/grid/components.zh-cn.md | 3 +- .../grid/configuration/_index.en.md | 5 +- .../grid/configuration/_index.ja.md | 3 +- .../grid/configuration/_index.pt-br.md | 3 +- .../grid/configuration/_index.zh-cn.md | 3 +- .../grid/configuration/cli_options.ja.md | 2 +- .../grid/configuration/cli_options.pt-br.md | 2 +- .../grid/configuration/cli_options.zh-cn.md | 2 +- .../grid/configuration/help.en.md | 5 +- .../grid/configuration/help.ja.md | 3 +- .../grid/configuration/help.pt-br.md | 3 +- .../grid/configuration/help.zh-cn.md | 3 +- .../grid/configuration/toml_options.ja.md | 2 +- .../grid/configuration/toml_options.pt-br.md | 2 +- .../grid/configuration/toml_options.zh-cn.md | 2 +- .../documentation/grid/getting_started.en.md | 5 +- .../documentation/grid/getting_started.ja.md | 3 +- .../grid/getting_started.pt-br.md | 3 +- .../grid/getting_started.zh-cn.md | 3 +- .../content/documentation/legacy/_index.en.md | 2 +- .../content/documentation/legacy/_index.ja.md | 1 - .../documentation/legacy/_index.pt-br.md | 1 - .../documentation/legacy/_index.zh-cn.md | 1 - .../documentation/legacy/selenium_1.en.md | 5 +- .../documentation/legacy/selenium_1.ja.md | 3 +- .../documentation/legacy/selenium_1.pt-br.md | 3 +- .../documentation/legacy/selenium_1.zh-cn.md | 3 +- .../legacy/selenium_2/remote_server.en.md | 5 +- .../legacy/selenium_2/remote_server.ja.md | 3 +- .../legacy/selenium_2/remote_server.pt-br.md | 3 +- .../legacy/selenium_2/remote_server.zh-cn.md | 3 +- .../legacy/selenium_2/upgrading.en.md | 5 +- .../legacy/selenium_2/upgrading.ja.md | 3 +- .../legacy/selenium_2/upgrading.pt-br.md | 3 +- .../legacy/selenium_2/upgrading.zh-cn.md | 3 +- .../legacy/selenium_3/grid_3.en.md | 5 +- .../legacy/selenium_3/grid_3.ja.md | 3 +- .../legacy/selenium_3/grid_3.pt-br.md | 3 +- .../legacy/selenium_3/grid_3.zh-cn.md | 3 +- .../legacy/selenium_3/grid_components.en.md | 5 +- .../legacy/selenium_3/grid_components.ja.md | 1 - .../selenium_3/grid_components.pt-br.md | 1 - .../selenium_3/grid_components.zh-cn.md | 1 - .../legacy/selenium_3/grid_setup.en.md | 5 +- .../legacy/selenium_3/grid_setup.ja.md | 3 +- .../legacy/selenium_3/grid_setup.pt-br.md | 3 +- .../legacy/selenium_3/grid_setup.zh-cn.md | 3 +- .../legacy/selenium_ide/_index.en.md | 2 +- .../legacy/selenium_ide/_index.ja.md | 1 - .../legacy/selenium_ide/_index.pt-br.md | 1 - .../legacy/selenium_ide/_index.zh-cn.md | 1 - .../legacy/selenium_ide/html_runner.en.md | 5 +- .../legacy/selenium_ide/html_runner.ja.md | 3 +- .../legacy/selenium_ide/html_runner.pt-br.md | 3 +- .../legacy/selenium_ide/html_runner.zh-cn.md | 3 +- .../documentation/overview/_index.en.md | 2 +- .../documentation/overview/_index.ja.md | 1 - .../documentation/overview/_index.pt-br.md | 1 - .../documentation/overview/_index.zh-cn.md | 1 - .../documentation/overview/components.en.md | 5 +- .../documentation/overview/components.ja.md | 3 +- .../overview/components.pt-br.md | 3 +- .../overview/components.zh-cn.md | 3 +- .../documentation/overview/details.en.md | 5 +- .../documentation/overview/details.ja.md | 3 +- .../documentation/overview/details.pt-br.md | 3 +- .../documentation/overview/details.zh-cn.md | 3 +- .../test_practices/discouraged/_index.en.md | 5 +- .../test_practices/discouraged/_index.ja.md | 3 +- .../discouraged/_index.pt-br.md | 3 +- .../discouraged/_index.zh-cn.md | 3 +- .../test_practices/discouraged/captchas.en.md | 5 +- .../test_practices/discouraged/captchas.ja.md | 3 +- .../discouraged/captchas.pt-br.md | 3 +- .../discouraged/captchas.zh-cn.md | 3 +- .../discouraged/file_downloads.en.md | 5 +- .../discouraged/file_downloads.ja.md | 3 +- .../discouraged/file_downloads.pt-br.md | 3 +- .../discouraged/file_downloads.zh-cn.md | 3 +- .../gmail_email_and_facebook_logins.en.md | 5 +- .../gmail_email_and_facebook_logins.ja.md | 3 +- .../gmail_email_and_facebook_logins.pt-br.md | 3 +- .../gmail_email_and_facebook_logins.zh-cn.md | 3 +- .../discouraged/http_response_codes.en.md | 5 +- .../discouraged/http_response_codes.ja.md | 3 +- .../discouraged/http_response_codes.pt-br.md | 3 +- .../discouraged/http_response_codes.zh-cn.md | 3 +- .../discouraged/link_spidering.en.md | 5 +- .../discouraged/link_spidering.ja.md | 3 +- .../discouraged/link_spidering.pt-br.md | 3 +- .../discouraged/link_spidering.zh-cn.md | 3 +- .../discouraged/performance_testing.en.md | 5 +- .../discouraged/performance_testing.ja.md | 3 +- .../discouraged/performance_testing.pt-br.md | 3 +- .../discouraged/performance_testing.zh-cn.md | 3 +- .../discouraged/test_dependency.en.md | 5 +- .../discouraged/test_dependency.ja.md | 3 +- .../discouraged/test_dependency.pt-br.md | 3 +- .../discouraged/test_dependency.zh-cn.md | 3 +- .../two_factor_authentication.en.md | 5 +- .../two_factor_authentication.ja.md | 3 +- .../two_factor_authentication.pt-br.md | 3 +- .../two_factor_authentication.zh-cn.md | 3 +- .../test_practices/encouraged/_index.en.md | 5 +- .../test_practices/encouraged/_index.ja.md | 3 +- .../test_practices/encouraged/_index.pt-br.md | 3 +- .../test_practices/encouraged/_index.zh-cn.md | 3 +- .../encouraged/avoid_sharing_state.en.md | 5 +- .../encouraged/avoid_sharing_state.ja.md | 3 +- .../encouraged/avoid_sharing_state.pt-br.md | 3 +- .../encouraged/avoid_sharing_state.zh-cn.md | 3 +- .../consider_using_a_fluent_api.en.md | 5 +- .../consider_using_a_fluent_api.ja.md | 3 +- .../consider_using_a_fluent_api.pt-br.md | 3 +- .../consider_using_a_fluent_api.zh-cn.md | 3 +- .../encouraged/domain_specific_language.en.md | 5 +- .../encouraged/domain_specific_language.ja.md | 3 +- .../domain_specific_language.pt-br.md | 3 +- .../domain_specific_language.zh-cn.md | 3 +- .../encouraged/fresh_browser_per_test.en.md | 5 +- .../encouraged/fresh_browser_per_test.ja.md | 3 +- .../fresh_browser_per_test.pt-br.md | 3 +- .../fresh_browser_per_test.zh-cn.md | 3 +- .../generating_application_state.en.md | 5 +- .../generating_application_state.ja.md | 3 +- .../generating_application_state.pt-br.md | 3 +- .../generating_application_state.zh-cn.md | 3 +- .../encouraged/improved_reporting.en.md | 5 +- .../encouraged/improved_reporting.ja.md | 3 +- .../encouraged/improved_reporting.pt-br.md | 3 +- .../encouraged/improved_reporting.zh-cn.md | 3 +- .../encouraged/mock_external_services.en.md | 5 +- .../encouraged/mock_external_services.ja.md | 3 +- .../mock_external_services.pt-br.md | 3 +- .../mock_external_services.zh-cn.md | 3 +- .../encouraged/page_object_models.en.md | 5 +- .../encouraged/page_object_models.ja.md | 3 +- .../encouraged/page_object_models.pt-br.md | 3 +- .../encouraged/page_object_models.zh-cn.md | 3 +- .../encouraged/test_independency.en.md | 5 +- .../encouraged/test_independency.ja.md | 3 +- .../encouraged/test_independency.pt-br.md | 3 +- .../encouraged/test_independency.zh-cn.md | 3 +- .../test_practices/overview.en.md | 5 +- .../test_practices/overview.ja.md | 3 +- .../test_practices/overview.pt-br.md | 3 +- .../test_practices/overview.zh-cn.md | 3 +- .../test_practices/testing_types.en.md | 5 +- .../test_practices/testing_types.ja.md | 3 +- .../test_practices/testing_types.pt-br.md | 3 +- .../test_practices/testing_types.zh-cn.md | 3 +- .../documentation/webdriver/_index.en.md | 2 +- .../documentation/webdriver/_index.ja.md | 1 - .../documentation/webdriver/_index.pt-br.md | 1 - .../documentation/webdriver/_index.zh-cn.md | 1 - .../webdriver/actions_api/keyboard.en.md | 5 +- .../webdriver/actions_api/keyboard.ja.md | 3 +- .../webdriver/actions_api/keyboard.pt-br.md | 3 +- .../webdriver/actions_api/keyboard.zh-cn.md | 3 +- .../webdriver/actions_api/mouse.en.md | 5 +- .../webdriver/actions_api/mouse.ja.md | 3 +- .../webdriver/actions_api/mouse.pt-br.md | 3 +- .../webdriver/actions_api/mouse.zh-cn.md | 3 +- .../webdriver/bidi/logging.en.md | 4 +- .../webdriver/bidi/logging.ja.md | 3 +- .../webdriver/bidi/logging.zh-cn.md | 3 +- .../documentation/webdriver/bidi/script.en.md | 5 +- .../documentation/webdriver/bidi/script.ja.md | 3 +- .../webdriver/bidi/script.pt-br.md | 3 +- .../webdriver/bidi/script.zh-cn.md | 3 +- .../webdriver/bidi/w3c/_index.en.md | 5 +- .../webdriver/bidi/w3c/_index.ja.md | 3 +- .../webdriver/bidi/w3c/_index.pt-br.md | 3 +- .../webdriver/bidi/w3c/_index.zh-cn.md | 3 +- .../webdriver/browsers/_index.en.md | 6 + .../webdriver/browsers/_index.ja.md | 8 +- .../webdriver/browsers/_index.pt-br.md | 8 +- .../webdriver/browsers/_index.zh-cn.md | 8 +- .../webdriver/browsers/chrome.ja.md | 2 +- .../webdriver/browsers/chrome.pt-br.md | 2 +- .../webdriver/browsers/chrome.zh-cn.md | 2 +- .../webdriver/browsers/firefox.ja.md | 2 +- .../webdriver/browsers/firefox.pt-br.md | 2 +- .../webdriver/browsers/firefox.zh-cn.md | 2 +- .../browsers/internet_explorer.ja.md | 2 +- .../browsers/internet_explorer.pt-br.md | 2 +- .../browsers/internet_explorer.zh-cn.md | 2 +- .../webdriver/browsers/safari.ja.md | 2 +- .../webdriver/browsers/safari.pt-br.md | 2 +- .../webdriver/browsers/safari.zh-cn.md | 2 +- .../webdriver/drivers/options.en.md | 9 + .../webdriver/drivers/options.ja.md | 15 +- .../webdriver/drivers/options.pt-br.md | 15 +- .../webdriver/drivers/options.zh-cn.md | 15 +- .../webdriver/drivers/remote_webdriver.en.md | 6 + .../webdriver/drivers/remote_webdriver.ja.md | 4 +- .../drivers/remote_webdriver.pt-br.md | 4 +- .../drivers/remote_webdriver.zh-cn.md | 4 +- .../webdriver/elements/_index.en.md | 5 +- .../webdriver/elements/_index.ja.md | 3 +- .../webdriver/elements/_index.pt-br.md | 3 +- .../webdriver/elements/_index.zh-cn.md | 3 +- .../webdriver/elements/file_upload.ja.md | 2 +- .../webdriver/elements/file_upload.pt-br.md | 2 +- .../webdriver/elements/file_upload.zh-cn.md | 2 +- .../webdriver/elements/finders.en.md | 5 +- .../webdriver/elements/finders.ja.md | 3 +- .../webdriver/elements/finders.pt-br.md | 3 +- .../webdriver/elements/finders.zh-cn.md | 3 +- .../webdriver/elements/locators.ja.md | 2 +- .../webdriver/elements/locators.pt-br.md | 2 +- .../webdriver/elements/locators.zh-cn.md | 2 +- .../webdriver/getting_started/_index.en.md | 14 +- .../webdriver/getting_started/_index.ja.md | 6 +- .../webdriver/getting_started/_index.pt-br.md | 6 +- .../webdriver/getting_started/_index.zh-cn.md | 6 +- .../getting_started/install_library.en.md | 5 +- .../getting_started/install_library.ja.md | 5 +- .../getting_started/install_library.pt-br.md | 5 +- .../getting_started/install_library.zh-cn.md | 5 +- .../webdriver/interactions/_index.en.md | 3 + .../webdriver/interactions/_index.ja.md | 3 +- .../webdriver/interactions/_index.pt-br.md | 5 +- .../webdriver/interactions/_index.zh-cn.md | 5 +- .../webdriver/interactions/alerts.en.md | 3 + .../webdriver/interactions/alerts.ja.md | 5 +- .../webdriver/interactions/alerts.pt-br.md | 5 +- .../webdriver/interactions/alerts.zh-cn.md | 5 +- .../webdriver/interactions/cookies.en.md | 5 +- .../webdriver/interactions/cookies.ja.md | 5 +- .../webdriver/interactions/cookies.pt-br.md | 5 +- .../webdriver/interactions/cookies.zh-cn.md | 5 +- .../webdriver/interactions/frames.ja.md | 2 +- .../webdriver/interactions/frames.pt-br.md | 2 +- .../webdriver/interactions/frames.zh-cn.md | 2 +- .../webdriver/interactions/navigation.ja.md | 2 +- .../interactions/navigation.pt-br.md | 2 +- .../interactions/navigation.zh-cn.md | 2 +- .../webdriver/interactions/print_page.en.md | 3 + .../webdriver/interactions/print_page.ja.md | 3 - .../interactions/print_page.pt-br.md | 3 - .../interactions/print_page.zh-cn.md | 3 - .../interactions/virtual_authenticator.ja.md | 2 +- .../virtual_authenticator.pt-br.md | 2 +- .../virtual_authenticator.zh-cn.md | 2 +- .../webdriver/interactions/windows.ja.md | 2 +- .../webdriver/interactions/windows.pt-br.md | 2 +- .../webdriver/interactions/windows.zh-cn.md | 2 +- .../webdriver/support_features/_index.en.md | 3 + .../webdriver/support_features/_index.ja.md | 5 +- .../support_features/_index.pt-br.md | 5 +- .../support_features/_index.zh-cn.md | 5 +- .../webdriver/support_features/colors.en.md | 3 + .../webdriver/support_features/colors.ja.md | 5 +- .../support_features/colors.pt-br.md | 5 +- .../support_features/colors.zh-cn.md | 5 +- .../support_features/listeners.ja.md | 2 +- .../support_features/listeners.pt-br.md | 2 +- .../support_features/listeners.zh-cn.md | 2 +- .../support_features/select_lists.en.md | 3 + .../support_features/select_lists.ja.md | 7 +- .../support_features/select_lists.pt-br.md | 7 +- .../support_features/select_lists.zh-cn.md | 7 +- .../support_features/thread_guard.en.md | 5 +- .../support_features/thread_guard.ja.md | 5 +- .../support_features/thread_guard.pt-br.md | 5 +- .../support_features/thread_guard.zh-cn.md | 5 +- .../errors/driver_location.en.md | 6 + .../errors/driver_location.ja.md | 6 +- .../errors/driver_location.pt-br.md | 6 +- .../errors/driver_location.zh-cn.md | 6 +- .../upgrade_to_selenium_4.ja.md | 4 +- .../upgrade_to_selenium_4.pt-br.md | 4 +- .../upgrade_to_selenium_4.zh-cn.md | 4 +- .../documentation/webdriver/waits.en.md | 2 +- .../documentation/webdriver/waits.ja.md | 1 - .../documentation/webdriver/waits.pt-br.md | 1 - .../documentation/webdriver/waits.zh-cn.md | 1 - website_and_docs/go.mod | 5 +- website_and_docs/go.sum | 17 +- website_and_docs/hugo.toml | 37 +- .../layouts/_partials/favicons.html | 24 + website_and_docs/layouts/blog/baseof.html | 2 +- website_and_docs/layouts/docs/baseof.html | 2 +- website_and_docs/layouts/home.html | 6 +- website_and_docs/layouts/meetings/baseof.html | 2 +- website_and_docs/layouts/meetings/single.html | 2 +- website_and_docs/layouts/partials/footer.html | 4 +- .../layouts/partials/hooks/head-end.html | 4 +- website_and_docs/layouts/shortcodes/gist.html | 9 + .../layouts/shortcodes/translation-alert.html | 2 +- website_and_docs/layouts/sponsors/list.html | 12 +- website_and_docs/package-lock.json | 1250 +---------------- website_and_docs/package.json | 9 +- .../hugoautogen/hugo_packagemeta.json | 10 + .../packages/hugoautogen/package.json | 9 + 352 files changed, 747 insertions(+), 1899 deletions(-) create mode 100644 website_and_docs/layouts/_partials/favicons.html create mode 100644 website_and_docs/layouts/shortcodes/gist.html create mode 100644 website_and_docs/packages/hugoautogen/hugo_packagemeta.json create mode 100644 website_and_docs/packages/hugoautogen/package.json diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 901aac7f3c29..87f91874d171 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Hugo uses: peaceiris/actions-hugo@v3 with: - hugo-version: ' 0.148.2' + hugo-version: '0.164.0' extended: true - name: Build run: chmod +x build-site.sh && ./build-site.sh diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index 63dbebca10e9..f91456b27649 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -25,7 +25,7 @@ jobs: - name: Set up Hugo uses: peaceiris/actions-hugo@v3 with: - hugo-version: ' 0.148.2' + hugo-version: '0.164.0' extended: true - name: Setup Node diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ebfa49d05ccb..0e13290526d9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,7 +21,7 @@ jobs: - name: Setup Hugo uses: peaceiris/actions-hugo@v3 with: - hugo-version: '0.148.2' + hugo-version: '0.164.0' extended: true - name: Build run: chmod +x build-site.sh && ./build-site.sh diff --git a/.gitpod.yml b/.gitpod.yml index db5e0cdab25a..3cc9e894c718 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -1,9 +1,9 @@ tasks: - name: Install Hugo, init submodules and start website init: | - curl -LO https://github.com/gohugoio/hugo/releases/download/v0.148.2/hugo_extended_0.148.2_linux-amd64.deb && \ - sudo dpkg -i hugo_extended_0.148.2_linux-amd64.deb && \ - sudo rm hugo_extended_0.148.2_linux-amd64.deb + curl -LO https://github.com/gohugoio/hugo/releases/download/v0.164.0/hugo_extended_0.164.0_linux-amd64.deb && \ + sudo dpkg -i hugo_extended_0.164.0_linux-amd64.deb && \ + sudo rm hugo_extended_0.164.0_linux-amd64.deb command: | cd website_and_docs hugo server --baseURL $(gp url 1313) --appendPort=false diff --git a/README.md b/README.md index 0fee4928daf1..02d8d44eb4ec 100755 --- a/README.md +++ b/README.md @@ -17,16 +17,24 @@ This is the repository used to build and publish the official Selenium [website] We use [Hugo](https://gohugo.io/) and the [Docsy theme](https://www.docsy.dev/) to build and render the site. You will need the **extended** Sass/SCSS version of the Hugo binary to work on this site. We recommend -to use **[Hugo 0.148.2](https://github.com/gohugoio/hugo/releases/tag/v0.148.2)** +to use **[Hugo 0.164.0](https://github.com/gohugoio/hugo/releases/tag/v0.164.0)** Steps needed to have this working locally and work on it: - [Install Hugo](https://gohugo.io/installation/) and follow the [Get Started](https://www.docsy.dev/docs/get-started/) instructions from Docsy - [Install go](https://go.dev/doc/install) +- [Install Node.js](https://nodejs.org/) (LTS 24) - Clone this repository - Run `cd website_and_docs` +- Run `npm install` - Run `hugo server` +`npm install` is required, not optional: since Docsy 0.16.0 the theme's +Bootstrap and Font Awesome assets are npm packages rather than Hugo modules. +Skipping it makes the build fail with SCSS import errors. If you ever change +the Docsy version, run `hugo mod npm pack` first to refresh +`packages/hugoautogen/`, then `npm install` again. + A full contribution guideline can be seen at [contributing](https://selenium.dev/documentation/about/contributing/) ## How to get involved? diff --git a/netlify.toml b/netlify.toml index 2d2312eb69c1..fe61b1fb39b6 100644 --- a/netlify.toml +++ b/netlify.toml @@ -3,23 +3,23 @@ publish = "website_and_docs/public" command = "chmod +x build-site.sh && ./build-site.sh" [context.production.environment] -NODE_VERSION = "22.13.0" -HUGO_VERSION = "0.148.2" -GO_VERSION = "1.20.1" +NODE_VERSION = "24.19.0" +HUGO_VERSION = "0.164.0" +GO_VERSION = "1.25.5" HUGO_ENV = "production" [context.deploy-preview] command = "chmod +x build-site.sh && ./build-site.sh" [context.deploy-preview.environment] -NODE_VERSION = "22.13.0" -HUGO_VERSION = "0.148.2" -GO_VERSION = "1.20.1" +NODE_VERSION = "24.19.0" +HUGO_VERSION = "0.164.0" +GO_VERSION = "1.25.5" [context.branch-deploy] command = "chmod +x build-site.sh && ./build-site.sh" [context.branch-deploy.environment] -NODE_VERSION = "22.13.0" -HUGO_VERSION = "0.148.2" -GO_VERSION = "1.20.1" +NODE_VERSION = "24.19.0" +HUGO_VERSION = "0.164.0" +GO_VERSION = "1.25.5" diff --git a/website_and_docs/content/blog/2020/selenium-4-alpha-6-is-out.md b/website_and_docs/content/blog/2020/selenium-4-alpha-6-is-out.md index bdbe4e45bac0..bfd69b9493b4 100644 --- a/website_and_docs/content/blog/2020/selenium-4-alpha-6-is-out.md +++ b/website_and_docs/content/blog/2020/selenium-4-alpha-6-is-out.md @@ -14,13 +14,13 @@ We are very pleased to announce the release of }} -{{< tweet user="shs96c" id="1266307376279359488" >}} -{{< tweet user="shs96c" id="1266307377420275713" >}} -{{< tweet user="shs96c" id="1266307378485563392" >}} -{{< tweet user="shs96c" id="1266307379513171968" >}} -{{< tweet user="AutomatedTester" id="1266025050706149379" >}} -{{< tweet user="p0deje" id="1266144106885111814" >}} +{{< x user="shs96c" id="1266307374941437952" >}} +{{< x user="shs96c" id="1266307376279359488" >}} +{{< x user="shs96c" id="1266307377420275713" >}} +{{< x user="shs96c" id="1266307378485563392" >}} +{{< x user="shs96c" id="1266307379513171968" >}} +{{< x user="AutomatedTester" id="1266025050706149379" >}} +{{< x user="p0deje" id="1266144106885111814" >}} Happy hacking! diff --git a/website_and_docs/content/blog/2021/new-look-for-selenium-site.md b/website_and_docs/content/blog/2021/new-look-for-selenium-site.md index 4a43812ca30e..1f496c4f217f 100644 --- a/website_and_docs/content/blog/2021/new-look-for-selenium-site.md +++ b/website_and_docs/content/blog/2021/new-look-for-selenium-site.md @@ -18,7 +18,7 @@ possible! We did a major revamp to our website two years ago. However, this revamp had some "technical debt" in it... -{{< tweet user="SeleniumHQ" id="1194205732347887616" >}} +{{< x user="SeleniumHQ" id="1194205732347887616" >}} We use [Hugo](https://gohugo.io/) to generate our website, and to build a website with Hugo, one normally needs to select a diff --git a/website_and_docs/content/blog/2021/selenium-4-rc-1.md b/website_and_docs/content/blog/2021/selenium-4-rc-1.md index d6a3b387ca4f..89957f741079 100644 --- a/website_and_docs/content/blog/2021/selenium-4-rc-1.md +++ b/website_and_docs/content/blog/2021/selenium-4-rc-1.md @@ -20,15 +20,15 @@ project, but most importantly, all the Selenium community who tried our beta releases, and gave us great and valuable feedback. -{{< tweet user="titusfortner" id="1433114357047627785" >}} +{{< x user="titusfortner" id="1433114357047627785" >}} -{{< tweet user="jimevansmusic" id="1433140517819322369" >}} +{{< x user="jimevansmusic" id="1433140517819322369" >}} -{{< tweet user="AutomatedTester" id="1433377616065667074" >}} +{{< x user="AutomatedTester" id="1433377616065667074" >}} -{{< tweet user="shs96c" id="1433474873972641793" >}} +{{< x user="shs96c" id="1433474873972641793" >}} -{{< tweet user="diegofmolina" id="1434820167360339968" >}} +{{< x user="diegofmolina" id="1434820167360339968" >}} One thing you may want to do to get ready for the update (which you diff --git a/website_and_docs/content/blog/2021/selenium-4-rc-2.md b/website_and_docs/content/blog/2021/selenium-4-rc-2.md index 94b7c11d4570..7f38fb0d759c 100644 --- a/website_and_docs/content/blog/2021/selenium-4-rc-2.md +++ b/website_and_docs/content/blog/2021/selenium-4-rc-2.md @@ -43,13 +43,13 @@ Thank you to everyone in the community who's given us so much helpful and thoughtful feedback on the first release candidate. We really hope that you enjoy this release candidate too! -{{< tweet user="AutomatedTester" id="1443577793871179786" >}} +{{< x user="AutomatedTester" id="1443577793871179786" >}} -{{< tweet user="jimevansmusic" id="1443601790092681221" >}} +{{< x user="jimevansmusic" id="1443601790092681221" >}} -{{< tweet user="titusfortner" id="1443575623822151688" >}} +{{< x user="titusfortner" id="1443575623822151688" >}} -{{< tweet user="shs96c" id="1443606189791662080" >}} +{{< x user="shs96c" id="1443606189791662080" >}} [geckodriver]: https://github.com/mozilla/geckodriver/releases diff --git a/website_and_docs/content/documentation/_index.en.md b/website_and_docs/content/documentation/_index.en.md index 136db40dc513..5761aea43668 100755 --- a/website_and_docs/content/documentation/_index.en.md +++ b/website_and_docs/content/documentation/_index.en.md @@ -3,7 +3,7 @@ title: "The Selenium Browser Automation Project" linkTitle: "Documentation" cascade: - type: docs -aliases: ["/documentation/en/"] +aliases: ["/documentation/en/", "/documentation/ja/", "/documentation/pt-br/", "/documentation/zh-cn/"] --- Selenium is an umbrella project for a range of tools and libraries diff --git a/website_and_docs/content/documentation/_index.ja.md b/website_and_docs/content/documentation/_index.ja.md index f77c397f5ce9..105d684c6bb2 100755 --- a/website_and_docs/content/documentation/_index.ja.md +++ b/website_and_docs/content/documentation/_index.ja.md @@ -3,7 +3,6 @@ title: "Seleniumブラウザー自動化プロジェクト" linkTitle: "ドキュメント" cascade: - type: docs -aliases: ["/documentation/ja/"] --- Seleniumは、ブラウザーの自動化を可能にし、それを支えるさまざまなツールとライブラリーから成るプロジェクトです。 diff --git a/website_and_docs/content/documentation/_index.pt-br.md b/website_and_docs/content/documentation/_index.pt-br.md index 7d92d0f5eb8b..22e9ab933a5a 100755 --- a/website_and_docs/content/documentation/_index.pt-br.md +++ b/website_and_docs/content/documentation/_index.pt-br.md @@ -3,7 +3,6 @@ title: "O Projeto Selenium de Automação de Navegadores" linkTitle: "Documentação" cascade: - type: docs -aliases: ["/documentation/pt-br/"] --- Selenium é um projeto que abrange uma variedade de ferramentas e bibliotecas diff --git a/website_and_docs/content/documentation/_index.zh-cn.md b/website_and_docs/content/documentation/_index.zh-cn.md index 8049e83ad16d..6fec87c31413 100755 --- a/website_and_docs/content/documentation/_index.zh-cn.md +++ b/website_and_docs/content/documentation/_index.zh-cn.md @@ -3,7 +3,6 @@ title: "Selenium 浏览器自动化项目" linkTitle: "文档" cascade: - type: docs -aliases: ["/documentation/zh-cn/"] --- Selenium 是支持 web 浏览器自动化的一系列工具和库的综合项目。 diff --git a/website_and_docs/content/documentation/about/_index.en.md b/website_and_docs/content/documentation/about/_index.en.md index 6efac3f28040..d35e04f369cb 100644 --- a/website_and_docs/content/documentation/about/_index.en.md +++ b/website_and_docs/content/documentation/about/_index.en.md @@ -5,8 +5,14 @@ weight: 16 aliases: [ "/documentation/en/introduction/about_this_documentation/", - "/documentation/en/front_matter/" - ] + "/documentation/en/front_matter/", +"/documentation/ja/introduction/about_this_documentation/", +"/documentation/ja/front_matter/", +"/documentation/pt-br/introduction/about_this_documentation/", +"/documentation/pt-br/front_matter/", +"/documentation/zh-cn/introduction/about_this_documentation/", +"/documentation/zh-cn/front_matter/" +] --- These docs, like the code itself, are maintained 100% by volunteers diff --git a/website_and_docs/content/documentation/about/_index.ja.md b/website_and_docs/content/documentation/about/_index.ja.md index fb80003cd097..a6aeb103b40a 100644 --- a/website_and_docs/content/documentation/about/_index.ja.md +++ b/website_and_docs/content/documentation/about/_index.ja.md @@ -2,11 +2,7 @@ title: "このドキュメントについて" linkTitle: "このドキュメントについて" weight: 16 -aliases: - [ - "/documentation/ja/introduction/about_this_documentation/", - "/documentation/ja/front_matter/" - ] + --- diff --git a/website_and_docs/content/documentation/about/_index.pt-br.md b/website_and_docs/content/documentation/about/_index.pt-br.md index d40b6fd0e921..1791487dbbad 100644 --- a/website_and_docs/content/documentation/about/_index.pt-br.md +++ b/website_and_docs/content/documentation/about/_index.pt-br.md @@ -2,11 +2,7 @@ title: "Sobre esta documentação" linkTitle: "Sobre esta documentação" weight: 16 -aliases: - [ - "/documentation/pt-br/introduction/about_this_documentation/", - "/documentation/pt-br/front_matter/" - ] + --- Essa documentação, como o próprio código, são mantidos 100% por voluntários diff --git a/website_and_docs/content/documentation/about/_index.zh-cn.md b/website_and_docs/content/documentation/about/_index.zh-cn.md index 56607eaa1a64..0cb993855663 100644 --- a/website_and_docs/content/documentation/about/_index.zh-cn.md +++ b/website_and_docs/content/documentation/about/_index.zh-cn.md @@ -2,11 +2,7 @@ title: "关于这个文档" linkTitle: "关于这个文档" weight: 16 -aliases: - [ - "/documentation/zh-cn/introduction/about_this_documentation/", - "/documentation/zh-cn/front_matter/" - ] + --- 这些文档,就像代码本身一样,100% 由 Selenium 社区中的志愿者维护。 diff --git a/website_and_docs/content/documentation/about/contributing.en.md b/website_and_docs/content/documentation/about/contributing.en.md index ec9fdc962aff..65cb2e9a0e26 100644 --- a/website_and_docs/content/documentation/about/contributing.en.md +++ b/website_and_docs/content/documentation/about/contributing.en.md @@ -6,7 +6,13 @@ description: >- Information on improving documentation and code examples for Selenium aliases: [ "/documentation/en/contributing/", -"/documentation/en/front_matter/typographical_conventions/" +"/documentation/en/front_matter/typographical_conventions/", +"/documentation/ja/contributing/", +"/documentation/ja/front_matter/typographical_conventions/", +"/documentation/pt-br/contributing/", +"/documentation/pt-br/front_matter/typographical_conventions/", +"/documentation/zh-cn/contributing/", +"/documentation/zh-cn/front_matter/typographical_conventions/" ] --- @@ -120,7 +126,7 @@ and check out your copy locally. We use [Hugo](https://gohugo.io/) and the [Docsy theme](https://www.docsy.dev/) to build and render the site. You will need the “extended” Sass/SCSS version of the Hugo binary to work on this site. We recommend -to use Hugo 0.148.2 . +to use Hugo 0.164.0 . Please follow the [Install Hugo](https://www.docsy.dev/docs/getting-started/#install-hugo) instructions from Docsy. diff --git a/website_and_docs/content/documentation/about/contributing.ja.md b/website_and_docs/content/documentation/about/contributing.ja.md index f07ec09704c5..bd3b14050b45 100644 --- a/website_and_docs/content/documentation/about/contributing.ja.md +++ b/website_and_docs/content/documentation/about/contributing.ja.md @@ -4,11 +4,6 @@ linkTitle: "Seleniumのサイトとドキュメントに貢献する" weight: 2 description: >- Seleniumのドキュメントとコード例を改善するための情報 -aliases: - [ - "/documentation/ja/contributing/", - "/documentation/ja/front_matter/typographical_conventions/" - ] --- Seleniumは大きなソフトウェアプロジェクトであり、そのサイトとドキュメントは、物事の仕組みを理解し、その可能性を活用する効果的な方法を学ぶための鍵となります。 @@ -97,7 +92,7 @@ Seleniumプロジェクトは新しいコントリビュータを歓迎します #### 依存関係: Hugo -[Hugo](https://gohugo.io/)と[Docsyテーマ](https://www.docsy.dev/)を使用してサイトの構築とレンダリングをしています。このサイトの作業をするには、Hugoバイナリの“拡張”Sass/SCSSバージョンが必要です。Hugo 0.148.2の使用を推奨します。 +[Hugo](https://gohugo.io/)と[Docsyテーマ](https://www.docsy.dev/)を使用してサイトの構築とレンダリングをしています。このサイトの作業をするには、Hugoバイナリの“拡張”Sass/SCSSバージョンが必要です。Hugo 0.164.0の使用を推奨します。 [Docsyのインストール手順](https://www.docsy.dev/docs/getting-started/#install-hugo)に従ってください。 diff --git a/website_and_docs/content/documentation/about/contributing.pt-br.md b/website_and_docs/content/documentation/about/contributing.pt-br.md index 3885b09b3443..dbf6782cabf2 100644 --- a/website_and_docs/content/documentation/about/contributing.pt-br.md +++ b/website_and_docs/content/documentation/about/contributing.pt-br.md @@ -5,11 +5,6 @@ weight: 2 requiresTranslation: true description: >- Informações em como melhorar a documentação e exemplos de código para Selenium. -aliases: - [ - "/documentation/pt-br/contributing/", - "/documentation/pt-br/front_matter/typographical_conventions/" - ] --- Selenium é um grande projeto de software, seu site e documentação são fundamentais @@ -120,7 +115,7 @@ e faça checkout na sua cópia localmente. Usamos [Hugo](https://gohugo.io/) e [Docsy theme](https://www.docsy.dev/) para criar e gerar o website. Você vai necessitar de usar a versão "extended" -Sass/SCSS do binário Hugo. Recomendamos a versão 0.148.2 . +Sass/SCSS do binário Hugo. Recomendamos a versão 0.164.0 . Por favor siga as instruções do Docsy [Install Hugo](https://www.docsy.dev/docs/getting-started/#install-hugo) diff --git a/website_and_docs/content/documentation/about/contributing.zh-cn.md b/website_and_docs/content/documentation/about/contributing.zh-cn.md index 0c8db1a5abe9..2a10a8984f11 100644 --- a/website_and_docs/content/documentation/about/contributing.zh-cn.md +++ b/website_and_docs/content/documentation/about/contributing.zh-cn.md @@ -4,10 +4,6 @@ linkTitle: 贡献 weight: 2 description: >- 有关改进 Selenium 文档和代码示例的信息 -aliases: [ - "/documentation/zh-cn/contributing/", - "/documentation/zh-cn/front_matter/typographical_conventions/" -] --- Selenium 是一个大型软件项目, @@ -114,7 +110,7 @@ Selenium 项目欢迎新的贡献者。 我们使用 [Hugo](https://gohugo.io/) 和 [Docsy theme](https://www.docsy.dev/) 用于构建和渲染本网站。 您需要 Hugo "extended" 扩展的 Sass/SCSS 版本用于这个网站。 -我们推荐使用 Hugo 0.148.2。 +我们推荐使用 Hugo 0.164.0。 请参考来自 Docsy 的说明 [安装 Hugo](https://www.docsy.dev/docs/getting-started/#install-hugo)。 diff --git a/website_and_docs/content/documentation/about/copyright.en.md b/website_and_docs/content/documentation/about/copyright.en.md index 3915afdcbf52..18979363fb5e 100644 --- a/website_and_docs/content/documentation/about/copyright.en.md +++ b/website_and_docs/content/documentation/about/copyright.en.md @@ -7,7 +7,10 @@ description: > under the Selenium umbrella. aliases: [ "/documentation/en/front_matter/copyright_and_attributions/", -"/documentation/about/copyright_and_attributions" +"/documentation/about/copyright_and_attributions", +"/documentation/ja/front_matter/copyright_and_attributions/", +"/documentation/pt-br/front_matter/copyright_and_attributions/", +"/documentation/zh-cn/front_matter/copyright_and_attributions/" ] --- diff --git a/website_and_docs/content/documentation/about/copyright.ja.md b/website_and_docs/content/documentation/about/copyright.ja.md index 04d97feb79f5..b227e7e4cc07 100644 --- a/website_and_docs/content/documentation/about/copyright.ja.md +++ b/website_and_docs/content/documentation/about/copyright.ja.md @@ -6,8 +6,7 @@ description: > Selenium に関連するさまざまなプロジェクトの著作権、貢献、 およびすべての帰属について。 aliases: [ -"/documentation/ja/front_matter/copyright_and_attributions/", -"/ja/documentation/about/copyright_and_attributions" +"/documentation/about/copyright_and_attributions" ] --- diff --git a/website_and_docs/content/documentation/about/copyright.pt-br.md b/website_and_docs/content/documentation/about/copyright.pt-br.md index d50d38fdb7e0..cfab5af6dcd3 100644 --- a/website_and_docs/content/documentation/about/copyright.pt-br.md +++ b/website_and_docs/content/documentation/about/copyright.pt-br.md @@ -5,8 +5,7 @@ weight: 1 description: > Direitos autorais, contribuições e todas as atribuições para os diferentes projetos sob a iniciativa do Selenium. aliases: [ -"/documentation/pt-br/front_matter/copyright_and_attributions/", -"/pt-br/documentation/about/copyright_and_attributions" +"/documentation/about/copyright_and_attributions" ] --- diff --git a/website_and_docs/content/documentation/about/copyright.zh-cn.md b/website_and_docs/content/documentation/about/copyright.zh-cn.md index dd928414b2ac..d49e1f3768c9 100644 --- a/website_and_docs/content/documentation/about/copyright.zh-cn.md +++ b/website_and_docs/content/documentation/about/copyright.zh-cn.md @@ -5,8 +5,7 @@ weight: 1 description: > Selenium工具集下的全部版权、贡献以及归属. aliases: [ -"/documentation/zh-cn/front_matter/copyright_and_attributions/", -"/zh-cn/documentation/about/copyright_and_attributions" +"/documentation/about/copyright_and_attributions" ] --- diff --git a/website_and_docs/content/documentation/grid/_index.en.md b/website_and_docs/content/documentation/grid/_index.en.md index cab1f133ecff..4f6632aa1157 100644 --- a/website_and_docs/content/documentation/grid/_index.en.md +++ b/website_and_docs/content/documentation/grid/_index.en.md @@ -9,8 +9,20 @@ aliases: "/documentation/en/selenium_installation/installing_standalone_server/", "/documentation/en/grid/", "/documentation/en/grid/grid_4/", - "/documentation/en/grid/purposes_and_main_functionalities/" - ] + "/documentation/en/grid/purposes_and_main_functionalities/", +"/documentation/ja/selenium_installation/installing_standalone_server/", +"/documentation/ja/grid/", +"/documentation/ja/grid/grid_4/", +"/documentation/ja/grid/purposes_and_main_functionalities/", +"/documentation/pt-br/selenium_installation/installing_standalone_server/", +"/documentation/pt-br/grid/", +"/documentation/pt-br/grid/grid_4/", +"/documentation/pt-br/grid/purposes_and_main_functionalities/", +"/documentation/zh-cn/selenium_installation/installing_standalone_server/", +"/documentation/zh-cn/grid/", +"/documentation/zh-cn/grid/grid_4/", +"/documentation/zh-cn/grid/purposes_and_main_functionalities/" +] --- Selenium Grid allows the execution of WebDriver scripts on remote machines diff --git a/website_and_docs/content/documentation/grid/_index.ja.md b/website_and_docs/content/documentation/grid/_index.ja.md index 23c2d39512c7..84e78f2b9e73 100644 --- a/website_and_docs/content/documentation/grid/_index.ja.md +++ b/website_and_docs/content/documentation/grid/_index.ja.md @@ -4,13 +4,6 @@ linkTitle: "Grid" weight: 4 description: > 複数のマシンで並行してテストを実行したいですか? Grid が手助けします。 -aliases: - [ - "/documentation/ja/selenium_installation/installing_standalone_server/", - "/documentation/ja/grid/", - "/documentation/ja/grid/grid_4/", - "/documentation/ja/grid/purposes_and_main_functionalities/", - ] --- Selenium Grid を利用して、クライアントからリモートブラウザーインスタンスにコマンドを diff --git a/website_and_docs/content/documentation/grid/_index.pt-br.md b/website_and_docs/content/documentation/grid/_index.pt-br.md index 1288fe2c1451..a85e5a6ff7dc 100644 --- a/website_and_docs/content/documentation/grid/_index.pt-br.md +++ b/website_and_docs/content/documentation/grid/_index.pt-br.md @@ -4,13 +4,6 @@ linkTitle: "Grid" weight: 4 description: > Pretende executar testes em paralelo em várias máquinas? Então a Grid é para si. -aliases: - [ - "/documentation/pt-br/selenium_installation/installing_standalone_server/", - "/documentation/pt-br/grid/", - "/documentation/pt-br/grid/grid_4/", - "/documentation/pt-br/grid/purposes_and_main_functionalities/" - ] --- Selenium Grid permite a execucão de scripts WebDriver em máquinas remotas, diff --git a/website_and_docs/content/documentation/grid/_index.zh-cn.md b/website_and_docs/content/documentation/grid/_index.zh-cn.md index fe867bf3e7f6..2e5acc460e6e 100644 --- a/website_and_docs/content/documentation/grid/_index.zh-cn.md +++ b/website_and_docs/content/documentation/grid/_index.zh-cn.md @@ -4,13 +4,6 @@ linkTitle: "Grid" weight: 4 description: > 要在多台计算机上并行运行测试吗? 那么, Grid正是为你准备的. -aliases: - [ - "/documentation/zh-cn/selenium_installation/installing_standalone_server/", - "/documentation/zh-cn/grid/", - "/documentation/zh-cn/grid/grid_4/", - "/documentation/zh-cn/grid/purposes_and_main_functionalities/" - ] --- Selenium Grid 允许通过将客户端发送的命令路由到远程浏览器实例来在远程机器上执行 WebDriver 脚本。 diff --git a/website_and_docs/content/documentation/grid/advanced_features/_index.en.md b/website_and_docs/content/documentation/grid/advanced_features/_index.en.md index 4b06a22f4d1b..3c1d7db879a5 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/_index.en.md +++ b/website_and_docs/content/documentation/grid/advanced_features/_index.en.md @@ -5,5 +5,5 @@ weight: 12 description: > To get all the details of the advanced features, understand how it works, and how to set up your own, please browse thorough the following sections. -aliases: ["/documentation/en/grid/grid_4/advanced_features/"] +aliases: ["/documentation/en/grid/grid_4/advanced_features/", "/documentation/ja/grid/grid_4/advanced_features/", "/documentation/pt-br/grid/grid_4/advanced_features/", "/documentation/zh-cn/grid/grid_4/advanced_features/"] --- diff --git a/website_and_docs/content/documentation/grid/advanced_features/_index.ja.md b/website_and_docs/content/documentation/grid/advanced_features/_index.ja.md index e6ac39966335..45282d8d5451 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/_index.ja.md +++ b/website_and_docs/content/documentation/grid/advanced_features/_index.ja.md @@ -4,5 +4,4 @@ linkTitle: "高度な機能" weight: 12 description: > 高度な機能のすべての詳細を取得し、それがどのように機能するか、および独自の設定方法を理解するには、次のセクションを参照してください。 -aliases: ["/documentation/ja/grid/grid_4/advanced_features/"] --- diff --git a/website_and_docs/content/documentation/grid/advanced_features/_index.pt-br.md b/website_and_docs/content/documentation/grid/advanced_features/_index.pt-br.md index e9a4d28b76ba..963e1bc2028c 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/_index.pt-br.md +++ b/website_and_docs/content/documentation/grid/advanced_features/_index.pt-br.md @@ -5,5 +5,4 @@ weight: 12 description: > Para obter todos os detalhes dos recursos avançados, entenda como funciona e como configurar crie o seu próprio, navegue pelas seções a seguir. -aliases: ["/documentation/pt-br/grid/grid_4/advanced_features/"] --- diff --git a/website_and_docs/content/documentation/grid/advanced_features/_index.zh-cn.md b/website_and_docs/content/documentation/grid/advanced_features/_index.zh-cn.md index c45a97e5d37f..821d6c67f5e7 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/_index.zh-cn.md +++ b/website_and_docs/content/documentation/grid/advanced_features/_index.zh-cn.md @@ -7,5 +7,4 @@ description: > 了解其工作原理, 以及如何设置自己的功能, 请浏览以下部分. -aliases: ["/documentation/zh-cn/grid/grid_4/advanced_features/"] --- diff --git a/website_and_docs/content/documentation/grid/advanced_features/endpoints.en.md b/website_and_docs/content/documentation/grid/advanced_features/endpoints.en.md index 3d605084c87c..37be1c4277e2 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/endpoints.en.md +++ b/website_and_docs/content/documentation/grid/advanced_features/endpoints.en.md @@ -4,7 +4,10 @@ linkTitle: "Endpoints" weight: 3 aliases: [ "/documentation/en/grid/grid_4/grid_endpoints/", -"/documentation/grid/advanced_features/grid_endpoints/" +"/documentation/grid/advanced_features/grid_endpoints/", +"/documentation/ja/grid/grid_4/grid_endpoints/", +"/documentation/pt-br/grid/grid_4/grid_endpoints/", +"/documentation/zh-cn/grid/grid_4/grid_endpoints/" ] --- diff --git a/website_and_docs/content/documentation/grid/advanced_features/endpoints.ja.md b/website_and_docs/content/documentation/grid/advanced_features/endpoints.ja.md index 5407895187d8..0450e60ee3d9 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/endpoints.ja.md +++ b/website_and_docs/content/documentation/grid/advanced_features/endpoints.ja.md @@ -3,8 +3,7 @@ title: "Grid エンドポイント" linkTitle: "Grid エンドポイント" weight: 3 aliases: [ -"/documentation/ja/grid/grid_4/grid_endpoints/", -"/ja/documentation/grid/advanced_features/grid_endpoints/" +"/documentation/grid/advanced_features/grid_endpoints/" ] --- diff --git a/website_and_docs/content/documentation/grid/advanced_features/endpoints.pt-br.md b/website_and_docs/content/documentation/grid/advanced_features/endpoints.pt-br.md index 046e2ab41fb8..3988155f88b0 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/endpoints.pt-br.md +++ b/website_and_docs/content/documentation/grid/advanced_features/endpoints.pt-br.md @@ -3,8 +3,7 @@ title: "Rotas da Grid" linkTitle: "Rotas da Grid" weight: 3 aliases: [ -"/documentation/pt-br/grid/grid_4/grid_endpoints/", -"/pt-br/documentation/grid/advanced_features/grid_endpoints/" +"/documentation/grid/advanced_features/grid_endpoints/" ] --- diff --git a/website_and_docs/content/documentation/grid/advanced_features/endpoints.zh-cn.md b/website_and_docs/content/documentation/grid/advanced_features/endpoints.zh-cn.md index 8e67ae00a270..3d170f94ecab 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/endpoints.zh-cn.md +++ b/website_and_docs/content/documentation/grid/advanced_features/endpoints.zh-cn.md @@ -3,8 +3,7 @@ title: "Grid端点" linkTitle: "Grid端点" weight: 3 aliases: [ -"/documentation/zh-cn/grid/grid_4/grid_endpoints/", -"/zh-cn/documentation/grid/advanced_features/grid_endpoints/" +"/documentation/grid/advanced_features/grid_endpoints/" ] --- diff --git a/website_and_docs/content/documentation/grid/advanced_features/graphql_support.en.md b/website_and_docs/content/documentation/grid/advanced_features/graphql_support.en.md index c068685dc23c..8c27e3428d92 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/graphql_support.en.md +++ b/website_and_docs/content/documentation/grid/advanced_features/graphql_support.en.md @@ -2,7 +2,7 @@ title: "GraphQL query support" linkTitle: "GraphQL Support" weight: 2 -aliases: ["/documentation/en/grid/grid_4/graphql_support/"] +aliases: ["/documentation/en/grid/grid_4/graphql_support/", "/documentation/ja/grid/grid_4/graphql_support/", "/documentation/pt-br/grid/grid_4/graphql_support/", "/documentation/zh-cn/grid/grid_4/graphql_support/"] --- GraphQL is a query language for APIs and a runtime for fulfilling those queries diff --git a/website_and_docs/content/documentation/grid/advanced_features/graphql_support.ja.md b/website_and_docs/content/documentation/grid/advanced_features/graphql_support.ja.md index b4514bf276f0..37c0495b2630 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/graphql_support.ja.md +++ b/website_and_docs/content/documentation/grid/advanced_features/graphql_support.ja.md @@ -2,7 +2,6 @@ title: "GraphQLクエリのサポート" linkTitle: "GraphQLクエリのサポート" weight: 2 -aliases: ["/documentation/ja/grid/grid_4/graphql_support/"] --- GraphQLは、APIのクエリ言語であり、既存のデータでこれらのクエリを実行するためのランタイムです。 diff --git a/website_and_docs/content/documentation/grid/advanced_features/graphql_support.pt-br.md b/website_and_docs/content/documentation/grid/advanced_features/graphql_support.pt-br.md index 5fe2c709c80f..495e9933e884 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/graphql_support.pt-br.md +++ b/website_and_docs/content/documentation/grid/advanced_features/graphql_support.pt-br.md @@ -2,7 +2,6 @@ title: "Suporte a buscas em GraphQL" linkTitle: "Suporte a buscas em GraphQL" weight: 2 -aliases: ["/documentation/pt-br/grid/grid_4/graphql_support/"] --- GraphQL é uma linguagem de consulta para APIs e um runtime para atender a essas consultas com seus dados existentes. Ele dá aos usuários o poder de pedir exatamente o que precisam e nada mais. diff --git a/website_and_docs/content/documentation/grid/advanced_features/graphql_support.zh-cn.md b/website_and_docs/content/documentation/grid/advanced_features/graphql_support.zh-cn.md index 7c87570867af..e1e418b6c49d 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/graphql_support.zh-cn.md +++ b/website_and_docs/content/documentation/grid/advanced_features/graphql_support.zh-cn.md @@ -2,7 +2,6 @@ title: "GraphQL查询支持" linkTitle: "GraphQL查询支持" weight: 2 -aliases: ["/documentation/zh-cn/grid/grid_4/graphql_support/"] --- diff --git a/website_and_docs/content/documentation/grid/advanced_features/observability.en.md b/website_and_docs/content/documentation/grid/advanced_features/observability.en.md index 2eee9fed9ebe..788bba74de3f 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/observability.en.md +++ b/website_and_docs/content/documentation/grid/advanced_features/observability.en.md @@ -2,7 +2,7 @@ title: "Observability in Selenium Grid" linkTitle: "Observability" weight: 1 -aliases: ["/documentation/en/grid/grid_4/advanced_features/observability/"] +aliases: ["/documentation/en/grid/grid_4/advanced_features/observability/", "/documentation/ja/grid/grid_4/advanced_features/observability/", "/documentation/pt-br/grid/grid_4/advanced_features/observability/", "/documentation/zh-cn/grid/grid_4/advanced_features/observability/"] --- ## Table of Contents diff --git a/website_and_docs/content/documentation/grid/advanced_features/observability.ja.md b/website_and_docs/content/documentation/grid/advanced_features/observability.ja.md index c62086606e7c..25191d27f5cd 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/observability.ja.md +++ b/website_and_docs/content/documentation/grid/advanced_features/observability.ja.md @@ -2,7 +2,6 @@ title: "可観測性" linkTitle: "可観測性" weight: 1 -aliases: ["/documentation/ja/grid/grid_4/advanced_features/observability/"] --- ## 目次 diff --git a/website_and_docs/content/documentation/grid/advanced_features/observability.pt-br.md b/website_and_docs/content/documentation/grid/advanced_features/observability.pt-br.md index 852e33ae3907..740a07a69a42 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/observability.pt-br.md +++ b/website_and_docs/content/documentation/grid/advanced_features/observability.pt-br.md @@ -2,7 +2,6 @@ title: "Observabilidade" linkTitle: "Observabilidade" weight: 1 -aliases: ["/documentation/pt-br/grid/grid_4/advanced_features/observability/"] --- diff --git a/website_and_docs/content/documentation/grid/advanced_features/observability.zh-cn.md b/website_and_docs/content/documentation/grid/advanced_features/observability.zh-cn.md index 95e43c79259e..20fa7cf7209f 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/observability.zh-cn.md +++ b/website_and_docs/content/documentation/grid/advanced_features/observability.zh-cn.md @@ -2,7 +2,6 @@ title: "可观测性" linkTitle: "可观测性" weight: 1 -aliases: ["/documentation/zh-cn/grid/grid_4/advanced_features/observability/"] --- diff --git a/website_and_docs/content/documentation/grid/applicability.en.md b/website_and_docs/content/documentation/grid/applicability.en.md index 5640b41a37e6..77ace76df690 100644 --- a/website_and_docs/content/documentation/grid/applicability.en.md +++ b/website_and_docs/content/documentation/grid/applicability.en.md @@ -6,7 +6,10 @@ description: > Is Grid right for you? aliases: [ "/documentation/en/grid/when_to_use_grid/", -"/documentation/grid/when_to_use_grid" +"/documentation/grid/when_to_use_grid", +"/documentation/ja/grid/when_to_use_grid/", +"/documentation/pt-br/grid/when_to_use_grid/", +"/documentation/zh-cn/grid/when_to_use_grid/" ] --- diff --git a/website_and_docs/content/documentation/grid/applicability.ja.md b/website_and_docs/content/documentation/grid/applicability.ja.md index ac2e4bffe006..74f41695df79 100644 --- a/website_and_docs/content/documentation/grid/applicability.ja.md +++ b/website_and_docs/content/documentation/grid/applicability.ja.md @@ -5,8 +5,7 @@ weight: 4 description: > Gridがあなたにとって最適なツールでしょうか? aliases: [ -"/documentation/ja/grid/when_to_use_grid/", -"/ja/documentation/grid/when_to_use_grid" +"/documentation/grid/when_to_use_grid" ] --- diff --git a/website_and_docs/content/documentation/grid/applicability.pt-br.md b/website_and_docs/content/documentation/grid/applicability.pt-br.md index 1c13f350cca9..3f7e505902a3 100644 --- a/website_and_docs/content/documentation/grid/applicability.pt-br.md +++ b/website_and_docs/content/documentation/grid/applicability.pt-br.md @@ -5,8 +5,7 @@ weight: 4 description: > Será a Grid a melhor escolha para você? aliases: [ -"/documentation/pt-br/grid/when_to_use_grid/", -"/pt-br/documentation/grid/when_to_use_grid" +"/documentation/grid/when_to_use_grid" ] --- diff --git a/website_and_docs/content/documentation/grid/applicability.zh-cn.md b/website_and_docs/content/documentation/grid/applicability.zh-cn.md index 486c1be49754..e1f126d95f34 100644 --- a/website_and_docs/content/documentation/grid/applicability.zh-cn.md +++ b/website_and_docs/content/documentation/grid/applicability.zh-cn.md @@ -5,8 +5,7 @@ weight: 4 description: > Grid适合您吗? aliases: [ -"/documentation/zh-cn/grid/when_to_use_grid/", -"/zh-cn/documentation/grid/when_to_use_grid" +"/documentation/grid/when_to_use_grid" ] --- diff --git a/website_and_docs/content/documentation/grid/architecture.ja.md b/website_and_docs/content/documentation/grid/architecture.ja.md index 823229b09700..dea051772896 100644 --- a/website_and_docs/content/documentation/grid/architecture.ja.md +++ b/website_and_docs/content/documentation/grid/architecture.ja.md @@ -3,7 +3,7 @@ title: "Grid アーキテクチャ" linkTitle: "アーキテクチャ" weight: 10 aliases: [ -"/ja/documentation/grid/grid_architecture" +"/documentation/grid/grid_architecture" ] --- diff --git a/website_and_docs/content/documentation/grid/architecture.pt-br.md b/website_and_docs/content/documentation/grid/architecture.pt-br.md index 26f953b75d30..b03a9d06d101 100644 --- a/website_and_docs/content/documentation/grid/architecture.pt-br.md +++ b/website_and_docs/content/documentation/grid/architecture.pt-br.md @@ -3,7 +3,7 @@ title: "Arquitectura da Grid" linkTitle: "Arquitectura da Grid" weight: 10 aliases: [ -"/pt-br/documentation/grid/grid_architecture" +"/documentation/grid/grid_architecture" ] --- diff --git a/website_and_docs/content/documentation/grid/architecture.zh-cn.md b/website_and_docs/content/documentation/grid/architecture.zh-cn.md index 5d68a313d76c..c9201bfb16c6 100644 --- a/website_and_docs/content/documentation/grid/architecture.zh-cn.md +++ b/website_and_docs/content/documentation/grid/architecture.zh-cn.md @@ -3,7 +3,7 @@ title: "Grid架构" linkTitle: "Grid架构" weight: 10 aliases: [ -"/zh-cn/documentation/grid/grid_architecture" +"/documentation/grid/grid_architecture" ] --- diff --git a/website_and_docs/content/documentation/grid/components.en.md b/website_and_docs/content/documentation/grid/components.en.md index df29d7f0e628..895d120b55c7 100644 --- a/website_and_docs/content/documentation/grid/components.en.md +++ b/website_and_docs/content/documentation/grid/components.en.md @@ -6,7 +6,10 @@ description: > Understand how to use the different Grid components aliases: [ "/documentation/en/grid/grid_4/components_of_a_grid/", -"/documentation/grid/components_of_a_grid/" +"/documentation/grid/components_of_a_grid/", +"/documentation/ja/grid/grid_4/components_of_a_grid/", +"/documentation/pt-br/grid/grid_4/components_of_a_grid/", +"/documentation/zh-cn/grid/grid_4/components_of_a_grid/" ] --- diff --git a/website_and_docs/content/documentation/grid/components.ja.md b/website_and_docs/content/documentation/grid/components.ja.md index 881803b51fb5..80112818d69d 100644 --- a/website_and_docs/content/documentation/grid/components.ja.md +++ b/website_and_docs/content/documentation/grid/components.ja.md @@ -5,8 +5,7 @@ weight: 6 description: > Grid コンポーネントの使い方について aliases: [ -"/documentation/ja/grid/grid_4/components_of_a_grid/", -"/ja/documentation/grid/components_of_a_grid/" +"/documentation/grid/components_of_a_grid/" ] --- diff --git a/website_and_docs/content/documentation/grid/components.pt-br.md b/website_and_docs/content/documentation/grid/components.pt-br.md index 9db5f2676706..e355343b6484 100644 --- a/website_and_docs/content/documentation/grid/components.pt-br.md +++ b/website_and_docs/content/documentation/grid/components.pt-br.md @@ -5,8 +5,7 @@ weight: 6 description: > Compreender como usar os componentes da Grid aliases: [ -"/documentation/pt-br/grid/grid_4/components_of_a_grid/", -"/pt-br/documentation/grid/components_of_a_grid/" +"/documentation/grid/components_of_a_grid/" ] --- diff --git a/website_and_docs/content/documentation/grid/components.zh-cn.md b/website_and_docs/content/documentation/grid/components.zh-cn.md index 9ee6760d555f..48c49491ddce 100644 --- a/website_and_docs/content/documentation/grid/components.zh-cn.md +++ b/website_and_docs/content/documentation/grid/components.zh-cn.md @@ -5,8 +5,7 @@ weight: 6 description: > 检查不同的Grid组件以了解如何使用它们. aliases: [ -"/documentation/zh-cn/grid/grid_4/components_of_a_grid/", -"/zh-cn/documentation/grid/components_of_a_grid/" +"/documentation/grid/components_of_a_grid/" ] --- diff --git a/website_and_docs/content/documentation/grid/configuration/_index.en.md b/website_and_docs/content/documentation/grid/configuration/_index.en.md index 89f9b717ab1c..abf4b08b427c 100644 --- a/website_and_docs/content/documentation/grid/configuration/_index.en.md +++ b/website_and_docs/content/documentation/grid/configuration/_index.en.md @@ -7,6 +7,9 @@ description: > common configuration values and component-specific configuration values. aliases: [ "/documentation/en/grid/grid_4/configuring_components/", -"/documentation/grid/configuring_components/" +"/documentation/grid/configuring_components/", +"/documentation/ja/grid/grid_4/configuring_components/", +"/documentation/pt-br/grid/grid_4/configuring_components/", +"/documentation/zh-cn/grid/grid_4/configuring_components/" ] --- diff --git a/website_and_docs/content/documentation/grid/configuration/_index.ja.md b/website_and_docs/content/documentation/grid/configuration/_index.ja.md index d840bee9bade..4f2037af0a80 100644 --- a/website_and_docs/content/documentation/grid/configuration/_index.ja.md +++ b/website_and_docs/content/documentation/grid/configuration/_index.ja.md @@ -5,7 +5,6 @@ weight: 8 description: > ここでは、各コンポーネントを、共通の設定とコンポーネント固有の設定で個別に設定する方法を確認できます。 aliases: [ -"/documentation/ja/grid/grid_4/configuring_components/", -"/ja/documentation/grid/configuring_components/" +"/documentation/grid/configuring_components/" ] --- diff --git a/website_and_docs/content/documentation/grid/configuration/_index.pt-br.md b/website_and_docs/content/documentation/grid/configuration/_index.pt-br.md index d339c5fec893..0e3b5d056273 100644 --- a/website_and_docs/content/documentation/grid/configuration/_index.pt-br.md +++ b/website_and_docs/content/documentation/grid/configuration/_index.pt-br.md @@ -6,8 +6,7 @@ description: > Leia aqui como pode configurar cada um dos componentes Grid com base em valores comuns ou específicos para o componente. aliases: [ -"/documentation/pt-br/grid/grid_4/configuring_components/", -"/pt-br/documentation/grid/configuring_components/" +"/documentation/grid/configuring_components/" ] --- diff --git a/website_and_docs/content/documentation/grid/configuration/_index.zh-cn.md b/website_and_docs/content/documentation/grid/configuration/_index.zh-cn.md index 209b15136848..ac80faac7a99 100644 --- a/website_and_docs/content/documentation/grid/configuration/_index.zh-cn.md +++ b/website_and_docs/content/documentation/grid/configuration/_index.zh-cn.md @@ -5,7 +5,6 @@ weight: 8 description: > 在这里,您可以看到如何根据公共配置值和特定于组件的配置值分别配置每个网格组件. aliases: [ -"/documentation/zh-cn/grid/grid_4/configuring_components/", -"/zh-cn/documentation/grid/configuring_components/" +"/documentation/grid/configuring_components/" ] --- diff --git a/website_and_docs/content/documentation/grid/configuration/cli_options.ja.md b/website_and_docs/content/documentation/grid/configuration/cli_options.ja.md index d0e79f64313a..a2f8e874c715 100644 --- a/website_and_docs/content/documentation/grid/configuration/cli_options.ja.md +++ b/website_and_docs/content/documentation/grid/configuration/cli_options.ja.md @@ -4,7 +4,7 @@ linkTitle: "CLI オプション" weight: 2 description: 全てのGridコンポーネントのCLIオプション詳細 aliases: [ -"/ja/documentation/grid/configuring_components/cli_options/" +"/documentation/grid/configuring_components/cli_options/" ] --- diff --git a/website_and_docs/content/documentation/grid/configuration/cli_options.pt-br.md b/website_and_docs/content/documentation/grid/configuration/cli_options.pt-br.md index 8084afafb511..0b5a08f91d27 100644 --- a/website_and_docs/content/documentation/grid/configuration/cli_options.pt-br.md +++ b/website_and_docs/content/documentation/grid/configuration/cli_options.pt-br.md @@ -4,7 +4,7 @@ linkTitle: "Opções CLI" weight: 2 description: Todas os detalhes das opções CLI de cada componente Grid. aliases: [ -"/pt-br/documentation/grid/configuring_components/cli_options/" +"/documentation/grid/configuring_components/cli_options/" ] --- diff --git a/website_and_docs/content/documentation/grid/configuration/cli_options.zh-cn.md b/website_and_docs/content/documentation/grid/configuration/cli_options.zh-cn.md index dfee2adcf317..e6bd8565739f 100644 --- a/website_and_docs/content/documentation/grid/configuration/cli_options.zh-cn.md +++ b/website_and_docs/content/documentation/grid/configuration/cli_options.zh-cn.md @@ -4,7 +4,7 @@ linkTitle: "CLI 选项" weight: 2 description: 所有网格组件配置CLI选项的详细信息. aliases: [ -"/zh-cn/documentation/grid/configuring_components/cli_options/" +"/documentation/grid/configuring_components/cli_options/" ] --- diff --git a/website_and_docs/content/documentation/grid/configuration/help.en.md b/website_and_docs/content/documentation/grid/configuration/help.en.md index 0d6a5ccd361c..51f3386a4bfb 100644 --- a/website_and_docs/content/documentation/grid/configuration/help.en.md +++ b/website_and_docs/content/documentation/grid/configuration/help.en.md @@ -5,7 +5,10 @@ weight: 1 description: Get information about all the available options to configure Grid. aliases: [ "/documentation/en/grid/grid_4/configuring_components/config_help/", -"/documentation/grid/configuring_components/config_help/" +"/documentation/grid/configuring_components/config_help/", +"/documentation/ja/grid/grid_4/configuring_components/config_help/", +"/documentation/pt-br/grid/grid_4/configuring_components/config_help/", +"/documentation/zh-cn/grid/grid_4/configuring_components/config_help/" ] --- diff --git a/website_and_docs/content/documentation/grid/configuration/help.ja.md b/website_and_docs/content/documentation/grid/configuration/help.ja.md index 4091e2a8385f..65a3ffee3ebf 100644 --- a/website_and_docs/content/documentation/grid/configuration/help.ja.md +++ b/website_and_docs/content/documentation/grid/configuration/help.ja.md @@ -4,8 +4,7 @@ linkTitle: "構成ヘルプ" weight: 1 description: Gridの設定に利用可能なオプション aliases: [ -"/documentation/ja/grid/grid_4/configuring_components/config_help/", -"/ja/documentation/grid/configuring_components/config_help/" +"/documentation/grid/configuring_components/config_help/" ] --- diff --git a/website_and_docs/content/documentation/grid/configuration/help.pt-br.md b/website_and_docs/content/documentation/grid/configuration/help.pt-br.md index c44cbcf74d8c..f363db58517e 100644 --- a/website_and_docs/content/documentation/grid/configuration/help.pt-br.md +++ b/website_and_docs/content/documentation/grid/configuration/help.pt-br.md @@ -4,8 +4,7 @@ linkTitle: "Ajuda de configuração" weight: 1 description: Obtenha ajuda sobre todas as opções disponíveis para configurar a Grid. aliases: [ -"/documentation/pt-br/grid/grid_4/configuring_components/config_help/", -"/pt-br/documentation/grid/configuring_components/config_help/" +"/documentation/grid/configuring_components/config_help/" ] --- diff --git a/website_and_docs/content/documentation/grid/configuration/help.zh-cn.md b/website_and_docs/content/documentation/grid/configuration/help.zh-cn.md index 35bac8a0c162..af88313d1a56 100644 --- a/website_and_docs/content/documentation/grid/configuration/help.zh-cn.md +++ b/website_and_docs/content/documentation/grid/configuration/help.zh-cn.md @@ -4,8 +4,7 @@ linkTitle: "帮助" weight: 1 description: 获取有关配置网格的所有可用选项的信息. aliases: [ -"/documentation/zh-cn/grid/grid_4/configuring_components/config_help/", -"/zh-cn/documentation/grid/configuring_components/config_help/" +"/documentation/grid/configuring_components/config_help/" ] --- diff --git a/website_and_docs/content/documentation/grid/configuration/toml_options.ja.md b/website_and_docs/content/documentation/grid/configuration/toml_options.ja.md index 88a59cb06593..14809c96acfe 100644 --- a/website_and_docs/content/documentation/grid/configuration/toml_options.ja.md +++ b/website_and_docs/content/documentation/grid/configuration/toml_options.ja.md @@ -4,7 +4,7 @@ linkTitle: "Toml オプション" weight: 3 description: Tomlファイルを使用したGridの設定例. aliases: [ -"/ja/documentation/grid/configuring_components/toml_options/" +"/documentation/grid/configuring_components/toml_options/" ] --- diff --git a/website_and_docs/content/documentation/grid/configuration/toml_options.pt-br.md b/website_and_docs/content/documentation/grid/configuration/toml_options.pt-br.md index 5b6932bd8c36..77c090c8c235 100644 --- a/website_and_docs/content/documentation/grid/configuration/toml_options.pt-br.md +++ b/website_and_docs/content/documentation/grid/configuration/toml_options.pt-br.md @@ -4,7 +4,7 @@ linkTitle: "Toml Options" weight: 3 description: Grid configuration examples using Toml files. aliases: [ -"/pt-br/documentation/grid/configuring_components/toml_options/" +"/documentation/grid/configuring_components/toml_options/" ] --- diff --git a/website_and_docs/content/documentation/grid/configuration/toml_options.zh-cn.md b/website_and_docs/content/documentation/grid/configuration/toml_options.zh-cn.md index ecda44aa766d..3a5be7fcfacd 100644 --- a/website_and_docs/content/documentation/grid/configuration/toml_options.zh-cn.md +++ b/website_and_docs/content/documentation/grid/configuration/toml_options.zh-cn.md @@ -4,7 +4,7 @@ linkTitle: "Toml选项" weight: 3 description: 使用Toml文件的Grid配置示例. aliases: [ -"/zh-cn/documentation/grid/configuring_components/toml_options/" +"/documentation/grid/configuring_components/toml_options/" ] requiresTranslation: true --- diff --git a/website_and_docs/content/documentation/grid/getting_started.en.md b/website_and_docs/content/documentation/grid/getting_started.en.md index 9b32f24ca380..e8e5f921fa8c 100644 --- a/website_and_docs/content/documentation/grid/getting_started.en.md +++ b/website_and_docs/content/documentation/grid/getting_started.en.md @@ -6,7 +6,10 @@ description: > Instructions for a simple Selenium Grid aliases: [ "/documentation/en/grid/grid_4/setting_up_your_own_grid/", -"/documentation/grid/setting_up_your_own_grid/" +"/documentation/grid/setting_up_your_own_grid/", +"/documentation/ja/grid/grid_4/setting_up_your_own_grid/", +"/documentation/pt-br/grid/grid_4/setting_up_your_own_grid/", +"/documentation/zh-cn/grid/grid_4/setting_up_your_own_grid/" ] --- diff --git a/website_and_docs/content/documentation/grid/getting_started.ja.md b/website_and_docs/content/documentation/grid/getting_started.ja.md index eb5c7a451f54..84efd5576f4e 100644 --- a/website_and_docs/content/documentation/grid/getting_started.ja.md +++ b/website_and_docs/content/documentation/grid/getting_started.ja.md @@ -6,8 +6,7 @@ needsTranslation: true description: > Selenium Gridの導入方法 aliases: [ -"/documentation/ja/grid/grid_4/setting_up_your_own_grid/", -"/ja/documentation/grid/setting_up_your_own_grid/" +"/documentation/grid/setting_up_your_own_grid/" ] --- diff --git a/website_and_docs/content/documentation/grid/getting_started.pt-br.md b/website_and_docs/content/documentation/grid/getting_started.pt-br.md index 4ef28f9b7e95..698fc30d9942 100644 --- a/website_and_docs/content/documentation/grid/getting_started.pt-br.md +++ b/website_and_docs/content/documentation/grid/getting_started.pt-br.md @@ -6,8 +6,7 @@ needsTranslation: true description: > Instruções para criar uma Selenium Grid simples aliases: [ -"/documentation/pt-br/grid/grid_4/setting_up_your_own_grid/", -"/pt-br/documentation/grid/setting_up_your_own_grid/" +"/documentation/grid/setting_up_your_own_grid/" ] --- diff --git a/website_and_docs/content/documentation/grid/getting_started.zh-cn.md b/website_and_docs/content/documentation/grid/getting_started.zh-cn.md index c56aec37a41a..edf048955ac7 100644 --- a/website_and_docs/content/documentation/grid/getting_started.zh-cn.md +++ b/website_and_docs/content/documentation/grid/getting_started.zh-cn.md @@ -6,8 +6,7 @@ needsTranslation: true description: > 一步一步地说明如何运行简单的Selenium Grid. aliases: [ -"/documentation/zh-cn/grid/grid_4/setting_up_your_own_grid/", -"/zh-cn/documentation/grid/setting_up_your_own_grid/" +"/documentation/grid/setting_up_your_own_grid/" ] --- diff --git a/website_and_docs/content/documentation/legacy/_index.en.md b/website_and_docs/content/documentation/legacy/_index.en.md index e908539139e9..f162ddbbcac4 100644 --- a/website_and_docs/content/documentation/legacy/_index.en.md +++ b/website_and_docs/content/documentation/legacy/_index.en.md @@ -5,5 +5,5 @@ weight: 14 description: > Documentation related to the legacy components of Selenium. Meant to be kept purely for historical reasons and not as a incentive to use deprecated components. -aliases: ["/documentation/en/legacy_docs/"] +aliases: ["/documentation/en/legacy_docs/", "/documentation/ja/legacy_docs/", "/documentation/pt-br/legacy_docs/", "/documentation/zh-cn/legacy_docs/"] --- diff --git a/website_and_docs/content/documentation/legacy/_index.ja.md b/website_and_docs/content/documentation/legacy/_index.ja.md index 6c08b22a957e..e3d8801c7b9a 100644 --- a/website_and_docs/content/documentation/legacy/_index.ja.md +++ b/website_and_docs/content/documentation/legacy/_index.ja.md @@ -5,7 +5,6 @@ weight: 14 description: > このセクションでは、Seleniumのレガシーコンポーネントに関連するすべてのドキュメントを見つけることができます。 これは、非推奨コンポーネントを使用する動機としてではなく、純粋に歴史的な理由で保持されることを意図しています。 -aliases: ["/documentation/ja/legacy_docs/"] --- {{% pageinfo color="warning" %}} diff --git a/website_and_docs/content/documentation/legacy/_index.pt-br.md b/website_and_docs/content/documentation/legacy/_index.pt-br.md index d738c2b2f8f1..8e044a69fe1d 100644 --- a/website_and_docs/content/documentation/legacy/_index.pt-br.md +++ b/website_and_docs/content/documentation/legacy/_index.pt-br.md @@ -6,7 +6,6 @@ description: > Nesta seção você pode encontrar toda a documentação relacionada aos componentes legados do Selenium. Isso deve ser mantido puramente por razões históricas e não como um incentivo para o uso obsoleto componentes. -aliases: ["/documentation/pt-br/legacy_docs/"] --- {{% pageinfo color="warning" %}} diff --git a/website_and_docs/content/documentation/legacy/_index.zh-cn.md b/website_and_docs/content/documentation/legacy/_index.zh-cn.md index b90d8aab8026..e50cb0017481 100644 --- a/website_and_docs/content/documentation/legacy/_index.zh-cn.md +++ b/website_and_docs/content/documentation/legacy/_index.zh-cn.md @@ -5,7 +5,6 @@ weight: 14 description: > 在此部分,您可以找到与Selenium的旧组件有关的所有文档. 这样做纯粹是出于历史原因,而不是鼓励使用已废弃的组件. -aliases: ["/documentation/zh-cn/legacy_docs/"] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_1.en.md b/website_and_docs/content/documentation/legacy/selenium_1.en.md index cec94b17dd14..fb39b47dbdad 100644 --- a/website_and_docs/content/documentation/legacy/selenium_1.en.md +++ b/website_and_docs/content/documentation/legacy/selenium_1.en.md @@ -6,7 +6,10 @@ description: > The original version of Selenium aliases: [ "/documentation/en/legacy_docs/selenium_rc/", -"/documentation/legacy/selenium_rc/" +"/documentation/legacy/selenium_rc/", +"/documentation/ja/legacy_docs/selenium_rc/", +"/documentation/pt-br/legacy_docs/selenium_rc/", +"/documentation/zh-cn/legacy_docs/selenium_rc/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_1.ja.md b/website_and_docs/content/documentation/legacy/selenium_1.ja.md index 2e968dc51f65..a50dd2d1e81e 100644 --- a/website_and_docs/content/documentation/legacy/selenium_1.ja.md +++ b/website_and_docs/content/documentation/legacy/selenium_1.ja.md @@ -5,8 +5,7 @@ weight: 2 description: > The original version of Selenium aliases: [ -"/documentation/ja/legacy_docs/selenium_rc/", -"/ja/documentation/legacy/selenium_rc/" +"/documentation/legacy/selenium_rc/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_1.pt-br.md b/website_and_docs/content/documentation/legacy/selenium_1.pt-br.md index 5492000d265c..6b2f902095d0 100644 --- a/website_and_docs/content/documentation/legacy/selenium_1.pt-br.md +++ b/website_and_docs/content/documentation/legacy/selenium_1.pt-br.md @@ -5,8 +5,7 @@ weight: 2 description: > The original version of Selenium aliases: [ -"/documentation/pt-br/legacy_docs/selenium_rc/", -"/pt-br/documentation/legacy/selenium_rc/" +"/documentation/legacy/selenium_rc/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_1.zh-cn.md b/website_and_docs/content/documentation/legacy/selenium_1.zh-cn.md index 8ad612de7109..07aa1ef8899a 100644 --- a/website_and_docs/content/documentation/legacy/selenium_1.zh-cn.md +++ b/website_and_docs/content/documentation/legacy/selenium_1.zh-cn.md @@ -5,8 +5,7 @@ weight: 2 description: > 原始版本的Selenium aliases: [ -"/documentation/zh-cn/legacy_docs/selenium_rc/", -"/zh-cn/documentation/legacy/selenium_rc/" +"/documentation/legacy/selenium_rc/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.en.md b/website_and_docs/content/documentation/legacy/selenium_2/remote_server.en.md index d2476ff4f1ab..bba4647cb297 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.en.md +++ b/website_and_docs/content/documentation/legacy/selenium_2/remote_server.en.md @@ -6,7 +6,10 @@ description: > Working with the Standalone Server. aliases: [ "/documentation/en/legacy_docs/remote_webdriver_server/", -"/documentation/legacy/remote_webdriver_server/" +"/documentation/legacy/remote_webdriver_server/", +"/documentation/ja/legacy_docs/remote_webdriver_server/", +"/documentation/pt-br/legacy_docs/remote_webdriver_server/", +"/documentation/zh-cn/legacy_docs/remote_webdriver_server/" ] --- This documentation previously located [on the wiki](https://github.com/SeleniumHQ/selenium/wiki/RemoteWebDriverServer) diff --git a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.ja.md b/website_and_docs/content/documentation/legacy/selenium_2/remote_server.ja.md index 14c44a6c6b28..003818c47d52 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.ja.md +++ b/website_and_docs/content/documentation/legacy/selenium_2/remote_server.ja.md @@ -3,8 +3,7 @@ title: "リモートWebDriverサーバー" linkTitle: "リモートWebDriverサーバー" weight: 6 aliases: [ -"/documentation/ja/legacy_docs/remote_webdriver_server/", -"/ja/documentation/legacy/remote_webdriver_server/" +"/documentation/legacy/remote_webdriver_server/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.pt-br.md b/website_and_docs/content/documentation/legacy/selenium_2/remote_server.pt-br.md index 92d93c69760b..d119e24cb91a 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.pt-br.md +++ b/website_and_docs/content/documentation/legacy/selenium_2/remote_server.pt-br.md @@ -3,8 +3,7 @@ title: "Servidor do WebDriver remoto" linkTitle: "Servidor do WebDriver remoto" weight: 6 aliases: [ -"/documentation/pt-br/legacy_docs/remote_webdriver_server/", -"/pt-br/documentation/legacy/remote_webdriver_server/" +"/documentation/legacy/remote_webdriver_server/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.zh-cn.md b/website_and_docs/content/documentation/legacy/selenium_2/remote_server.zh-cn.md index 869a1daf33ae..1fe0d3cde112 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.zh-cn.md +++ b/website_and_docs/content/documentation/legacy/selenium_2/remote_server.zh-cn.md @@ -3,8 +3,7 @@ title: "远程WebDriver服务器" linkTitle: "远程WebDriver服务器" weight: 6 aliases: [ -"/documentation/zh-cn/legacy_docs/remote_webdriver_server/", -"/zh-cn/documentation/legacy/remote_webdriver_server/" +"/documentation/legacy/remote_webdriver_server/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.en.md b/website_and_docs/content/documentation/legacy/selenium_2/upgrading.en.md index ec5b1b8b9f2d..fd56fe4d2c5b 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.en.md +++ b/website_and_docs/content/documentation/legacy/selenium_2/upgrading.en.md @@ -6,7 +6,10 @@ description: > Information on Updating from Selenium 1 to Selenium 2. aliases: [ "/documentation/en/legacy_docs/migrating_from_rc_to_webdriver/", -"/documentation/legacy/migrating_from_rc_to_webdriver/" +"/documentation/legacy/migrating_from_rc_to_webdriver/", +"/documentation/ja/legacy_docs/migrating_from_rc_to_webdriver/", +"/documentation/pt-br/legacy_docs/migrating_from_rc_to_webdriver/", +"/documentation/zh-cn/legacy_docs/migrating_from_rc_to_webdriver/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.ja.md b/website_and_docs/content/documentation/legacy/selenium_2/upgrading.ja.md index fd367286d32d..a6c2bac4e274 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.ja.md +++ b/website_and_docs/content/documentation/legacy/selenium_2/upgrading.ja.md @@ -3,8 +3,7 @@ title: "RCからWebDriverへの移行" linkTitle: "RCからWebDriverへの移行" weight: 2 aliases: [ -"/documentation/ja/legacy_docs/migrating_from_rc_to_webdriver/", -"/ja/documentation/legacy/migrating_from_rc_to_webdriver/" +"/documentation/legacy/migrating_from_rc_to_webdriver/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.pt-br.md b/website_and_docs/content/documentation/legacy/selenium_2/upgrading.pt-br.md index 866f468860f5..0ab58823ae4d 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.pt-br.md +++ b/website_and_docs/content/documentation/legacy/selenium_2/upgrading.pt-br.md @@ -3,8 +3,7 @@ title: "Migrando do RC para WebDriver" linkTitle: "Migrando do RC para WebDriver" weight: 2 aliases: [ -"/documentation/pt-br/legacy_docs/migrating_from_rc_to_webdriver/", -"/pt-br/documentation/legacy/migrating_from_rc_to_webdriver/" +"/documentation/legacy/migrating_from_rc_to_webdriver/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.zh-cn.md b/website_and_docs/content/documentation/legacy/selenium_2/upgrading.zh-cn.md index 30e3f2afa563..f11265e73a9d 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.zh-cn.md +++ b/website_and_docs/content/documentation/legacy/selenium_2/upgrading.zh-cn.md @@ -3,8 +3,7 @@ title: "从RC迁移到WebDriver" linkTitle: "从RC迁移到WebDriver" weight: 2 aliases: [ -"/documentation/zh-cn/legacy_docs/migrating_from_rc_to_webdriver/", -"/zh-cn/documentation/legacy/migrating_from_rc_to_webdriver/" +"/documentation/legacy/migrating_from_rc_to_webdriver/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.en.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_3.en.md index 3bb070123028..ddcb5973bcdf 100644 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.en.md +++ b/website_and_docs/content/documentation/legacy/selenium_3/grid_3.en.md @@ -7,7 +7,10 @@ description: > Grid 3 was completely rewritten for the new Grid 4. aliases: [ "/documentation/en/grid/grid_3/", -"/documentation/legacy/grid_3" +"/documentation/legacy/grid_3", +"/documentation/ja/grid/grid_3/", +"/documentation/pt-br/grid/grid_3/", +"/documentation/zh-cn/grid/grid_3/" ] --- You can read our documentation for more information about [Grid 4]({{< ref "/documentation/grid" >}}) diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.ja.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_3.ja.md index 2bd2955fbb97..4f59d6548068 100644 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.ja.md +++ b/website_and_docs/content/documentation/legacy/selenium_3/grid_3.ja.md @@ -6,8 +6,7 @@ description: > Selenium Grid 3 supported WebDriver without Selenium RC code. Grid 3 was completely rewritten for the new Grid 4. aliases: [ -"/documentation/ja/grid/grid_3/", -"/ja/documentation/legacy/grid_3" +"/documentation/legacy/grid_3" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.pt-br.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_3.pt-br.md index a85ae007ffee..2042510a4b3a 100644 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.pt-br.md +++ b/website_and_docs/content/documentation/legacy/selenium_3/grid_3.pt-br.md @@ -6,8 +6,7 @@ description: > Selenium Grid 3 supported WebDriver without Selenium RC code. Grid 3 was completely rewritten for the new Grid 4. aliases: [ -"/documentation/pt-br/grid/grid_3/", -"/pt-br/documentation/legacy/grid_3" +"/documentation/legacy/grid_3" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.zh-cn.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_3.zh-cn.md index d73930ad04a7..f4ccaabda42d 100644 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.zh-cn.md +++ b/website_and_docs/content/documentation/legacy/selenium_3/grid_3.zh-cn.md @@ -6,8 +6,7 @@ description: > Selenium Grid 3 supported WebDriver without Selenium RC code. Grid 3 was completely rewritten for the new Grid 4. aliases: [ -"/documentation/zh-cn/grid/grid_3/", -"/zh-cn/documentation/legacy/grid_3" +"/documentation/legacy/grid_3" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.en.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_components.en.md index 06b3ccc63759..2318cbf97473 100644 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.en.md +++ b/website_and_docs/content/documentation/legacy/selenium_3/grid_components.en.md @@ -6,7 +6,10 @@ description: > Description of Hub and Nodes for Grid 3. aliases: [ "/documentation/en/grid/grid_3/components_of_a_grid/", -"/documentation/legacy/grid_3/components_of_a_grid/" +"/documentation/legacy/grid_3/components_of_a_grid/", +"/documentation/ja/grid/grid_3/components_of_a_grid/", +"/documentation/pt-br/grid/grid_3/components_of_a_grid/", +"/documentation/zh-cn/grid/grid_3/components_of_a_grid/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.ja.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_components.ja.md index bb349c1c69f2..bcddc67001bd 100644 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.ja.md +++ b/website_and_docs/content/documentation/legacy/selenium_3/grid_components.ja.md @@ -4,7 +4,6 @@ linkTitle: "グリッドのコンポーネント" weight: 6 description: > Description of Hub and Nodes for Grid 3. -aliases: ["/documentation/ja/grid/grid_3/components_of_a_grid/"] --- {{< figure src="/images/documentation/legacy/grid_3/grid.png" class="img-responsive text-center" alt="Grid 3 Components">}} diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.pt-br.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_components.pt-br.md index c1629c710fd0..56063b18e0bd 100644 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.pt-br.md +++ b/website_and_docs/content/documentation/legacy/selenium_3/grid_components.pt-br.md @@ -4,7 +4,6 @@ linkTitle: "Grid Components" weight: 6 description: > Description of Hub and Nodes for Grid 3. -aliases: ["/documentation/pt-br/grid/grid_3/components_of_a_grid/"] --- {{< figure src="/images/documentation/legacy/grid_3/grid.png" class="img-responsive text-center" alt="Grid 3 Components">}} diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.zh-cn.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_components.zh-cn.md index ad7d080ad8e7..636c8588930f 100644 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.zh-cn.md +++ b/website_and_docs/content/documentation/legacy/selenium_3/grid_components.zh-cn.md @@ -4,7 +4,6 @@ linkTitle: "服务网格的组件" weight: 6 description: > Description of Hub and Nodes for Grid 3. -aliases: ["/documentation/zh-cn/grid/grid_3/components_of_a_grid/"] --- {{< figure src="/images/documentation/legacy/grid_3/grid.png" class="img-responsive text-center" alt="Grid 3 Components">}} diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.en.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.en.md index d68d7af7ab56..5b8e5390cbcc 100644 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.en.md +++ b/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.en.md @@ -6,7 +6,10 @@ description: > Quick start guide for setting up Grid 3. aliases: [ "/documentation/en/grid/grid_3/setting_up_your_own_grid/", -"/documentation/legacy/grid_3/setting_up_your_own_grid/" +"/documentation/legacy/grid_3/setting_up_your_own_grid/", +"/documentation/ja/grid/grid_3/setting_up_your_own_grid/", +"/documentation/pt-br/grid/grid_3/setting_up_your_own_grid/", +"/documentation/zh-cn/grid/grid_3/setting_up_your_own_grid/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.ja.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.ja.md index 42829b9d27fa..77f0d0f4b63b 100644 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.ja.md +++ b/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.ja.md @@ -5,8 +5,7 @@ weight: 4 description: > Quick start guide for setting up Grid 3. aliases: [ -"/documentation/ja/grid/grid_3/setting_up_your_own_grid/", -"/ja/documentation/legacy/grid_3/setting_up_your_own_grid/" +"/documentation/legacy/grid_3/setting_up_your_own_grid/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.pt-br.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.pt-br.md index 2f22f674ec26..e213ee1462fe 100644 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.pt-br.md +++ b/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.pt-br.md @@ -5,8 +5,7 @@ weight: 4 description: > Quick start guide for setting up Grid 3. aliases: [ -"/documentation/pt-br/grid/grid_3/setting_up_your_own_grid/", -"/pt-br/documentation/legacy/grid_3/setting_up_your_own_grid/" +"/documentation/legacy/grid_3/setting_up_your_own_grid/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.zh-cn.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.zh-cn.md index e33f55973040..3d4456339623 100644 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.zh-cn.md +++ b/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.zh-cn.md @@ -5,8 +5,7 @@ weight: 4 description: > Quick start guide for setting up Grid 3. aliases: [ -"/documentation/zh-cn/grid/grid_3/setting_up_your_own_grid/", -"/zh-cn/documentation/legacy/grid_3/setting_up_your_own_grid/" +"/documentation/legacy/grid_3/setting_up_your_own_grid/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_ide/_index.en.md b/website_and_docs/content/documentation/legacy/selenium_ide/_index.en.md index 0e937358da24..aa71c24866ac 100644 --- a/website_and_docs/content/documentation/legacy/selenium_ide/_index.en.md +++ b/website_and_docs/content/documentation/legacy/selenium_ide/_index.en.md @@ -4,7 +4,7 @@ linkTitle: "Selenium IDE" weight: 8 description: > Selenium IDE was the original Firefox extension for Record and Playback. -aliases: ["/documentation/en/legacy_docs/selenium_ide/"] +aliases: ["/documentation/en/legacy_docs/selenium_ide/", "/documentation/ja/legacy_docs/selenium_ide/", "/documentation/pt-br/legacy_docs/selenium_ide/", "/documentation/zh-cn/legacy_docs/selenium_ide/"] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_ide/_index.ja.md b/website_and_docs/content/documentation/legacy/selenium_ide/_index.ja.md index dcef8026d4dd..248f0b0a4487 100644 --- a/website_and_docs/content/documentation/legacy/selenium_ide/_index.ja.md +++ b/website_and_docs/content/documentation/legacy/selenium_ide/_index.ja.md @@ -2,7 +2,6 @@ title: "レガシー Selenium IDE" linkTitle: "Selenium IDE" weight: 8 -aliases: ["/documentation/ja/legacy_docs/selenium_ide/"] --- ## 紹介 diff --git a/website_and_docs/content/documentation/legacy/selenium_ide/_index.pt-br.md b/website_and_docs/content/documentation/legacy/selenium_ide/_index.pt-br.md index 08d65c70fb0e..60c186e2bbcd 100644 --- a/website_and_docs/content/documentation/legacy/selenium_ide/_index.pt-br.md +++ b/website_and_docs/content/documentation/legacy/selenium_ide/_index.pt-br.md @@ -2,7 +2,6 @@ title: "Selenium IDE Legado" linkTitle: "Selenium IDE" weight: 8 -aliases: ["/documentation/pt-br/legacy_docs/selenium_ide/"] --- ## Introdução diff --git a/website_and_docs/content/documentation/legacy/selenium_ide/_index.zh-cn.md b/website_and_docs/content/documentation/legacy/selenium_ide/_index.zh-cn.md index f613eae76e6e..28ad7f67e884 100644 --- a/website_and_docs/content/documentation/legacy/selenium_ide/_index.zh-cn.md +++ b/website_and_docs/content/documentation/legacy/selenium_ide/_index.zh-cn.md @@ -2,7 +2,6 @@ title: "Legacy Selenium IDE" linkTitle: "Selenium IDE" weight: 8 -aliases: ["/documentation/zh-cn/legacy_docs/selenium_ide/"] --- {{% pageinfo color="warning" %}} diff --git a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.en.md b/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.en.md index bd40067671e2..194160b83c72 100644 --- a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.en.md +++ b/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.en.md @@ -6,7 +6,10 @@ description: > Execute HTML Selenium IDE exports from command line aliases: [ "/documentation/en/legacy_docs/html-runner/", -"/documentation/legacy/html_runner/" +"/documentation/legacy/html_runner/", +"/documentation/ja/legacy_docs/html-runner/", +"/documentation/pt-br/legacy_docs/html-runner/", +"/documentation/zh-cn/legacy_docs/html-runner/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.ja.md b/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.ja.md index 196fac53a116..8e4f17ed0654 100644 --- a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.ja.md +++ b/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.ja.md @@ -5,8 +5,7 @@ weight: 2 description: > Execute HTML Selenium IDE exports from command line aliases: [ -"/documentation/ja/legacy_docs/html-runner/", -"/ja/documentation/legacy/html_runner/" +"/documentation/legacy/html_runner/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.pt-br.md b/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.pt-br.md index 8194adea48a8..2cd667de7b89 100644 --- a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.pt-br.md +++ b/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.pt-br.md @@ -5,8 +5,7 @@ weight: 2 description: > Execute HTML Selenium IDE exports from command line aliases: [ -"/documentation/pt-br/legacy_docs/html-runner/", -"/pt-br/documentation/legacy/html_runner/" +"/documentation/legacy/html_runner/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.zh-cn.md b/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.zh-cn.md index 6e9754aad27a..a0946e30586a 100644 --- a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.zh-cn.md +++ b/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.zh-cn.md @@ -5,8 +5,7 @@ weight: 2 description: > Execute HTML Selenium IDE exports from command line aliases: [ -"/documentation/zh-cn/legacy_docs/html-runner/", -"/zh-cn/documentation/legacy/html_runner/" +"/documentation/legacy/html_runner/" ] --- diff --git a/website_and_docs/content/documentation/overview/_index.en.md b/website_and_docs/content/documentation/overview/_index.en.md index 02fbeafd7e9d..f3cb1d9a0c64 100644 --- a/website_and_docs/content/documentation/overview/_index.en.md +++ b/website_and_docs/content/documentation/overview/_index.en.md @@ -4,7 +4,7 @@ linkTitle: "Overview" weight: 1 description: > Is Selenium for you? See an overview of the different project components. -aliases: ["/documentation/en/introduction/"] +aliases: ["/documentation/en/introduction/", "/documentation/ja/introduction/", "/documentation/pt-br/introduction/", "/documentation/zh-cn/introduction/"] --- diff --git a/website_and_docs/content/documentation/overview/_index.ja.md b/website_and_docs/content/documentation/overview/_index.ja.md index 8a8ac6efdb09..7de205c59726 100644 --- a/website_and_docs/content/documentation/overview/_index.ja.md +++ b/website_and_docs/content/documentation/overview/_index.ja.md @@ -4,7 +4,6 @@ linkTitle: "概要" weight: 1 description: > Seleniumはあなたに適していますか?さまざまなプロジェクトのコンポーネントの概要を参照してください。 -aliases: ["/documentation/ja/introduction/"] --- Seleniumは単一のツールやAPIではなく、多くのツールから構成されています。 diff --git a/website_and_docs/content/documentation/overview/_index.pt-br.md b/website_and_docs/content/documentation/overview/_index.pt-br.md index 5c50abaa71fa..845080e9ab0f 100644 --- a/website_and_docs/content/documentation/overview/_index.pt-br.md +++ b/website_and_docs/content/documentation/overview/_index.pt-br.md @@ -4,7 +4,6 @@ linkTitle: "Resumo" weight: 1 description: > Será Selenium a ferramenta para você? Veja um resumo dos componentes do projecto. -aliases: ["/documentation/pt-br/introduction/"] --- Selenium não é só uma ferramenta ou API, diff --git a/website_and_docs/content/documentation/overview/_index.zh-cn.md b/website_and_docs/content/documentation/overview/_index.zh-cn.md index ab27288d82b4..1ac133b9f9a3 100644 --- a/website_and_docs/content/documentation/overview/_index.zh-cn.md +++ b/website_and_docs/content/documentation/overview/_index.zh-cn.md @@ -4,7 +4,6 @@ linkTitle: "概述" weight: 1 description: > Selenium适合你吗? 请参见不同项目组件的概述. -aliases: ["/documentation/zh-cn/introduction/"] --- diff --git a/website_and_docs/content/documentation/overview/components.en.md b/website_and_docs/content/documentation/overview/components.en.md index 92e705a9faca..64e991c086bd 100644 --- a/website_and_docs/content/documentation/overview/components.en.md +++ b/website_and_docs/content/documentation/overview/components.en.md @@ -4,7 +4,10 @@ linkTitle: "Components" weight: 1 aliases: [ "/documentation/en/webdriver/understanding_the_components/", -"/documentation/webdriver/understanding_the_components" +"/documentation/webdriver/understanding_the_components", +"/documentation/ja/webdriver/understanding_the_components/", +"/documentation/pt-br/webdriver/understanding_the_components/", +"/documentation/zh-cn/webdriver/understanding_the_components/" ] --- diff --git a/website_and_docs/content/documentation/overview/components.ja.md b/website_and_docs/content/documentation/overview/components.ja.md index f7d542e810b5..ffed7bad26b0 100644 --- a/website_and_docs/content/documentation/overview/components.ja.md +++ b/website_and_docs/content/documentation/overview/components.ja.md @@ -3,8 +3,7 @@ title: "コンポーネントを理解する" linkTitle: "コンポーネントを理解する" weight: 1 aliases: [ -"/documentation/ja/webdriver/understanding_the_components/", -"/ja/documentation/webdriver/understanding_the_components" +"/documentation/webdriver/understanding_the_components" ] --- diff --git a/website_and_docs/content/documentation/overview/components.pt-br.md b/website_and_docs/content/documentation/overview/components.pt-br.md index 508c86856819..e8cf13f8959d 100644 --- a/website_and_docs/content/documentation/overview/components.pt-br.md +++ b/website_and_docs/content/documentation/overview/components.pt-br.md @@ -3,8 +3,7 @@ title: "Entendendo os componentes" linkTitle: "Entendendo os componentes" weight: 1 aliases: [ -"/documentation/pt-br/webdriver/understanding_the_components/", -"/pt-br/documentation/webdriver/understanding_the_components" +"/documentation/webdriver/understanding_the_components" ] --- diff --git a/website_and_docs/content/documentation/overview/components.zh-cn.md b/website_and_docs/content/documentation/overview/components.zh-cn.md index 6fc1e76ddb16..7852754dceae 100644 --- a/website_and_docs/content/documentation/overview/components.zh-cn.md +++ b/website_and_docs/content/documentation/overview/components.zh-cn.md @@ -3,8 +3,7 @@ title: "了解组件" linkTitle: "了解组件" weight: 1 aliases: [ -"/documentation/zh-cn/webdriver/understanding_the_components/", -"/zh-cn/documentation/webdriver/understanding_the_components" +"/documentation/webdriver/understanding_the_components" ] --- diff --git a/website_and_docs/content/documentation/overview/details.en.md b/website_and_docs/content/documentation/overview/details.en.md index 7700beaa9475..5bb04f416e7d 100644 --- a/website_and_docs/content/documentation/overview/details.en.md +++ b/website_and_docs/content/documentation/overview/details.en.md @@ -7,7 +7,10 @@ description: > and support the automation of web browsers. aliases: [ "/documentation/en/introduction/the_selenium_project_and_tools/", -"/documentation/overview/a_deeper_look" +"/documentation/overview/a_deeper_look", +"/documentation/ja/introduction/the_selenium_project_and_tools/", +"/documentation/pt-br/introduction/the_selenium_project_and_tools/", +"/documentation/zh-cn/introduction/the_selenium_project_and_tools/" ] --- diff --git a/website_and_docs/content/documentation/overview/details.ja.md b/website_and_docs/content/documentation/overview/details.ja.md index d495501f9fdf..3a30898f3086 100644 --- a/website_and_docs/content/documentation/overview/details.ja.md +++ b/website_and_docs/content/documentation/overview/details.ja.md @@ -6,8 +6,7 @@ description: > Seleniumは、Webブラウザの自動化を可能にし、その自動化を支援する 多様なツールとライブラリを包含するプロジェクトです。 aliases: [ -"/documentation/ja/introduction/the_selenium_project_and_tools/", -"/ja/documentation/overview/a_deeper_look" +"/documentation/overview/a_deeper_look" ] --- diff --git a/website_and_docs/content/documentation/overview/details.pt-br.md b/website_and_docs/content/documentation/overview/details.pt-br.md index edd1d1b0d23c..3abfd61610c4 100644 --- a/website_and_docs/content/documentation/overview/details.pt-br.md +++ b/website_and_docs/content/documentation/overview/details.pt-br.md @@ -6,8 +6,7 @@ description: > Selenium é um projeto abrangente para uma gama de ferramentas e bibliotecas que permitem e suportam a automação de navegadores da web. aliases: [ -"/documentation/pt-br/introduction/the_selenium_project_and_tools/", -"/pt-br/documentation/overview/a_deeper_look" +"/documentation/overview/a_deeper_look" ] --- diff --git a/website_and_docs/content/documentation/overview/details.zh-cn.md b/website_and_docs/content/documentation/overview/details.zh-cn.md index e31bba574532..c6fcc790e33c 100644 --- a/website_and_docs/content/documentation/overview/details.zh-cn.md +++ b/website_and_docs/content/documentation/overview/details.zh-cn.md @@ -5,8 +5,7 @@ weight: 2 description: > Selenium 是一系列工具和库的综合项目,这些工具和库支持 web 浏览器的自动化。 aliases: [ -"/documentation/zh-cn/introduction/the_selenium_project_and_tools/", -"/zh-cn/documentation/overview/a_deeper_look" +"/documentation/overview/a_deeper_look" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/_index.en.md b/website_and_docs/content/documentation/test_practices/discouraged/_index.en.md index 1612cb3768fa..1c4fc28db545 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/_index.en.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/_index.en.md @@ -6,7 +6,10 @@ description: > Things to avoid when automating browsers with Selenium. aliases: [ "/documentation/en/worst_practices/", -"/documentation/worst_practices/" +"/documentation/worst_practices/", +"/documentation/ja/worst_practices/", +"/documentation/pt-br/worst_practices/", +"/documentation/zh-cn/worst_practices/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/_index.ja.md b/website_and_docs/content/documentation/test_practices/discouraged/_index.ja.md index 541ddff56b99..fe8fb4546c0e 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/_index.ja.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/_index.ja.md @@ -5,7 +5,6 @@ weight: 8 description: > Seleniumでブラウザを自動化するときに避けるべきこと。 aliases: [ -"/documentation/ja/worst_practices/", -"/ja/documentation/worst_practices/" +"/documentation/worst_practices/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/_index.pt-br.md b/website_and_docs/content/documentation/test_practices/discouraged/_index.pt-br.md index efa7fa5fc26d..3fcfcb1c3f8d 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/_index.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/_index.pt-br.md @@ -5,7 +5,6 @@ weight: 8 description: > Temas a evitar quando automatizar navegadores com Selenium. aliases: [ -"/documentation/pt-br/worst_practices/", -"/pt-br/documentation/worst_practices/" +"/documentation/worst_practices/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/_index.zh-cn.md b/website_and_docs/content/documentation/test_practices/discouraged/_index.zh-cn.md index 816a2583b4a1..7b27322e785d 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/_index.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/_index.zh-cn.md @@ -5,8 +5,7 @@ weight: 8 description: > 使用Selenium自动化浏览器时应避免的事项. aliases: [ -"/documentation/zh-cn/worst_practices/", -"/zh-cn/documentation/worst_practices/" +"/documentation/worst_practices/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/captchas.en.md b/website_and_docs/content/documentation/test_practices/discouraged/captchas.en.md index e5ac5f872b43..67489e34a311 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/captchas.en.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/captchas.en.md @@ -4,7 +4,10 @@ linkTitle: "Captchas" weight: 1 aliases: [ "/documentation/en/worst_practices/captchas/", -"/documentation/worst_practices/captchas/" +"/documentation/worst_practices/captchas/", +"/documentation/ja/worst_practices/captchas/", +"/documentation/pt-br/worst_practices/captchas/", +"/documentation/zh-cn/worst_practices/captchas/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/captchas.ja.md b/website_and_docs/content/documentation/test_practices/discouraged/captchas.ja.md index 66ad765597ba..6484ae16a62d 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/captchas.ja.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/captchas.ja.md @@ -3,8 +3,7 @@ title: "CAPTCHA(キャプチャ)" linkTitle: "CAPTCHA(キャプチャ)" weight: 1 aliases: [ -"/documentation/ja/worst_practices/captchas/", -"/ja/documentation/worst_practices/captchas/" +"/documentation/worst_practices/captchas/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/captchas.pt-br.md b/website_and_docs/content/documentation/test_practices/discouraged/captchas.pt-br.md index 79de825d7d22..516a903ae558 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/captchas.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/captchas.pt-br.md @@ -3,8 +3,7 @@ title: "Captchas" linkTitle: "Captchas" weight: 1 aliases: [ -"/documentation/pt-br/worst_practices/captchas/", -"/pt-br/documentation/worst_practices/captchas/" +"/documentation/worst_practices/captchas/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/captchas.zh-cn.md b/website_and_docs/content/documentation/test_practices/discouraged/captchas.zh-cn.md index 85383992472a..e2e7a14f7118 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/captchas.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/captchas.zh-cn.md @@ -3,8 +3,7 @@ title: "验证码" linkTitle: "验证码" weight: 1 aliases: [ -"/documentation/zh-cn/worst_practices/captchas/", -"/zh-cn/documentation/worst_practices/captchas/" +"/documentation/worst_practices/captchas/" ] --- 验证码 (CAPTCHA), 是 _全自动区分计算机和人类的图灵测试_ *(Completely Automated Public Turing test to tell Computers and Humans Apart)* 的简称, diff --git a/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.en.md b/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.en.md index 78a686b2125c..fde9ac91bfcf 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.en.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.en.md @@ -4,7 +4,10 @@ linkTitle: "File downloads" weight: 2 aliases: [ "/documentation/en/worst_practices/file_downloads/", -"/documentation/worst_practices/file_downloads/" +"/documentation/worst_practices/file_downloads/", +"/documentation/ja/worst_practices/file_downloads/", +"/documentation/pt-br/worst_practices/file_downloads/", +"/documentation/zh-cn/worst_practices/file_downloads/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.ja.md b/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.ja.md index 2f2b4ab54c0d..ab9c0b8fedba 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.ja.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.ja.md @@ -3,8 +3,7 @@ title: "ファイルダウンロード" linkTitle: "ファイルダウンロード" weight: 2 aliases: [ -"/documentation/ja/worst_practices/file_downloads/", -"/ja/documentation/worst_practices/file_downloads/" +"/documentation/worst_practices/file_downloads/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.pt-br.md b/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.pt-br.md index 3cc5f0a5be91..2a335267672c 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.pt-br.md @@ -3,8 +3,7 @@ title: "Downloads de arquivo" linkTitle: "Downloads de arquivo" weight: 2 aliases: [ -"/documentation/pt-br/worst_practices/file_downloads/", -"/pt-br/documentation/worst_practices/file_downloads/" +"/documentation/worst_practices/file_downloads/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.zh-cn.md b/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.zh-cn.md index 47b28975a66b..c58231464412 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.zh-cn.md @@ -3,8 +3,7 @@ title: "文件下载" linkTitle: "文件下载" weight: 2 aliases: [ -"/documentation/zh-cn/worst_practices/file_downloads/", -"/zh-cn/documentation/worst_practices/file_downloads/" +"/documentation/worst_practices/file_downloads/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.en.md b/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.en.md index 21cf84a1608f..6f305f542746 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.en.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.en.md @@ -4,7 +4,10 @@ linkTitle: "Gmail, email and Facebook" weight: 4 aliases: [ "/documentation/en/worst_practices/gmail_email_and_facebook_logins/", -"/documentation/worst_practices/gmail_email_and_facebook_logins/" +"/documentation/worst_practices/gmail_email_and_facebook_logins/", +"/documentation/ja/worst_practices/gmail_email_and_facebook_logins/", +"/documentation/pt-br/worst_practices/gmail_email_and_facebook_logins/", +"/documentation/zh-cn/worst_practices/gmail_email_and_facebook_logins/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.ja.md b/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.ja.md index a34bf64d8e32..70eba9ee0d28 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.ja.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.ja.md @@ -3,8 +3,7 @@ title: "Gmail、Eメール、Facebookログイン" linkTitle: "Gmail、Eメール、Facebook" weight: 4 aliases: [ -"/documentation/ja/worst_practices/gmail_email_and_facebook_logins/", -"/ja/documentation/worst_practices/gmail_email_and_facebook_logins/" +"/documentation/worst_practices/gmail_email_and_facebook_logins/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.pt-br.md b/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.pt-br.md index 63a318edc028..202f1221675a 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.pt-br.md @@ -3,8 +3,7 @@ title: "Login via Gmail, email e Facebook" linkTitle: "Login via Gmail, email e Facebook" weight: 4 aliases: [ -"/documentation/pt-br/worst_practices/gmail_email_and_facebook_logins/", -"/pt-br/documentation/worst_practices/gmail_email_and_facebook_logins/" +"/documentation/worst_practices/gmail_email_and_facebook_logins/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.zh-cn.md b/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.zh-cn.md index 6c97259ee3d5..738d7d33647f 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.zh-cn.md @@ -3,8 +3,7 @@ title: "Gmail, email 和 Facebook 登录" linkTitle: "Gmail, email and Facebook" weight: 4 aliases: [ -"/documentation/zh-cn/worst_practices/gmail_email_and_facebook_logins/", -"/zh-cn/documentation/worst_practices/gmail_email_and_facebook_logins/" +"/documentation/worst_practices/gmail_email_and_facebook_logins/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.en.md b/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.en.md index be4f20cf2471..67e9120d0548 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.en.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.en.md @@ -4,7 +4,10 @@ linkTitle: "HTTP response codes" weight: 3 aliases: [ "/documentation/en/worst_practices/http_response_codes/", -"/documentation/worst_practices/http_response_codes/" +"/documentation/worst_practices/http_response_codes/", +"/documentation/ja/worst_practices/http_response_codes/", +"/documentation/pt-br/worst_practices/http_response_codes/", +"/documentation/zh-cn/worst_practices/http_response_codes/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.ja.md b/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.ja.md index 34c4fd1aeb5c..767f607dca3d 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.ja.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.ja.md @@ -3,8 +3,7 @@ title: "HTTPレスポンスコード" linkTitle: "HTTPレスポンスコード" weight: 3 aliases: [ -"/documentation/ja/worst_practices/http_response_codes/", -"/ja/documentation/worst_practices/http_response_codes/" +"/documentation/worst_practices/http_response_codes/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.pt-br.md b/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.pt-br.md index 48311a2e9a92..ea78f028370e 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.pt-br.md @@ -3,8 +3,7 @@ title: "Códigos de respostas HTTP" linkTitle: "Códigos de respostas HTTP" weight: 3 aliases: [ -"/documentation/pt-br/worst_practices/http_response_codes/", -"/pt-br/documentation/worst_practices/http_response_codes/" +"/documentation/worst_practices/http_response_codes/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.zh-cn.md b/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.zh-cn.md index 625f4b0279bf..df51f272d5f1 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.zh-cn.md @@ -3,8 +3,7 @@ title: "HTTP响应码" linkTitle: "HTTP响应码" weight: 3 aliases: [ -"/documentation/zh-cn/worst_practices/http_response_codes/", -"/zh-cn/documentation/worst_practices/http_response_codes/" +"/documentation/worst_practices/http_response_codes/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.en.md b/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.en.md index 59d35eb79f32..d28e7c7f5617 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.en.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.en.md @@ -4,7 +4,10 @@ linkTitle: "Link spidering" weight: 7 aliases: [ "/documentation/en/worst_practices/link_spidering/", -"/documentation/worst_practices/link_spidering/" +"/documentation/worst_practices/link_spidering/", +"/documentation/ja/worst_practices/link_spidering/", +"/documentation/pt-br/worst_practices/link_spidering/", +"/documentation/zh-cn/worst_practices/link_spidering/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.ja.md b/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.ja.md index b4a6254ba37b..88f52733ffeb 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.ja.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.ja.md @@ -3,8 +3,7 @@ title: "リンクスパイダー" linkTitle: "リンクスパイダー" weight: 7 aliases: [ -"/documentation/ja/worst_practices/link_spidering/", -"/ja/documentation/worst_practices/link_spidering/" +"/documentation/worst_practices/link_spidering/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.pt-br.md b/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.pt-br.md index 810fa6de0b31..c00bd834f4e5 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.pt-br.md @@ -3,8 +3,7 @@ title: "Navegação por links" linkTitle: "Navegação por links" weight: 7 aliases: [ -"/documentation/pt-br/worst_practices/link_spidering/", -"/pt-br/documentation/worst_practices/link_spidering/" +"/documentation/worst_practices/link_spidering/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.zh-cn.md b/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.zh-cn.md index 0f0be9f539cf..255b69824d26 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.zh-cn.md @@ -3,8 +3,7 @@ title: "爬取链接" linkTitle: "爬取链接" weight: 7 aliases: [ -"/documentation/zh-cn/worst_practices/link_spidering/", -"/zh-cn/documentation/worst_practices/link_spidering/" +"/documentation/worst_practices/link_spidering/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.en.md b/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.en.md index f6e69b5cf3ec..c8271a2ceed1 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.en.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.en.md @@ -4,7 +4,10 @@ linkTitle: "Performance testing" weight: 6 aliases: [ "/documentation/en/worst_practices/performance_testing/", -"/documentation/worst_practices/performance_testing/" +"/documentation/worst_practices/performance_testing/", +"/documentation/ja/worst_practices/performance_testing/", +"/documentation/pt-br/worst_practices/performance_testing/", +"/documentation/zh-cn/worst_practices/performance_testing/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.ja.md b/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.ja.md index df1ba36d37f3..1da5838964b2 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.ja.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.ja.md @@ -3,8 +3,7 @@ title: "パフォーマンステスト" linkTitle: "パフォーマンステスト" weight: 6 aliases: [ -"/documentation/ja/worst_practices/performance_testing/", -"/ja/documentation/worst_practices/performance_testing/" +"/documentation/worst_practices/performance_testing/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.pt-br.md b/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.pt-br.md index 90f1ecfb9f98..c3614675f6ce 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.pt-br.md @@ -3,8 +3,7 @@ title: "Teste de performance/desempenho" linkTitle: "Teste de performance/desempenho" weight: 6 aliases: [ -"/documentation/pt-br/worst_practices/performance_testing/", -"/pt-br/documentation/worst_practices/performance_testing/" +"/documentation/worst_practices/performance_testing/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.zh-cn.md b/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.zh-cn.md index 07d890c32579..a01f024b618e 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.zh-cn.md @@ -3,8 +3,7 @@ title: "性能测试" linkTitle: "性能测试" weight: 6 aliases: [ -"/documentation/zh-cn/worst_practices/performance_testing/", -"/zh-cn/documentation/worst_practices/performance_testing/" +"/documentation/worst_practices/performance_testing/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.en.md b/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.en.md index c52576ceb01a..934b1a6e0224 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.en.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.en.md @@ -4,7 +4,10 @@ linkTitle: "Test dependency" weight: 5 aliases: [ "/documentation/en/worst_practices/test_dependency/", -"/documentation/worst_practices/test_dependency/" +"/documentation/worst_practices/test_dependency/", +"/documentation/ja/worst_practices/test_dependency/", +"/documentation/pt-br/worst_practices/test_dependency/", +"/documentation/zh-cn/worst_practices/test_dependency/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.ja.md b/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.ja.md index 7ea2077e4bfe..7bfbf7a84619 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.ja.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.ja.md @@ -3,8 +3,7 @@ title: "テストの依存関係" linkTitle: "テストの依存関係" weight: 5 aliases: [ -"/documentation/ja/worst_practices/test_dependency/", -"/ja/documentation/worst_practices/test_dependency/" +"/documentation/worst_practices/test_dependency/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.pt-br.md b/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.pt-br.md index 166a9dcd30a3..b86d28a8b7cf 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.pt-br.md @@ -3,8 +3,7 @@ title: "Dependência entre testes" linkTitle: "Dependência entre testes" weight: 5 aliases: [ -"/documentation/pt-br/worst_practices/test_dependency/", -"/pt-br/documentation/worst_practices/test_dependency/" +"/documentation/worst_practices/test_dependency/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.zh-cn.md b/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.zh-cn.md index 8752c956fc28..45b471a85f1c 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.zh-cn.md @@ -3,8 +3,7 @@ title: "测试依赖" linkTitle: "测试依赖" weight: 5 aliases: [ -"/documentation/zh-cn/worst_practices/test_dependency/", -"/zh-cn/documentation/worst_practices/test_dependency/" +"/documentation/worst_practices/test_dependency/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.en.md b/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.en.md index ebbc483b9265..dbed65a51502 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.en.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.en.md @@ -4,7 +4,10 @@ linkTitle: "Two Factor Authentication" weight: 8 aliases: [ "/documentation/en/worst_practices/two_factor_authentication/", -"/documentation/worst_practices/two_factor_authentication/" +"/documentation/worst_practices/two_factor_authentication/", +"/documentation/ja/worst_practices/two_factor_authentication/", +"/documentation/pt-br/worst_practices/two_factor_authentication/", +"/documentation/zh-cn/worst_practices/two_factor_authentication/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.ja.md b/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.ja.md index 82ab1003c38e..f3a16a88aaa2 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.ja.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.ja.md @@ -3,8 +3,7 @@ title: "二要素認証" linkTitle: "二要素認証" weight: 8 aliases: [ -"/documentation/ja/worst_practices/two_factor_authentication/", -"/ja/documentation/worst_practices/two_factor_authentication/" +"/documentation/worst_practices/two_factor_authentication/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.pt-br.md b/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.pt-br.md index 6275139b71f4..94bcb9b6fb4b 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.pt-br.md @@ -3,8 +3,7 @@ title: "Autenticação de Dois Fatores (2FA)" linkTitle: "Autenticação de Dois Fatores (2FA)" weight: 8 aliases: [ -"/documentation/pt-br/worst_practices/two_factor_authentication/", -"/pt-br/documentation/worst_practices/two_factor_authentication/" +"/documentation/worst_practices/two_factor_authentication/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.zh-cn.md b/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.zh-cn.md index e82b12085c20..9cc4a5f5bb07 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.zh-cn.md @@ -3,8 +3,7 @@ title: "双因素认证" linkTitle: "双因素认证" weight: 8 aliases: [ -"/documentation/zh-cn/worst_practices/two_factor_authentication/", -"/zh-cn/documentation/worst_practices/two_factor_authentication/" +"/documentation/worst_practices/two_factor_authentication/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/_index.en.md b/website_and_docs/content/documentation/test_practices/encouraged/_index.en.md index bcc6c41cf193..e0f5d4ef6963 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/_index.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/_index.en.md @@ -6,7 +6,10 @@ description: > Some guidelines and recommendations on testing from the Selenium project. aliases: [ "/documentation/en/guidelines_and_recommendations/", -"/documentation/guidelines/" +"/documentation/guidelines/", +"/documentation/ja/guidelines_and_recommendations/", +"/documentation/pt-br/guidelines_and_recommendations/", +"/documentation/zh-cn/guidelines_and_recommendations/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/_index.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/_index.ja.md index 20dcbcfb50b0..eb005b28f55e 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/_index.ja.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/_index.ja.md @@ -5,8 +5,7 @@ weight: 3 description: > Seleniumプロジェクトからのテストに関するいくつかのガイドラインと推奨事項 aliases: [ -"/documentation/ja/guidelines_and_recommendations/", -"/ja/documentation/guidelines/" +"/documentation/guidelines/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/_index.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/_index.pt-br.md index 7633dfcd027b..7bf0f0ea8365 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/_index.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/_index.pt-br.md @@ -5,8 +5,7 @@ weight: 7 description: > Guias e recomendações ao preparar soluções de testes com o projecto Selenium. aliases: [ -"/documentation/pt-br/guidelines_and_recommendations/", -"/pt-br/documentation/guidelines/" +"/documentation/guidelines/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/_index.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/_index.zh-cn.md index ea2f2bd64133..46785d6c8cff 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/_index.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/_index.zh-cn.md @@ -5,8 +5,7 @@ weight: 7 description: > Selenium项目的一些测试指南和建议. aliases: [ -"/documentation/zh-cn/guidelines_and_recommendations/", -"/zh-cn/documentation/guidelines/" +"/documentation/guidelines/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.en.md b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.en.md index c72f7f128477..0a126998ee06 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.en.md @@ -4,7 +4,10 @@ linkTitle: "Avoid sharing state" weight: 8 aliases: [ "/documentation/en/guidelines_and_recommendations/avoid_sharing_state/", -"/documentation/guidelines/avoid_sharing_state/" +"/documentation/guidelines/avoid_sharing_state/", +"/documentation/ja/guidelines_and_recommendations/avoid_sharing_state/", +"/documentation/pt-br/guidelines_and_recommendations/avoid_sharing_state/", +"/documentation/zh-cn/guidelines_and_recommendations/avoid_sharing_state/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.ja.md index 4c4597541d31..ae23dd2267a8 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.ja.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.ja.md @@ -3,8 +3,7 @@ title: "状態を共有しない" linkTitle: "状態を共有しない" weight: 8 aliases: [ -"/documentation/ja/guidelines_and_recommendations/avoid_sharing_state/", -"/ja/documentation/guidelines/avoid_sharing_state/" +"/documentation/guidelines/avoid_sharing_state/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.pt-br.md index b40d8e89d3ad..00cb270ebe56 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.pt-br.md @@ -3,8 +3,7 @@ title: "Evite compartilhamento de estado" linkTitle: "Evite compartilhamento de estado" weight: 8 aliases: [ -"/documentation/pt-br/guidelines_and_recommendations/avoid_sharing_state/", -"/pt-br/documentation/guidelines/avoid_sharing_state/" +"/documentation/guidelines/avoid_sharing_state/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.zh-cn.md index b68921f15ec4..65b618a11d28 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.zh-cn.md @@ -3,8 +3,7 @@ title: "避免共享状态" linkTitle: "避免共享状态" weight: 8 aliases: [ -"/documentation/zh-cn/guidelines_and_recommendations/avoid_sharing_state/", -"/zh-cn/documentation/guidelines/avoid_sharing_state/" +"/documentation/guidelines/avoid_sharing_state/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.en.md b/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.en.md index bf993c45061f..66d437545b92 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.en.md @@ -4,7 +4,10 @@ linkTitle: "Consider using a fluent API" weight: 10 aliases: [ "/documentation/en/guidelines_and_recommendations/consider_using_a_fluent_api/", -"/documentation/guidelines/consider_using_a_fluent_api/" +"/documentation/guidelines/consider_using_a_fluent_api/", +"/documentation/ja/guidelines_and_recommendations/consider_using_a_fluent_api/", +"/documentation/pt-br/guidelines_and_recommendations/consider_using_a_fluent_api/", +"/documentation/zh-cn/guidelines_and_recommendations/consider_using_a_fluent_api/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.ja.md index e0486902b36a..c24ec9fbb9ea 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.ja.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.ja.md @@ -3,8 +3,7 @@ title: "Fluent APIの使用を検討する" linkTitle: "Fluent APIの使用を検討する" weight: 10 aliases: [ -"/documentation/ja/guidelines_and_recommendations/consider_using_a_fluent_api/", -"/ja/documentation/guidelines/consider_using_a_fluent_api/" +"/documentation/guidelines/consider_using_a_fluent_api/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.pt-br.md index 01fa45cdef08..d8105a71dc18 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.pt-br.md @@ -3,8 +3,7 @@ title: "Considere usar uma API fluente" LinkTitle: "Considere usar uma API fluente" weight: 10 aliases: [ -"/documentation/pt-br/guidelines_and_recommendations/consider_using_a_fluent_api/", -"/pt-br/documentation/guidelines/consider_using_a_fluent_api/" +"/documentation/guidelines/consider_using_a_fluent_api/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.zh-cn.md index e3a32132fca5..5e6fb26d1eab 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.zh-cn.md @@ -3,8 +3,7 @@ title: "考虑使用Fluent API" linkTitle: "考虑使用Fluent API" weight: 10 aliases: [ -"/documentation/zh-cn/guidelines_and_recommendations/consider_using_a_fluent_api/", -"/zh-cn/documentation/guidelines/consider_using_a_fluent_api/" +"/documentation/guidelines/consider_using_a_fluent_api/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.en.md b/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.en.md index 141fc4b2d414..8b212e3ecaa4 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.en.md @@ -4,7 +4,10 @@ linkTitle: "Domain specific language" weight: 4 aliases: [ "/documentation/en/guidelines_and_recommendations/domain_specific_language/", -"/documentation/guidelines/domain_specific_language/" +"/documentation/guidelines/domain_specific_language/", +"/documentation/ja/guidelines_and_recommendations/domain_specific_language/", +"/documentation/pt-br/guidelines_and_recommendations/domain_specific_language/", +"/documentation/zh-cn/guidelines_and_recommendations/domain_specific_language/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.ja.md index 5f2024923c11..40ae76a2b640 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.ja.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.ja.md @@ -3,8 +3,7 @@ title: "ドメイン固有言語(DSL)" linkTitle: "ドメイン固有言語(DSL)" weight: 4 aliases: [ -"/documentation/ja/guidelines_and_recommendations/domain_specific_language/", -"/ja/documentation/guidelines/domain_specific_language/" +"/documentation/guidelines/domain_specific_language/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.pt-br.md index b72f40985fbe..7452ec82435a 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.pt-br.md @@ -3,8 +3,7 @@ title: "Linguagem específica de domínio (DSL)" linkTitle: "Linguagem específica de domínio (DSL)" weight: 4 aliases: [ -"/documentation/pt-br/guidelines_and_recommendations/domain_specific_language/", -"/pt-br/documentation/guidelines/domain_specific_language/" +"/documentation/guidelines/domain_specific_language/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.zh-cn.md index 5f34d7937e2b..55257e49af6a 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.zh-cn.md @@ -3,8 +3,7 @@ title: "领域特定语言" linkTitle: "领域特定语言" weight: 4 aliases: [ -"/documentation/zh-cn/guidelines_and_recommendations/domain_specific_language/", -"/zh-cn/documentation/guidelines/domain_specific_language/" +"/documentation/guidelines/domain_specific_language/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.en.md b/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.en.md index b5b6d2493581..bd73b4aecbf6 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.en.md @@ -4,7 +4,10 @@ linkTitle: "Fresh browser per test" weight: 11 aliases: [ "/documentation/en/guidelines_and_recommendations/fresh_browser_per_test/", -"/documentation/guidelines/fresh_browser_per_test/" +"/documentation/guidelines/fresh_browser_per_test/", +"/documentation/ja/guidelines_and_recommendations/fresh_browser_per_test/", +"/documentation/pt-br/guidelines_and_recommendations/fresh_browser_per_test/", +"/documentation/zh-cn/guidelines_and_recommendations/fresh_browser_per_test/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.ja.md index 7cd29a87921d..af87f9e2187f 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.ja.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.ja.md @@ -3,8 +3,7 @@ title: "テストごとに新しいブラウザを起動する" linkTitle: "テストごとに新しいブラウザを起動する" weight: 11 aliases: [ -"/documentation/ja/guidelines_and_recommendations/fresh_browser_per_test/", -"/ja/documentation/guidelines/fresh_browser_per_test/" +"/documentation/guidelines/fresh_browser_per_test/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.pt-br.md index 1e13fe15f926..f722db34b4fa 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.pt-br.md @@ -3,8 +3,7 @@ title: "Navegador novo por teste" linkTitle: "Navegador novo por teste" weight: 11 aliases: [ -"/documentation/pt-br/guidelines_and_recommendations/fresh_browser_per_test/", -"/pt-br/documentation/guidelines/fresh_browser_per_test/" +"/documentation/guidelines/fresh_browser_per_test/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.zh-cn.md index d6b988f8b9c9..04cebe967041 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.zh-cn.md @@ -3,8 +3,7 @@ title: "每次测试都刷新浏览器" linkTitle: "每次测试都刷新浏览器" weight: 11 aliases: [ -"/documentation/zh-cn/guidelines_and_recommendations/fresh_browser_per_test/", -"/zh-cn/documentation/guidelines/fresh_browser_per_test/" +"/documentation/guidelines/fresh_browser_per_test/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.en.md b/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.en.md index 9871566fe5c4..4e2b6ab6f015 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.en.md @@ -4,7 +4,10 @@ linkTitle: "Generating application state" weight: 5 aliases: [ "/documentation/en/guidelines_and_recommendations/generating_application_state/", -"/documentation/guidelines/generating_application_state/" +"/documentation/guidelines/generating_application_state/", +"/documentation/ja/guidelines_and_recommendations/generating_application_state/", +"/documentation/pt-br/guidelines_and_recommendations/generating_application_state/", +"/documentation/zh-cn/guidelines_and_recommendations/generating_application_state/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.ja.md index 14e3e72d4770..2aea4670bde5 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.ja.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.ja.md @@ -3,8 +3,7 @@ title: "アプリケーション状態の生成" linkTitle: "アプリケーション状態の生成" weight: 5 aliases: [ -"/documentation/ja/guidelines_and_recommendations/generating_application_state/", -"/ja/documentation/guidelines/generating_application_state/" +"/documentation/guidelines/generating_application_state/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.pt-br.md index 46cf96f95b00..5283ded806f3 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.pt-br.md @@ -3,8 +3,7 @@ title: "Gerando estado da aplicação" linkTitle: "Gerando estado da aplicação" weight: 5 aliases: [ -"/documentation/pt-br/guidelines_and_recommendations/generating_application_state/", -"/pt-br/documentation/guidelines/generating_application_state/" +"/documentation/guidelines/generating_application_state/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.zh-cn.md index 008e4553c6f0..1f71a670a411 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.zh-cn.md @@ -3,8 +3,7 @@ title: "生成应用程序状态" linkTitle: "生成应用程序状态" weight: 5 aliases: [ -"/documentation/zh-cn/guidelines_and_recommendations/generating_application_state/", -"/zh-cn/documentation/guidelines/generating_application_state/" +"/documentation/guidelines/generating_application_state/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.en.md b/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.en.md index adad6a120f77..475e37e8fcc6 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.en.md @@ -4,7 +4,10 @@ linkTitle: "Improved reporting" weight: 7 aliases: [ "/documentation/en/guidelines_and_recommendations/improved_reporting/", -"/documentation/guidelines/improved_reporting/" +"/documentation/guidelines/improved_reporting/", +"/documentation/ja/guidelines_and_recommendations/improved_reporting/", +"/documentation/pt-br/guidelines_and_recommendations/improved_reporting/", +"/documentation/zh-cn/guidelines_and_recommendations/improved_reporting/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.ja.md index c73bb5dacab5..1662cf4e33b3 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.ja.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.ja.md @@ -3,8 +3,7 @@ title: "改善されたレポート" linkTitle: "改善されたレポート" weight: 7 aliases: [ -"/documentation/ja/guidelines_and_recommendations/improved_reporting/", -"/ja/documentation/guidelines/improved_reporting/" +"/documentation/guidelines/improved_reporting/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.pt-br.md index 8d9b7d4735eb..28020bc97cfb 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.pt-br.md @@ -3,8 +3,7 @@ title: "Relatórios melhorados" linkTitle: "Relatórios melhorados" weight: 7 aliases: [ -"/documentation/pt-br/guidelines_and_recommendations/improved_reporting/", -"/pt-br/documentation/guidelines/improved_reporting/" +"/documentation/guidelines/improved_reporting/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.zh-cn.md index ca09d5d3462f..121a35fd3069 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.zh-cn.md @@ -3,8 +3,7 @@ title: "改善报告" linkTitle: "改善报告" weight: 7 aliases: [ -"/documentation/zh-cn/guidelines_and_recommendations/improved_reporting/", -"/zh-cn/documentation/guidelines/improved_reporting/" +"/documentation/guidelines/improved_reporting/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.en.md b/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.en.md index a531c1ef2227..a8f7e14beaf1 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.en.md @@ -4,7 +4,10 @@ linkTitle: "Mock external services" weight: 6 aliases: [ "/documentation/en/guidelines_and_recommendations/mock_external_services/", -"/documentation/guidelines/mock_external_services/" +"/documentation/guidelines/mock_external_services/", +"/documentation/ja/guidelines_and_recommendations/mock_external_services/", +"/documentation/pt-br/guidelines_and_recommendations/mock_external_services/", +"/documentation/zh-cn/guidelines_and_recommendations/mock_external_services/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.ja.md index 96e28e54ad58..65fa5545741c 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.ja.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.ja.md @@ -3,8 +3,7 @@ title: "モック外部サービス" linkTitle: "モック外部サービス" weight: 6 aliases: [ -"/documentation/ja/guidelines_and_recommendations/mock_external_services/", -"/ja/documentation/guidelines/mock_external_services/" +"/documentation/guidelines/mock_external_services/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.pt-br.md index 8577e5e4b5ae..5b521d425ba9 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.pt-br.md @@ -3,8 +3,7 @@ title: "Simulação de serviços externos" linkTitle: "Simulação de serviços externos" weight: 6 aliases: [ -"/documentation/pt-br/guidelines_and_recommendations/mock_external_services/", -"/pt-br/documentation/guidelines/mock_external_services/" +"/documentation/guidelines/mock_external_services/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.zh-cn.md index 54401fc84dc7..f2458717787d 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.zh-cn.md @@ -3,8 +3,7 @@ title: "模拟外部服务" linkTitle: "模拟外部服务" weight: 6 aliases: [ -"/documentation/zh-cn/guidelines_and_recommendations/mock_external_services/", -"/zh-cn/documentation/guidelines/mock_external_services/" +"/documentation/guidelines/mock_external_services/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.en.md b/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.en.md index 7b3e331bb136..00d7a75b7ff6 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.en.md @@ -4,7 +4,10 @@ linkTitle: "Page object models" weight: 3 aliases: [ "/documentation/en/guidelines_and_recommendations/page_object_models/", -"/documentation/guidelines/page_object_models/" +"/documentation/guidelines/page_object_models/", +"/documentation/ja/guidelines_and_recommendations/page_object_models/", +"/documentation/pt-br/guidelines_and_recommendations/page_object_models/", +"/documentation/zh-cn/guidelines_and_recommendations/page_object_models/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.ja.md index 79a70678a65e..2f9304b5fe52 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.ja.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.ja.md @@ -4,8 +4,7 @@ linkTitle: "ページオブジェクトモデル" weight: 3 needsTranslation: true aliases: [ -"/documentation/ja/guidelines_and_recommendations/page_object_models/", -"/ja/documentation/guidelines/page_object_models/" +"/documentation/guidelines/page_object_models/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.pt-br.md index 4b0be7a9ed0c..289ceb35b2c4 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.pt-br.md @@ -4,8 +4,7 @@ linkTitle: "Modelos de objetos de página" weight: 3 needsTranslation: false aliases: [ -"/documentation/pt-br/guidelines_and_recommendations/page_object_models/", -"/pt-br/documentation/guidelines/page_object_models/" +"/documentation/guidelines/page_object_models/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md index e5b482bd93b2..2b77e7875fa1 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md @@ -3,8 +3,7 @@ title: "页面对象模型" linkTitle: "页面对象模型" weight: 3 aliases: [ -"/documentation/zh-cn/guidelines_and_recommendations/page_object_models/", -"/zh-cn/documentation/guidelines/page_object_models/" +"/documentation/guidelines/page_object_models/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/test_independency.en.md b/website_and_docs/content/documentation/test_practices/encouraged/test_independency.en.md index bc1f8d18fcd0..4a37e1bfc2f8 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/test_independency.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/test_independency.en.md @@ -4,7 +4,10 @@ linkTitle: "Test independency" weight: 9 aliases: [ "/documentation/en/guidelines_and_recommendations/test_independency/", -"/documentation/guidelines/test_independency/" +"/documentation/guidelines/test_independency/", +"/documentation/ja/guidelines_and_recommendations/test_independency/", +"/documentation/pt-br/guidelines_and_recommendations/test_independency/", +"/documentation/zh-cn/guidelines_and_recommendations/test_independency/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/test_independency.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/test_independency.ja.md index 4dc0a9e8ed43..cb114dddff29 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/test_independency.ja.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/test_independency.ja.md @@ -3,8 +3,7 @@ title: "テストの独立性" linkTitle: "テストの独立性" weight: 9 aliases: [ -"/documentation/ja/guidelines_and_recommendations/test_independency/", -"/ja/documentation/guidelines/test_independency/" +"/documentation/guidelines/test_independency/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/test_independency.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/test_independency.pt-br.md index 21d7ab8b3843..44fb5ae212eb 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/test_independency.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/test_independency.pt-br.md @@ -3,8 +3,7 @@ title: "Independência de Testes" linkTitle: "Independência de Testes" weight: 9 aliases: [ -"/documentation/pt-br/guidelines_and_recommendations/test_independency/", -"/pt-br/documentation/guidelines/test_independency/" +"/documentation/guidelines/test_independency/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/test_independency.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/test_independency.zh-cn.md index bd3922a0eee7..c57f1f0efd08 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/test_independency.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/test_independency.zh-cn.md @@ -3,8 +3,7 @@ title: "测试的独立性" linkTitle: "测试的独立性" weight: 9 aliases: [ -"/documentation/zh-cn/guidelines_and_recommendations/test_independency/", -"/zh-cn/documentation/guidelines/test_independency/" +"/documentation/guidelines/test_independency/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/overview.en.md b/website_and_docs/content/documentation/test_practices/overview.en.md index c0ca18457f91..a64bef71e5ec 100644 --- a/website_and_docs/content/documentation/test_practices/overview.en.md +++ b/website_and_docs/content/documentation/test_practices/overview.en.md @@ -4,7 +4,10 @@ linkTitle: "Overview" weight: 1 aliases: [ "/documentation/en/introduction/on_test_automation/", -"/documentation/guidelines/on_test_automation/" +"/documentation/guidelines/on_test_automation/", +"/documentation/ja/introduction/on_test_automation/", +"/documentation/pt-br/introduction/on_test_automation/", +"/documentation/zh-cn/introduction/on_test_automation/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/overview.ja.md b/website_and_docs/content/documentation/test_practices/overview.ja.md index 7b1c12df4b34..6f24b419b8b0 100644 --- a/website_and_docs/content/documentation/test_practices/overview.ja.md +++ b/website_and_docs/content/documentation/test_practices/overview.ja.md @@ -3,8 +3,7 @@ title: "テスト自動化について" linkTitle: "テスト自動化について" weight: 1 aliases: [ -"/documentation/ja/introduction/on_test_automation/", -"/ja/documentation/guidelines/on_test_automation/" +"/documentation/guidelines/on_test_automation/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/overview.pt-br.md b/website_and_docs/content/documentation/test_practices/overview.pt-br.md index 83804203a666..cfe998152a24 100644 --- a/website_and_docs/content/documentation/test_practices/overview.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/overview.pt-br.md @@ -3,8 +3,7 @@ title: "Sobre automação de testes" linkTitle: "Sobre automação de testes" weight: 2 aliases: [ -"/documentation/pt-br/introduction/on_test_automation/", -"/pt-br/documentation/guidelines/on_test_automation/" +"/documentation/guidelines/on_test_automation/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/overview.zh-cn.md b/website_and_docs/content/documentation/test_practices/overview.zh-cn.md index 2240d389bd93..0be347024e03 100644 --- a/website_and_docs/content/documentation/test_practices/overview.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/overview.zh-cn.md @@ -3,8 +3,7 @@ title: "测试自动化概述" linkTitle: "概述" weight: 1 aliases: [ -"/documentation/zh-cn/introduction/on_test_automation/", -"/zh-cn/documentation/guidelines/on_test_automation/" +"/documentation/guidelines/on_test_automation/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/testing_types.en.md b/website_and_docs/content/documentation/test_practices/testing_types.en.md index 85c775fcca21..efc7692a11a1 100644 --- a/website_and_docs/content/documentation/test_practices/testing_types.en.md +++ b/website_and_docs/content/documentation/test_practices/testing_types.en.md @@ -4,7 +4,10 @@ linkTitle: "Testing Types" weight: 2 aliases: [ "/documentation/en/introduction/types_of_testing/", -"/documentation/guidelines/types_of_testing/" +"/documentation/guidelines/types_of_testing/", +"/documentation/ja/introduction/types_of_testing/", +"/documentation/pt-br/introduction/types_of_testing/", +"/documentation/zh-cn/introduction/types_of_testing/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/testing_types.ja.md b/website_and_docs/content/documentation/test_practices/testing_types.ja.md index 22ce4ab68585..cd84fb3c584c 100644 --- a/website_and_docs/content/documentation/test_practices/testing_types.ja.md +++ b/website_and_docs/content/documentation/test_practices/testing_types.ja.md @@ -3,8 +3,7 @@ title: "テストの種類" linkTitle: "テストの種類" weight: 2 aliases: [ -"/documentation/ja/introduction/types_of_testing/", -"/ja/documentation/guidelines/types_of_testing/" +"/documentation/guidelines/types_of_testing/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/testing_types.pt-br.md b/website_and_docs/content/documentation/test_practices/testing_types.pt-br.md index 2e38617c401b..7ed9c71a17f4 100644 --- a/website_and_docs/content/documentation/test_practices/testing_types.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/testing_types.pt-br.md @@ -3,8 +3,7 @@ title: "Tipos de teste" linkTitle: "Tipos de teste" weight: 2 aliases: [ -"/documentation/pt-br/introduction/types_of_testing/", -"/pt-br/documentation/guidelines/types_of_testing/" +"/documentation/guidelines/types_of_testing/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/testing_types.zh-cn.md b/website_and_docs/content/documentation/test_practices/testing_types.zh-cn.md index d5f6e939ef12..3f83c2683171 100644 --- a/website_and_docs/content/documentation/test_practices/testing_types.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/testing_types.zh-cn.md @@ -3,8 +3,7 @@ title: "测试类型" linkTitle: "测试类型" weight: 2 aliases: [ -"/documentation/zh-cn/introduction/types_of_testing/", -"/zh-cn/documentation/guidelines/types_of_testing/" +"/documentation/guidelines/types_of_testing/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/_index.en.md b/website_and_docs/content/documentation/webdriver/_index.en.md index 4924f9fab727..08855dafc963 100644 --- a/website_and_docs/content/documentation/webdriver/_index.en.md +++ b/website_and_docs/content/documentation/webdriver/_index.en.md @@ -4,7 +4,7 @@ linkTitle: "WebDriver" weight: 2 description: > WebDriver drives a browser natively; learn more about it. -aliases: ["/documentation/en/webdriver/"] +aliases: ["/documentation/en/webdriver/", "/documentation/ja/webdriver/", "/documentation/pt-br/webdriver/", "/documentation/zh-cn/webdriver/"] --- diff --git a/website_and_docs/content/documentation/webdriver/_index.ja.md b/website_and_docs/content/documentation/webdriver/_index.ja.md index d5c43995b9e7..74e046ad3329 100644 --- a/website_and_docs/content/documentation/webdriver/_index.ja.md +++ b/website_and_docs/content/documentation/webdriver/_index.ja.md @@ -4,7 +4,6 @@ linkTitle: "WebDriver" weight: 2 description: > WebDriverはブラウザをネイティブに操作します。詳細については、こちらをご覧ください。 -aliases: ["/documentation/ja/webdriver/"] --- WebDriverは、ユーザーがローカルまたはSeleniumサーバーを使用するリモートマシンで行うように、ブラウザをネイティブに動かし、ブラウザの自動化に関して大きく前進します。 diff --git a/website_and_docs/content/documentation/webdriver/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/_index.pt-br.md index 3d7f50d6a494..f7e4e8f563e1 100644 --- a/website_and_docs/content/documentation/webdriver/_index.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/_index.pt-br.md @@ -3,7 +3,6 @@ title: "WebDriver" linkTitle: "WebDriver" weight: 2 description: WebDriver manipula um navegador nativamente; aprenda mais sobre isso. -aliases: ["/documentation/pt-br/webdriver/"] --- O WebDriver manipula um navegador nativamente, como um usuário faria, seja localmente diff --git a/website_and_docs/content/documentation/webdriver/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/_index.zh-cn.md index 7502487ca9f4..5a84a51ad946 100644 --- a/website_and_docs/content/documentation/webdriver/_index.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/_index.zh-cn.md @@ -4,7 +4,6 @@ linkTitle: "WebDriver" weight: 2 description: > WebDriver以原生的方式驱动浏览器; 在此了解更多内容. -aliases: ["/documentation/zh-cn/webdriver/"] --- diff --git a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.en.md b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.en.md index 357877eaabac..34dcb4dc2d8d 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.en.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.en.md @@ -6,7 +6,10 @@ description: > A representation of any key input device for interacting with a web page. aliases: [ "/documentation/en/webdriver/keyboard/", -"/documentation/webdriver/keyboard/" +"/documentation/webdriver/keyboard/", +"/documentation/ja/webdriver/keyboard/", +"/documentation/pt-br/webdriver/keyboard/", +"/documentation/zh-cn/webdriver/keyboard/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.ja.md b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.ja.md index f01b5587c585..79f5934ab6f4 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.ja.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.ja.md @@ -5,8 +5,7 @@ weight: 2 description: > A representation of any key input device for interacting with a web page. aliases: [ -"/documentation/ja/webdriver/keyboard/", -"/ja/documentation/webdriver/keyboard/" +"/documentation/webdriver/keyboard/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.pt-br.md b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.pt-br.md index 2a56f3ed5592..b0922ddd4d5e 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.pt-br.md @@ -5,8 +5,7 @@ weight: 2 description: > Uma representação de qualquer dispositivo de entrada de teclado para interagir com uma página da web. aliases: [ -"/documentation/pt-br/webdriver/keyboard/", -"/pt-br/documentation/webdriver/keyboard/" +"/documentation/webdriver/keyboard/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.zh-cn.md b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.zh-cn.md index a72e02c92de5..1b732de1dc8d 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.zh-cn.md @@ -5,8 +5,7 @@ weight: 2 description: > 一种适用于任何与网页交互的按键输入设备的表现形式. aliases: [ -"/documentation/zh-cn/webdriver/keyboard/", -"/zh-cn/documentation/webdriver/keyboard/" +"/documentation/webdriver/keyboard/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/actions_api/mouse.en.md b/website_and_docs/content/documentation/webdriver/actions_api/mouse.en.md index 18753781f685..656d535f1c9b 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/mouse.en.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/mouse.en.md @@ -7,7 +7,10 @@ description: > A representation of any pointer device for interacting with a web page. aliases: [ "/documentation/en/support_packages/mouse_and_keyboard_actions_in_detail/", -"/documentation/support_packages/mouse_and_keyboard_actions_in_detail/" +"/documentation/support_packages/mouse_and_keyboard_actions_in_detail/", +"/documentation/ja/support_packages/mouse_and_keyboard_actions_in_detail/", +"/documentation/pt-br/support_packages/mouse_and_keyboard_actions_in_detail/", +"/documentation/zh-cn/support_packages/mouse_and_keyboard_actions_in_detail/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/actions_api/mouse.ja.md b/website_and_docs/content/documentation/webdriver/actions_api/mouse.ja.md index 6e04b0d58af8..5fcd7a7ce334 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/mouse.ja.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/mouse.ja.md @@ -6,8 +6,7 @@ needsTranslation: true description: > A representation of any pointer device for interacting with a web page. aliases: [ -"/documentation/ja/support_packages/mouse_and_keyboard_actions_in_detail/", -"/ja/documentation/support_packages/mouse_and_keyboard_actions_in_detail/" +"/documentation/support_packages/mouse_and_keyboard_actions_in_detail/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/actions_api/mouse.pt-br.md b/website_and_docs/content/documentation/webdriver/actions_api/mouse.pt-br.md index 8bae0d1cf3ea..604ae58f26c1 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/mouse.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/mouse.pt-br.md @@ -6,8 +6,7 @@ needsTranslation: true description: > Uma representação de qualquer dispositivo de ponteiro para interagir com uma página da web. aliases: [ -"/documentation/pt-br/support_packages/mouse_and_keyboard_actions_in_detail/", -"/pt-br/documentation/support_packages/mouse_and_keyboard_actions_in_detail/" +"/documentation/support_packages/mouse_and_keyboard_actions_in_detail/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/actions_api/mouse.zh-cn.md b/website_and_docs/content/documentation/webdriver/actions_api/mouse.zh-cn.md index ce77a1349a26..05ae1ebb744e 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/mouse.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/mouse.zh-cn.md @@ -5,8 +5,7 @@ weight: 4 description: > 任何用于与网页进行交互的指针设备的表示形式. aliases: [ -"/documentation/zh-cn/support_packages/mouse_and_keyboard_actions_in_detail/", -"/zh-cn/documentation/support_packages/mouse_and_keyboard_actions_in_detail/" +"/documentation/support_packages/mouse_and_keyboard_actions_in_detail/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/bidi/logging.en.md b/website_and_docs/content/documentation/webdriver/bidi/logging.en.md index 312123ec9737..121c2937cfa2 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/logging.en.md +++ b/website_and_docs/content/documentation/webdriver/bidi/logging.en.md @@ -7,7 +7,9 @@ description: > different things, these methods are made available via a "script" namespace. aliases: [ "/documentation/en/webdriver/bidirectional/bidirectional_w3c/log", - "/documentation/webdriver/bidirectional/webdriver_bidi/log" + "/documentation/webdriver/bidirectional/webdriver_bidi/log", +"/documentation/ja/webdriver/bidirectional/bidirectional_w3c/log", +"/documentation/zh-cn/webdriver/bidirectional/bidirectional_w3c/log" ] --- diff --git a/website_and_docs/content/documentation/webdriver/bidi/logging.ja.md b/website_and_docs/content/documentation/webdriver/bidi/logging.ja.md index ae23c7a6412b..bf0b34bcf76e 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/logging.ja.md +++ b/website_and_docs/content/documentation/webdriver/bidi/logging.ja.md @@ -6,8 +6,7 @@ description: > These features are related to logging. Because "logging" can refer to so many different things, these methods are made available via a "script" namespace. aliases: [ - "/documentation/ja/webdriver/bidirectional/bidirectional_w3c/log", - "/documentation/webdriver/bidirectional/webdriver_bidi/log" +"/documentation/webdriver/bidirectional/webdriver_bidi/log" ] --- diff --git a/website_and_docs/content/documentation/webdriver/bidi/logging.zh-cn.md b/website_and_docs/content/documentation/webdriver/bidi/logging.zh-cn.md index 682b8dc2f866..c447199f34e6 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/logging.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/bidi/logging.zh-cn.md @@ -7,8 +7,7 @@ description: > 由于"logging"可以指代许多不同的事物, 因此这些方法通过"script"命名空间提供. aliases: [ - "/documentation/zh-cn/webdriver/bidirectional/bidirectional_w3c/log", - "/documentation/webdriver/bidirectional/webdriver_bidi/log" +"/documentation/webdriver/bidirectional/webdriver_bidi/log" ] --- diff --git a/website_and_docs/content/documentation/webdriver/bidi/script.en.md b/website_and_docs/content/documentation/webdriver/bidi/script.en.md index 32bac136952c..94028e664fdd 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/script.en.md +++ b/website_and_docs/content/documentation/webdriver/bidi/script.en.md @@ -6,7 +6,10 @@ description: > These features are related to scripts, and are made available via a "script" namespace. aliases: [ "/documentation/en/webdriver/bidirectional/bidirectional_w3c/script", - "/documentation/webdriver/bidirectional/webdriver_bidi/script" + "/documentation/webdriver/bidirectional/webdriver_bidi/script", +"/documentation/ja/webdriver/bidirectional/bidirectional_w3c/script", +"/documentation/pt-br/webdriver/bidirectional/bidirectional_w3c/script", +"/documentation/zh-cn/webdriver/bidirectional/bidirectional_w3c/script" ] --- diff --git a/website_and_docs/content/documentation/webdriver/bidi/script.ja.md b/website_and_docs/content/documentation/webdriver/bidi/script.ja.md index 879d595decea..74272e4cf635 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/script.ja.md +++ b/website_and_docs/content/documentation/webdriver/bidi/script.ja.md @@ -5,8 +5,7 @@ weight: 1 description: > These features are related to scripts, and are made available via a "script" namespace. aliases: [ - "/documentation/ja/webdriver/bidirectional/bidirectional_w3c/script", - "/documentation/webdriver/bidirectional/webdriver_bidi/script" +"/documentation/webdriver/bidirectional/webdriver_bidi/script" ] --- diff --git a/website_and_docs/content/documentation/webdriver/bidi/script.pt-br.md b/website_and_docs/content/documentation/webdriver/bidi/script.pt-br.md index 30710f7a1a4d..74272e4cf635 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/script.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/bidi/script.pt-br.md @@ -5,8 +5,7 @@ weight: 1 description: > These features are related to scripts, and are made available via a "script" namespace. aliases: [ - "/documentation/pt-br/webdriver/bidirectional/bidirectional_w3c/script", - "/documentation/webdriver/bidirectional/webdriver_bidi/script" +"/documentation/webdriver/bidirectional/webdriver_bidi/script" ] --- diff --git a/website_and_docs/content/documentation/webdriver/bidi/script.zh-cn.md b/website_and_docs/content/documentation/webdriver/bidi/script.zh-cn.md index a5f6cc05a82e..74272e4cf635 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/script.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/bidi/script.zh-cn.md @@ -5,8 +5,7 @@ weight: 1 description: > These features are related to scripts, and are made available via a "script" namespace. aliases: [ - "/documentation/zh-cn/webdriver/bidirectional/bidirectional_w3c/script", - "/documentation/webdriver/bidirectional/webdriver_bidi/script" +"/documentation/webdriver/bidirectional/webdriver_bidi/script" ] --- diff --git a/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.en.md b/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.en.md index 6e7cbe79eebb..901049a76082 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.en.md +++ b/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.en.md @@ -8,7 +8,10 @@ description: > aliases: [ "/documentation/en/webdriver/bidirectional/bidirectional_w3c", "/documentation/en/webdriver/bidi_apis/bidi_w3c", -"/documentation/webdriver/bidi_apis/bidi_w3c" +"/documentation/webdriver/bidi_apis/bidi_w3c", +"/documentation/ja/webdriver/bidi_apis/bidi_w3c", +"/documentation/pt-br/webdriver/bidi_apis/bidi_w3c", +"/documentation/zh-cn/webdriver/bidi_apis/bidi_w3c" ] --- diff --git a/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.ja.md b/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.ja.md index dde7e33f7a77..ef405b5f33c3 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.ja.md +++ b/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.ja.md @@ -3,8 +3,7 @@ title: "BiDirectional API (W3C compliant)" linkTitle: "BiDi API (W3C compliant)" weight: 16 aliases: [ -"/documentation/ja/webdriver/bidi_apis/bidi_w3c", -"/ja/documentation/webdriver/bidi_apis/bidi_w3c" +"/documentation/webdriver/bidi_apis/bidi_w3c" ] --- diff --git a/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.pt-br.md index afedb63de712..d2d8ee08f475 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.pt-br.md @@ -3,8 +3,7 @@ title: "BiDirectional API (W3C compliant)" linkTitle: "BiDi API (W3C compliant)" weight: 16 aliases: [ -"/documentation/pt-br/webdriver/bidi_apis/bidi_w3c", -"/pt-br/documentation/webdriver/bidi_apis/bidi_w3c" +"/documentation/webdriver/bidi_apis/bidi_w3c" ] --- diff --git a/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.zh-cn.md index 70e97c54bc5c..5ffb6e94c3a0 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.zh-cn.md @@ -3,8 +3,7 @@ title: "BiDirectional API (W3C compliant)" linkTitle: "BiDi API (W3C compliant)" weight: 16 aliases: [ -"/documentation/zh-cn/webdriver/bidi_apis/bidi_w3c", -"/zh-cn/documentation/webdriver/bidi_apis/bidi_w3c" +"/documentation/webdriver/bidi_apis/bidi_w3c" ] --- diff --git a/website_and_docs/content/documentation/webdriver/browsers/_index.en.md b/website_and_docs/content/documentation/webdriver/browsers/_index.en.md index 60e763b78512..88219fe5e6dc 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/_index.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/_index.en.md @@ -8,6 +8,12 @@ aliases: [ "/documentation/webdriver/capabilities/driver_specific_capabilities/", "/documentation/getting_started/open_browser/", "/documentation/capabilities/", +"/documentation/ja/driver_idiosyncrasies/", +"/documentation/ja/driver_idiosyncrasies/driver_specific_capabilities/", +"/documentation/pt-br/driver_idiosyncrasies/", +"/documentation/pt-br/driver_idiosyncrasies/driver_specific_capabilities/", +"/documentation/zh-cn/driver_idiosyncrasies/", +"/documentation/zh-cn/driver_idiosyncrasies/driver_specific_capabilities/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/browsers/_index.ja.md b/website_and_docs/content/documentation/webdriver/browsers/_index.ja.md index e02362bd530a..ec07fd908e35 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/_index.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/_index.ja.md @@ -3,11 +3,9 @@ title: "対応ブラウザ" linkTitle: "ブラウザ" weight: 4 aliases: [ -"/documentation/ja/driver_idiosyncrasies/", -"/documentation/ja/driver_idiosyncrasies/driver_specific_capabilities/", -"/ja/documentation/webdriver/capabilities/driver_specific_capabilities/", -"/ja/documentation/getting_started/open_browser/", -"/ja/documentation/capabilities/", +"/documentation/webdriver/capabilities/driver_specific_capabilities/", +"/documentation/getting_started/open_browser/", +"/documentation/capabilities/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/browsers/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/_index.pt-br.md index 5fbed2bde624..06a79cf2c87b 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/_index.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/_index.pt-br.md @@ -3,11 +3,9 @@ title: "Navegadores suportados" linkTitle: "Navegadores" weight: 4 aliases: [ -"/documentation/pt-br/driver_idiosyncrasies/", -"/documentation/pt-br/driver_idiosyncrasies/driver_specific_capabilities/", -"/pt-br/documentation/webdriver/capabilities/driver_specific_capabilities/", -"/pt-br/documentation/getting_started/open_browser/", -"/pt-br/documentation/capabilities/", +"/documentation/webdriver/capabilities/driver_specific_capabilities/", +"/documentation/getting_started/open_browser/", +"/documentation/capabilities/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/browsers/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/_index.zh-cn.md index 0235bea16592..96338477a868 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/_index.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/_index.zh-cn.md @@ -3,11 +3,9 @@ title: "支持的浏览器列表" linkTitle: "浏览器" weight: 4 aliases: [ -"/documentation/zh-cn/driver_idiosyncrasies/", -"/documentation/zh-cn/driver_idiosyncrasies/driver_specific_capabilities/", -"/zh-cn/documentation/webdriver/capabilities/driver_specific_capabilities/", -"/zh-cn/documentation/getting_started/open_browser/", -"/zh-cn/documentation/capabilities/", +"/documentation/webdriver/capabilities/driver_specific_capabilities/", +"/documentation/getting_started/open_browser/", +"/documentation/capabilities/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md index 23f67875883d..74a1c0aea4b8 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md @@ -5,7 +5,7 @@ weight: 4 description: >- これらは、Google Chromeブラウザに特有の機能と機能です。 aliases: [ -"/ja/documentation/capabilities/chromium" +"/documentation/capabilities/chromium" ] --- diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md index ee5dba69770f..a1e0b8a7c720 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md @@ -5,7 +5,7 @@ weight: 4 description: >- Estas capacidades e características são específicas ao navegador Google Chrome. aliases: [ -"/pt-br/documentation/capabilities/chromium" +"/documentation/capabilities/chromium" ] --- diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md index 9ba7e23518d0..83bd255a5184 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md @@ -5,7 +5,7 @@ weight: 4 description: >- 特定于 Google Chrome 浏览器的功能和特性. aliases: [ -"/zh-cn/documentation/capabilities/chromium" +"/documentation/capabilities/chromium" ] --- diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md index 7d03c5a17d60..54b971a7c87d 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md @@ -5,7 +5,7 @@ weight: 6 description: >- これらは、Mozilla Firefoxブラウザに特有の機能と機能です。 aliases: [ -"/ja/documentation/capabilities/firefox" +"/documentation/capabilities/firefox" ] --- diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md index 45f30fe5b7db..819de462656e 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md @@ -5,7 +5,7 @@ weight: 6 description: >- Estas capacidades e características são específicas ao navegador Mozilla Firefox. aliases: [ -"/pt-br/documentation/capabilities/firefox" +"/documentation/capabilities/firefox" ] --- diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md index 07457aee69d9..652caa943eb4 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md @@ -5,7 +5,7 @@ weight: 6 description: >- These are capabilities and features specific to Mozilla Firefox browsers. aliases: [ -"/zh-cn/documentation/capabilities/firefox" +"/documentation/capabilities/firefox" ] --- diff --git a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.ja.md b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.ja.md index c6c116958167..0a6a3450f764 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.ja.md @@ -5,7 +5,7 @@ weight: 8 description: >- これらは、Microsoft Internet Explorerブラウザに特有の機能と機能です。 aliases: [ -"/ja/documentation/capabilities/internet_explorer" +"/documentation/capabilities/internet_explorer" ] --- diff --git a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.pt-br.md index 6b824b744520..8f832d076ead 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.pt-br.md @@ -5,7 +5,7 @@ weight: 8 description: >- Estas capacidades e características são específicas ao navegador Microsoft Internet Explorer. aliases: [ -"/pt-br/documentation/capabilities/internet_explorer" +"/documentation/capabilities/internet_explorer" ] --- diff --git a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.zh-cn.md index d70a20d28d1c..b68f4f6d3741 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.zh-cn.md @@ -5,7 +5,7 @@ weight: 8 description: >- 这些是 Microsoft Internet Explorer 浏览器特有的功能和特性. aliases: [ -"/zh-cn/documentation/capabilities/internet_explorer" +"/documentation/capabilities/internet_explorer" ] --- diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md b/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md index d389ebb1b8fc..72e6d3a129c2 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md @@ -5,7 +5,7 @@ weight: 10 description: >- これらは、Apple Safariブラウザ固有の機能です。 aliases: [ -"/ja/documentation/capabilities/safari" +"/documentation/capabilities/safari" ] --- diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md index 21ce234a936e..f84630aecc81 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md @@ -5,7 +5,7 @@ weight: 10 description: >- Estas capacidades e características são específicas ao navegador Apple Safari. aliases: [ -"/pt-br/documentation/capabilities/safari" +"/documentation/capabilities/safari" ] --- diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md index 216813dc201d..ad66615b8576 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md @@ -5,7 +5,7 @@ weight: 10 description: >- 这些是特定于Apple Safari浏览器的功能和特性. aliases: [ -"/zh-cn/documentation/capabilities/safari" +"/documentation/capabilities/safari" ] --- diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.en.md b/website_and_docs/content/documentation/webdriver/drivers/options.en.md index f2e405b8c6b6..a799240efcbd 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.en.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.en.md @@ -14,6 +14,15 @@ aliases: [ "/documentation/webdriver/page_loading_strategy/", "/documentation/webdriver/capabilities/page_loading_strategy/", "/documentation/capabilitis/shared/", +"/documentation/ja/driver_idiosyncrasies/shared_capabilities/", +"/documentation/ja/webdriver/http_proxies/", +"/documentation/ja/webdriver/page_loading_strategy/", +"/documentation/pt-br/driver_idiosyncrasies/shared_capabilities/", +"/documentation/pt-br/webdriver/http_proxies/", +"/documentation/pt-br/webdriver/page_loading_strategy/", +"/documentation/zh-cn/driver_idiosyncrasies/shared_capabilities/", +"/documentation/zh-cn/webdriver/http_proxies/", +"/documentation/zh-cn/webdriver/page_loading_strategy/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.ja.md b/website_and_docs/content/documentation/webdriver/drivers/options.ja.md index 6cc2adb2d14b..43af93aba9db 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.ja.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.ja.md @@ -5,15 +5,12 @@ weight: 2 description: >- これらの機能はすべてのブラウザで共有されています。 aliases: [ -"/documentation/ja/driver_idiosyncrasies/shared_capabilities/", -"/ja/documentation/webdriver/capabilities/shared_capabilities/", -"/documentation/ja/webdriver/http_proxies/", -"/ja/documentation/webdriver/http_proxies/", -"/ja/documentation/webdriver/capabilities/http_proxies/", -"/documentation/ja/webdriver/page_loading_strategy/", -"/ja/documentation/webdriver/page_loading_strategy/", -"/ja/documentation/webdriver/capabilities/page_loading_strategy/", -"/ja/documentation/capabilitis/shared/", +"/documentation/webdriver/capabilities/shared_capabilities/", +"/documentation/webdriver/http_proxies/", +"/documentation/webdriver/capabilities/http_proxies/", +"/documentation/webdriver/page_loading_strategy/", +"/documentation/webdriver/capabilities/page_loading_strategy/", +"/documentation/capabilitis/shared/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md b/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md index ad1de1aab53d..60bda9fcd64f 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md @@ -6,15 +6,12 @@ needsTranslation: true description: >- Esses recursos são compartilhados por todos os navegadores. aliases: [ -"/documentation/pt-br/driver_idiosyncrasies/shared_capabilities/", -"/pt-br/documentation/webdriver/capabilities/shared_capabilities/", -"/documentation/pt-br/webdriver/http_proxies/", -"/pt-br/documentation/webdriver/http_proxies/", -"/pt-br/documentation/webdriver/capabilities/http_proxies/", -"/documentation/pt-br/webdriver/page_loading_strategy/", -"/pt-br/documentation/webdriver/page_loading_strategy/", -"/pt-br/documentation/webdriver/capabilities/page_loading_strategy/", -"/pt-br/documentation/capabilitis/shared/", +"/documentation/webdriver/capabilities/shared_capabilities/", +"/documentation/webdriver/http_proxies/", +"/documentation/webdriver/capabilities/http_proxies/", +"/documentation/webdriver/page_loading_strategy/", +"/documentation/webdriver/capabilities/page_loading_strategy/", +"/documentation/capabilitis/shared/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md b/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md index 6004207daf6e..0d8e9688681e 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md @@ -5,15 +5,12 @@ weight: 2 description: >- 这些capabilities用于所有浏览器. aliases: [ -"/documentation/zh-cn/driver_idiosyncrasies/shared_capabilities/", -"/zh-cn/documentation/webdriver/capabilities/shared_capabilities/", -"/documentation/zh-cn/webdriver/http_proxies/", -"/zh-cn/documentation/webdriver/http_proxies/", -"/zh-cn/documentation/webdriver/capabilities/http_proxies/", -"/documentation/zh-cn/webdriver/page_loading_strategy/", -"/zh-cn/documentation/webdriver/page_loading_strategy/", -"/zh-cn/documentation/webdriver/capabilities/page_loading_strategy/", -"/zh-cn/documentation/capabilitis/shared/", +"/documentation/webdriver/capabilities/shared_capabilities/", +"/documentation/webdriver/http_proxies/", +"/documentation/webdriver/capabilities/http_proxies/", +"/documentation/webdriver/page_loading_strategy/", +"/documentation/webdriver/capabilities/page_loading_strategy/", +"/documentation/capabilitis/shared/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.en.md b/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.en.md index 2f1492665407..456098987ca8 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.en.md +++ b/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.en.md @@ -6,6 +6,12 @@ aliases: [ "/documentation/en/remote_webdriver/", "/documentation/en/remote_webdriver/remote_webdriver_client/", "/documentation/webdriver/remote_webdriver/", +"/documentation/ja/remote_webdriver/", +"/documentation/ja/remote_webdriver/remote_webdriver_client/", +"/documentation/pt-br/remote_webdriver/", +"/documentation/pt-br/remote_webdriver/remote_webdriver_client/", +"/documentation/zh-cn/remote_webdriver/", +"/documentation/zh-cn/remote_webdriver/remote_webdriver_client/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.ja.md b/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.ja.md index 32b5187aa815..82f776341eec 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.ja.md +++ b/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.ja.md @@ -3,9 +3,7 @@ title: "リモートWebDriver" linkTitle: "リモートWebDriver" weight: 10 aliases: [ -"/documentation/ja/remote_webdriver/", -"/documentation/ja/remote_webdriver/remote_webdriver_client/", -"/ja/documentation/webdriver/remote_webdriver/", +"/documentation/webdriver/remote_webdriver/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.pt-br.md b/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.pt-br.md index c9807adf02ba..5d9578a1b08f 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.pt-br.md @@ -3,9 +3,7 @@ title: "WebDriver Remoto" linkTitle: "Remote WebDriver" weight: 10 aliases: [ -"/documentation/pt-br/remote_webdriver/", -"/documentation/pt-br/remote_webdriver/remote_webdriver_client/", -"/pt-br/documentation/webdriver/remote_webdriver/", +"/documentation/webdriver/remote_webdriver/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.zh-cn.md b/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.zh-cn.md index a31e563d6f6e..a924c10abb69 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.zh-cn.md @@ -3,9 +3,7 @@ title: "远程WebDriver" linkTitle: "远程WebDriver" weight: 10 aliases: [ -"/documentation/zh-cn/remote_webdriver/", -"/documentation/zh-cn/remote_webdriver/remote_webdriver_client/", -"/zh-cn/documentation/webdriver/remote_webdriver/", +"/documentation/webdriver/remote_webdriver/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/elements/_index.en.md b/website_and_docs/content/documentation/webdriver/elements/_index.en.md index 28177c5c5ee0..9838bc2d4414 100644 --- a/website_and_docs/content/documentation/webdriver/elements/_index.en.md +++ b/website_and_docs/content/documentation/webdriver/elements/_index.en.md @@ -4,7 +4,10 @@ linkTitle: "Elements" weight: 8 aliases: [ "/documentation/en/webdriver/web_element/", -"/documentation/webdriver/web_element/" +"/documentation/webdriver/web_element/", +"/documentation/ja/webdriver/web_element/", +"/documentation/pt-br/webdriver/web_element/", +"/documentation/zh-cn/webdriver/web_element/" ] description: > Identifying and working with element objects in the DOM. diff --git a/website_and_docs/content/documentation/webdriver/elements/_index.ja.md b/website_and_docs/content/documentation/webdriver/elements/_index.ja.md index 105aacb7fa7d..8cf98fdf8f41 100644 --- a/website_and_docs/content/documentation/webdriver/elements/_index.ja.md +++ b/website_and_docs/content/documentation/webdriver/elements/_index.ja.md @@ -3,8 +3,7 @@ title: "Web要素" linkTitle: "Web要素" weight: 8 aliases: [ -"/documentation/ja/webdriver/web_element/", -"/ja/documentation/webdriver/web_element/" +"/documentation/webdriver/web_element/" ] description: > DOM内の要素オブジェクトの識別と操作 diff --git a/website_and_docs/content/documentation/webdriver/elements/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/elements/_index.pt-br.md index e87b31b3a6d1..3e1d547d6ab1 100644 --- a/website_and_docs/content/documentation/webdriver/elements/_index.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/elements/_index.pt-br.md @@ -4,8 +4,7 @@ linkTitle: "Elemento Web" weight: 8 needsTranslation: true aliases: [ -"/documentation/pt-br/webdriver/web_element/", -"/pt-br/documentation/webdriver/web_element/" +"/documentation/webdriver/web_element/" ] description: > Identificando e trabalhando com elementos no DOM. diff --git a/website_and_docs/content/documentation/webdriver/elements/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/elements/_index.zh-cn.md index e28377332a26..d91305d47ac5 100644 --- a/website_and_docs/content/documentation/webdriver/elements/_index.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/elements/_index.zh-cn.md @@ -3,8 +3,7 @@ title: "网络元素" linkTitle: "元素" weight: 8 aliases: [ -"/documentation/zh-cn/webdriver/web_element/", -"/zh-cn/documentation/webdriver/web_element/" +"/documentation/webdriver/web_element/" ] description: > 在DOM中识别和使用元素对象. diff --git a/website_and_docs/content/documentation/webdriver/elements/file_upload.ja.md b/website_and_docs/content/documentation/webdriver/elements/file_upload.ja.md index 8827f75fe243..7a30437a093e 100644 --- a/website_and_docs/content/documentation/webdriver/elements/file_upload.ja.md +++ b/website_and_docs/content/documentation/webdriver/elements/file_upload.ja.md @@ -3,7 +3,7 @@ title: "ファイルのアップロード" linkTitle: "ファイルのアップロード" weight: 5 aliases: [ -"/ja/documentation/webdriver/additional_features/fileupload/" +"/documentation/webdriver/additional_features/fileupload/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/elements/file_upload.pt-br.md b/website_and_docs/content/documentation/webdriver/elements/file_upload.pt-br.md index 3593e70f2634..3e79210e64f8 100644 --- a/website_and_docs/content/documentation/webdriver/elements/file_upload.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/elements/file_upload.pt-br.md @@ -3,7 +3,7 @@ title: "File Upload" linkTitle: "File Upload" weight: 5 aliases: [ -"/pt-br/documentation/webdriver/additional_features/fileupload/" +"/documentation/webdriver/additional_features/fileupload/" ] description: > Como subir arquivos com Selenium diff --git a/website_and_docs/content/documentation/webdriver/elements/file_upload.zh-cn.md b/website_and_docs/content/documentation/webdriver/elements/file_upload.zh-cn.md index bb6c8de19f26..5cbd702e0db3 100644 --- a/website_and_docs/content/documentation/webdriver/elements/file_upload.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/elements/file_upload.zh-cn.md @@ -3,7 +3,7 @@ title: "文件上传" linkTitle: "文件上传" weight: 5 aliases: [ -"/zh-cn/documentation/webdriver/additional_features/fileupload/" +"/documentation/webdriver/additional_features/fileupload/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/elements/finders.en.md b/website_and_docs/content/documentation/webdriver/elements/finders.en.md index 0bf1c9b031ec..0036b10bceed 100644 --- a/website_and_docs/content/documentation/webdriver/elements/finders.en.md +++ b/website_and_docs/content/documentation/webdriver/elements/finders.en.md @@ -4,7 +4,10 @@ linkTitle: "Finders" weight: 2 aliases: [ "/documentation/en/webdriver/locating_elements/", -"/documentation/webdriver/locating_elements/" +"/documentation/webdriver/locating_elements/", +"/documentation/ja/webdriver/locating_elements/", +"/documentation/pt-br/webdriver/locating_elements/", +"/documentation/zh-cn/webdriver/locating_elements/" ] description: > Locating the elements based on the provided locator values. diff --git a/website_and_docs/content/documentation/webdriver/elements/finders.ja.md b/website_and_docs/content/documentation/webdriver/elements/finders.ja.md index 933571f9d0ea..3bd2315d696f 100644 --- a/website_and_docs/content/documentation/webdriver/elements/finders.ja.md +++ b/website_and_docs/content/documentation/webdriver/elements/finders.ja.md @@ -3,8 +3,7 @@ title: "Web要素の検索" linkTitle: "検索" weight: 2 aliases: [ -"/documentation/ja/webdriver/locating_elements/", -"/ja/documentation/webdriver/locating_elements/" +"/documentation/webdriver/locating_elements/" ] description: > 提供されたロケーターの値に基づいて要素を検索します。 diff --git a/website_and_docs/content/documentation/webdriver/elements/finders.pt-br.md b/website_and_docs/content/documentation/webdriver/elements/finders.pt-br.md index a2daa5354965..5baa1b63b9ce 100644 --- a/website_and_docs/content/documentation/webdriver/elements/finders.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/elements/finders.pt-br.md @@ -4,8 +4,7 @@ linkTitle: "Finders" weight: 2 needsTranslation: true aliases: [ -"/documentation/pt-br/webdriver/locating_elements/", -"/pt-br/documentation/webdriver/locating_elements/" +"/documentation/webdriver/locating_elements/" ] description: > Localizando elementos com base nos valores providenciados pelo localizador. diff --git a/website_and_docs/content/documentation/webdriver/elements/finders.zh-cn.md b/website_and_docs/content/documentation/webdriver/elements/finders.zh-cn.md index 1633e2742cf3..3ca864b23595 100644 --- a/website_and_docs/content/documentation/webdriver/elements/finders.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/elements/finders.zh-cn.md @@ -3,8 +3,7 @@ title: "查询网络元素" linkTitle: "查询器" weight: 2 aliases: [ -"/documentation/zh-cn/webdriver/locating_elements/", -"/zh-cn/documentation/webdriver/locating_elements/" +"/documentation/webdriver/locating_elements/" ] description: > 根据提供的定位值定位元素. diff --git a/website_and_docs/content/documentation/webdriver/elements/locators.ja.md b/website_and_docs/content/documentation/webdriver/elements/locators.ja.md index 3bc2ce1ab647..e39faff030e5 100644 --- a/website_and_docs/content/documentation/webdriver/elements/locators.ja.md +++ b/website_and_docs/content/documentation/webdriver/elements/locators.ja.md @@ -3,7 +3,7 @@ title: "要素を探す" linkTitle: "要素を探す" weight: 1 aliases: [ -"/ja/documentation/webdriver/relative_locators/" +"/documentation/webdriver/relative_locators/" ] description: > DOM内の1つ以上の特定の要素を識別する方法 diff --git a/website_and_docs/content/documentation/webdriver/elements/locators.pt-br.md b/website_and_docs/content/documentation/webdriver/elements/locators.pt-br.md index b2a9a9861de7..351c80d1d76a 100644 --- a/website_and_docs/content/documentation/webdriver/elements/locators.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/elements/locators.pt-br.md @@ -4,7 +4,7 @@ linkTitle: "Localizando elementos" weight: 4 needsTranslation: true aliases: [ -"/pt-br/documentation/webdriver/relative_locators/" +"/documentation/webdriver/relative_locators/" ] description: > Formas de identificar um ou mais elementos no DOM. diff --git a/website_and_docs/content/documentation/webdriver/elements/locators.zh-cn.md b/website_and_docs/content/documentation/webdriver/elements/locators.zh-cn.md index 4e36248d4368..6cd1c9326e14 100644 --- a/website_and_docs/content/documentation/webdriver/elements/locators.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/elements/locators.zh-cn.md @@ -4,7 +4,7 @@ linkTitle: "定位器" weight: 4 needsTranslation: true aliases: [ -"/zh-cn/documentation/webdriver/relative_locators/" +"/documentation/webdriver/relative_locators/" ] description: > 在DOM中标识一个或多个特定元素的方法. diff --git a/website_and_docs/content/documentation/webdriver/getting_started/_index.en.md b/website_and_docs/content/documentation/webdriver/getting_started/_index.en.md index 970460322daa..94b82bb00871 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/_index.en.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/_index.en.md @@ -9,7 +9,19 @@ aliases: [ "/documentation/en/getting_started/quick/", "/documentation/en/selenium_installation/", "/documentation/en/getting_started_with_webdriver/", -"/documentation/getting_started/" +"/documentation/getting_started/", +"/documentation/ja/getting_started/", +"/documentation/ja/getting_started/quick/", +"/documentation/ja/selenium_installation/", +"/documentation/ja/getting_started_with_webdriver/", +"/documentation/pt-br/getting_started/", +"/documentation/pt-br/getting_started/quick/", +"/documentation/pt-br/selenium_installation/", +"/documentation/pt-br/getting_started_with_webdriver/", +"/documentation/zh-cn/getting_started/", +"/documentation/zh-cn/getting_started/quick/", +"/documentation/zh-cn/selenium_installation/", +"/documentation/zh-cn/getting_started_with_webdriver/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/getting_started/_index.ja.md b/website_and_docs/content/documentation/webdriver/getting_started/_index.ja.md index 4874ab8c2d5e..2aa669bc6209 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/_index.ja.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/_index.ja.md @@ -6,11 +6,7 @@ needsTranslation: true description: > Seleniumを初めて使用する場合は、すぐに習得するのに役立つリソースがいくつかあります。 aliases: [ -"/documentation/ja/getting_started/", -"/documentation/ja/getting_started/quick/", -"/documentation/ja/selenium_installation/", -"/documentation/ja/getting_started_with_webdriver/", -"/ja/documentation/getting_started/" +"/documentation/getting_started/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/getting_started/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/getting_started/_index.pt-br.md index 754cf29f5818..82ec00f7a3af 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/_index.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/_index.pt-br.md @@ -6,11 +6,7 @@ needsTranslation: true description: > Se você é novo no Selenium, nós temos alguns recursos que podem te ajudar a se atualizar imediatamente. aliases: [ -"/documentation/pt-br/getting_started/", -"/documentation/pt-br/getting_started/quick/", -"/documentation/pt-br/selenium_installation/", -"/documentation/pt-br/getting_started_with_webdriver/", -"/pt-br/documentation/getting_started/" +"/documentation/getting_started/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/getting_started/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/getting_started/_index.zh-cn.md index 43778efb5763..712a1b8988ff 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/_index.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/_index.zh-cn.md @@ -6,11 +6,7 @@ needsTranslation: false description: > 如果你是Selenium的新手, 我们有一些资源帮助你快速入门. aliases: [ -"/documentation/zh-cn/getting_started/", -"/documentation/zh-cn/getting_started/quick/", -"/documentation/zh-cn/selenium_installation/", -"/documentation/zh-cn/getting_started_with_webdriver/", -"/zh-cn/documentation/getting_started/" +"/documentation/getting_started/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/getting_started/install_library.en.md b/website_and_docs/content/documentation/webdriver/getting_started/install_library.en.md index 618d427f1bd5..a128fc0633f5 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/install_library.en.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/install_library.en.md @@ -7,7 +7,10 @@ description: > aliases: [ "/documentation/en/selenium_installation/installing_selenium_libraries/", "/documentation/getting_started/installing_selenium_libraries/", -"/documentation/getting_started/install_selenium_library/" +"/documentation/getting_started/install_selenium_library/", +"/documentation/ja/selenium_installation/installing_selenium_libraries/", +"/documentation/pt-br/selenium_installation/installing_selenium_libraries/", +"/documentation/zh-cn/selenium_installation/installing_selenium_libraries/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/getting_started/install_library.ja.md b/website_and_docs/content/documentation/webdriver/getting_started/install_library.ja.md index 50d38d71390f..e2f12d13e613 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/install_library.ja.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/install_library.ja.md @@ -5,9 +5,8 @@ weight: 2 description: > お気に入りのプログラミング言語用にSeleniumライブラリを設定します。 aliases: [ -"/documentation/ja/selenium_installation/installing_selenium_libraries/", -"/ja/documentation/getting_started/installing_selenium_libraries/", -"/ja/documentation/getting_started/install_selenium_library/" +"/documentation/getting_started/installing_selenium_libraries/", +"/documentation/getting_started/install_selenium_library/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/getting_started/install_library.pt-br.md b/website_and_docs/content/documentation/webdriver/getting_started/install_library.pt-br.md index b3efa2ddd8e2..a5e6dd8f6dd7 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/install_library.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/install_library.pt-br.md @@ -6,9 +6,8 @@ needsTranslation: true description: > Configurando a biblioteca Selenium para sua linguagem de programação favorita. aliases: [ -"/documentation/pt-br/selenium_installation/installing_selenium_libraries/", -"/pt-br/documentation/getting_started/installing_selenium_libraries/", -"/pt-br/documentation/getting_started/install_selenium_library/" +"/documentation/getting_started/installing_selenium_libraries/", +"/documentation/getting_started/install_selenium_library/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/getting_started/install_library.zh-cn.md b/website_and_docs/content/documentation/webdriver/getting_started/install_library.zh-cn.md index ccf16b1cb17e..8970d8427606 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/install_library.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/install_library.zh-cn.md @@ -5,9 +5,8 @@ weight: 2 description: > 配置自动化的浏览器. aliases: [ -"/documentation/zh-cn/selenium_installation/installing_selenium_libraries/", -"/zh-cn/documentation/getting_started/installing_selenium_libraries/", -"/zh-cn/documentation/getting_started/install_selenium_library/" +"/documentation/getting_started/installing_selenium_libraries/", +"/documentation/getting_started/install_selenium_library/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/_index.en.md b/website_and_docs/content/documentation/webdriver/interactions/_index.en.md index fa978a5b69ba..6037f15c96c5 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/_index.en.md +++ b/website_and_docs/content/documentation/webdriver/interactions/_index.en.md @@ -6,6 +6,9 @@ aliases: [ "/documentation/en/webdriver/browser_manipulation/", "/documentation/webdriver/browser_manipulation/", "/documentation/webdriver/browser/", +"/documentation/ja/webdriver/browser_manipulation/", +"/documentation/pt-br/webdriver/browser_manipulation/", +"/documentation/zh-cn/webdriver/browser_manipulation/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/_index.ja.md b/website_and_docs/content/documentation/webdriver/interactions/_index.ja.md index 76b7f69e7bf0..197d74faa73b 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/_index.ja.md +++ b/website_and_docs/content/documentation/webdriver/interactions/_index.ja.md @@ -3,8 +3,7 @@ title: "ブラウザのインタラクション" linkTitle: "Interactions" weight: 10 aliases: [ -"/documentation/ja/webdriver/browser_manipulation/", -"/ja/documentation/webdriver/browser_manipulation/", +"/documentation/webdriver/browser_manipulation/", "ja/documentation/webdriver/browser/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/interactions/_index.pt-br.md index 473e0a81924e..e25340bbd86f 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/_index.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/interactions/_index.pt-br.md @@ -4,9 +4,8 @@ linkTitle: "Interactions" weight: 10 requiresTranslation: true aliases: [ -"/documentation/pt-br/webdriver/browser_manipulation/", -"/pt-br/documentation/webdriver/browser_manipulation/", -"/pt-br/documentation/webdriver/browser/" +"/documentation/webdriver/browser_manipulation/", +"/documentation/webdriver/browser/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/interactions/_index.zh-cn.md index b445d8216c2d..6af3e50fe706 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/_index.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/interactions/_index.zh-cn.md @@ -3,9 +3,8 @@ title: "浏览器交互" linkTitle: "交互" weight: 10 aliases: [ -"/documentation/zh-cn/webdriver/browser_manipulation/", -"/zh-cn/documentation/webdriver/browser_manipulation/", -"/zh-cn/documentation/webdriver/browser/" +"/documentation/webdriver/browser_manipulation/", +"/documentation/webdriver/browser/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/alerts.en.md b/website_and_docs/content/documentation/webdriver/interactions/alerts.en.md index 6eed39772716..32cb0198def9 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/alerts.en.md +++ b/website_and_docs/content/documentation/webdriver/interactions/alerts.en.md @@ -6,6 +6,9 @@ aliases: [ "/documentation/en/webdriver/js_alerts_prompts_and_confirmations/", "/documentation/webdriver/js_alerts_prompts_and_confirmations/", "/documentation/webdriver/browser/alerts", +"/documentation/ja/webdriver/js_alerts_prompts_and_confirmations/", +"/documentation/pt-br/webdriver/js_alerts_prompts_and_confirmations/", +"/documentation/zh-cn/webdriver/js_alerts_prompts_and_confirmations/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/alerts.ja.md b/website_and_docs/content/documentation/webdriver/interactions/alerts.ja.md index b0597debdf67..c33d5a0b3356 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/alerts.ja.md +++ b/website_and_docs/content/documentation/webdriver/interactions/alerts.ja.md @@ -3,9 +3,8 @@ title: "JavaScript アラート、プロンプトおよび確認" linkTitle: "JavaScript アラート、プロンプトおよび確認" weight: 2 aliases: [ -"/documentation/ja/webdriver/js_alerts_prompts_and_confirmations/", -"/ja/documentation/webdriver/js_alerts_prompts_and_confirmations/", -"/ja/documentation/webdriver/browser/alerts", +"/documentation/webdriver/js_alerts_prompts_and_confirmations/", +"/documentation/webdriver/browser/alerts" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/alerts.pt-br.md b/website_and_docs/content/documentation/webdriver/interactions/alerts.pt-br.md index 88f228a126b5..feb7213828e3 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/alerts.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/interactions/alerts.pt-br.md @@ -3,9 +3,8 @@ title: "Alertas, prompts e confirmações JavaScript" linkTitle: "Alertas, prompts e confirmações JavaScript" weight: 2 aliases: [ -"/documentation/pt-br/webdriver/js_alerts_prompts_and_confirmations/", -"/pt-br/documentation/webdriver/js_alerts_prompts_and_confirmations/", -"/pt-br/documentation/webdriver/browser/alerts/" +"/documentation/webdriver/js_alerts_prompts_and_confirmations/", +"/documentation/webdriver/browser/alerts/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/alerts.zh-cn.md b/website_and_docs/content/documentation/webdriver/interactions/alerts.zh-cn.md index ced3129ea689..233aac3f8107 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/alerts.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/interactions/alerts.zh-cn.md @@ -3,9 +3,8 @@ title: "JavaScript 警告框,提示框和确认框" linkTitle: "警告框" weight: 2 aliases: [ -"/documentation/zh-cn/webdriver/js_alerts_prompts_and_confirmations/", -"/zh-cn/documentation/webdriver/js_alerts_prompts_and_confirmations/", -"/zh-cn/documentation/webdriver/browser/alerts/", +"/documentation/webdriver/js_alerts_prompts_and_confirmations/", +"/documentation/webdriver/browser/alerts/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/cookies.en.md b/website_and_docs/content/documentation/webdriver/interactions/cookies.en.md index 49fc296dabe2..cd3de1d3b13a 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/cookies.en.md +++ b/website_and_docs/content/documentation/webdriver/interactions/cookies.en.md @@ -5,7 +5,10 @@ weight: 4 aliases: [ "/documentation/en/support_packages/working_with_cookies/", "/documentation/support_packages/working_with_cookies/", -"/documentation/webdriver/browser/cookies" +"/documentation/webdriver/browser/cookies", +"/documentation/ja/support_packages/working_with_cookies/", +"/documentation/pt-br/support_packages/working_with_cookies/", +"/documentation/zh-cn/support_packages/working_with_cookies/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/cookies.ja.md b/website_and_docs/content/documentation/webdriver/interactions/cookies.ja.md index 68055b39fbe8..b1bb02bbf8ef 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/cookies.ja.md +++ b/website_and_docs/content/documentation/webdriver/interactions/cookies.ja.md @@ -3,9 +3,8 @@ title: "クッキーの使用" linkTitle: "クッキーの使用" weight: 4 aliases: [ -"/documentation/ja/support_packages/working_with_cookies/", -"/ja/documentation/support_packages/working_with_cookies/", -"/ja/documentation/webdriver/browser/cookies/" +"/documentation/support_packages/working_with_cookies/", +"/documentation/webdriver/browser/cookies/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/cookies.pt-br.md b/website_and_docs/content/documentation/webdriver/interactions/cookies.pt-br.md index 4515b48ba4be..8ad37192c55b 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/cookies.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/interactions/cookies.pt-br.md @@ -3,9 +3,8 @@ title: "Trabalhando com cookies" linkTitle: "Trabalhando com cookies" weight: 4 aliases: [ -"/documentation/pt-br/support_packages/working_with_cookies/", -"/pt-br/documentation/support_packages/working_with_cookies/", -"/pt-br/documentation/webdriver/browser/cookies/" +"/documentation/support_packages/working_with_cookies/", +"/documentation/webdriver/browser/cookies/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/cookies.zh-cn.md b/website_and_docs/content/documentation/webdriver/interactions/cookies.zh-cn.md index c4455e645452..b2e2af952828 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/cookies.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/interactions/cookies.zh-cn.md @@ -3,9 +3,8 @@ title: "同cookies一起工作" linkTitle: "Cookies" weight: 4 aliases: [ -"/documentation/zh-cn/support_packages/working_with_cookies/", -"/zh-cn/documentation/support_packages/working_with_cookies/", -"/zh-cn/documentation/webdriver/browser/cookies/" +"/documentation/support_packages/working_with_cookies/", +"/documentation/webdriver/browser/cookies/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/frames.ja.md b/website_and_docs/content/documentation/webdriver/interactions/frames.ja.md index 8f340dbdc358..df37bf2f2126 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/frames.ja.md +++ b/website_and_docs/content/documentation/webdriver/interactions/frames.ja.md @@ -3,7 +3,7 @@ title: "IFrame と Frame の操作" linkTitle: "フレーム" weight: 6 aliases: [ -"/ja/documentation/webdriver/browser/frames/" +"/documentation/webdriver/browser/frames/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/frames.pt-br.md b/website_and_docs/content/documentation/webdriver/interactions/frames.pt-br.md index c4530191e055..7af667fd1f49 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/frames.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/interactions/frames.pt-br.md @@ -3,7 +3,7 @@ title: "Working with IFrames and frames" linkTitle: "Frames" weight: 6 aliases: [ -"/pt-br/documentation/webdriver/browser/frames/" +"/documentation/webdriver/browser/frames/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/frames.zh-cn.md b/website_and_docs/content/documentation/webdriver/interactions/frames.zh-cn.md index dea749a9eaf9..a61b3e13e205 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/frames.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/interactions/frames.zh-cn.md @@ -3,7 +3,7 @@ title: "与IFrames和frames一起工作" linkTitle: "Frames" weight: 6 aliases: [ -"/zh-cn/documentation/webdriver/browser/frames/" +"/documentation/webdriver/browser/frames/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/navigation.ja.md b/website_and_docs/content/documentation/webdriver/interactions/navigation.ja.md index b36fd3583676..15c359ed5d77 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/navigation.ja.md +++ b/website_and_docs/content/documentation/webdriver/interactions/navigation.ja.md @@ -3,7 +3,7 @@ title: "ブラウザー ナビゲーション" linkTitle: "ナビゲーション" weight: 1 aliases: [ -"/ja/documentation/webdriver/browser/navigation/" +"/documentation/webdriver/browser/navigation/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/navigation.pt-br.md b/website_and_docs/content/documentation/webdriver/interactions/navigation.pt-br.md index d807f836635b..70f23fc6c1b4 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/navigation.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/interactions/navigation.pt-br.md @@ -3,7 +3,7 @@ title: "Browser navigation" linkTitle: "Navigation" weight: 1 aliases: [ -"/pt-br/documentation/webdriver/browser/navigation/" +"/documentation/webdriver/browser/navigation/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/navigation.zh-cn.md b/website_and_docs/content/documentation/webdriver/interactions/navigation.zh-cn.md index f92e0fca0447..abf3dfee026b 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/navigation.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/interactions/navigation.zh-cn.md @@ -3,7 +3,7 @@ title: "浏览器导航" linkTitle: "导航" weight: 1 aliases: [ -"/zh-cn/documentation/webdriver/browser/navigation/" +"/documentation/webdriver/browser/navigation/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/print_page.en.md b/website_and_docs/content/documentation/webdriver/interactions/print_page.en.md index ab209d171e77..fa8e5698112c 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/print_page.en.md +++ b/website_and_docs/content/documentation/webdriver/interactions/print_page.en.md @@ -4,6 +4,9 @@ linkTitle: "Print Page" weight: 7 aliases: [ "/documentation/en/support_packages/print_page/", +"/documentation/ja/support_packages/print_page/", +"/documentation/pt-br/support_packages/print_page/", +"/documentation/zh-cn/support_packages/print_page/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/print_page.ja.md b/website_and_docs/content/documentation/webdriver/interactions/print_page.ja.md index 89b1de707538..f409d6fc5817 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/print_page.ja.md +++ b/website_and_docs/content/documentation/webdriver/interactions/print_page.ja.md @@ -2,9 +2,6 @@ title: "Print Page" linkTitle: "Print Page" weight: 7 -aliases: [ -"/documentation/ja/support_packages/print_page/", -] --- Printing a webpage is a common task, whether for sharing information or maintaining archives. diff --git a/website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md b/website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md index 9c8733a93dba..ecc25306614c 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md @@ -2,9 +2,6 @@ title: "Print Page" linkTitle: "Print Page" weight: 7 -aliases: [ -"/documentation/pt-br/support_packages/print_page/", -] --- Printing a webpage is a common task, whether for sharing information or maintaining archives. diff --git a/website_and_docs/content/documentation/webdriver/interactions/print_page.zh-cn.md b/website_and_docs/content/documentation/webdriver/interactions/print_page.zh-cn.md index e4f4c45aa8bf..d5d524354fce 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/print_page.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/interactions/print_page.zh-cn.md @@ -2,9 +2,6 @@ title: "打印页面" linkTitle: "打印页面" weight: 7 -aliases: [ -"/documentation/zh-cn/support_packages/print_page/", -] --- 无论是共享信息还是维护档案,打印网页都是一项常见任务。 diff --git a/website_and_docs/content/documentation/webdriver/interactions/virtual_authenticator.ja.md b/website_and_docs/content/documentation/webdriver/interactions/virtual_authenticator.ja.md index b68bb7b0f093..c36d51577e81 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/virtual_authenticator.ja.md +++ b/website_and_docs/content/documentation/webdriver/interactions/virtual_authenticator.ja.md @@ -5,7 +5,7 @@ weight: 16 description: > A representation of the Web Authenticator model. aliases: [ -"/ja/documentation/webdriver/virtual_authenticator/" +"/documentation/webdriver/virtual_authenticator/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/virtual_authenticator.pt-br.md b/website_and_docs/content/documentation/webdriver/interactions/virtual_authenticator.pt-br.md index 0565926dfb65..e44d1c3d117a 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/virtual_authenticator.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/interactions/virtual_authenticator.pt-br.md @@ -5,7 +5,7 @@ weight: 16 description: > Uma representação do modelo Web Authenticator. aliases: [ -"/pt-br/documentation/webdriver/virtual_authenticator/" +"/documentation/webdriver/virtual_authenticator/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/virtual_authenticator.zh-cn.md b/website_and_docs/content/documentation/webdriver/interactions/virtual_authenticator.zh-cn.md index 6d6a8b208361..5297ca2d83db 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/virtual_authenticator.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/interactions/virtual_authenticator.zh-cn.md @@ -5,7 +5,7 @@ weight: 16 description: > 一种Web身份验证器模型的表示形式. aliases: [ -"/zh-cn/documentation/webdriver/virtual_authenticator/" +"/documentation/webdriver/virtual_authenticator/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/windows.ja.md b/website_and_docs/content/documentation/webdriver/interactions/windows.ja.md index 46c5ff370218..322523f20790 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/windows.ja.md +++ b/website_and_docs/content/documentation/webdriver/interactions/windows.ja.md @@ -3,7 +3,7 @@ title: "ウィンドウとタブの操作" linkTitle: "ウィンドウ" weight: 8 aliases: [ -"/ja/documentation/webdriver/browser/windows/" +"/documentation/webdriver/browser/windows/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/windows.pt-br.md b/website_and_docs/content/documentation/webdriver/interactions/windows.pt-br.md index 7e54160c985e..c55718e2cc5f 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/windows.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/interactions/windows.pt-br.md @@ -3,7 +3,7 @@ title: "Working with windows and tabs" linkTitle: "Windows" weight: 8 aliases: [ -"/pt-br/documentation/webdriver/browser/windows/" +"/documentation/webdriver/browser/windows/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/windows.zh-cn.md b/website_and_docs/content/documentation/webdriver/interactions/windows.zh-cn.md index 7af43be25777..12a56914f4ad 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/windows.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/interactions/windows.zh-cn.md @@ -3,7 +3,7 @@ title: "同窗口和标签一起工作" linkTitle: "窗口" weight: 8 aliases: [ -"/zh-cn/documentation/webdriver/browser/windows/" +"/documentation/webdriver/browser/windows/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/support_features/_index.en.md b/website_and_docs/content/documentation/webdriver/support_features/_index.en.md index 484b9a75324a..ca97a496d0d5 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/_index.en.md +++ b/website_and_docs/content/documentation/webdriver/support_features/_index.en.md @@ -8,6 +8,9 @@ aliases: [ "/documentation/en/support_packages/", "/documentation/support_packages/", "/documentation/webdriver/additional_features/", +"/documentation/ja/support_packages/", +"/documentation/pt-br/support_packages/", +"/documentation/zh-cn/support_packages/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/support_features/_index.ja.md b/website_and_docs/content/documentation/webdriver/support_features/_index.ja.md index 6d7db49142d5..63c300badf0e 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/_index.ja.md +++ b/website_and_docs/content/documentation/webdriver/support_features/_index.ja.md @@ -5,9 +5,8 @@ weight: 18 description: > サポートクラスは、オプションの高水準な機能を提供します。 aliases: [ -"/documentation/ja/support_packages/", -"/ja/documentation/support_packages/", -"/ja/documentation/webdriver/additional_features/", +"/documentation/support_packages/", +"/documentation/webdriver/additional_features/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/support_features/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/support_features/_index.pt-br.md index d5c814a0a557..5bc40ea99e13 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/_index.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/support_features/_index.pt-br.md @@ -5,9 +5,8 @@ weight: 18 description: > As classes de suporte fornecem características opcionais de nível superior. aliases: [ -"/documentation/pt-br/support_packages/", -"/pt-br/documentation/support_packages/", -"/pt-br/documentation/additional_features/", +"/documentation/support_packages/", +"/documentation/additional_features/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/support_features/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/support_features/_index.zh-cn.md index 3a383d9f1407..ddc6cf49ed16 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/_index.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/support_features/_index.zh-cn.md @@ -5,9 +5,8 @@ weight: 18 description: > 针对更高层面功能的额外支持类. aliases: [ -"/documentation/zh-cn/support_packages/", -"/zh-cn/documentation/support_packages/", -"/zh-cn/documentation/additional_features/", +"/documentation/support_packages/", +"/documentation/additional_features/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/support_features/colors.en.md b/website_and_docs/content/documentation/webdriver/support_features/colors.en.md index 7a2d892081b0..ec6b8bf1ed7d 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/colors.en.md +++ b/website_and_docs/content/documentation/webdriver/support_features/colors.en.md @@ -6,6 +6,9 @@ aliases: [ "/documentation/en/support_packages/working_with_colours/", "/documentation/support_packages/working_with_colours/", "/documentation/webdriver/additional_features/working_with_colours/", +"/documentation/ja/support_packages/working_with_colours/", +"/documentation/pt-br/support_packages/working_with_colours/", +"/documentation/zh-cn/support_packages/working_with_colours/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/support_features/colors.ja.md b/website_and_docs/content/documentation/webdriver/support_features/colors.ja.md index 35076b1f68dc..0192e554d6ef 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/colors.ja.md +++ b/website_and_docs/content/documentation/webdriver/support_features/colors.ja.md @@ -3,9 +3,8 @@ title: "色を扱う" linkTitle: "色を扱う" weight: 3 aliases: [ -"/documentation/ja/support_packages/working_with_colours/", -"/ja/documentation/support_packages/working_with_colours/", -"/ja/documentation/webdriver/additional_features/working_with_colours/", +"/documentation/support_packages/working_with_colours/", +"/documentation/webdriver/additional_features/working_with_colours/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/support_features/colors.pt-br.md b/website_and_docs/content/documentation/webdriver/support_features/colors.pt-br.md index 6da352c77a2b..c2fdd7e93e4c 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/colors.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/support_features/colors.pt-br.md @@ -3,9 +3,8 @@ title: "Trabalhando com cores" linkTitle: "Trabalhando com cores" weight: 3 aliases: [ -"/documentation/pt-br/support_packages/working_with_colours/", -"/pt-br/documentation/support_packages/working_with_colours/", -"/pt-br/documentation/webdriver/additional_features/working_with_colours/", +"/documentation/support_packages/working_with_colours/", +"/documentation/webdriver/additional_features/working_with_colours/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/support_features/colors.zh-cn.md b/website_and_docs/content/documentation/webdriver/support_features/colors.zh-cn.md index 62a935277616..53e166a81f2b 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/colors.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/support_features/colors.zh-cn.md @@ -3,9 +3,8 @@ title: "同颜色一起工作" linkTitle: "颜色" weight: 3 aliases: [ -"/documentation/zh-cn/support_packages/working_with_colours/", -"/zh-cn/documentation/support_packages/working_with_colours/", -"/zh-cn/documentation/webdriver/additional_features/working_with_colours/", +"/documentation/support_packages/working_with_colours/", +"/documentation/webdriver/additional_features/working_with_colours/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/support_features/listeners.ja.md b/website_and_docs/content/documentation/webdriver/support_features/listeners.ja.md index bae523635254..03aad5a93255 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/listeners.ja.md +++ b/website_and_docs/content/documentation/webdriver/support_features/listeners.ja.md @@ -3,7 +3,7 @@ title: "コマンドリスナー" linkTitle: "リスナー" weight: 2 aliases: [ - "/ja/documentation/webdriver/drivers/listeners", + "/documentation/webdriver/drivers/listeners", ] --- diff --git a/website_and_docs/content/documentation/webdriver/support_features/listeners.pt-br.md b/website_and_docs/content/documentation/webdriver/support_features/listeners.pt-br.md index d23c1655dc57..cfecbd7cb65f 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/listeners.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/support_features/listeners.pt-br.md @@ -3,7 +3,7 @@ title: "Command Listeners" linkTitle: "Listeners" weight: 2 aliases: [ - "/pt-br/documentation/webdriver/drivers/listeners", + "/documentation/webdriver/drivers/listeners", ] --- diff --git a/website_and_docs/content/documentation/webdriver/support_features/listeners.zh-cn.md b/website_and_docs/content/documentation/webdriver/support_features/listeners.zh-cn.md index 015b9e9afb76..7f1255f7d246 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/listeners.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/support_features/listeners.zh-cn.md @@ -3,7 +3,7 @@ title: "命令监听器" linkTitle: "监听器" weight: 2 aliases: [ - "/zh-cn/documentation/webdriver/drivers/listeners", + "/documentation/webdriver/drivers/listeners", ] --- diff --git a/website_and_docs/content/documentation/webdriver/support_features/select_lists.en.md b/website_and_docs/content/documentation/webdriver/support_features/select_lists.en.md index 8ae5aa2272d7..745894d95a46 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/select_lists.en.md +++ b/website_and_docs/content/documentation/webdriver/support_features/select_lists.en.md @@ -7,6 +7,9 @@ aliases: [ "/documentation/support_packages/working_with_select_elements/", "/documentation/webdriver/elements/select_elements/", "/documentation/webdriver/elements/select_list", +"/documentation/ja/support_packages/working_with_select_elements/", +"/documentation/pt-br/support_packages/working_with_select_elements/", +"/documentation/zh-cn/support_packages/working_with_select_elements/" ] description: > Select lists have special behaviors compared to other elements. diff --git a/website_and_docs/content/documentation/webdriver/support_features/select_lists.ja.md b/website_and_docs/content/documentation/webdriver/support_features/select_lists.ja.md index e493aecaa293..1140dfbd7d59 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/select_lists.ja.md +++ b/website_and_docs/content/documentation/webdriver/support_features/select_lists.ja.md @@ -3,10 +3,9 @@ title: "選択要素の操作" linkTitle: "選択要素の操作" weight: 5 aliases: [ -"/documentation/ja/support_packages/working_with_select_elements/", -"/ja/documentation/support_packages/working_with_select_elements/", -"/ja/documentation/webdriver/elements/select_elements/", -"/ja/documentation/webdriver/elements/select_list", +"/documentation/support_packages/working_with_select_elements/", +"/documentation/webdriver/elements/select_elements/", +"/documentation/webdriver/elements/select_list" ] description: > 選択リストには、他の要素と比較して特別な動作があります。 diff --git a/website_and_docs/content/documentation/webdriver/support_features/select_lists.pt-br.md b/website_and_docs/content/documentation/webdriver/support_features/select_lists.pt-br.md index 5aa849b885e4..7c5f27b79611 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/select_lists.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/support_features/select_lists.pt-br.md @@ -4,10 +4,9 @@ linkTitle: "Trabalhando com elementos select" weight: 10 needsTranslation: true aliases: [ -"/documentation/pt-br/support_packages/working_with_select_elements/", -"/pt-br/documentation/support_packages/working_with_select_elements/", -"/pt-br/documentation/webdriver/elements/select_elements/", -"/pt-br/documentation/webdriver/elements/select_list", +"/documentation/support_packages/working_with_select_elements/", +"/documentation/webdriver/elements/select_elements/", +"/documentation/webdriver/elements/select_list" ] description: > Select lists have special behaviors compared to other elements. diff --git a/website_and_docs/content/documentation/webdriver/support_features/select_lists.zh-cn.md b/website_and_docs/content/documentation/webdriver/support_features/select_lists.zh-cn.md index f4105a19d708..0b1fbd975bed 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/select_lists.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/support_features/select_lists.zh-cn.md @@ -3,10 +3,9 @@ title: "使用选择列表元素" linkTitle: "选择列表" weight: 10 aliases: [ -"/documentation/zh-cn/support_packages/working_with_select_elements/", -"/zh-cn/documentation/support_packages/working_with_select_elements/", -"/zh-cn/documentation/webdriver/elements/select_elements/", -"/zh-cn/documentation/webdriver/elements/select_list", +"/documentation/support_packages/working_with_select_elements/", +"/documentation/webdriver/elements/select_elements/", +"/documentation/webdriver/elements/select_list" ] description: > 与其他元素相比,选择列表具有特殊的行为. diff --git a/website_and_docs/content/documentation/webdriver/support_features/thread_guard.en.md b/website_and_docs/content/documentation/webdriver/support_features/thread_guard.en.md index a4aff0a1126f..a194249f7ceb 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/thread_guard.en.md +++ b/website_and_docs/content/documentation/webdriver/support_features/thread_guard.en.md @@ -5,7 +5,10 @@ weight: 6 aliases: [ "/documentation/en/support_classes/", "/documentation/support_packages/thread_guard/", -"/documentation/webdriver/additional_features/thread_guard/" +"/documentation/webdriver/additional_features/thread_guard/", +"/documentation/ja/support_classes/", +"/documentation/pt-br/support_classes/", +"/documentation/zh-cn/support_classes/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/support_features/thread_guard.ja.md b/website_and_docs/content/documentation/webdriver/support_features/thread_guard.ja.md index 1c7b3db7b803..22e8f12dc836 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/thread_guard.ja.md +++ b/website_and_docs/content/documentation/webdriver/support_features/thread_guard.ja.md @@ -3,9 +3,8 @@ title: "ThreadGuard" linkTitle: "ThreadGuard" weight: 6 aliases: [ -"/documentation/ja/support_classes/", -"/ja/documentation/support_packages/thread_guard/", -"/ja/documentation/webdriver/additional_features/thread_guard/" +"/documentation/support_packages/thread_guard/", +"/documentation/webdriver/additional_features/thread_guard/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/support_features/thread_guard.pt-br.md b/website_and_docs/content/documentation/webdriver/support_features/thread_guard.pt-br.md index 68f690fd7b98..a8a7988c567f 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/thread_guard.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/support_features/thread_guard.pt-br.md @@ -3,9 +3,8 @@ title: "ThreadGuard" linkTitle: "ThreadGuard" weight: 6 aliases: [ -"/documentation/pt-br/support_classes/", -"/pt-br/documentation/support_packages/thread_guard/", -"/pt-br/documentation/webdriver/additional_features/thread_guard/" +"/documentation/support_packages/thread_guard/", +"/documentation/webdriver/additional_features/thread_guard/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/support_features/thread_guard.zh-cn.md b/website_and_docs/content/documentation/webdriver/support_features/thread_guard.zh-cn.md index 2a14b9b5c8d5..2d6c9f0681d6 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/thread_guard.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/support_features/thread_guard.zh-cn.md @@ -3,9 +3,8 @@ title: "线程守卫" linkTitle: "线程守卫" weight: 6 aliases: [ -"/documentation/zh-cn/support_classes/", -"/zh-cn/documentation/support_packages/thread_guard/", -"/zh-cn/documentation/webdriver/additional_features/thread_guard/" +"/documentation/support_packages/thread_guard/", +"/documentation/webdriver/additional_features/thread_guard/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.en.md b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.en.md index 220a2da7503a..ac9def894705 100644 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.en.md +++ b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.en.md @@ -9,6 +9,12 @@ aliases: [ "/documentation/en/webdriver/driver_requirements/", "/documentation/getting_started/installing_browser_drivers/", "/documentation/webdriver/getting_started/install_drivers/", +"/documentation/ja/selenium_installation/installing_webdriver_binaries/", +"/documentation/ja/webdriver/driver_requirements/", +"/documentation/pt-br/selenium_installation/installing_webdriver_binaries/", +"/documentation/pt-br/webdriver/driver_requirements/", +"/documentation/zh-cn/selenium_installation/installing_webdriver_binaries/", +"/documentation/zh-cn/webdriver/driver_requirements/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.ja.md b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.ja.md index b8b6e0db3983..dfc2c003701a 100644 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.ja.md +++ b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.ja.md @@ -6,10 +6,8 @@ needsTranslation: true description: > Troubleshooting missing path to driver executable. aliases: [ -"/documentation/ja/selenium_installation/installing_webdriver_binaries/", -"/documentation/ja/webdriver/driver_requirements/", -"/ja/documentation/getting_started/installing_browser_drivers/", -"/ja/documentation/webdriver/getting_started/install_drivers/", +"/documentation/getting_started/installing_browser_drivers/", +"/documentation/webdriver/getting_started/install_drivers/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.pt-br.md b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.pt-br.md index 5f8a0ffcdcda..a5e76eac8336 100644 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.pt-br.md @@ -6,10 +6,8 @@ needsTranslation: true description: > Troubleshooting missing path to driver executable. aliases: [ -"/documentation/pt-br/selenium_installation/installing_webdriver_binaries/", -"/documentation/pt-br/webdriver/driver_requirements/", -"/pt-br/documentation/getting_started/installing_browser_drivers/", -"/pt-br/documentation/webdriver/getting_started/install_drivers/", +"/documentation/getting_started/installing_browser_drivers/", +"/documentation/webdriver/getting_started/install_drivers/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.zh-cn.md b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.zh-cn.md index 208557197327..4fd4573d6a27 100644 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.zh-cn.md @@ -5,10 +5,8 @@ weight: 4 description: > Troubleshooting missing path to driver executable. aliases: [ -"/documentation/zh-cn/selenium_installation/installing_webdriver_binaries/", -"/documentation/zh-cn/webdriver/driver_requirements/", -"/zh-cn/documentation/getting_started/installing_browser_drivers/", -"/zh-cn/documentation/webdriver/getting_started/install_drivers/", +"/documentation/getting_started/installing_browser_drivers/", +"/documentation/webdriver/getting_started/install_drivers/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.ja.md b/website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.ja.md index ee63e678d2b6..899e9c82134f 100644 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.ja.md +++ b/website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.ja.md @@ -5,8 +5,8 @@ weight: 10 description: > Selenium 4に興味がありますか? 最新リリースへのアップグレードに役立つこのガイドを確認してください。 aliases: [ -"/ja/documentation/getting_started/how_to_upgrade_to_selenium_4/", -"/ja/documentation/webdriver/getting_started/upgrade_to_selenium_4/" +"/documentation/getting_started/how_to_upgrade_to_selenium_4/", +"/documentation/webdriver/getting_started/upgrade_to_selenium_4/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.pt-br.md b/website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.pt-br.md index 6a911747a91c..4eec96e2c954 100644 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.pt-br.md @@ -5,8 +5,8 @@ weight: 10 description: > Interessado no Selenium 4? Veja este guia para realizar o upgrade para a ultima versão! aliases: [ -"/pt-br/documentation/getting_started/how_to_upgrade_to_selenium_4/", -"/pt-br/documentation/webdriver/getting_started/upgrade_to_selenium_4/" +"/documentation/getting_started/how_to_upgrade_to_selenium_4/", +"/documentation/webdriver/getting_started/upgrade_to_selenium_4/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.zh-cn.md b/website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.zh-cn.md index 5b52f3bab2ba..e9202a44361d 100644 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/troubleshooting/upgrade_to_selenium_4.zh-cn.md @@ -5,8 +5,8 @@ weight: 10 description: > 对Selenium 4感兴趣? 查看本指南, 它将帮助您升级到最新版本! aliases: [ -"/zh-cn/documentation/getting_started/how_to_upgrade_to_selenium_4/", -"/zh-cn/documentation/webdriver/getting_started/upgrade_to_selenium_4/" +"/documentation/getting_started/how_to_upgrade_to_selenium_4/", +"/documentation/webdriver/getting_started/upgrade_to_selenium_4/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/waits.en.md b/website_and_docs/content/documentation/webdriver/waits.en.md index 65483bddbea4..921c521d32ef 100644 --- a/website_and_docs/content/documentation/webdriver/waits.en.md +++ b/website_and_docs/content/documentation/webdriver/waits.en.md @@ -2,7 +2,7 @@ title: "Waiting Strategies" linkTitle: "Waits" weight: 6 -aliases: ["/documentation/en/webdriver/waits/"] +aliases: ["/documentation/en/webdriver/waits/", "/documentation/ja/webdriver/waits/", "/documentation/pt-br/webdriver/waits/", "/documentation/zh-cn/webdriver/waits/"] --- Perhaps the most common challenge for browser automation is ensuring diff --git a/website_and_docs/content/documentation/webdriver/waits.ja.md b/website_and_docs/content/documentation/webdriver/waits.ja.md index 815a31a9622c..55bce1e806a3 100644 --- a/website_and_docs/content/documentation/webdriver/waits.ja.md +++ b/website_and_docs/content/documentation/webdriver/waits.ja.md @@ -2,7 +2,6 @@ title: "待機" linkTitle: "待機" weight: 6 -aliases: ["/documentation/ja/webdriver/waits/"] --- Perhaps the most common challenge for browser automation is ensuring diff --git a/website_and_docs/content/documentation/webdriver/waits.pt-br.md b/website_and_docs/content/documentation/webdriver/waits.pt-br.md index 88cf8601db61..d32b8ba20f28 100644 --- a/website_and_docs/content/documentation/webdriver/waits.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/waits.pt-br.md @@ -2,7 +2,6 @@ title: "Esperas" linkTitle: "Esperas" weight: 6 -aliases: ["/documentation/pt-br/webdriver/waits/"] --- Perhaps the most common challenge for browser automation is ensuring diff --git a/website_and_docs/content/documentation/webdriver/waits.zh-cn.md b/website_and_docs/content/documentation/webdriver/waits.zh-cn.md index 1baf4c95a229..0d2b3cf95894 100644 --- a/website_and_docs/content/documentation/webdriver/waits.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/waits.zh-cn.md @@ -2,7 +2,6 @@ title: "等待策略" linkTitle: "等待" weight: 6 -aliases: ["/documentation/zh-cn/webdriver/waits/"] --- diff --git a/website_and_docs/go.mod b/website_and_docs/go.mod index 5f2d0c8acfc4..8fec30b28136 100644 --- a/website_and_docs/go.mod +++ b/website_and_docs/go.mod @@ -2,7 +2,4 @@ module github.com/SeleniumHQseleniumhq.github.io go 1.20 -require ( - github.com/google/docsy v0.10.0 // indirect - github.com/google/docsy/dependencies v0.7.2 // indirect -) +require github.com/google/docsy/theme v0.16.0 diff --git a/website_and_docs/go.sum b/website_and_docs/go.sum index 4fe9d7e72bd1..879c6f0509ec 100644 --- a/website_and_docs/go.sum +++ b/website_and_docs/go.sum @@ -1,15 +1,2 @@ -github.com/FortAwesome/Font-Awesome v0.0.0-20230327165841-0698449d50f2/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= -github.com/FortAwesome/Font-Awesome v0.0.0-20240108205627-a1232e345536/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= -github.com/FortAwesome/Font-Awesome v0.0.0-20240402185447-c0f460dca7f7/go.mod h1:IUgezN/MFpCDIlFezw3L8j83oeiIuYoj28Miwr/KUYo= -github.com/google/docsy v0.7.2 h1:KzhFgTd3taF1jq9HDemH3omlUqn9qfdE68sxRyTySpM= -github.com/google/docsy v0.7.2/go.mod h1:ol3w2s1FBUzENdKSAEeNjtuaISUzHYHTw60xv5QH3Dg= -github.com/google/docsy v0.8.0 h1:RgHyKRTo8YwScMThrf01Ky2yCGpUS1hpkspwNv6szT4= -github.com/google/docsy v0.8.0/go.mod h1:FqTNN2T7pWEGW8dc+v5hQ5VF29W5uaL00PQ1LdVw5F8= -github.com/google/docsy v0.9.1 h1:+jqges1YCd+yHeuZ1BUvD8V8mEGVtPxULg5j/vaJ984= -github.com/google/docsy v0.9.1/go.mod h1:saOqKEUOn07Bc0orM/JdIF3VkOanHta9LU5Y53bwN2U= -github.com/google/docsy v0.10.0 h1:6tMDacPwAyRWNCfvsn/9qGOZDQ8b0aRzjRZvnZPY5dg= -github.com/google/docsy v0.10.0/go.mod h1:c0nIAqmRTOuJ01F85U/wJPQtc3Zj9N58Kea9bOT2AJc= -github.com/google/docsy/dependencies v0.7.2 h1:+t5ufoADQAj4XneFphz4A+UU0ICAxmNaRHVWtMYXPSI= -github.com/google/docsy/dependencies v0.7.2/go.mod h1:gihhs5gmgeO+wuoay4FwOzob+jYJVyQbNaQOh788lD4= -github.com/twbs/bootstrap v5.2.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= -github.com/twbs/bootstrap v5.3.3+incompatible/go.mod h1:fZTSrkpSf0/HkL0IIJzvVspTt1r9zuf7XlZau8kpcY0= +github.com/google/docsy/theme v0.16.0 h1:9uV9qEhk7UpJ8KYbSpTPQlq6htH+8hYskedgGZVnNsU= +github.com/google/docsy/theme v0.16.0/go.mod h1:NX/JqXCbZBn9Q2Hj7ez9Xeh9z4XcLiwmDYZXhB4RhRM= diff --git a/website_and_docs/hugo.toml b/website_and_docs/hugo.toml index 921cadbfdf89..54f7c699522f 100644 --- a/website_and_docs/hugo.toml +++ b/website_and_docs/hugo.toml @@ -38,9 +38,13 @@ angledQuotes = false latexDashes = true # Image processing configuration. +# +# The global "quality" key was deprecated in Hugo 0.163.0 in favour of +# per-format settings. It was set to 75, which is Hugo's default for JPEG and +# WebP, so dropping it changes no output. resampleFilter stays: Docsy relies +# on CatmullRom for sharp photographic downscaling. [imaging] resampleFilter = "CatmullRom" -quality = 75 anchor = "smart" [services] @@ -50,45 +54,50 @@ anchor = "smart" # Language configuration +# "label" replaces the deprecated "languageName" key as of Hugo 0.158.0. [languages] [languages.en] title = "Selenium" -languageName ="English" +label = "English" weight = 1 [languages.en.params] description = "Selenium automates browsers. That's it!" [languages.pt-br] title = "Selenium" -languageName ="Português (Brasileiro)" +label = "Português (Brasileiro)" weight = 2 [languages.pt-br.params] description = "Selenium automates browsers. That's it!" [languages.zh-cn] title = "Selenium" -languageName = "中文简体" +label = "中文简体" weight = 3 [languages.zh-cn.params] description = "Selenium automates browsers. That's it!" [languages.ja] title = "Selenium" -languageName = "日本語" +label = "日本語" weight = 4 [languages.ja.params] description = "Selenium automates browsers. That's it!" # Import docsy theme as module +# +# Docsy 0.16.0 moved the theme from the repository root into theme/, so the +# import path is github.com/google/docsy/theme (still tagged as a plain +# release version). The same release dropped the docsy/dependencies module: +# Bootstrap and Font Awesome now arrive as npm packages, pulled into +# package.json by `hugo mod npm pack`. See scripts/README or the Docsy 0.16.0 +# release notes if the vendored asset paths ever need re-checking. [module] proxy = "direct" # uncomment line below for temporary local development of module - #replacements = "github.com/google/docsy -> ../../docsy" + #replacements = "github.com/google/docsy/theme -> ../../docsy/theme" [module.hugoVersion] extended = true - min = "0.73.0" - [[module.imports]] - path = "github.com/google/docsy" - disable = false + min = "0.160.1" [[module.imports]] - path = "github.com/google/docsy/dependencies" + path = "github.com/google/docsy/theme" disable = false [markup] @@ -378,6 +387,12 @@ year = "year" [security] enableInlineShortcodes = false + # Hugo 0.162.0 began denying text/html content files by default. This site + # hand-authors the landing pages for several sections as .html (content/ + # _index.*.html, content/about/_index.html, and others), so the media type + # has to be allowed back in explicitly. The list is deliberately narrow: + # markdown plus the HTML we already publish, rather than the '.*' catch-all. + allowContent = ['^text/markdown$', '^text/html$'] [security.exec] allow = ['^dart-sass-embedded$', '^go$', '^npx$', '^postcss$', '^git$'] osEnv = ['(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$'] diff --git a/website_and_docs/layouts/_partials/favicons.html b/website_and_docs/layouts/_partials/favicons.html new file mode 100644 index 000000000000..a96e1a10362c --- /dev/null +++ b/website_and_docs/layouts/_partials/favicons.html @@ -0,0 +1,24 @@ +{{/* + Selenium's favicon links. + + Docsy 0.16.0 stopped shipping default favicon artwork and its replacement + partial only discovers conventionally named files in the site's static/ root + (static/favicon.ico, static/apple-touch-icon.png, and so on). This site keeps + its icons in static/favicons/ instead, so without this override no icon links + are emitted at all. + + Overriding rather than relocating the files keeps every icon URL exactly as + it is published today. + + Note that until this release the site also linked six android-NxN.png icons + that came from Docsy's own default artwork, not from this repository. Those + files no longer exist, so the Selenium-branded pwa-*.png icons already in + static/favicons/ take their place. +*/ -}} + + + + + + + diff --git a/website_and_docs/layouts/blog/baseof.html b/website_and_docs/layouts/blog/baseof.html index 7b289d49e452..30785782a59f 100644 --- a/website_and_docs/layouts/blog/baseof.html +++ b/website_and_docs/layouts/blog/baseof.html @@ -1,5 +1,5 @@ - + {{ partial "head.html" . }} diff --git a/website_and_docs/layouts/docs/baseof.html b/website_and_docs/layouts/docs/baseof.html index 1a2426db634a..958e1385ffda 100644 --- a/website_and_docs/layouts/docs/baseof.html +++ b/website_and_docs/layouts/docs/baseof.html @@ -1,5 +1,5 @@ - + {{ partial "head.html" . }} diff --git a/website_and_docs/layouts/home.html b/website_and_docs/layouts/home.html index 6f1cc5902387..78d564f669ac 100644 --- a/website_and_docs/layouts/home.html +++ b/website_and_docs/layouts/home.html @@ -2,9 +2,9 @@ {{ with .Content }} {{ . }} -{{ partial "development-level-sponsors.html" (dict "Data" $.Site.Data) }} -{{ partial "selenium-level-sponsors.html" (dict "Data" $.Site.Data) }} -{{ partial "platinum-level-sponsors.html" (dict "Data" $.Site.Data) }} +{{ partial "development-level-sponsors.html" (dict "Data" hugo.Data) }} +{{ partial "selenium-level-sponsors.html" (dict "Data" hugo.Data) }} +{{ partial "platinum-level-sponsors.html" (dict "Data" hugo.Data) }} {{ partial "news-feed.html" (dict "regular_pages" $.Site.RegularPages) }} {{ partial "selenium-container.html" (dict "title" "Support the Selenium Project" "text" "Learn more or view the full list of sponsors." "color_bg" "selenium-cyan" "color_btn" "selenium-white-cyan" "btn_text" "Learn more") }} {{ partial "donate-to-selenium.html" . }} diff --git a/website_and_docs/layouts/meetings/baseof.html b/website_and_docs/layouts/meetings/baseof.html index 77fe23bd3e97..5f5b8f96cfd6 100644 --- a/website_and_docs/layouts/meetings/baseof.html +++ b/website_and_docs/layouts/meetings/baseof.html @@ -1,5 +1,5 @@ - + {{ partial "head.html" . }} diff --git a/website_and_docs/layouts/meetings/single.html b/website_and_docs/layouts/meetings/single.html index 49bb662ad0b2..723601db59b4 100644 --- a/website_and_docs/layouts/meetings/single.html +++ b/website_and_docs/layouts/meetings/single.html @@ -1,3 +1,3 @@ {{ define "main" }} -{{ .Render "content" }} +{{ .Render "_td-content" }} {{ end }} diff --git a/website_and_docs/layouts/partials/footer.html b/website_and_docs/layouts/partials/footer.html index f69a924c294f..c89a82ae036d 100644 --- a/website_and_docs/layouts/partials/footer.html +++ b/website_and_docs/layouts/partials/footer.html @@ -1,7 +1,7 @@ {{/* Avoiding showing extra sections for home page and sponsors */}} {{ if and (ne .Kind "home") (ne .Section "sponsors" ) }} -{{ partial "development-level-sponsors.html" (dict "Data" $.Site.Data) }} -{{ partial "selenium-level-sponsors.html" (dict "Data" $.Site.Data) }} +{{ partial "development-level-sponsors.html" (dict "Data" hugo.Data) }} +{{ partial "selenium-level-sponsors.html" (dict "Data" hugo.Data) }} {{ partial "selenium-container.html" (dict "title" "Support the Selenium Project" "text" "Learn more or view the full list of sponsors." "color_bg" "selenium-cyan" "color_btn" "selenium-white-cyan" "btn_text" "Learn more") }} {{ end }} diff --git a/website_and_docs/layouts/partials/hooks/head-end.html b/website_and_docs/layouts/partials/hooks/head-end.html index 2a239c648f64..e24a513c17d4 100644 --- a/website_and_docs/layouts/partials/hooks/head-end.html +++ b/website_and_docs/layouts/partials/hooks/head-end.html @@ -22,10 +22,10 @@ {{- if .IsTranslated }} {{- range .AllTranslations }} - + {{- end }} {{- range .AllTranslations }} -{{- if eq .Language.Lang "en" }} +{{- if eq .Language.Name "en" }} {{- end }} {{- end }} diff --git a/website_and_docs/layouts/shortcodes/gist.html b/website_and_docs/layouts/shortcodes/gist.html new file mode 100644 index 000000000000..32f545e6909a --- /dev/null +++ b/website_and_docs/layouts/shortcodes/gist.html @@ -0,0 +1,9 @@ +{{- /* + Local replacement for Hugo's built-in "gist" shortcode, which was deprecated + in Hugo 0.143.0 and removed in 0.156.0. Hugo's removal note points sites at + writing their own, so this reproduces the original template verbatim to keep + the three archived blog posts that use it rendering exactly as before. + + Usage: {{< gist USERNAME GIST_ID [FILENAME] >}} +*/ -}} + diff --git a/website_and_docs/layouts/shortcodes/translation-alert.html b/website_and_docs/layouts/shortcodes/translation-alert.html index 8860ce4ddb6d..39e49361c426 100644 --- a/website_and_docs/layouts/shortcodes/translation-alert.html +++ b/website_and_docs/layouts/shortcodes/translation-alert.html @@ -1,4 +1,4 @@ -{{ $language := .Site.Language.LanguageName }} +{{ $language := .Site.Language.Label }} {{ $code := .Site.Language }} {{ $p1 := printf "only the [documentation](/%s/documentation) is translated to %s. The rest of the website is in English." $code $language }} {{ $p2 := printf "We have an official translator for this language, but check our [contribution guidelines](/%s/documentation/about/contributing/) if you'd like to help." $code}} diff --git a/website_and_docs/layouts/sponsors/list.html b/website_and_docs/layouts/sponsors/list.html index 022c25074770..737704ef6f32 100644 --- a/website_and_docs/layouts/sponsors/list.html +++ b/website_and_docs/layouts/sponsors/list.html @@ -5,12 +5,12 @@ {{ .Content }} -{{ partial "development-level-sponsors.html" (dict "Data" $.Site.Data) }} -{{ partial "selenium-level-sponsors.html" (dict "Data" $.Site.Data) }} -{{ partial "platinum-level-sponsors.html" (dict "Data" $.Site.Data) }} -{{ partial "gold-level-sponsors.html" (dict "Data" $.Site.Data) }} -{{ partial "silver-level-sponsors.html" (dict "Data" $.Site.Data) }} -{{ partial "bronze-level-sponsors.html" (dict "Data" $.Site.Data) }} +{{ partial "development-level-sponsors.html" (dict "Data" hugo.Data) }} +{{ partial "selenium-level-sponsors.html" (dict "Data" hugo.Data) }} +{{ partial "platinum-level-sponsors.html" (dict "Data" hugo.Data) }} +{{ partial "gold-level-sponsors.html" (dict "Data" hugo.Data) }} +{{ partial "silver-level-sponsors.html" (dict "Data" hugo.Data) }} +{{ partial "bronze-level-sponsors.html" (dict "Data" hugo.Data) }} {{ partial "open-collective-level-sponsors.html" }}
diff --git a/website_and_docs/package-lock.json b/website_and_docs/package-lock.json index dd0beaf671ed..fec2fa57d880 100644 --- a/website_and_docs/package-lock.json +++ b/website_and_docs/package-lock.json @@ -8,1241 +8,87 @@ "name": "website_source_files", "version": "0.1.0", "license": "Apache-2.0", - "dependencies": { - "autoprefixer": "^10.4.21", - "postcss": "^8.5.14", - "postcss-cli": "^11.0.1" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/autoprefixer": { - "version": "10.5.4", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.5.4.tgz", - "integrity": "sha512-MaU0U/za7N3r6brxD4YB/l4NSrFzLPlANv6wEuQVaIPlD3L4W9rFcQPbL/EilY9BHhHvhfcz3gInDLrEtWT4EA==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/autoprefixer" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "browserslist": "^4.28.6", - "caniuse-lite": "^1.0.30001806", - "fraction.js": "^5.3.4", - "picocolors": "^1.1.1", - "postcss-value-parser": "^4.2.0" - }, - "bin": { - "autoprefixer": "bin/autoprefixer" - }, - "engines": { - "node": "^10 || ^12 || >=14" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/baseline-browser-mapping": { - "version": "2.10.42", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.42.tgz", - "integrity": "sha512-c/jurFrDLyui7o1J86yLkRu4LMsTYcBohveus7/I2Hzdn9KIP2bdJPTue/lR1KH46enoPbD77GKeSYNdyPoD3Q==", - "bin": { - "baseline-browser-mapping": "dist/cli.cjs" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "engines": { - "node": ">=8" - } - }, - "node_modules/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "license": "MIT", - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/browserslist": { - "version": "4.28.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.6.tgz", - "integrity": "sha512-FQBYNK15VMslhLHpA7+n+n1GOlF1kId2xcCg7/j95f24AOF6VDYMNH4mFxF7KuaTdv627faazpOAjFzMrfJOUw==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "baseline-browser-mapping": "^2.10.42", - "caniuse-lite": "^1.0.30001803", - "electron-to-chromium": "^1.5.389", - "node-releases": "^2.0.51", - "update-browserslist-db": "^1.2.3" - }, - "bin": { - "browserslist": "cli.js" - }, - "engines": { - "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" - } - }, - "node_modules/caniuse-lite": { - "version": "1.0.30001806", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001806.tgz", - "integrity": "sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/caniuse-lite" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } + "workspaces": [ + "packages/hugoautogen" ] }, - "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/dependency-graph": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-1.0.0.tgz", - "integrity": "sha512-cW3gggJ28HZ/LExwxP2B++aiKxhJXMSIt9K48FOXQkm+vuG5gyatXnLsONRJdzO/7VfjDIiaOOa/bs4l464Lwg==", - "license": "MIT", - "engines": { - "node": ">=4" - } - }, - "node_modules/electron-to-chromium": { - "version": "1.5.389", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.389.tgz", - "integrity": "sha512-cEto7aeOqBfU1D+c5py5pE+ooscKE75JifxLBdFUZsqAxRS6y7kebtxAZvICszSl05gPjYHDTjY+lXpyGvpJbg==" - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "license": "MIT", + "node_modules/@fortawesome/fontawesome-free": { + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.7.2.tgz", + "integrity": "sha512-JUOtgFW6k9u4Y+xeIaEiLr3+cjoUPiAuLXoyKOJSia6Duzb7pq+A76P9ZdPDoAoxHdHzq6gE9/jKBGXlZT8FbA==", + "license": "(CC-BY-4.0 AND OFL-1.1 AND MIT)", "engines": { "node": ">=6" } }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "node_modules/@popperjs/core": { + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", "license": "MIT", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/fraction.js": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-5.3.4.tgz", - "integrity": "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==", - "engines": { - "node": "*" - }, + "peer": true, "funding": { - "type": "github", - "url": "https://github.com/sponsors/rawify" - } - }, - "node_modules/fs-extra": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", - "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "license": "MIT", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, - "node_modules/lilconfig": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.1.tgz", - "integrity": "sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/antonk52" + "type": "opencollective", + "url": "https://opencollective.com/popperjs" } }, - "node_modules/nanoid": { - "version": "3.3.18", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz", - "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==", + "node_modules/bootstrap": { + "version": "5.3.8", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.8.tgz", + "integrity": "sha512-HP1SZDqaLDPwsNiqRqi5NcP0SSXciX2s9E+RyqJIIqGo+vJeN5AJVM98CXmW/Wux0nQ5L7jeWUdplCEf0Ee+tg==", "funding": [ { "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, - "node_modules/node-releases": { - "version": "2.0.51", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.51.tgz", - "integrity": "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==", - "engines": { - "node": ">=18" - } - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", - "license": "ISC" - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postcss": { - "version": "8.5.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.26.tgz", - "integrity": "sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" + "url": "https://github.com/sponsors/twbs" }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "nanoid": "^3.3.17", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/postcss-cli": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/postcss-cli/-/postcss-cli-11.0.1.tgz", - "integrity": "sha512-0UnkNPSayHKRe/tc2YGW6XnSqqOA9eqpiRMgRlV1S6HdGi16vwJBx7lviARzbV1HpQHqLLRH3o8vTcB0cLc+5g==", - "license": "MIT", - "dependencies": { - "chokidar": "^3.3.0", - "dependency-graph": "^1.0.0", - "fs-extra": "^11.0.0", - "picocolors": "^1.0.0", - "postcss-load-config": "^5.0.0", - "postcss-reporter": "^7.0.0", - "pretty-hrtime": "^1.0.3", - "read-cache": "^1.0.0", - "slash": "^5.0.0", - "tinyglobby": "^0.2.12", - "yargs": "^17.0.0" - }, - "bin": { - "postcss": "index.js" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "postcss": "^8.0.0" - } - }, - "node_modules/postcss-load-config": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-5.0.3.tgz", - "integrity": "sha512-90pBBI5apUVruIEdCxZic93Wm+i9fTrp7TXbgdUCH+/L+2WnfpITSpq5dFU/IPvbv7aNiMlQISpUkAm3fEcvgQ==", - "funding": [ { "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" + "url": "https://opencollective.com/bootstrap" } ], - "dependencies": { - "lilconfig": "^3.0.0", - "yaml": "^2.3.4" - }, - "engines": { - "node": ">= 18" - }, - "peerDependencies": { - "jiti": ">=1.21.0", - "postcss": ">=8.0.9" - }, - "peerDependenciesMeta": { - "jiti": { - "optional": true - }, - "postcss": { - "optional": true - } - } - }, - "node_modules/postcss-reporter": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/postcss-reporter/-/postcss-reporter-7.0.5.tgz", - "integrity": "sha512-glWg7VZBilooZGOFPhN9msJ3FQs19Hie7l5a/eE6WglzYqVeH3ong3ShFcp9kDWJT1g2Y/wd59cocf9XxBtkWA==", - "dependencies": { - "picocolors": "^1.0.0", - "thenby": "^1.3.4" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - "peerDependencies": { - "postcss": "^8.1.0" - } - }, - "node_modules/postcss-value-parser": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", - "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" - }, - "node_modules/pretty-hrtime": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", - "integrity": "sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==", - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/read-cache": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", - "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", - "dependencies": { - "pify": "^2.3.0" - } - }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/slash": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", - "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==", - "license": "MIT", - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/thenby": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/thenby/-/thenby-1.3.4.tgz", - "integrity": "sha512-89Gi5raiWA3QZ4b2ePcEwswC3me9JIg+ToSgtE0JWeCynLnLxNr/f9G+xfo9K+Oj4AFdom8YNJjibIARTJmapQ==" - }, - "node_modules/tinyglobby": { - "version": "0.2.12", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", - "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==", - "license": "MIT", - "dependencies": { - "fdir": "^6.4.3", - "picomatch": "^4.0.2" - }, - "engines": { - "node": ">=12.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/SuperchupuDev" - } - }, - "node_modules/tinyglobby/node_modules/fdir": { - "version": "6.4.3", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", - "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", "license": "MIT", "peerDependencies": { - "picomatch": "^3 || ^4" - }, - "peerDependenciesMeta": { - "picomatch": { - "optional": true - } + "@popperjs/core": "^2.11.8" } }, - "node_modules/tinyglobby/node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "license": "MIT", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "license": "MIT", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/update-browserslist-db": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", - "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - }, - "bin": { - "update-browserslist-db": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" - } - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "engines": { - "node": ">=10" - } + "node_modules/website_and_docs": { + "resolved": "packages/hugoautogen", + "link": true }, - "node_modules/yaml": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", - "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", - "bin": { - "yaml": "bin.mjs" - }, - "engines": { - "node": ">= 14.6" - }, - "funding": { - "url": "https://github.com/sponsors/eemeli" - } - }, - "node_modules/yargs": { - "version": "17.7.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.1.tgz", - "integrity": "sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==", + "packages/hugoautogen": { + "name": "website_and_docs", + "version": "0.1.0", "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" + "@fortawesome/fontawesome-free": "6.7.2", + "bootstrap": "5.3.8" }, - "engines": { - "node": ">=12" - } - }, - "node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "engines": { - "node": ">=12" - } + "devDependencies": {} } }, "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + "@fortawesome/fontawesome-free": { + "version": "6.7.2", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.7.2.tgz", + "integrity": "sha512-JUOtgFW6k9u4Y+xeIaEiLr3+cjoUPiAuLXoyKOJSia6Duzb7pq+A76P9ZdPDoAoxHdHzq6gE9/jKBGXlZT8FbA==" }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } + "@popperjs/core": { + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "peer": true }, - "anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - } + "bootstrap": { + "version": "5.3.8", + "resolved": "https://registry.npmjs.org/bootstrap/-/bootstrap-5.3.8.tgz", + "integrity": "sha512-HP1SZDqaLDPwsNiqRqi5NcP0SSXciX2s9E+RyqJIIqGo+vJeN5AJVM98CXmW/Wux0nQ5L7jeWUdplCEf0Ee+tg==", + "requires": {} }, - "autoprefixer": { - "version": "10.5.4", - "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.5.4.tgz", - "integrity": "sha512-MaU0U/za7N3r6brxD4YB/l4NSrFzLPlANv6wEuQVaIPlD3L4W9rFcQPbL/EilY9BHhHvhfcz3gInDLrEtWT4EA==", + "website_and_docs": { + "version": "file:packages/hugoautogen", "requires": { - "browserslist": "^4.28.6", - "caniuse-lite": "^1.0.30001806", - "fraction.js": "^5.3.4", - "picocolors": "^1.1.1", - "postcss-value-parser": "^4.2.0" + "@fortawesome/fontawesome-free": "6.7.2", + "bootstrap": "5.3.8" } - }, - "baseline-browser-mapping": { - "version": "2.10.42", - "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.42.tgz", - "integrity": "sha512-c/jurFrDLyui7o1J86yLkRu4LMsTYcBohveus7/I2Hzdn9KIP2bdJPTue/lR1KH46enoPbD77GKeSYNdyPoD3Q==" - }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" - }, - "braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "requires": { - "fill-range": "^7.1.1" - } - }, - "browserslist": { - "version": "4.28.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.6.tgz", - "integrity": "sha512-FQBYNK15VMslhLHpA7+n+n1GOlF1kId2xcCg7/j95f24AOF6VDYMNH4mFxF7KuaTdv627faazpOAjFzMrfJOUw==", - "requires": { - "baseline-browser-mapping": "^2.10.42", - "caniuse-lite": "^1.0.30001803", - "electron-to-chromium": "^1.5.389", - "node-releases": "^2.0.51", - "update-browserslist-db": "^1.2.3" - } - }, - "caniuse-lite": { - "version": "1.0.30001806", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001806.tgz", - "integrity": "sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==" - }, - "chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "requires": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "fsevents": "~2.3.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - } - }, - "cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "dependency-graph": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-1.0.0.tgz", - "integrity": "sha512-cW3gggJ28HZ/LExwxP2B++aiKxhJXMSIt9K48FOXQkm+vuG5gyatXnLsONRJdzO/7VfjDIiaOOa/bs4l464Lwg==" - }, - "electron-to-chromium": { - "version": "1.5.389", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.389.tgz", - "integrity": "sha512-cEto7aeOqBfU1D+c5py5pE+ooscKE75JifxLBdFUZsqAxRS6y7kebtxAZvICszSl05gPjYHDTjY+lXpyGvpJbg==" - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==" - }, - "fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "fraction.js": { - "version": "5.3.4", - "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-5.3.4.tgz", - "integrity": "sha512-1X1NTtiJphryn/uLQz3whtY6jK3fTqoE3ohKs0tT+Ujr1W59oopxmoEh7Lu5p6vBaPbgoM0bzveAW4Qi5RyWDQ==" - }, - "fs-extra": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", - "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - } - }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "optional": true - }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" - }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "requires": { - "is-glob": "^4.0.1" - } - }, - "graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "requires": { - "binary-extensions": "^2.0.0" - } - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" - }, - "jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "requires": { - "graceful-fs": "^4.1.6", - "universalify": "^2.0.0" - } - }, - "lilconfig": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.1.tgz", - "integrity": "sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==" - }, - "nanoid": { - "version": "3.3.18", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.18.tgz", - "integrity": "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==" - }, - "node-releases": { - "version": "2.0.51", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.51.tgz", - "integrity": "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==" - }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" - }, - "picocolors": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" - }, - "picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" - }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==" - }, - "postcss": { - "version": "8.5.26", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.26.tgz", - "integrity": "sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ==", - "requires": { - "nanoid": "^3.3.17", - "picocolors": "^1.1.1", - "source-map-js": "^1.2.1" - } - }, - "postcss-cli": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/postcss-cli/-/postcss-cli-11.0.1.tgz", - "integrity": "sha512-0UnkNPSayHKRe/tc2YGW6XnSqqOA9eqpiRMgRlV1S6HdGi16vwJBx7lviARzbV1HpQHqLLRH3o8vTcB0cLc+5g==", - "requires": { - "chokidar": "^3.3.0", - "dependency-graph": "^1.0.0", - "fs-extra": "^11.0.0", - "picocolors": "^1.0.0", - "postcss-load-config": "^5.0.0", - "postcss-reporter": "^7.0.0", - "pretty-hrtime": "^1.0.3", - "read-cache": "^1.0.0", - "slash": "^5.0.0", - "tinyglobby": "^0.2.12", - "yargs": "^17.0.0" - } - }, - "postcss-load-config": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-5.0.3.tgz", - "integrity": "sha512-90pBBI5apUVruIEdCxZic93Wm+i9fTrp7TXbgdUCH+/L+2WnfpITSpq5dFU/IPvbv7aNiMlQISpUkAm3fEcvgQ==", - "requires": { - "lilconfig": "^3.0.0", - "yaml": "^2.3.4" - } - }, - "postcss-reporter": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/postcss-reporter/-/postcss-reporter-7.0.5.tgz", - "integrity": "sha512-glWg7VZBilooZGOFPhN9msJ3FQs19Hie7l5a/eE6WglzYqVeH3ong3ShFcp9kDWJT1g2Y/wd59cocf9XxBtkWA==", - "requires": { - "picocolors": "^1.0.0", - "thenby": "^1.3.4" - } - }, - "postcss-value-parser": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", - "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==" - }, - "pretty-hrtime": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz", - "integrity": "sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==" - }, - "read-cache": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz", - "integrity": "sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==", - "requires": { - "pify": "^2.3.0" - } - }, - "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "requires": { - "picomatch": "^2.2.1" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" - }, - "slash": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-5.1.0.tgz", - "integrity": "sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==" - }, - "source-map-js": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==" - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "thenby": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/thenby/-/thenby-1.3.4.tgz", - "integrity": "sha512-89Gi5raiWA3QZ4b2ePcEwswC3me9JIg+ToSgtE0JWeCynLnLxNr/f9G+xfo9K+Oj4AFdom8YNJjibIARTJmapQ==" - }, - "tinyglobby": { - "version": "0.2.12", - "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.12.tgz", - "integrity": "sha512-qkf4trmKSIiMTs/E63cxH+ojC2unam7rJ0WrauAzpT3ECNTxGRMlaXxVbfxMUC/w0LaYk6jQ4y/nGR9uBO3tww==", - "requires": { - "fdir": "^6.4.3", - "picomatch": "^4.0.2" - }, - "dependencies": { - "fdir": { - "version": "6.4.3", - "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.4.3.tgz", - "integrity": "sha512-PMXmW2y1hDDfTSRc9gaXIuCCRpuoz3Kaz8cUelp3smouvfT632ozg2vrT6lJsHKKOF59YLbOGfAWGUcKEfRMQw==", - "requires": {} - }, - "picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==" - } - } - }, - "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "requires": { - "is-number": "^7.0.0" - } - }, - "universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" - }, - "update-browserslist-db": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", - "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", - "requires": { - "escalade": "^3.2.0", - "picocolors": "^1.1.1" - } - }, - "wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" - }, - "yaml": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", - "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==" - }, - "yargs": { - "version": "17.7.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.1.tgz", - "integrity": "sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==", - "requires": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - } - }, - "yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==" } } } diff --git a/website_and_docs/package.json b/website_and_docs/package.json index 74867abd76c9..2f1c385f3773 100644 --- a/website_and_docs/package.json +++ b/website_and_docs/package.json @@ -8,9 +8,8 @@ }, "author": "SeleniumHQ", "license": "Apache-2.0", - "dependencies": { - "autoprefixer": "^10.4.21", - "postcss": "^8.5.14", - "postcss-cli": "^11.0.1" - } + "dependencies": {}, + "workspaces": [ + "packages/hugoautogen" + ] } diff --git a/website_and_docs/packages/hugoautogen/hugo_packagemeta.json b/website_and_docs/packages/hugoautogen/hugo_packagemeta.json new file mode 100644 index 000000000000..387a6cd17331 --- /dev/null +++ b/website_and_docs/packages/hugoautogen/hugo_packagemeta.json @@ -0,0 +1,10 @@ +{ + "sum": "347aa5c9c5cc3d14", + "dependencySources": { + "dependencies": { + "@fortawesome/fontawesome-free": "github.com/google/docsy/theme", + "bootstrap": "github.com/google/docsy/theme" + }, + "devDependencies": {} + } +} diff --git a/website_and_docs/packages/hugoautogen/package.json b/website_and_docs/packages/hugoautogen/package.json new file mode 100644 index 000000000000..2e616b6ee5cd --- /dev/null +++ b/website_and_docs/packages/hugoautogen/package.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "@fortawesome/fontawesome-free": "6.7.2", + "bootstrap": "5.3.8" + }, + "devDependencies": {}, + "name": "website_and_docs", + "version": "0.1.0" +} From bd3d6f1cc4bb2d4049e48a29d339cc961c21821c Mon Sep 17 00:00:00 2001 From: AutomatedTester Date: Tue, 11 Aug 2026 15:47:47 +0100 Subject: [PATCH 2/2] Remove translated pages whose legacy URLs now resolve to English The previous commit moved 248 legacy /documentation//... aliases onto their English counterparts, because Hugo 0.155.0 no longer lets a translated page publish an alias at the site root. Those URLs kept working but started resolving to the English page rather than the translated one. Rather than keep translated pages that the legacy URLs no longer reach, this removes them and redirects every URL they published: - 209 translated pages deleted (70 ja, 69 pt-br, 70 zh-cn), leaving roughly 54 translated documentation pages per language. - 426 URLs preserved as aliases on the English counterparts, covering each deleted page's own permalink and every alias it carried, so nothing 404s. Permalinks were taken from `hugo list all` rather than derived from file paths. - 97 `ref` shortcodes in the 51 surviving translated pages pointed at deleted pages. Hugo resolves refs within the current language, so they now pass lang="en" and resolve against the English page, matching where those URLs redirect. Only the file and line positions Hugo reported are changed, so refs to translated pages that still exist are untouched. Verified by diffing the built output against the pre-deletion build: every URL still resolves except /ja/documentation/webdriver/ja/documentation/webdriver/browser/, a doubled path produced by an alias that was missing its leading slash. The URL it was meant to create, /ja/documentation/webdriver/browser/, did not exist before this change either. The other 48 differences are noindex print-format copies of the deleted pages. --- .../content/documentation/_index.en.md | 6 +- .../content/documentation/_index.ja.md | 49 - .../content/documentation/_index.pt-br.md | 59 - .../content/documentation/_index.zh-cn.md | 57 - .../content/documentation/about/_index.en.md | 5 +- .../content/documentation/about/_index.ja.md | 19 - .../documentation/about/_index.pt-br.md | 31 - .../documentation/about/_index.zh-cn.md | 19 - .../documentation/about/contributing.en.md | 5 +- .../documentation/about/contributing.ja.md | 191 -- .../documentation/about/contributing.pt-br.md | 229 --- .../documentation/about/contributing.zh-cn.md | 224 -- .../documentation/about/copyright.en.md | 8 +- .../documentation/about/copyright.ja.md | 245 --- .../documentation/about/copyright.pt-br.md | 272 --- .../documentation/about/copyright.zh-cn.md | 266 --- .../content/documentation/about/style.ja.md | 2 +- .../documentation/about/style.pt-br.md | 2 +- .../documentation/about/style.zh-cn.md | 2 +- .../content/documentation/grid/_index.en.md | 5 +- .../content/documentation/grid/_index.ja.md | 19 - .../documentation/grid/_index.pt-br.md | 19 - .../documentation/grid/_index.zh-cn.md | 17 - .../grid/advanced_features/_index.en.md | 6 +- .../grid/advanced_features/_index.ja.md | 7 - .../grid/advanced_features/_index.pt-br.md | 8 - .../grid/advanced_features/_index.zh-cn.md | 10 - .../grid/advanced_features/endpoints.en.md | 8 +- .../grid/advanced_features/endpoints.ja.md | 207 -- .../grid/advanced_features/endpoints.pt-br.md | 184 -- .../grid/advanced_features/endpoints.zh-cn.md | 178 -- .../advanced_features/graphql_support.en.md | 6 +- .../advanced_features/graphql_support.ja.md | 184 -- .../graphql_support.pt-br.md | 183 -- .../graphql_support.zh-cn.md | 184 -- .../advanced_features/observability.en.md | 6 +- .../advanced_features/observability.ja.md | 188 -- .../advanced_features/observability.pt-br.md | 172 -- .../advanced_features/observability.zh-cn.md | 167 -- .../documentation/grid/applicability.en.md | 8 +- .../documentation/grid/applicability.ja.md | 41 - .../documentation/grid/applicability.pt-br.md | 44 - .../documentation/grid/applicability.zh-cn.md | 40 - .../documentation/grid/components.en.md | 8 +- .../documentation/grid/components.ja.md | 103 - .../documentation/grid/components.pt-br.md | 106 - .../documentation/grid/components.zh-cn.md | 71 - .../grid/configuration/_index.en.md | 8 +- .../grid/configuration/_index.ja.md | 10 - .../grid/configuration/_index.pt-br.md | 12 - .../grid/configuration/_index.zh-cn.md | 10 - .../grid/configuration/cli_options.ja.md | 2 +- .../grid/configuration/cli_options.pt-br.md | 2 +- .../grid/configuration/cli_options.zh-cn.md | 2 +- .../grid/configuration/help.en.md | 8 +- .../grid/configuration/help.ja.md | 113 - .../grid/configuration/help.pt-br.md | 116 -- .../grid/configuration/help.zh-cn.md | 120 -- .../grid/configuration/toml_options.ja.md | 2 +- .../grid/configuration/toml_options.pt-br.md | 2 +- .../grid/configuration/toml_options.zh-cn.md | 2 +- .../documentation/grid/getting_started.en.md | 8 +- .../documentation/grid/getting_started.ja.md | 314 --- .../grid/getting_started.pt-br.md | 311 --- .../grid/getting_started.zh-cn.md | 281 --- .../content/documentation/legacy/_index.en.md | 6 +- .../content/documentation/legacy/_index.ja.md | 19 - .../documentation/legacy/_index.pt-br.md | 21 - .../documentation/legacy/_index.zh-cn.md | 10 - .../documentation/legacy/selenium_1.en.md | 8 +- .../documentation/legacy/selenium_1.ja.md | 1509 -------------- .../documentation/legacy/selenium_1.pt-br.md | 1701 --------------- .../documentation/legacy/selenium_1.zh-cn.md | 1825 ----------------- .../legacy/selenium_2/remote_server.en.md | 8 +- .../legacy/selenium_2/remote_server.ja.md | 87 - .../legacy/selenium_2/remote_server.pt-br.md | 104 - .../legacy/selenium_2/remote_server.zh-cn.md | 104 - .../legacy/selenium_2/upgrading.en.md | 8 +- .../legacy/selenium_2/upgrading.ja.md | 223 -- .../legacy/selenium_2/upgrading.pt-br.md | 250 --- .../legacy/selenium_2/upgrading.zh-cn.md | 261 --- .../legacy/selenium_3/grid_3.en.md | 8 +- .../legacy/selenium_3/grid_3.ja.md | 25 - .../legacy/selenium_3/grid_3.pt-br.md | 34 - .../legacy/selenium_3/grid_3.zh-cn.md | 38 - .../legacy/selenium_3/grid_components.en.md | 5 +- .../legacy/selenium_3/grid_components.ja.md | 31 - .../selenium_3/grid_components.pt-br.md | 37 - .../selenium_3/grid_components.zh-cn.md | 31 - .../legacy/selenium_3/grid_setup.en.md | 8 +- .../legacy/selenium_3/grid_setup.ja.md | 203 -- .../legacy/selenium_3/grid_setup.pt-br.md | 256 --- .../legacy/selenium_3/grid_setup.zh-cn.md | 206 -- .../legacy/selenium_ide/_index.en.md | 6 +- .../legacy/selenium_ide/_index.ja.md | 1467 ------------- .../legacy/selenium_ide/_index.pt-br.md | 1726 ---------------- .../legacy/selenium_ide/_index.zh-cn.md | 1749 ---------------- .../legacy/selenium_ide/html_runner.en.md | 8 +- .../legacy/selenium_ide/html_runner.ja.md | 95 - .../legacy/selenium_ide/html_runner.pt-br.md | 99 - .../legacy/selenium_ide/html_runner.zh-cn.md | 94 - .../documentation/overview/_index.en.md | 6 +- .../documentation/overview/_index.ja.md | 32 - .../documentation/overview/_index.pt-br.md | 44 - .../documentation/overview/_index.zh-cn.md | 37 - .../documentation/overview/components.en.md | 8 +- .../documentation/overview/components.ja.md | 52 - .../overview/components.pt-br.md | 77 - .../overview/components.zh-cn.md | 56 - .../documentation/overview/details.en.md | 8 +- .../documentation/overview/details.ja.md | 70 - .../documentation/overview/details.pt-br.md | 95 - .../documentation/overview/details.zh-cn.md | 70 - .../test_practices/design_strategies.ja.md | 4 +- .../test_practices/design_strategies.pt-br.md | 4 +- .../test_practices/design_strategies.zh-cn.md | 4 +- .../test_practices/discouraged/_index.en.md | 8 +- .../test_practices/discouraged/_index.ja.md | 10 - .../discouraged/_index.pt-br.md | 10 - .../discouraged/_index.zh-cn.md | 12 - .../test_practices/discouraged/captchas.en.md | 8 +- .../test_practices/discouraged/captchas.ja.md | 15 - .../discouraged/captchas.pt-br.md | 16 - .../discouraged/captchas.zh-cn.md | 14 - .../discouraged/file_downloads.en.md | 8 +- .../discouraged/file_downloads.ja.md | 18 - .../discouraged/file_downloads.pt-br.md | 24 - .../discouraged/file_downloads.zh-cn.md | 19 - .../gmail_email_and_facebook_logins.en.md | 8 +- .../gmail_email_and_facebook_logins.ja.md | 21 - .../gmail_email_and_facebook_logins.pt-br.md | 35 - .../gmail_email_and_facebook_logins.zh-cn.md | 32 - .../discouraged/http_response_codes.en.md | 8 +- .../discouraged/http_response_codes.ja.md | 31 - .../discouraged/http_response_codes.pt-br.md | 57 - .../discouraged/http_response_codes.zh-cn.md | 33 - .../discouraged/link_spidering.en.md | 8 +- .../discouraged/link_spidering.ja.md | 15 - .../discouraged/link_spidering.pt-br.md | 25 - .../discouraged/link_spidering.zh-cn.md | 20 - .../discouraged/performance_testing.en.md | 8 +- .../discouraged/performance_testing.ja.md | 25 - .../discouraged/performance_testing.pt-br.md | 52 - .../discouraged/performance_testing.zh-cn.md | 37 - .../discouraged/test_dependency.en.md | 8 +- .../discouraged/test_dependency.ja.md | 12 - .../discouraged/test_dependency.pt-br.md | 13 - .../discouraged/test_dependency.zh-cn.md | 10 - .../two_factor_authentication.en.md | 8 +- .../two_factor_authentication.ja.md | 25 - .../two_factor_authentication.pt-br.md | 24 - .../two_factor_authentication.zh-cn.md | 19 - .../test_practices/encouraged/_index.en.md | 8 +- .../test_practices/encouraged/_index.ja.md | 23 - .../test_practices/encouraged/_index.pt-br.md | 30 - .../test_practices/encouraged/_index.zh-cn.md | 24 - .../encouraged/avoid_sharing_state.en.md | 8 +- .../encouraged/avoid_sharing_state.ja.md | 25 - .../encouraged/avoid_sharing_state.pt-br.md | 27 - .../encouraged/avoid_sharing_state.zh-cn.md | 25 - .../consider_using_a_fluent_api.en.md | 8 +- .../consider_using_a_fluent_api.ja.md | 50 - .../consider_using_a_fluent_api.pt-br.md | 52 - .../consider_using_a_fluent_api.zh-cn.md | 48 - .../encouraged/domain_specific_language.en.md | 8 +- .../encouraged/domain_specific_language.ja.md | 88 - .../domain_specific_language.pt-br.md | 99 - .../domain_specific_language.zh-cn.md | 95 - .../encouraged/fresh_browser_per_test.en.md | 8 +- .../encouraged/fresh_browser_per_test.ja.md | 17 - .../fresh_browser_per_test.pt-br.md | 18 - .../fresh_browser_per_test.zh-cn.md | 18 - .../generating_application_state.en.md | 8 +- .../generating_application_state.ja.md | 18 - .../generating_application_state.pt-br.md | 19 - .../generating_application_state.zh-cn.md | 18 - .../encouraged/improved_reporting.en.md | 8 +- .../encouraged/improved_reporting.ja.md | 27 - .../encouraged/improved_reporting.pt-br.md | 28 - .../encouraged/improved_reporting.zh-cn.md | 28 - .../encouraged/mock_external_services.en.md | 8 +- .../encouraged/mock_external_services.ja.md | 10 - .../mock_external_services.pt-br.md | 11 - .../mock_external_services.zh-cn.md | 11 - .../encouraged/page_object_models.en.md | 8 +- .../encouraged/page_object_models.ja.md | 497 ----- .../encouraged/page_object_models.pt-br.md | 497 ----- .../encouraged/page_object_models.zh-cn.md | 517 ----- .../encouraged/test_independency.en.md | 8 +- .../encouraged/test_independency.ja.md | 19 - .../encouraged/test_independency.pt-br.md | 25 - .../encouraged/test_independency.zh-cn.md | 23 - .../test_practices/overview.en.md | 8 +- .../test_practices/overview.ja.md | 370 ---- .../test_practices/overview.pt-br.md | 431 ---- .../test_practices/overview.zh-cn.md | 378 ---- .../test_practices/testing_types.en.md | 8 +- .../test_practices/testing_types.ja.md | 97 - .../test_practices/testing_types.pt-br.md | 143 -- .../test_practices/testing_types.zh-cn.md | 127 -- .../documentation/webdriver/_index.en.md | 6 +- .../documentation/webdriver/_index.ja.md | 20 - .../documentation/webdriver/_index.pt-br.md | 22 - .../documentation/webdriver/_index.zh-cn.md | 22 - .../webdriver/actions_api/_index.ja.md | 2 +- .../webdriver/actions_api/_index.pt-br.md | 2 +- .../webdriver/actions_api/_index.zh-cn.md | 4 +- .../webdriver/actions_api/keyboard.en.md | 8 +- .../webdriver/actions_api/keyboard.ja.md | 169 -- .../webdriver/actions_api/keyboard.pt-br.md | 162 -- .../webdriver/actions_api/keyboard.zh-cn.md | 171 -- .../webdriver/actions_api/mouse.en.md | 8 +- .../webdriver/actions_api/mouse.ja.md | 353 ---- .../webdriver/actions_api/mouse.pt-br.md | 336 --- .../webdriver/actions_api/mouse.zh-cn.md | 345 ---- .../webdriver/bidi/logging.en.md | 6 +- .../webdriver/bidi/logging.ja.md | 118 -- .../webdriver/bidi/logging.zh-cn.md | 120 -- .../documentation/webdriver/bidi/script.en.md | 8 +- .../documentation/webdriver/bidi/script.ja.md | 21 - .../webdriver/bidi/script.pt-br.md | 21 - .../webdriver/bidi/script.zh-cn.md | 21 - .../webdriver/bidi/w3c/_index.en.md | 8 +- .../webdriver/bidi/w3c/_index.ja.md | 24 - .../webdriver/bidi/w3c/_index.pt-br.md | 24 - .../webdriver/bidi/w3c/_index.zh-cn.md | 15 - .../webdriver/browsers/_index.en.md | 14 +- .../webdriver/browsers/_index.ja.md | 12 - .../webdriver/browsers/_index.pt-br.md | 12 - .../webdriver/browsers/_index.zh-cn.md | 12 - .../webdriver/browsers/chrome.ja.md | 4 +- .../webdriver/browsers/chrome.pt-br.md | 4 +- .../webdriver/browsers/chrome.zh-cn.md | 4 +- .../webdriver/browsers/edge.ja.md | 2 +- .../webdriver/browsers/edge.pt-br.md | 2 +- .../webdriver/browsers/edge.zh-cn.md | 2 +- .../webdriver/browsers/firefox.ja.md | 8 +- .../webdriver/browsers/firefox.pt-br.md | 8 +- .../webdriver/browsers/firefox.zh-cn.md | 8 +- .../webdriver/browsers/safari.ja.md | 2 +- .../webdriver/browsers/safari.pt-br.md | 2 +- .../webdriver/browsers/safari.zh-cn.md | 2 +- .../webdriver/drivers/_index.ja.md | 4 +- .../webdriver/drivers/_index.pt-br.md | 4 +- .../webdriver/drivers/_index.zh-cn.md | 4 +- .../webdriver/drivers/options.en.md | 23 +- .../webdriver/drivers/options.ja.md | 568 ----- .../webdriver/drivers/options.pt-br.md | 610 ------ .../webdriver/drivers/options.zh-cn.md | 598 ------ .../webdriver/drivers/remote_webdriver.en.md | 8 +- .../webdriver/drivers/remote_webdriver.ja.md | 273 --- .../drivers/remote_webdriver.pt-br.md | 297 --- .../drivers/remote_webdriver.zh-cn.md | 302 --- .../webdriver/elements/_index.en.md | 8 +- .../webdriver/elements/_index.ja.md | 12 - .../webdriver/elements/_index.pt-br.md | 14 - .../webdriver/elements/_index.zh-cn.md | 12 - .../webdriver/elements/finders.en.md | 8 +- .../webdriver/elements/finders.ja.md | 475 ----- .../webdriver/elements/finders.pt-br.md | 479 ----- .../webdriver/elements/finders.zh-cn.md | 485 ----- .../webdriver/elements/interactions.ja.md | 2 +- .../webdriver/elements/interactions.pt-br.md | 2 +- .../webdriver/elements/interactions.zh-cn.md | 2 +- .../webdriver/elements/locators.ja.md | 4 +- .../webdriver/elements/locators.pt-br.md | 4 +- .../webdriver/elements/locators.zh-cn.md | 4 +- .../webdriver/getting_started/_index.en.md | 8 +- .../webdriver/getting_started/_index.ja.md | 33 - .../webdriver/getting_started/_index.pt-br.md | 43 - .../webdriver/getting_started/_index.zh-cn.md | 38 - .../getting_started/first_script.ja.md | 12 +- .../getting_started/first_script.pt-br.md | 8 +- .../getting_started/first_script.zh-cn.md | 12 +- .../getting_started/install_library.en.md | 11 +- .../getting_started/install_library.ja.md | 161 -- .../getting_started/install_library.pt-br.md | 166 -- .../getting_started/install_library.zh-cn.md | 163 -- .../getting_started/using_selenium.ja.md | 4 +- .../getting_started/using_selenium.pt-br.md | 4 +- .../getting_started/using_selenium.zh-cn.md | 4 +- .../webdriver/interactions/_index.en.md | 10 +- .../webdriver/interactions/_index.ja.md | 58 - .../webdriver/interactions/_index.pt-br.md | 59 - .../webdriver/interactions/_index.zh-cn.md | 57 - .../webdriver/interactions/alerts.en.md | 11 +- .../webdriver/interactions/alerts.ja.md | 176 -- .../webdriver/interactions/alerts.pt-br.md | 169 -- .../webdriver/interactions/alerts.zh-cn.md | 171 -- .../webdriver/interactions/cookies.en.md | 11 +- .../webdriver/interactions/cookies.ja.md | 321 --- .../webdriver/interactions/cookies.pt-br.md | 325 --- .../webdriver/interactions/cookies.zh-cn.md | 327 --- .../webdriver/interactions/print_page.en.md | 5 +- .../webdriver/interactions/print_page.ja.md | 220 -- .../interactions/print_page.pt-br.md | 220 -- .../interactions/print_page.zh-cn.md | 216 -- .../webdriver/support_features/_index.en.md | 11 +- .../webdriver/support_features/_index.ja.md | 15 - .../support_features/_index.pt-br.md | 15 - .../support_features/_index.zh-cn.md | 15 - .../webdriver/support_features/colors.en.md | 11 +- .../webdriver/support_features/colors.ja.md | 228 -- .../support_features/colors.pt-br.md | 238 --- .../support_features/colors.zh-cn.md | 225 -- .../expected_conditions.ja.md | 2 +- .../expected_conditions.pt-br.md | 2 +- .../expected_conditions.zh-cn.md | 2 +- .../support_features/select_lists.en.md | 14 +- .../support_features/select_lists.ja.md | 276 --- .../support_features/select_lists.pt-br.md | 277 --- .../support_features/select_lists.zh-cn.md | 281 --- .../support_features/thread_guard.en.md | 11 +- .../support_features/thread_guard.ja.md | 62 - .../support_features/thread_guard.pt-br.md | 64 - .../support_features/thread_guard.zh-cn.md | 67 - .../webdriver/troubleshooting/_index.ja.md | 4 +- .../webdriver/troubleshooting/_index.pt-br.md | 4 +- .../webdriver/troubleshooting/_index.zh-cn.md | 4 +- .../troubleshooting/errors/_index.ja.md | 4 +- .../troubleshooting/errors/_index.pt-br.md | 4 +- .../troubleshooting/errors/_index.zh-cn.md | 4 +- .../errors/driver_location.en.md | 11 +- .../errors/driver_location.ja.md | 158 -- .../errors/driver_location.pt-br.md | 158 -- .../errors/driver_location.zh-cn.md | 158 -- .../documentation/webdriver/waits.en.md | 6 +- .../documentation/webdriver/waits.ja.md | 158 -- .../documentation/webdriver/waits.pt-br.md | 158 -- .../documentation/webdriver/waits.zh-cn.md | 179 -- 330 files changed, 600 insertions(+), 34320 deletions(-) delete mode 100755 website_and_docs/content/documentation/_index.ja.md delete mode 100755 website_and_docs/content/documentation/_index.pt-br.md delete mode 100755 website_and_docs/content/documentation/_index.zh-cn.md delete mode 100644 website_and_docs/content/documentation/about/_index.ja.md delete mode 100644 website_and_docs/content/documentation/about/_index.pt-br.md delete mode 100644 website_and_docs/content/documentation/about/_index.zh-cn.md delete mode 100644 website_and_docs/content/documentation/about/contributing.ja.md delete mode 100644 website_and_docs/content/documentation/about/contributing.pt-br.md delete mode 100644 website_and_docs/content/documentation/about/contributing.zh-cn.md delete mode 100644 website_and_docs/content/documentation/about/copyright.ja.md delete mode 100644 website_and_docs/content/documentation/about/copyright.pt-br.md delete mode 100644 website_and_docs/content/documentation/about/copyright.zh-cn.md delete mode 100644 website_and_docs/content/documentation/grid/_index.ja.md delete mode 100644 website_and_docs/content/documentation/grid/_index.pt-br.md delete mode 100644 website_and_docs/content/documentation/grid/_index.zh-cn.md delete mode 100644 website_and_docs/content/documentation/grid/advanced_features/_index.ja.md delete mode 100644 website_and_docs/content/documentation/grid/advanced_features/_index.pt-br.md delete mode 100644 website_and_docs/content/documentation/grid/advanced_features/_index.zh-cn.md delete mode 100644 website_and_docs/content/documentation/grid/advanced_features/endpoints.ja.md delete mode 100644 website_and_docs/content/documentation/grid/advanced_features/endpoints.pt-br.md delete mode 100644 website_and_docs/content/documentation/grid/advanced_features/endpoints.zh-cn.md delete mode 100644 website_and_docs/content/documentation/grid/advanced_features/graphql_support.ja.md delete mode 100644 website_and_docs/content/documentation/grid/advanced_features/graphql_support.pt-br.md delete mode 100644 website_and_docs/content/documentation/grid/advanced_features/graphql_support.zh-cn.md delete mode 100644 website_and_docs/content/documentation/grid/advanced_features/observability.ja.md delete mode 100644 website_and_docs/content/documentation/grid/advanced_features/observability.pt-br.md delete mode 100644 website_and_docs/content/documentation/grid/advanced_features/observability.zh-cn.md delete mode 100644 website_and_docs/content/documentation/grid/applicability.ja.md delete mode 100644 website_and_docs/content/documentation/grid/applicability.pt-br.md delete mode 100644 website_and_docs/content/documentation/grid/applicability.zh-cn.md delete mode 100644 website_and_docs/content/documentation/grid/components.ja.md delete mode 100644 website_and_docs/content/documentation/grid/components.pt-br.md delete mode 100644 website_and_docs/content/documentation/grid/components.zh-cn.md delete mode 100644 website_and_docs/content/documentation/grid/configuration/_index.ja.md delete mode 100644 website_and_docs/content/documentation/grid/configuration/_index.pt-br.md delete mode 100644 website_and_docs/content/documentation/grid/configuration/_index.zh-cn.md delete mode 100644 website_and_docs/content/documentation/grid/configuration/help.ja.md delete mode 100644 website_and_docs/content/documentation/grid/configuration/help.pt-br.md delete mode 100644 website_and_docs/content/documentation/grid/configuration/help.zh-cn.md delete mode 100644 website_and_docs/content/documentation/grid/getting_started.ja.md delete mode 100644 website_and_docs/content/documentation/grid/getting_started.pt-br.md delete mode 100644 website_and_docs/content/documentation/grid/getting_started.zh-cn.md delete mode 100644 website_and_docs/content/documentation/legacy/_index.ja.md delete mode 100644 website_and_docs/content/documentation/legacy/_index.pt-br.md delete mode 100644 website_and_docs/content/documentation/legacy/_index.zh-cn.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_1.ja.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_1.pt-br.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_1.zh-cn.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_2/remote_server.ja.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_2/remote_server.pt-br.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_2/remote_server.zh-cn.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_2/upgrading.ja.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_2/upgrading.pt-br.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_2/upgrading.zh-cn.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_3/grid_3.ja.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_3/grid_3.pt-br.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_3/grid_3.zh-cn.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_3/grid_components.ja.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_3/grid_components.pt-br.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_3/grid_components.zh-cn.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_3/grid_setup.ja.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_3/grid_setup.pt-br.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_3/grid_setup.zh-cn.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_ide/_index.ja.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_ide/_index.pt-br.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_ide/_index.zh-cn.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_ide/html_runner.ja.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_ide/html_runner.pt-br.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_ide/html_runner.zh-cn.md delete mode 100644 website_and_docs/content/documentation/overview/_index.ja.md delete mode 100644 website_and_docs/content/documentation/overview/_index.pt-br.md delete mode 100644 website_and_docs/content/documentation/overview/_index.zh-cn.md delete mode 100644 website_and_docs/content/documentation/overview/components.ja.md delete mode 100644 website_and_docs/content/documentation/overview/components.pt-br.md delete mode 100644 website_and_docs/content/documentation/overview/components.zh-cn.md delete mode 100644 website_and_docs/content/documentation/overview/details.ja.md delete mode 100644 website_and_docs/content/documentation/overview/details.pt-br.md delete mode 100644 website_and_docs/content/documentation/overview/details.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/_index.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/_index.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/_index.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/captchas.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/captchas.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/captchas.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/file_downloads.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/file_downloads.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/file_downloads.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/link_spidering.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/link_spidering.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/link_spidering.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/performance_testing.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/performance_testing.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/performance_testing.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/test_dependency.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/test_dependency.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/test_dependency.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/_index.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/_index.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/_index.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/page_object_models.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/page_object_models.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/test_independency.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/test_independency.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/encouraged/test_independency.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/overview.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/overview.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/overview.zh-cn.md delete mode 100644 website_and_docs/content/documentation/test_practices/testing_types.ja.md delete mode 100644 website_and_docs/content/documentation/test_practices/testing_types.pt-br.md delete mode 100644 website_and_docs/content/documentation/test_practices/testing_types.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/_index.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/_index.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/_index.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/actions_api/keyboard.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/actions_api/keyboard.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/actions_api/keyboard.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/actions_api/mouse.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/actions_api/mouse.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/actions_api/mouse.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/bidi/logging.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/bidi/logging.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/bidi/script.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/bidi/script.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/bidi/script.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/bidi/w3c/_index.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/bidi/w3c/_index.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/bidi/w3c/_index.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/browsers/_index.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/browsers/_index.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/browsers/_index.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/drivers/options.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/elements/_index.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/elements/_index.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/elements/_index.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/elements/finders.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/elements/finders.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/elements/finders.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/getting_started/_index.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/getting_started/_index.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/getting_started/_index.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/getting_started/install_library.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/getting_started/install_library.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/getting_started/install_library.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/interactions/_index.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/interactions/_index.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/interactions/_index.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/interactions/alerts.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/interactions/alerts.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/interactions/alerts.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/interactions/cookies.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/interactions/cookies.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/interactions/cookies.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/interactions/print_page.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/interactions/print_page.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/support_features/_index.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/support_features/_index.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/support_features/_index.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/support_features/colors.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/support_features/colors.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/support_features/colors.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/support_features/select_lists.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/support_features/select_lists.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/support_features/select_lists.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/support_features/thread_guard.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/support_features/thread_guard.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/support_features/thread_guard.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.zh-cn.md delete mode 100644 website_and_docs/content/documentation/webdriver/waits.ja.md delete mode 100644 website_and_docs/content/documentation/webdriver/waits.pt-br.md delete mode 100644 website_and_docs/content/documentation/webdriver/waits.zh-cn.md diff --git a/website_and_docs/content/documentation/_index.en.md b/website_and_docs/content/documentation/_index.en.md index 5761aea43668..6403594cebd2 100755 --- a/website_and_docs/content/documentation/_index.en.md +++ b/website_and_docs/content/documentation/_index.en.md @@ -3,7 +3,11 @@ title: "The Selenium Browser Automation Project" linkTitle: "Documentation" cascade: - type: docs -aliases: ["/documentation/en/", "/documentation/ja/", "/documentation/pt-br/", "/documentation/zh-cn/"] +aliases: ["/documentation/en/", "/documentation/ja/", "/documentation/pt-br/", "/documentation/zh-cn/", +"/ja/documentation/", +"/pt-br/documentation/", +"/zh-cn/documentation/" +] --- Selenium is an umbrella project for a range of tools and libraries diff --git a/website_and_docs/content/documentation/_index.ja.md b/website_and_docs/content/documentation/_index.ja.md deleted file mode 100755 index 105d684c6bb2..000000000000 --- a/website_and_docs/content/documentation/_index.ja.md +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: "Seleniumブラウザー自動化プロジェクト" -linkTitle: "ドキュメント" -cascade: -- type: docs ---- - -Seleniumは、ブラウザーの自動化を可能にし、それを支えるさまざまなツールとライブラリーから成るプロジェクトです。 - -Seleniumは、ユーザーとブラウザーのやり取りをエミュレートするための拡張機能、ブラウザーの割り当てを拡張するための分散サーバー、そしてすべての主要なブラウザーで -同じコードを使えるようにする[W3C WebDriver仕様](//www.w3.org/TR/webdriver/)の実装のためのインフラストラクチャーを提供します。 - -このプロジェクトは、何千時間もの時間を費やしてきたボランティアの貢献者によって支えられています。 -ソースコードは、誰でも利用し、楽しみ、改善できるよう[自由に公開]({{< ref "copyright.md#license" >}})されています。 - -Seleniumは、ウェブプラットフォームの自動化について開かれた議論を促進するために、ブラウザーベンダー、エンジニア、愛好家を結び付けています。 -このプロジェクトは、コミュニティを育成・支援するために[年次カンファレンス](//seleniumconf.com/)を開催しています。 - -Seleniumの中核となる[WebDriver]({{< ref "webdriver.md" >}})は、多くのブラウザーで同じように実行できる命令セットを記述するためのインターフェースです。 -以下に、最も簡単な例の一つを示します。 - - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/hello/HelloSelenium.java" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/hello/hello_selenium.py" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/HelloSelenium.cs" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/hello/hello_selenium.rb" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/hello/helloSelenium.js" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/hello/HelloSelenium.kt" >}} -{{< /tab >}} -{{< /tabpane >}} - - - -[概要]({{< ref "overview" >}})を参照して、プロジェクトのさまざまなコンポーネントを確認し、Seleniumが適切なツールであるかどうかを判断してください。 - -[入門]({{< ref "webdriver/getting_started" >}})に進み、Seleniumのインストール方法と、テスト自動化ツールとして適切に使用する方法を学びましょう。 -また、このような単純なテストをスケールさせ、複数のブラウザーと複数のオペレーティングシステムを使用する大規模な分散環境で実行する方法も確認してください。 diff --git a/website_and_docs/content/documentation/_index.pt-br.md b/website_and_docs/content/documentation/_index.pt-br.md deleted file mode 100755 index 22e9ab933a5a..000000000000 --- a/website_and_docs/content/documentation/_index.pt-br.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: "O Projeto Selenium de Automação de Navegadores" -linkTitle: "Documentação" -cascade: -- type: docs ---- - -Selenium é um projeto que abrange uma variedade de ferramentas e bibliotecas -que permitem e suportam a automação de navegadores da web. - -Ele fornece extensões para emular a interação do usuário com os navegadores, -um servidor de distribuição para escalonar a alocação do navegador, -e a infraestrutura para implementações da [Especificação W3C WebDriver](//www.w3.org/TR/webdriver/) -que permite escrever código intercambiável para todos os principais navegadores da web. - -Este projeto é possível graças a colaboradores voluntários -que dedicam milhares de horas de seu próprio tempo, -e disponibilizaram o código-fonte [disponível gratuitamente]({{< ref "copyright.md#license" >}}) -para qualquer um usar, aproveitar e melhorar. - -Selenium reúne criadores de navegadores, engenheiros e entusiastas -para promover uma discussão aberta sobre a automação da plataforma da web. -O projeto organiza [uma conferência anual](//seleniumconf.com/) -para ensinar e nutrir a comunidade. - -No núcleo do Selenium está [WebDriver]({{< ref "webdriver.md" >}}), -uma interface para escrever conjuntos de instruções que podem ser executados alternadamente em muitos -navegadores. Aqui está uma das instruções mais simples que você pode fazer: - - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/hello/HelloSelenium.java" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/hello/hello_selenium.py" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/HelloSelenium.cs" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/hello/hello_selenium.rb" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/hello/helloSelenium.js" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/hello/HelloSelenium.kt" >}} -{{< /tab >}} -{{< /tabpane >}} - - -Consulte a [Visão Geral]({{< ref "overview" >}}) para verificar os diferentes componentes do projeto -e decidir se o Selenium é a ferramenta certa para você. - -Você deve continuar no Guia de [Introdução]({{< ref "webdriver/getting_started" >}}) -para entender como instalar o Selenium e usá-lo com sucesso como uma -ferramenta de automação de teste e dimensionar testes simples como esse para serem executados em ambientes grandes -e distribuídos em vários navegadores e em vários sistemas operacionais diferentes. diff --git a/website_and_docs/content/documentation/_index.zh-cn.md b/website_and_docs/content/documentation/_index.zh-cn.md deleted file mode 100755 index 6fec87c31413..000000000000 --- a/website_and_docs/content/documentation/_index.zh-cn.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: "Selenium 浏览器自动化项目" -linkTitle: "文档" -cascade: -- type: docs ---- - -Selenium 是支持 web 浏览器自动化的一系列工具和库的综合项目。 - -它提供了扩展来模拟用户与浏览器的交互,用于扩展浏览器分配的分发服务器, -以及用于实现 [W3C WebDriver 规范](//www.w3.org/TR/webdriver/) 的基础结构, -该 规范 允许您为所有主要 Web 浏览器编写可互换的代码。 - -这个项目是由志愿者贡献者实现的,他们投入了自己数千小时的时间, -并使源代码[免费提供]({{< ref "copyright.md#许可" >}})给任何人使用、享受和改进。 - -Selenium 汇集了浏览器供应商,工程师和爱好者,以进一步围绕 Web 平台自动化进行公开讨论。 -该项目组织了[一次年度会议](//seleniumconf.com/),以教学和培养社区。 - -Selenium 的核心是 [WebDriver]({{< ref "webdriver.md" >}}),这是一个编写指令集的接口,可以在许多浏览器中互换运行。 -这里有一个最简单的说明: - - - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/hello/HelloSelenium.java" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/hello/hello_selenium.py" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/HelloSelenium.cs" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/hello/hello_selenium.rb" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/hello/helloSelenium.js" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/hello/HelloSelenium.kt" >}} -{{< /tab >}} -{{< /tabpane >}} - - -请参阅 [概述]({{< ref "overview" >}}) -以检查不同的项目组件, -并确定Selenium是否适合您. - -您应该继续阅读 [开始]({{< ref "webdriver/getting_started" >}}), -以了解如何安装Selenium, -将其成功用作测试自动化工具, -并将这样的简单测试扩展为 -在大型分布式环境, -以及不同操作系统上的环境上 -运行多个浏览器的测试. diff --git a/website_and_docs/content/documentation/about/_index.en.md b/website_and_docs/content/documentation/about/_index.en.md index d35e04f369cb..ee997d6902ed 100644 --- a/website_and_docs/content/documentation/about/_index.en.md +++ b/website_and_docs/content/documentation/about/_index.en.md @@ -11,7 +11,10 @@ aliases: "/documentation/pt-br/introduction/about_this_documentation/", "/documentation/pt-br/front_matter/", "/documentation/zh-cn/introduction/about_this_documentation/", -"/documentation/zh-cn/front_matter/" +"/documentation/zh-cn/front_matter/", +"/ja/documentation/about/", +"/pt-br/documentation/about/", +"/zh-cn/documentation/about/" ] --- diff --git a/website_and_docs/content/documentation/about/_index.ja.md b/website_and_docs/content/documentation/about/_index.ja.md deleted file mode 100644 index a6aeb103b40a..000000000000 --- a/website_and_docs/content/documentation/about/_index.ja.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "このドキュメントについて" -linkTitle: "このドキュメントについて" -weight: 16 - ---- - - -これらのドキュメントは、コード自体と同様に、Seleniumコミュニティ内のボランティアによって100%維持されます。 -当初から多くの人が使用してきましたが、多くの人が短期間しか使用しておらず、新しいユーザーのオンボーディングエクスペリエンスの改善に時間を割いてきました。 - -ドキュメントに問題がある場合、知りたいです! -問題を伝える最良の方法は、[https://github.com/seleniumhq/seleniumhq.github.io/issues](//github.com/seleniumhq/seleniumhq.github.io/issues)にアクセスし、問題が既に報告されているかどうかを検索することです。 -そうでない場合は、自由に開いてください! - -コミュニティの多くのメンバーは、[Libera.chat](https://libera.chat/) で _#selenium_ Liberaチャンネルに頻繁にアクセスします。 -気軽に立ち寄って質問してください。 -これらのドキュメントで役立つと思われるヘルプを受け取った場合は、必ず貢献を追加してください。 -これらのドキュメントを更新することはできますが、通常のコミッター以外から投稿を受け取ると、誰にとってもずっと簡単になります。 diff --git a/website_and_docs/content/documentation/about/_index.pt-br.md b/website_and_docs/content/documentation/about/_index.pt-br.md deleted file mode 100644 index 1791487dbbad..000000000000 --- a/website_and_docs/content/documentation/about/_index.pt-br.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: "Sobre esta documentação" -linkTitle: "Sobre esta documentação" -weight: 16 - ---- - -Essa documentação, como o próprio código, são mantidos 100% por voluntários -dentro da comunidade Selenium. -Muitos têm usado desde o seu início, -mas muitos mais o usam há pouco tempo, -e dedicaram seu tempo para ajudar a melhorar a experiência de integração -para novos usuários. - -Se houver algum problema com a documentação, queremos saber! -A melhor maneira de comunicar um problema é visitar -[https://github.com/seleniumhq/seleniumhq.github.io/issues](//github.com/seleniumhq/seleniumhq.github.io/issues) -e pesquise se o problema já foi ou não arquivado. -Se não, fique à vontade para abrir um! - -Muitos membros da comunidade frequentam -o canal Libera _#selenium_ em [Libera.chat](https://libera.chat/). -Sinta-se à vontade para entrar e fazer perguntas -e se você receber ajuda que você acha que poderia ser útil nessa documentação, -certifique-se de adicionar sua contribuição! -Podemos atualizar essa documentação, -mas é muito mais fácil para todos quando recebemos contribuições -de fora dos committers normais. - - - diff --git a/website_and_docs/content/documentation/about/_index.zh-cn.md b/website_and_docs/content/documentation/about/_index.zh-cn.md deleted file mode 100644 index 0cb993855663..000000000000 --- a/website_and_docs/content/documentation/about/_index.zh-cn.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "关于这个文档" -linkTitle: "关于这个文档" -weight: 16 - ---- - -这些文档,就像代码本身一样,100% 由 Selenium 社区中的志愿者维护。 -许多人自成立以来一直在使用它,但更多人只是在短时间内使用它,并且已经花时间帮助改善新用户的入门体验。 - -如果文档有问题,我们想知道! -沟通问题的最佳方式是访问 -[https://github.com/seleniumhq/seleniumhq.github.io/issues](//github.com/seleniumhq/seleniumhq.github.io/issues) -并搜索问题是否已经提交。 -如果没有,请随意打开一个! - -社区的许多成员经常光顾 [Libera.chat](https://libera.chat/) 的 _#selenium_ Libera 频道。 -请随时来访并提出问题,如果您得到了您认为在这些文档中可能有用的帮助,请务必添加您的贡献! -我们可以更新这些文档,但当我们从普通提交者之外获得贡献时,对每个人来说都容易得多。 diff --git a/website_and_docs/content/documentation/about/contributing.en.md b/website_and_docs/content/documentation/about/contributing.en.md index 65cb2e9a0e26..6ffb3860b9b5 100644 --- a/website_and_docs/content/documentation/about/contributing.en.md +++ b/website_and_docs/content/documentation/about/contributing.en.md @@ -12,7 +12,10 @@ aliases: [ "/documentation/pt-br/contributing/", "/documentation/pt-br/front_matter/typographical_conventions/", "/documentation/zh-cn/contributing/", -"/documentation/zh-cn/front_matter/typographical_conventions/" +"/documentation/zh-cn/front_matter/typographical_conventions/", +"/ja/documentation/about/contributing/", +"/pt-br/documentation/about/contributing/", +"/zh-cn/documentation/about/contributing/" ] --- diff --git a/website_and_docs/content/documentation/about/contributing.ja.md b/website_and_docs/content/documentation/about/contributing.ja.md deleted file mode 100644 index bd3b14050b45..000000000000 --- a/website_and_docs/content/documentation/about/contributing.ja.md +++ /dev/null @@ -1,191 +0,0 @@ ---- -title: "Seleniumのサイトとドキュメントに貢献する" -linkTitle: "Seleniumのサイトとドキュメントに貢献する" -weight: 2 -description: >- - Seleniumのドキュメントとコード例を改善するための情報 ---- - -Seleniumは大きなソフトウェアプロジェクトであり、そのサイトとドキュメントは、物事の仕組みを理解し、その可能性を活用する効果的な方法を学ぶための鍵となります。 - -このプロジェクトには、Seleniumのサイトとドキュメントの両方が含まれています。これは、Seleniumを効果的に使用する方法、Seleniumに参加する方法、およびSeleniumに貢献する方法に関する最新情報を提供するための継続的な取り組みです(特定のリリースを対象としていません)。 - -サイトおよびドキュメントへの貢献は、以下のセクションで説明されているプロセスに従います。 - ---- - -Seleniumプロジェクトは、皆様からのコントリビューションを歓迎します。 -お手伝いをいただくには、いくつかの方法があります: - -## イシュー報告 - -新しい問題を報告したり、既存の問題についてコメントしたりするときは、議論がSeleniumソフトウェア、そのサイトおよび/またはドキュメントに関する具体的な技術問題に関連していることを確認してください。 - -Seleniumのすべてのコンポーネントは、時間の経過とともに非常に速く変化するため、ドキュメントが古くなる可能性があります。 -このようなケースを見つけた場合には、遠慮なくイシューを作成してください。 -また、ドキュメントを最新の状態に更新する方法をご存知でしたら、関連する変更を含むプルリクエストを送ってしてください。 - -見つかったものが問題であるかどうかわからない場合、[https://selenium.dev/support](https://selenium.dev/support)に記載されているコミュニケーション手段にて質問してください。 - - -## 何を手伝うか - -### 例の作成 - -追加が必要な例には、次のマークが付いています: {{% badge-code %}} - -すべてのコード例をCIで実行できるようにし、サイト上のすべてのコードをコピー&ペーストして実行できることを確認したいと考えています。そのため、コードを[examplesディレクトリ](https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/)の適切な場所に配置します。 -ドキュメントの各ページは各言語のテストファイルに関連しており、命名規則に従う必要があります。 -例えば、このページ(https://www.selenium.dev/documentation/webdriver/browsers/chrome/)の例は以下のファイルに追加されています: -* `"/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java"` -* `"/examples/python/tests/browsers/test_chrome.py"` -* `"/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs"` -* `"/examples/ruby/spec/browsers/chrome_spec.rb"` -* `"/examples/javascript/test/browser/chromeSpecificCaps.spec.js"` - -各例はそれぞれ独自のテストが必要です。理想的には、各テストにはコードが意図したとおりに動作することを確認するアサーションが含まれています。 -コードを適切なファイル内の独自のテストにコピーしたら、Markdownファイルで参照する必要があります。 - -例えば、Rubyのtabは次のようになります: - - {{}} - {{}} - {{}} - -末尾の行番号は、実際に表示される項目を表すコードの行のみを表します。 -ユーザーがより多くのコンテキストを必要とする場合、GitHubページへのリンクをクリックすると完全なコンテキストが表示されます。 - -ページにテストを追加する場合は、Markdownファイル内の他のすべての行番号が正しいことを確認してください。 -ページの先頭にテストを追加すると、そのファイルの行番号を持つドキュメント内のすべての参照が更新されます。 - -コード例では、シナリオを示すために関連するWebサイトやWebページが必要になる場合があります。 -例が安定して動作するように、https://www.selenium.dev/selenium/web/ で利用できるテスト用Webページを使用することを推奨します。 - -最後に、CIでテストがパスすることを確認してください。 - - -### 例の移動 - -移動が必要な例には、次のマークが付いています: {{% badge-examples %}} - -[例の作成](#例の作成)セクションのすべてが適用されますが、1つ追加があります。 - -tabには`text=true`を含めてください。デフォルトではtabはコード用にフォーマットされるため、Markdownや他のショートコードステートメント(`gh-codeblock`など)を使用するには、`text=true`を宣言する必要があります。 -ほとんどの例では、`tabpane`が`text=true`を宣言しますが、tabの一部にコード例が含まれている場合、`tabpane`はそれを指定できず、自動コードフォーマットが不要なtabでは指定する必要があります。 - - -## 貢献 - -Seleniumプロジェクトは新しいコントリビュータを歓迎します。目立った価値ある貢献を継続的に行った個人は _コミッター_ -として認められ、プロジェクトへのコミットアクセス権が与えられます。 - -本ガイドでは、貢献のプロセスについて説明します。 - -### ステップ 1: フォーク - -[GitHub](https://github.com/seleniumhq/seleniumhq.github.io)上のプロジェクトをフォークし、コピーをローカルにチェックアウトしてください。 - -```shell -% git clone git@github.com:seleniumhq/seleniumhq.github.io.git -% cd seleniumhq.github.io -``` - -#### 依存関係: Hugo - -[Hugo](https://gohugo.io/)と[Docsyテーマ](https://www.docsy.dev/)を使用してサイトの構築とレンダリングをしています。このサイトの作業をするには、Hugoバイナリの“拡張”Sass/SCSSバージョンが必要です。Hugo 0.164.0の使用を推奨します。 - -[Docsyのインストール手順](https://www.docsy.dev/docs/getting-started/#install-hugo)に従ってください。 - -### ステップ 2: ブランチの作成 - -フィーチャーブランチを作成し、ハックを開始します。: - -```shell -% git checkout -b my-feature-branch -``` - -我々はHEADベースの開発を行っています。つまり、全ての変更はtrunkブランチ上に直接適用されます。 - -### ステップ 3: 変更を加える - -リポジトリにはサイトとドキュメントが含まれています。 変更を加える前に、submoduleを初期化し、必要な依存関係をインストールしてください(以下のコマンドを参照)。サイトに変更を加えるには、`website_and_docs` ディレクトリで作業してください。変更のライブプレビューを確認するには、サイトのルートディレクトリで `hugo server`を実行してください。 - -```shell -% git submodule update --init --recursive -% cd website_and_docs -% hugo server -``` - -寄稿に関する規約の詳細については、 [スタイルガイド]({{< ref "style.md" >}}) をご覧ください。 - -### ステップ 4: コミット - -まず、gitがあなたの名前とメールアドレスを知っていることを確認してください: - -```shell -% git config --global user.name 'Santa Claus' -% git config --global user.email 'santa@example.com' -``` - -**適切なコミットメッセージを書くことは重要です。**コミットメッセージには、変更された内容、理由、修正されたイシューへの参照(ある場合)を記述する必要があります。作成するときは、次のガイドラインに従ってください。: - -1. 最初の行は約50文字以下で、変更の簡単な説明を含める必要があります。 -2. 2行目は空白のままにします。 -3. 他のすべての行を72列で折り返します。 -4. `Fixes #N`を含めてください。ここでは _N_ がこのコミットで修正したイシュー番号です(存在する場合)。 - -適切なコミットメッセージは次のようになります: - -```text -explain commit normatively in one line - -Body of commit message is a few lines of text, explaining things -in more detail, possibly giving some background about the issue -being fixed, etc. - -The body of the commit message can be several paragraphs, and -please do proper word-wrap and keep columns shorter than about -72 characters or so. That way `git log` will show things -nicely even when it is indented. - -Fixes #141 -``` - -最初の行は`git shortlog`や`git log --oneline`を実行した際に他人が最初に目にするため、意味のあるものでなければなりません。 - -### ステップ 5: リベース - -あなたの作業を同期するため、(`git merge`ではなく)`git rebase`を時々実行してください。 - -```shell -% git fetch origin -% git rebase origin/trunk -``` - -### ステップ 6: テスト - -あなたの変更が何も問題を起こしていないことを確認するため、常に忘れずに[ローカルサーバーの実行](https://gohugo.io/getting-started/usage/#livereload)を行ってください。 - -### ステップ 7: プッシュ - -```shell -% git push origin my-feature-branch -``` - -https://github.com/yourusername/seleniumhq.github.io.git を開き、 _Pull Request_ を押し、 -フォームを入力してください。 **CLAに署名したことを示してください**。 -CLAに署名するには、 -[cla-assistant.io/SeleniumHQ/seleniumhq.github.io](https://cla-assistant.io/SeleniumHQ/seleniumhq.github.io) -にアクセスし、ページ上の"Sign in with GitHub to agree"ボタンをクリックしてください。 - -プルリクエストは通常数日以内にレビューされます。対応すべきコメントがある場合は、新しく(できれば -[fixups](http://git-scm.com/docs/git-commit)で)コミットし、同じブランチにプッシュしてください。 - -### ステップ 8: 統合 - -コードレビューが完了すると、コミッターがPRを取得し、リポジトリのtrunkブランチに統合します。 -マスターブランチで履歴を線形に保持するのが好きなので、通常はブランチの履歴をスカッシュしてリベースします。 - -## コミュニケーション - -プロジェクトのコントリビューターおよびコミュニティ全体と交流する方法については、全て https://selenium.dev/support で詳細が記載されています。 diff --git a/website_and_docs/content/documentation/about/contributing.pt-br.md b/website_and_docs/content/documentation/about/contributing.pt-br.md deleted file mode 100644 index dbf6782cabf2..000000000000 --- a/website_and_docs/content/documentation/about/contributing.pt-br.md +++ /dev/null @@ -1,229 +0,0 @@ ---- -title: "Contribuindo com o Site e Documentação do Selenium" -linkTitle: "Contribuindo com o Site e Documentação do Selenium" -weight: 2 -requiresTranslation: true -description: >- - Informações em como melhorar a documentação e exemplos de código para Selenium. ---- - -Selenium é um grande projeto de software, seu site e documentação são fundamentais -para entender como as coisas funcionam e aprender maneiras eficazes de explorar -seu potencial. - -Este projeto contém o site e a documentação do Selenium. Isto é -um esforço contínuo (não direcionado a nenhuma versão específica) para fornecer -informações atualizadas sobre como usar o Selenium de forma eficaz, como se -envolver e como contribuir para o Selenium. - -As contribuições para o site e documentação seguem o processo descrito na seção abaixo sobre contribuições. - ---- - -O projeto Selenium recebe contribuições de todos. Há um -várias maneiras de ajudar: - -## Reportar um problema - -Ao relatar um novo problema ou comentar sobre problemas existentes, por favor -certifique-se de que as discussões estão relacionadas a questões técnicas concretas sobre o -software Selenium, seu site e/ou documentação. - -Todos os componentes do Selenium mudam bastante rápido ao longo do tempo, então este -pode fazer com que a documentação fique desatualizada. Se você observar que este é -o caso, como mencionado, não hesite em criar um problema para isso. -Também pode ser possível que você saiba como atualizar a -documentação, então, envie-nos um Pull Request com a -alteração. - -Se você não tem certeza se o que encontrou é um problema ou não, -pergunte através dos canais de comunicação descritos em -https://selenium.dev/support. - - -## What to Help With - -### Creating Examples - -Examples that need to be added are marked with: {{% badge-code %}} - -We want to be able to run all of our code examples in the CI to ensure that people can copy and paste and -execute everything on the site. So we put the code where it belongs in the -[examples directory](https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/). -Each page in the documentation correlates to a test file in each of the languages, and should follow naming conventions. -For instance examples for this page https://www.selenium.dev/documentation/webdriver/browsers/chrome/ get added in these -files: -* `"/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java"` -* `"/examples/python/tests/browsers/test_chrome.py"` -* `"/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs"` -* `"/examples/ruby/spec/browsers/chrome_spec.rb"` -* `"/examples/javascript/test/browser/chromeSpecificCaps.spec.js"` - -Each example should get its own test. Ideally each test has an assertion that verifies the code works as intended. -Once the code is copied to its own test in the proper file, it needs to be referenced in the markdown file. - -For example, the tab in Ruby would look like this: - - {{}} - {{}} - {{}} - -The line numbers at the end represent only the line or lines of code that actually represent the item being displayed. -If a user wants more context, they can click the link to the GitHub page that will show the full context. - -Make sure that if you add a test to the page that all the other line numbers in the markdown file are still -correct. Adding a test at the top of a page means updating every single reference in the documentation that has a line -number for that file. - -Code examples may need a relevant website or web page to demonstrate the scenario. To ensure examples consistently work, -it is recommended to use the test web pages available at https://www.selenium.dev/selenium/web/. - -Finally, make sure that the tests pass in the CI. - - -### Moving Examples - -Examples that need to be moved are marked with: {{% badge-examples %}} - -Everything from the [Creating Examples](#creating-examples) section applies, with one addition. - -Make sure the tab includes `text=true`. By default, the tabs get formatted -for code, so to use markdown or other shortcode statements (like `gh-codeblock`) it needs to be declared as text. -For most examples, the `tabpane` declares the `text=true`, but if some of the tabs have code examples, the `tabpane` -cannot specify it, and it must be specified in the tabs that do not need automatic code formatting. - - -## Contribuições - -O projeto Selenium dá as boas-vindas a novos contribuidores. Indivíduos fazendo -contribuições significativas e valiosas ao longo do tempo são transformados em _Committers_ -e recebem acesso de commit ao projeto. - -Este guia irá guiá-lo através do processo de contribuição. - -### Passo 1: Fork - -Faça um fork do projeto [no GitHub](https://github.com/seleniumhq/seleniumhq.github.io) -e faça checkout na sua cópia localmente. - -```shell -% git clone git@github.com:seleniumhq/seleniumhq.github.io.git -% cd seleniumhq.github.io -``` - -#### Dependências: Hugo - -Usamos [Hugo](https://gohugo.io/) e [Docsy theme](https://www.docsy.dev/) -para criar e gerar o website. Você vai necessitar de usar a versão "extended" -Sass/SCSS do binário Hugo. Recomendamos a versão 0.164.0 . - -Por favor siga as instruções do Docsy [Install Hugo](https://www.docsy.dev/docs/getting-started/#install-hugo) - - -### Passo 2: Branch - -Crie uma branch e comece a hackear: - -```shell -% git checkout -b my-feature-branch -``` - -Praticamos o desenvolvimento baseado em HEAD, o que significa que todas as mudanças são aplicadas -diretamente no topo do `dev`. - -### Passo 3: Faça mudanças - -O repositório contém o website e a documentação. Antes de começar a alterar coisas, por favor -veja o resto dos passos para preparar as dependências e sub-módulos (veja os comandos abaixo). - -Para fazer alterações ao website, trabalha na pasta `website_and_docs`. Para ver uma previsão -do aspecto do website, execute `hugo server` a partir da raíz do projecto. - -```shell -% git submodule update --init --recursive -% cd website_and_docs -% hugo server -``` - -See [Style Guide]({{< ref "style.md" >}}) for more information on our conventions for contribution - -### Passo 4: Commit - -Primeiro, certifique-se de que o git saiba seu nome e endereço de e-mail: - -```shell -% git config --global user.name 'Santa Claus' -% git config --global user.email 'santa@example.com' -``` - -**Escrever boas mensagens de commit é importante.** Uma mensagem de confirmação -deve descrever o que mudou, por que e conter referência de problemas corrigidos (se -houver). Siga estas diretrizes ao escrever um: - -1. A primeira linha deve ter cerca de 50 caracteres ou menos e conter uma - breve da descrição da mudança. -2. Mantenha a segunda linha em branco. -3. Quebra todas as outras linhas em 72 colunas. -4. Incluir `Fixes # N`, onde _N_ é o número do problema que o commit corrige - se houver. - -Uma boa mensagem de confirmação pode ter a seguinte aparência: - -```text -explain commit normatively in one line - -Body of commit message is a few lines of text, explaining things -in more detail, possibly giving some background about the issue -being fixed, etc. - -The body of the commit message can be several paragraphs, and -please do proper word-wrap and keep columns shorter than about -72 characters or so. That way `git log` will show things -nicely even when it is indented. - -Fixes #141 -``` - -A primeira linha deve ser significativa, pois é o que as pessoas veem quando -executam `git shortlog` ou` git log --oneline`. - -### Passo 5: Rebase - -Use `git rebase` (não `git merge`) para sincronizar seu trabalho de tempos em tempos. - -```shell -% git fetch origin -% git rebase origin/trunk -``` - -### Passo 6: Teste - -Lembre-se sempre de [executar o servidor local](https://gohugo.io/getting-started/usage/#livereload), -com isso, você pode ter certeza de que suas alterações não prejudicaram nada. - -### Passo 7: Push - -```shell -% git push origin my-feature-branch -``` - -Acesse https://github.com/yourusername/seleniumhq.github.io.git e -clique em _Pull Request_ e preencha o formulário. **Por favor indique -que você assinou o CLA**. Para assinar o CLA, visite -[cla-assistant.io/SeleniumHQ/seleniumhq.github.io](https://cla-assistant.io/SeleniumHQ/seleniumhq.github.io) -e clique no botão "Sign in with GitHub to agree" na página. - -Os Pull Requests geralmente são revisados em alguns dias. Se houver -comentários a abordar, aplique suas alterações em novos commits (de preferência -[fixups](http://git-scm.com/docs/git-commit)) e envie para a mesma -branch. - -### Passo 8: Integração - -Quando a revisão do código for concluída, um committer integrará seu PR no branch de tronco do repositório. Porque gostamos de manter um -histórico linear no `trunk`, nós normalmente iremos dar Squash & Rebase no histórico da sua branch. - -## Comunicação - -Todos os detalhes sobre como se comunicar com os colaboradores do projeto -e a comunidade em geral podem ser encontrados em https://selenium.dev/support diff --git a/website_and_docs/content/documentation/about/contributing.zh-cn.md b/website_and_docs/content/documentation/about/contributing.zh-cn.md deleted file mode 100644 index 2a10a8984f11..000000000000 --- a/website_and_docs/content/documentation/about/contributing.zh-cn.md +++ /dev/null @@ -1,224 +0,0 @@ ---- -title: 为 Selenium 站点和文档做贡献 -linkTitle: 贡献 -weight: 2 -description: >- - 有关改进 Selenium 文档和代码示例的信息 ---- - -Selenium 是一个大型软件项目, -其网站和文档是了解事情如何工作以及学习有效利用其潜力的关键。 - -该项目包含 Selenium 的网站和文档。 -这是一项持续的工作(不针对任何特定版本), -用于提供有效使用 Selenium、 -如何参与以及如何为 Selenium 做出贡献的更新信息。 - -对网站和文档的贡献遵循以下部分中有关贡献的描述。 - ---- - -Selenium 项目欢迎每一个人的贡献。 -您可以通过多种方式提供帮助: - -## 上报问题 - -在报告新问题或评论现有问题时, -请确保讨论与 Selenium 的软件、 -其站点与文档的具体技术问题相关。 - -随着时间的推移,所有 Selenium 组件的变化都非常快, -因此这可能会导致文档过时。 -如前所述,如果您遇到这种情况,请不要犹豫,为此创建一个 issue。 -您也可能知道如何更新文档,因此请向我们发送包含相关更改的 Pull Request。 - -如果不确定所发现的问题是否存在,请通过 -https://selenium.dev/support 中描述的沟通渠道进行询问。 - - -## 帮助事项 - -### 创建示例 - -需要添加的示例会用:{{% badge-code %}} 标记 - -我们希望能够在 CI 中运行所有代码示例,以确保人们可以复制和粘贴并 -执行网站上的所有内容。因此,我们将代码放在 -[示例目录](https://github.com/SeleniumHQ/seleniumhq.github.io/blob/trunk/examples/)中。 -文档中的每个页面对应每种语言的一个测试文件,并应遵循命名约定。 -例如,此页面 https://www.selenium.dev/documentation/webdriver/browsers/chrome/ 的示例会添加到这些 -文件中: -* `"/examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java"` -* `"/examples/python/tests/browsers/test_chrome.py"` -* `"/examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs"` -* `"/examples/ruby/spec/browsers/chrome_spec.rb"` -* `"/examples/javascript/test/browser/chromeSpecificCaps.spec.js"` - -每个示例应有自己的测试。理想情况下,每个测试都有一个断言来验证代码按预期工作。 -一旦代码被复制到正确文件中的测试中,就需要在 markdown 文件中引用它。 - -例如,Ruby 中的 tab 看起来像这样: - - {{}} - {{}} - {{}} - -末尾的行号仅代表实际显示项的代码行。 -如果用户需要更多上下文,可以点击链接到 GitHub 页面,该页面将显示完整上下文。 - -确保如果在页面中添加测试,markdown 文件中的所有其他行号仍然 -正确。在页面顶部添加测试意味着更新文档中所有引用该文件行号的地方。 - -代码示例可能需要相关的网站或网页来演示场景。为确保示例始终有效, -建议使用 https://www.selenium.dev/selenium/web/ 中提供的测试网页。 - -最后,确保测试在 CI 中通过。 - - -### 迁移示例 - -需要迁移的示例会用:{{% badge-examples %}} 标记 - -[创建示例](#创建示例) 部分的所有内容都适用,但有一处补充。 - -确保 tab 包含 `text=true`。默认情况下,tab 会格式化为 -代码,因此要使用 markdown 或其他 shortcode 语句(如 `gh-codeblock`),需要将其声明为文本。 -对于大多数示例,`tabpane` 会声明 `text=true`,但如果某些 tab 包含代码示例,则 `tabpane` -不能指定它,而必须在不需要自动代码格式化的 tab 中指定。 - - -## 贡献机制 - -Selenium 项目欢迎新的贡献者。 -随时间做出重大且有价值的贡献的个人将成为 _提交者_,并获得对该项目的提交权限。 - -本指南将指导您完成贡献的过程。 - -### 步骤 1:Fork - -在 [GitHub](https://github.com/seleniumhq/seleniumhq.github.io) 上 Fork 本项目, -并检出到您的本地 - - -```shell -% git clone git@github.com:seleniumhq/seleniumhq.github.io.git -% cd seleniumhq.github.io -``` - -#### 依赖:Hugo - -我们使用 [Hugo](https://gohugo.io/) 和 [Docsy theme](https://www.docsy.dev/) -用于构建和渲染本网站。 -您需要 Hugo "extended" 扩展的 Sass/SCSS 版本用于这个网站。 -我们推荐使用 Hugo 0.164.0。 - -请参考来自 Docsy 的说明 -[安装 Hugo](https://www.docsy.dev/docs/getting-started/#install-hugo)。 - -### 步骤 2:分支 - -创建一个功能分支并开始工作: - -```shell -% git checkout -b my-feature-branch -``` - -我们实践基于 HEAD 的开发模式,这意味着所有更改都直接应用在 `trunk` 之上。 - -### 步骤 3:做出改变 - -本仓库包含站点和文档。 -要对网站进行更改, -请使用 `website_and_docs` 目录。 -要查看更改的实时预览, -请在站点的根目录上运行 `hugo server`。 - -```shell -% cd website_and_docs -% hugo server -``` - -项目会从 GitHub 加载代码,如果代码已更新但 -未在预览中反映出来,您可以不使用缓存运行 hugo:`hugo server --ignoreCache` - -请参阅 [样式指南]({{< ref "style.md" >}}), -以了解更多关于我们约定的信息 - -### 步骤 4:提交 - -首先确保 git 知道您的姓名和电子邮件地址: - -```shell -% git config --global user.name 'Santa Claus' -% git config --global user.email 'santa@example.com' -``` - -**编写良好的提交信息很重要。** -提交信息应描述更改的内容, -原因以及引用已修复的问题(如果有)。 -撰写时应遵循以下规则: - -1. 第一行应大约 50 个字符或更少,并包含对该更改的简短说明。 -2. 保持第二行空白。 -3. 在所有 72 列处换行。 -4. 包括 `Fixes #N`,其中 _N_ 是提交修复的问题编号(如果有)。 - -一个好的提交信息可能看起来像这样: - -```text -explain commit normatively in one line - -Body of commit message is a few lines of text, explaining things -in more detail, possibly giving some background about the issue -being fixed, etc. - -The body of the commit message can be several paragraphs, and -please do proper word-wrap and keep columns shorter than about -72 characters or so. That way `git log` will show things -nicely even when it is indented. - -Fixes #141 -``` - -第一行必须有意义,因为这是人们在运行 `git shortlog` 或 `git log --oneline` 时看到的内容。 - -### 步骤 5:Rebase - -使用 `git rebase`(而非 `git merge`)不时地同步您的工作。 - -```shell -% git fetch origin -% git rebase origin/trunk -``` - -### 步骤 6:测试 - -永远记住要[运行本地服务](https://gohugo.io/getting-started/usage/#livereload), -这样做可以确保您的更改没有破坏任何事情。 - -### 步骤 7:Push - -```shell -% git push origin my-feature-branch -``` - -访问 https://github.com/yourusername/seleniumhq.github.io.git -并点击 _Pull Request_ 以及填写表格。 -**请明确您已经签署了 CLA**。要签署 CLA,请访问 -[cla-assistant.io/SeleniumHQ/seleniumhq.github.io](https://cla-assistant.io/SeleniumHQ/seleniumhq.github.io) -并点击页面上的 "Sign in with GitHub to agree" 按钮。 - -Pull Request 通常会在几天内进行审核。 -如果有评论要解决,请在新提交(最好是[修正](http://git-scm.com/docs/git-commit))中应用您的更改, -然后 push 到同一分支。 - -### 步骤 8:集成 - -代码审查完成后,提交者将获取您的 PR 并将其集成到项目的 trunk 分支中。 -因为我们希望在 trunk 分支上保持线性历史记录, -所以我们通常会 squash 并 rebase 您的分支历史记录。 - -## 沟通 - -有关如何与项目贡献者和整个社区进行沟通的所有详细信息, -可以在 https://selenium.dev/support 找到。 diff --git a/website_and_docs/content/documentation/about/copyright.en.md b/website_and_docs/content/documentation/about/copyright.en.md index 18979363fb5e..c04ec1b04d4d 100644 --- a/website_and_docs/content/documentation/about/copyright.en.md +++ b/website_and_docs/content/documentation/about/copyright.en.md @@ -10,7 +10,13 @@ aliases: [ "/documentation/about/copyright_and_attributions", "/documentation/ja/front_matter/copyright_and_attributions/", "/documentation/pt-br/front_matter/copyright_and_attributions/", -"/documentation/zh-cn/front_matter/copyright_and_attributions/" +"/documentation/zh-cn/front_matter/copyright_and_attributions/", +"/ja/documentation/about/copyright/", +"/ja/documentation/about/copyright_and_attributions", +"/pt-br/documentation/about/copyright/", +"/pt-br/documentation/about/copyright_and_attributions", +"/zh-cn/documentation/about/copyright/", +"/zh-cn/documentation/about/copyright_and_attributions" ] --- diff --git a/website_and_docs/content/documentation/about/copyright.ja.md b/website_and_docs/content/documentation/about/copyright.ja.md deleted file mode 100644 index b227e7e4cc07..000000000000 --- a/website_and_docs/content/documentation/about/copyright.ja.md +++ /dev/null @@ -1,245 +0,0 @@ ---- -title: "著作権と帰属" -linkTitle: "著作権と帰属" -weight: 1 -description: > - Selenium に関連するさまざまなプロジェクトの著作権、貢献、 - およびすべての帰属について。 -aliases: [ -"/documentation/about/copyright_and_attributions" -] ---- - -## **Seleniumのドキュメント** - -このドキュメントをできるだけ完全かつ正確にするためにあらゆる努力が払われましたが、 -保証または適合性は暗示されていません。 -提供される情報は「現状のまま」です。 -著者および出版社は、本書に含まれる情報から生じる損失または損害に関して、 -いかなる個人または団体に対しても責任を負わないものとします。 -ここに含まれる情報の使用に関して、特許責任は一切負いません。 - -## 帰属 - -### 謝辞 - -#### [Selenium メインリポジトリ](//github.com/SeleniumHQ/selenium/) - -{{% gh-contributors "https://api.github.com/repos/seleniumhq/selenium/contributors?per_page=100" %}} - -#### [Selenium IDE](//github.com/SeleniumHQ/selenium-ide/) - -{{% gh-contributors "https://api.github.com/repos/seleniumhq/selenium-ide/contributors?per_page=100" %}} - -#### [Docker Selenium](//github.com/SeleniumHQ/docker-selenium/) - -{{% gh-contributors "https://api.github.com/repos/seleniumhq/docker-selenium/contributors?per_page=100" %}} - -#### [Selenium Web サイトとドキュメント](//github.com/SeleniumHQ/seleniumhq.github.io/) - -{{% gh-contributors "https://api.github.com/repos/seleniumhq/seleniumhq.github.io/contributors?per_page=100" %}} - -#### [以前の Selenium Web サイト](//github.com/SeleniumHQ/www.seleniumhq.org/) - -{{% gh-contributors "https://api.github.com/repos/seleniumhq/www.seleniumhq.org/contributors?per_page=100" %}} - -#### [以前のドキュメント書き直しプロジェクト](//github.com/SeleniumHQ/docs/) - -{{% gh-contributors "https://api.github.com/repos/seleniumhq/docs/contributors?per_page=100" %}} - - -## Seleniumドキュメントプロジェクトで使用されるサードパーティソフトウェア - -| ソフトウェア | バージョン | ライセンス | -| -------- | ------- | ------- | -| [Hugo](//gohugo.io/) | v0.110.0 | [Apache 2.0](//gohugo.io/about/license/) | -| [Docsy](//github.com/google/docsy/) | --- | [Apache 2.0](//github.com/google/docsy/blob/master/LICENSE) | - - -## ライセンス - -Seleniumプロジェクトから作成されたすべてのコードとドキュメントは、 -Apache 2.0ライセンスに基づいてライセンスされており、 -[Software Freedom Conservancy](//sfconservancy.org/) に著作権があります。 - -ライセンスは便宜上ここに含まれていますが、 -[Apache FoundationのWebサイト](//apache.org/licenses/LICENSE-2.0.html)でも見つけることができます。 - -```markdown - Apache License - Version 2.0, 2004年1月 - http://www.apache.org/licenses/ - - 使用、複製、および頒布に関する条項 - - 1. 定義   - - 「ライセンス」とは、このドキュメントの第1項から第9項までで定義している、 - 使用、複製、および頒布に関する条項を指します。 - - 「ライセンサー」とは、著作権所有者、あるいは著作権所有者が - ライセンス付与対象として認めた者を指します。 - - 「法人」とは、行為者と、行為者を管理するか行為者により管理されるか - 行為者共通の管理下にある他のすべての者とから成る連合体を指します。 - この定義における「管理」とは、 - (i) 契約またはその他により、直接または間接的にこの法人の指揮・経営を行う権限、または - (ii) この法人の50%以上の株式の所有権 または - (iii) 受益所有権を有することを指します。 - - 「あなた」とは、本ライセンスにより付与される権利を行使する個人または法人を指します。 - - 「ソース」形式とは、ソフトウェアのソースコード、ドキュメントソース、 - 設定ファイルといった、変更を加えるのに好都合な形式を指します。 - - 「オブジェクト」形式とは、コンパイルされたオブジェクトコード、生成されたドキュメント、 - 他のメディアへの変換物といった、ソース形式の機械的な変換により生じる形式を指します。 - - 「成果物」とは、ソース形式であるとオブジェクト形式であるとを問わず、 - 製作物に挿入または添付される(後出の付録に例がある)著作権表示で示された著作物で、 - 本ライセンスに基づいて利用が許されるものを指します。 - - 「派生成果物」とは、編集上の改訂、注解、推敲など、 - 成果物を基にしていて全体としてオリジナル著作物と呼べるような製作物全般を指します。 - 本ライセンスでは、成果物や派生成果物から分離できる製作物や、 - 成果物や派生成果物のインタフェースへの単なるリンク(または名前によるバインド)を、 - 派生成果物に含めません。 - - 「コントリビューション」とは、成果物のオリジナルバージョンならびに成果物 - または派生成果物への変更や追加も含めて、著作権所有者あるいは著作権所有者が認めた - 個人または法人による成果物への組み込みを意図してライセンサーに提出される - 著作物全般を指します。 - この定義における「提出」とは、成果物を論じたり改良するためにライセンサー - またはその代理者により管理される電子的メーリングリスト、ソースコード管理システム、 - 問題追跡システムといった、電子的方法、口頭、または書面で、 - ライセンサーまたはその代理者に情報を送ることを指します。 - ただし、著作権所有者が書面で「コントリビューションでない」と明示したものは除きます。 - - 「コントリビューター」とは、ライセンサーおよびその代理を務める個人または法人で、 - 自分のコントリビューションがライセンサーに受領されて成果物に組み込まれた者を指します。 - - 2. 著作権ライセンスの付与 - 本ライセンスの条項に従って、各コントリビューターはあなたに対し、 - ソース形式であれオブジェクト形式であれ、成果物および派生成果物を複製したり、 - 派生成果物を作成したり、公に表示したり、公に実行したり、サブライセンスしたり、 - 頒布したりする、無期限で世界規模で非独占的で使用料無料で取り消し不能な - 著作権ライセンスを付与します。 - - 3. 特許ライセンスの付与 - 本ライセンスの条項に従って、各コントリビューターはあなたに対し、 - 成果物を作成したり、使用したり、販売したり、販売用に提供したり、 - インポートしたり、その他の方法で移転したりする、 - 無期限で世界規模で非独占的で使用料無料で取り消し不能な - (この項で明記したものは除く)特許ライセンスを付与します。 - ただし、このようなライセンスは、コントリビューターによって - ライセンス可能な特許申請のうち、当該コントリビューターのコントリビューションを - 単独または該当する成果物と組み合わせて用いることで必然的に侵害されるものにのみ - 適用されます。 - あなたが誰かに対し、交差請求や反訴を含めて、 - 成果物あるいは成果物に組み込まれたコントリビューションが - 直接または間接的な特許侵害に当たるとして特許訴訟を起こした場合、 - 本ライセンスに基づいてあなたに付与された特許ライセンスは、 - そうした訴訟が正式に起こされた時点で終了するものとします。 - - 4. 再頒布 - あなたは、ソース形式であれオブジェクト形式であれ、変更の有無に関わらず、 - 以下の条件をすべて満たす限りにおいて、成果物またはその派生成果物のコピーを - 複製したり頒布したりすることができます。 - - (a) 成果物または派生成果物の他の受領者に本ライセンスのコピーも渡すこと。 - - (b) 変更を加えたファイルについては、あなたが変更したということが - よくわかるような告知を入れること。 - - (c) ソース形式の派生成果物を頒布する場合は、ソース形式の成果物に含まれている著作権、 - 特許、商標、および帰属についての告知を、派生成果物のどこにも関係しないものは除いて、 - すべて派生成果物に入れること。 - - (d) 成果物の一部として「NOTICE」に相当するテキストファイルが含まれている場合は、 - そうしたNOTICEファイルに含まれている帰属告知のコピーを、 - 派生成果物のどこにも関係しないものは除いて、頒布する派生成果物に入れること。 - その際、次のうちの少なくとも1箇所に挿入すること。 - (i) 派生成果物の一部として頒布するNOTICEテキストファイル、 - (ii) ソース形式またはドキュメント(派生成果物と共にドキュメントを頒布する場合)、 - (iii) 派生成果物によって生成される表示 - (こうした第三者告知を盛り込むことが標準的なやり方になっている場合)。 - NOTICEファイルの内容はあくまで情報伝達用であって、 - 本ライセンスを修正するものであってはなりません。 - あなたは頒布する派生成果物に自分の帰属告知を - (成果物からのNOTICEテキストに並べて、またはその付録として)追加できますが、 - これはそうした追加の帰属告知が本ライセンスの修正と - 解釈されるおそれがない場合に限られます。 - - あなたは自分の修正物に自らの著作権表示を追加することができ、 - 自分の修正物の使用、複製、または頒布について、あるいはそうした派生成果物の全体について、 - 付加的なライセンス条項または異なるライセンス条項を設けることができます。 - ただし、これは成果物についてのあなたの使用、複製、および頒布が、 - それ以外の点で本ライセンスの条項に従っている場合に限られます。 - - 5. コントリビューションの提出 - 特に断りがない限り、あなたが成果物への組み込みを意図してライセンサーに - 提出したコントリビューションは、付加的な条項がなければ、 - 本ライセンスの条項に従うものとします。 - 上述の規定にかかわらず、そうしたコントリビューションに関してあなたがライセンサーと - 結んだかもしれない別のライセンス契約の条項を、ここで無効にしたり - 修正したりすることはありません。 - - 6. 商標 - 本ライセンスでは、成果物の出所を記述したりNOTICEファイルの内容を複製するときに - 必要になる妥当で慣習的な使い方は別として、ライセンサーの商号、商標、サービスマーク、 - または製品名の使用権を付与しません。 - - 7. 保証の否認 - 適用される法律または書面での同意によって命じられない限り、 - ライセンサーは成果物を(そしてコントリビューターは各自のコントリビューションを) - 「現状のまま」提供するものとし、明示黙示を問わず、タイトル、非侵害性、 - 商業的な使用可能性、および特定の目的に対する適合性を含め、 - いかなる保証も条件も提供しません。 - あなたは成果物の使用や再頒布の適切性を自分で判断する責任を持つと共に、 - 本ライセンスにより付与される権利を行使することに伴うすべてのリスクを負うことになります。 - - 8. 責任の制限 - いかなる条件および法理論においても、不法行為(過失を含む)、契約、 - またはその他いかなる場合でも、適用される法律または書面での同意によって命じられない限り、 - コントリビューターは本ライセンスまたは成果物の使い方に関連して生じる直接損害、 - 間接損害、偶発的な損害、特別損害、懲罰的損害、または結果損害を含め、 - 営業権の損失、業務の停止、コンピューター障害または誤作動、 - その他の商業上の損害や損失など、いかなる損害に対しても、 - たとえそうした損害の可能性をたとえ知らされていたとしても、 - あなたに責任を負わないものとします。 - - 9. 保証または追加的責任の引き受け - 成果物またはその派生成果物を再頒布する際、あなたはサポート、保証、損害補償、 - またはその他の責任や、本ライセンスに矛盾しない権利を提示し、 - これを有料にすることができます。 - ただし、そうした責任を引き受ける場合、あなたはそれを自分自身のためにだけ - 自己責任として行えるのであって、他のコントリビューターのために行うことはできません。 - また、あなたはそうした保証や追加的責任のせいで他のコントリビューターに - 責任が降りかかったり賠償要求が出されたとしても、それらのコントリビューターに - 損害が及ぶのを防ぐと共に各コントリビューターの損害を補償することに同意しなければなりません。 - - 使用、複製、および頒布に関する条項の終わり - - 付録: Apache Licenseの適用の仕方 - - あなたの製作物にApache Licenseを適用するときは、次の定型文を添付してください。 - ただし、"[]"で囲まれている部分は、あなた自身の識別情報に置き換えてください - (その際、角括弧は取り除きます)。 - また、この文言を該当するファイル形式に合ったコメント構文で囲んでください。 - さらに、第三者アーカイブ内での識別を容易にするため、 - ファイル名またはクラス名ならびに趣旨説明が著作権表示と同じ「印刷ページ」に - 現れるようにすることをお勧めします。 - - Copyright [yyyy] [著作権所有者の名前] - - Apache License Version 2.0(「本ライセンス」)に基づいてライセンスされます。 - あなたがこのファイルを使用するためには、本ライセンスに従わなければなりません。 - 本ライセンスのコピーは下記の場所から入手できます。 - - http://www.apache.org/licenses/LICENSE-2.0 - - 適用される法律または書面での同意によって命じられない限り、 - 本ライセンスに基づいて頒布されるソフトウェアは、明示黙示を問わず、 - いかなる保証も条件もなしに「現状のまま」頒布されます。 - 本ライセンスでの権利と制限を規定した文言については、本ライセンスを参照してください。 -``` diff --git a/website_and_docs/content/documentation/about/copyright.pt-br.md b/website_and_docs/content/documentation/about/copyright.pt-br.md deleted file mode 100644 index cfab5af6dcd3..000000000000 --- a/website_and_docs/content/documentation/about/copyright.pt-br.md +++ /dev/null @@ -1,272 +0,0 @@ ---- -title: "Direitos autorais e atribuições" -linkTitle: "Direitos autorais e atribuições" -weight: 1 -description: > - Direitos autorais, contribuições e todas as atribuições para os diferentes projetos sob a iniciativa do Selenium. -aliases: [ -"/documentation/about/copyright_and_attributions" -] ---- - -## **A Documentação do Selenium** - -Todo esforço foi feito para tornar esta documentação a mais completa e precisa possível, -mas nenhuma garantia ou adequação está implícita. As informações fornecidas são -"no estado em que se encontram". Os autores e a editora não terão qualquer responsabilidade -para com qualquer pessoa ou entidade com relação a quaisquer perdas ou danos decorrentes -das informações contidas neste livro. Nenhuma responsabilidade de patente é assumida com -relação ao uso das informações aqui contidas. - - -## Atribuições - -### Agradecimentos: - -#### [Selenium Main Repository](//github.com/SeleniumHQ/selenium/) - -{{% gh-contributors "https://api.github.com/repos/seleniumhq/selenium/contributors?per_page=100" %}} - -#### [Selenium IDE](//github.com/SeleniumHQ/selenium-ide/) - -{{% gh-contributors "https://api.github.com/repos/seleniumhq/selenium-ide/contributors?per_page=100" %}} - -#### [Docker Selenium](//github.com/SeleniumHQ/docker-selenium/) - -{{% gh-contributors "https://api.github.com/repos/seleniumhq/docker-selenium/contributors?per_page=100" %}} - -#### [Selenium Website e Docs](//github.com/SeleniumHQ/seleniumhq.github.io/) - -{{% gh-contributors "https://api.github.com/repos/seleniumhq/seleniumhq.github.io/contributors?per_page=100" %}} - -#### [Website Selenium Anterior](//github.com/SeleniumHQ/www.seleniumhq.org/) - -{{% gh-contributors "https://api.github.com/repos/seleniumhq/www.seleniumhq.org/contributors?per_page=100" %}} - -#### [Projeto de Re-escrita da Documentação Anterior](//github.com/SeleniumHQ/docs/) - -{{% gh-contributors "https://api.github.com/repos/seleniumhq/docs/contributors?per_page=100" %}} - - -## Projetos de terceiros usados pela documentação do Selenium: - -| Software | Versão | Licença | -| -------- | ------- | ------- | -| [Hugo](//gohugo.io/) | v0.110.0 | [Apache 2.0](//gohugo.io/about/license/) | -| [Docsy](//github.com/google/docsy/) | --- | [Apache 2.0](//github.com/google/docsy/blob/master/LICENSE) | - - -## Licença - -Todo o código e documentação proveniente do projeto Selenium -está licenciado sob a licença Apache 2.0, -com a [Software Freedom Conservancy](//sfconservancy.org/) -como detentor dos direitos autorais. - -A licença está incluída aqui por conveniência, -mas você também pode encontrá-la no -[Site da Apache Foundation](//apache.org/licenses/LICENSE-2.0.html): - -```markdown - 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. -``` diff --git a/website_and_docs/content/documentation/about/copyright.zh-cn.md b/website_and_docs/content/documentation/about/copyright.zh-cn.md deleted file mode 100644 index d49e1f3768c9..000000000000 --- a/website_and_docs/content/documentation/about/copyright.zh-cn.md +++ /dev/null @@ -1,266 +0,0 @@ ---- -title: "版权和归属" -linkTitle: "版权和归属" -weight: 1 -description: > - Selenium工具集下的全部版权、贡献以及归属. -aliases: [ -"/documentation/about/copyright_and_attributions" -] ---- - -## **Selenium文档** - -我们已尽一切努力使本文档尽可能完整和准确, 但难以保证一定适用. -信息提供是基于“as-is”的. -若本文档所含信息引起的任何损失或损害, 作者和出版者对所有个人或实体均不承担任何责任. -不承担任何与使用本文信息相关的专利责任. - -## 归属 - -### 感谢: - -#### [Selenium Main Repository](//github.com/SeleniumHQ/selenium/) - -{{% gh-contributors "https://api.github.com/repos/seleniumhq/selenium/contributors?per_page=100" %}} - -#### [Selenium IDE](//github.com/SeleniumHQ/selenium-ide/) - -{{% gh-contributors "https://api.github.com/repos/seleniumhq/selenium-ide/contributors?per_page=100" %}} - -#### [Docker Selenium](//github.com/SeleniumHQ/docker-selenium/) - -{{% gh-contributors "https://api.github.com/repos/seleniumhq/docker-selenium/contributors?per_page=100" %}} - -#### [Selenium Website & Docs](//github.com/SeleniumHQ/seleniumhq.github.io/) - -{{% gh-contributors "https://api.github.com/repos/seleniumhq/seleniumhq.github.io/contributors?per_page=100" %}} - -#### [Previous Selenium Website](//github.com/SeleniumHQ/www.seleniumhq.org/) - -{{% gh-contributors "https://api.github.com/repos/seleniumhq/www.seleniumhq.org/contributors?per_page=100" %}} - -#### [Previous Documentation Rewrite Project](//github.com/SeleniumHQ/docs/) - -{{% gh-contributors "https://api.github.com/repos/seleniumhq/docs/contributors?per_page=100" %}} - -## Selenium文档项目使用的第三方软件: - -| 软件 | 版本 | 许可 | -| -------- | ------- | ------- | -| [Hugo](//gohugo.io/) | v0.110.0 | [Apache 2.0](//gohugo.io/about/license/) | -| [Docsy](//github.com/google/docsy/) | --- | [Apache 2.0](//github.com/google/docsy/blob/master/LICENSE) | - -## 许可 - -源自Selenium项目的所有代码和文档均基于Apache2.0的许可, -由 [Software Freedom Conservancy](//sfconservancy.org/) -作为版权所有者. - -为方便起见, 此处包含许可证, -您也可以在此查看 -[Apache 基金会站点](//apache.org/licenses/LICENSE-2.0.html): - -```markdown - 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. -``` diff --git a/website_and_docs/content/documentation/about/style.ja.md b/website_and_docs/content/documentation/about/style.ja.md index ac87c2a7c4ba..d3e85b1e0ffb 100644 --- a/website_and_docs/content/documentation/about/style.ja.md +++ b/website_and_docs/content/documentation/about/style.ja.md @@ -7,7 +7,7 @@ description: >- --- このドキュメントにコンテンツを追加する方法の詳細な手順については、 -[コントリビューションのドキュメント]({{< ref contributing.md >}})を参照してください。 +[コントリビューションのドキュメント]({{< ref path="contributing.md" lang="en" >}})を参照してください。 ## アラート diff --git a/website_and_docs/content/documentation/about/style.pt-br.md b/website_and_docs/content/documentation/about/style.pt-br.md index 760f76d18bd0..890da8b11024 100644 --- a/website_and_docs/content/documentation/about/style.pt-br.md +++ b/website_and_docs/content/documentation/about/style.pt-br.md @@ -6,7 +6,7 @@ description: >- Convenções para contribuições à documentação do Selenium e exemplos de código. --- -Read our [contributing documentation]({{< ref contributing.md >}}) for complete instructions on +Read our [contributing documentation]({{< ref path="contributing.md" lang="en" >}}) for complete instructions on how to add content to this documentation. ## Alerts diff --git a/website_and_docs/content/documentation/about/style.zh-cn.md b/website_and_docs/content/documentation/about/style.zh-cn.md index fa2ad642bc07..e31bc792fd05 100644 --- a/website_and_docs/content/documentation/about/style.zh-cn.md +++ b/website_and_docs/content/documentation/about/style.zh-cn.md @@ -6,7 +6,7 @@ description: >- Conventions for contributions to the Selenium documentation and code examples --- -Read our [contributing documentation]({{< ref contributing.md >}}) for complete instructions on +Read our [contributing documentation]({{< ref path="contributing.md" lang="en" >}}) for complete instructions on how to add content to this documentation. ## Alerts diff --git a/website_and_docs/content/documentation/grid/_index.en.md b/website_and_docs/content/documentation/grid/_index.en.md index 4f6632aa1157..269ad078cabb 100644 --- a/website_and_docs/content/documentation/grid/_index.en.md +++ b/website_and_docs/content/documentation/grid/_index.en.md @@ -21,7 +21,10 @@ aliases: "/documentation/zh-cn/selenium_installation/installing_standalone_server/", "/documentation/zh-cn/grid/", "/documentation/zh-cn/grid/grid_4/", -"/documentation/zh-cn/grid/purposes_and_main_functionalities/" +"/documentation/zh-cn/grid/purposes_and_main_functionalities/", +"/ja/documentation/grid/", +"/pt-br/documentation/grid/", +"/zh-cn/documentation/grid/" ] --- diff --git a/website_and_docs/content/documentation/grid/_index.ja.md b/website_and_docs/content/documentation/grid/_index.ja.md deleted file mode 100644 index 84e78f2b9e73..000000000000 --- a/website_and_docs/content/documentation/grid/_index.ja.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "Grid" -linkTitle: "Grid" -weight: 4 -description: > - 複数のマシンで並行してテストを実行したいですか? Grid が手助けします。 ---- - -Selenium Grid を利用して、クライアントからリモートブラウザーインスタンスにコマンドを -ルーティングし、リモートマシン上で WebDriver スクリプトを実行することができます。 - -Grid の目標は、 - -- 複数のマシンでの並行したテスト実行を、簡単な方法で提供する -- 異なるバージョンのブラウザでのテストを可能にする -- クロスプラットフォームテストを可能にする - -興味がありますか? -Grid の仕組みと設定方法が知りたければ以下のセクションを読んでください。 diff --git a/website_and_docs/content/documentation/grid/_index.pt-br.md b/website_and_docs/content/documentation/grid/_index.pt-br.md deleted file mode 100644 index a85e5a6ff7dc..000000000000 --- a/website_and_docs/content/documentation/grid/_index.pt-br.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "Grid" -linkTitle: "Grid" -weight: 4 -description: > - Pretende executar testes em paralelo em várias máquinas? Então a Grid é para si. ---- - -Selenium Grid permite a execucão de scripts WebDriver em máquinas remotas, -passando os comandos recebidos pelo cliente para a instância remotas do navegador. - -O objectivo da Grid é: - -* Providenciar uma forma fácil de executar testes em paralelo em multiplas máquinas -* Permitir testes em versões diferentes de navegadores -* Permitir testes em várias plataformas - -Está interessado? Enão siga lendo as próximas secções para entender como a Grid funciona -e também como montar a sua. diff --git a/website_and_docs/content/documentation/grid/_index.zh-cn.md b/website_and_docs/content/documentation/grid/_index.zh-cn.md deleted file mode 100644 index 2e5acc460e6e..000000000000 --- a/website_and_docs/content/documentation/grid/_index.zh-cn.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "Grid" -linkTitle: "Grid" -weight: 4 -description: > - 要在多台计算机上并行运行测试吗? 那么, Grid正是为你准备的. ---- - -Selenium Grid 允许通过将客户端发送的命令路由到远程浏览器实例来在远程机器上执行 WebDriver 脚本。 - -Grid 的目标: - -* 提供一种在多台机器上并行运行测试的简单方法 -* 允许在不同的浏览器版本上进行测试 -* 启用跨平台测试 - -感兴趣? 通过以下部分了解Grid的工作原理, 以及如何设置自己的. \ No newline at end of file diff --git a/website_and_docs/content/documentation/grid/advanced_features/_index.en.md b/website_and_docs/content/documentation/grid/advanced_features/_index.en.md index 3c1d7db879a5..c89af7d92a69 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/_index.en.md +++ b/website_and_docs/content/documentation/grid/advanced_features/_index.en.md @@ -5,5 +5,9 @@ weight: 12 description: > To get all the details of the advanced features, understand how it works, and how to set up your own, please browse thorough the following sections. -aliases: ["/documentation/en/grid/grid_4/advanced_features/", "/documentation/ja/grid/grid_4/advanced_features/", "/documentation/pt-br/grid/grid_4/advanced_features/", "/documentation/zh-cn/grid/grid_4/advanced_features/"] +aliases: ["/documentation/en/grid/grid_4/advanced_features/", "/documentation/ja/grid/grid_4/advanced_features/", "/documentation/pt-br/grid/grid_4/advanced_features/", "/documentation/zh-cn/grid/grid_4/advanced_features/", +"/ja/documentation/grid/advanced_features/", +"/pt-br/documentation/grid/advanced_features/", +"/zh-cn/documentation/grid/advanced_features/" +] --- diff --git a/website_and_docs/content/documentation/grid/advanced_features/_index.ja.md b/website_and_docs/content/documentation/grid/advanced_features/_index.ja.md deleted file mode 100644 index 45282d8d5451..000000000000 --- a/website_and_docs/content/documentation/grid/advanced_features/_index.ja.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: "高度な機能" -linkTitle: "高度な機能" -weight: 12 -description: > - 高度な機能のすべての詳細を取得し、それがどのように機能するか、および独自の設定方法を理解するには、次のセクションを参照してください。 ---- diff --git a/website_and_docs/content/documentation/grid/advanced_features/_index.pt-br.md b/website_and_docs/content/documentation/grid/advanced_features/_index.pt-br.md deleted file mode 100644 index 963e1bc2028c..000000000000 --- a/website_and_docs/content/documentation/grid/advanced_features/_index.pt-br.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: "Características avançadas" -linkTitle: "Características avançadas" -weight: 12 -description: > - Para obter todos os detalhes dos recursos avançados, entenda como funciona e como configurar - crie o seu próprio, navegue pelas seções a seguir. ---- diff --git a/website_and_docs/content/documentation/grid/advanced_features/_index.zh-cn.md b/website_and_docs/content/documentation/grid/advanced_features/_index.zh-cn.md deleted file mode 100644 index 821d6c67f5e7..000000000000 --- a/website_and_docs/content/documentation/grid/advanced_features/_index.zh-cn.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "高级功能" -linkTitle: "高级功能" -weight: 12 -description: > - 要获得高级功能的所有详细信息, - 了解其工作原理, - 以及如何设置自己的功能, - 请浏览以下部分. ---- diff --git a/website_and_docs/content/documentation/grid/advanced_features/endpoints.en.md b/website_and_docs/content/documentation/grid/advanced_features/endpoints.en.md index 37be1c4277e2..97ebe0f26966 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/endpoints.en.md +++ b/website_and_docs/content/documentation/grid/advanced_features/endpoints.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/grid/advanced_features/grid_endpoints/", "/documentation/ja/grid/grid_4/grid_endpoints/", "/documentation/pt-br/grid/grid_4/grid_endpoints/", -"/documentation/zh-cn/grid/grid_4/grid_endpoints/" +"/documentation/zh-cn/grid/grid_4/grid_endpoints/", +"/ja/documentation/grid/advanced_features/endpoints/", +"/ja/documentation/grid/advanced_features/grid_endpoints/", +"/pt-br/documentation/grid/advanced_features/endpoints/", +"/pt-br/documentation/grid/advanced_features/grid_endpoints/", +"/zh-cn/documentation/grid/advanced_features/endpoints/", +"/zh-cn/documentation/grid/advanced_features/grid_endpoints/" ] --- diff --git a/website_and_docs/content/documentation/grid/advanced_features/endpoints.ja.md b/website_and_docs/content/documentation/grid/advanced_features/endpoints.ja.md deleted file mode 100644 index 0450e60ee3d9..000000000000 --- a/website_and_docs/content/documentation/grid/advanced_features/endpoints.ja.md +++ /dev/null @@ -1,207 +0,0 @@ ---- -title: "Grid エンドポイント" -linkTitle: "Grid エンドポイント" -weight: 3 -aliases: [ -"/documentation/grid/advanced_features/grid_endpoints/" -] ---- - -## Grid - -### Grid ステータス - -Grid ステータスは Grid の現在の状態を提供します。 登録されている全てのノードの詳細で構成されます。 -各ノードのステータスには、ノードの稼働状況、セッション、およびスロットに関する情報が含まれます。 - -```shell -curl --request GET 'http://localhost:4444/status' -``` - -### セッションの削除 - -セッションを削除すると、WebDriver セッションが終了し、ドライバがアクティブなセッションマップから削除されます。 -削除されたセッション ID を使用するリクエストや、ドライバのインスタンスを再利用しようとすると、エラーとなります。 - -```shell -curl --request DELETE 'http://localhost:4444/session/' -``` - -### Which URL should I use? - -スタンドアロンモードでは、Grid URL は スタンドアロンサーバーのアドレスになります。 - -ハブ&ノードモードでは、Grid URL は ハブのアドレスになります。 - -完全分散モードでは、Grid URL は ルーターのアドレスになります。 - -上記すべてのモードのデフォルトの URL は http://localhost:4444 です。 - -## ディストリビューター - -### ノード削除 - -ノードを Grid から削除するには、以下の curl コマンドを使用します。 -このコマンドは、そのノード上で実行中のセッションを停止させるものではありません。 -ノードは明示的に強制終了されない限り、そのまま動作し続けます。 -ディストリビューターはそのノードを認識しなくなるため、マッチする新しいセッションのリクエストは はその Node に転送されません。 - -スタンドアロンモードでは、ディストリビューターの URL はスタンドアロンサーバーのアドレスとなります。 - -ハブ&ノードモードでは、ディストリビューターの URL は ハブのアドレスになります。 - -```shell -curl --request DELETE 'http://localhost:4444/se/grid/distributor/node/' --header 'X-REGISTRATION-SECRET: ' -``` - -完全分散モードでは、ディストリビューター URL は ディストリビューターのアドレスになります。 - -```shell -curl --request DELETE 'http://localhost:4444/se/grid/distributor/node/' --header 'X-REGISTRATION-SECRET: ' -``` - -Grid の設定時に登録用の secret を設定していない場合は次のようにします: - -```shell -curl --request DELETE 'http:///se/grid/distributor/node/' --header 'X-REGISTRATION-SECRET;' -``` - -### ノードのドレイン - -ノードドレインコマンドはノードをグレースフルシャットダウンするために利用します。 -ドレインは実行中のセッションがすべて完了した後にノードを停止します。 -新規のセッションは受け付けません。 - -スタンドアロンモードでは、ディストリビューターの URL はスタンドアロンサーバーのアドレスとなります。 - -ハブ&ノードモードでは、ディストリビューターの URL は ハブのアドレスになります。 - -```shell -curl --request POST 'http://localhost:4444/se/grid/distributor/node//drain' --header 'X-REGISTRATION-SECRET: ' -``` - -完全分散モードでは、ディストリビューター URL は ディストリビューターのアドレスになります。 - -```shell -curl --request POST 'http://localhost:4444/se/grid/distributor/node//drain' --header 'X-REGISTRATION-SECRET: ' -``` - -Grid の設定時に登録用の secret を設定していない場合は次のようにします: - -```shell -curl --request POST 'http:///se/grid/distributor/node//drain' --header 'X-REGISTRATION-SECRET;' -``` - -## ノード - -この節でのエンドポイントは、ハブ&ノードモードとノードが独立して動作する完全分散型 Grid モードに適用されます。 -ノードが 1 つの場合、デフォルトのノード URL は http://localhost:5555 です。 -複数のノードがある場合は、[Grid ステータス](#grid-ステータス) を使ってすべてのノードの詳細とノードアドレスを取得してください。 - -### ステータス - -ノードステータスは基本的にノードのヘルスチェックのためのものです。 -ディストリビューターは定期的にノードの状態を ping で取得し、それに応じて Grid モデルを更新します。 -ステータスには稼働状況、セッション、およびスロットに関する情報が含まれます。 - -```shell -curl --request GET 'http://localhost:5555/status' -``` - -### ドレイン - -ディストリビューターは [ドレイン](#ノードのドレイン)コマンドを適切なノードに渡します。 -ノードを直接ドレインするには以下の curl コマンドを使います。 -どちらのエンドポイントも有効であり、同じ結果になります。 -ドレインは、ノードを停止する前に進行中のセッションを終了させます。 - -```shell -curl --request POST 'http://localhost:5555/se/grid/node/drain' --header 'X-REGISTRATION-SECRET: ' -``` - -Grid の設定時に登録用の secret を設定していない場合は次のようにします: - -```shell -curl --request POST 'http:///se/grid/node/drain' --header 'X-REGISTRATION-SECRET;' -``` - -### セッションオーナーのチェック - -あるセッションがノードに属しているかどうかをチェックするには、以下の curl コマンドを使います。 - -```shell -curl --request GET 'http://localhost:5555/se/grid/node/owner/' --header 'X-REGISTRATION-SECRET: ' -``` - -Grid の設定時に登録用の secret を設定していない場合は次のようにします: - -```shell -curl --request GET 'http:///se/grid/node/owner/' --header 'X-REGISTRATION-SECRET;' -``` - -もしセッションがノードに属していたら true を返し、そうでなければ false が返ります。 - -### セッションの削除 - -セッションを削除すると、WebDriver セッションが終了し、ドライバがアクティブなセッションマップから削除されます。 -削除されたセッション ID を使用するリクエストや、ドライバのインスタンスを再利用しようとすると、エラーとなります。 - -```shell -curl --request DELETE 'http://localhost:5555/se/grid/node/session/' --header 'X-REGISTRATION-SECRET: ' -``` - -Grid の設定時に登録用の secret を設定していない場合は次のようにします: - -```shell -curl --request DELETE 'http:///se/grid/node/session/' --header 'X-REGISTRATION-SECRET;' -``` - -## 新規セッションキュー - -### 新規セッションキューのクリア - -新規セッションキューには、新規セッションリクエストが格納されます。 -キューをクリアするには、以下に挙げる curl コマンドを使用します。 -キューを消去すると、キューにあるすべてのリクエストを拒否します。 -サーバーは各リクエストのそれぞれのクライアントにエラーレスポンスを返します。 -クリアコマンドの結果は、削除されたリクエストの数です。 - -スタンドアロンモードでは、キューの URL はスタンドアロンサーバーのアドレスとなります。 - -ハブ&ノードモードでは、キューの URL は ハブのアドレスになります。 - -```shell -curl --request DELETE 'http://localhost:4444/se/grid/newsessionqueue/queue' --header 'X-REGISTRATION-SECRET: ' -``` - -完全分散モードでは、キューの URL は 新規セッションキューのアドレスになります。 - -```shell -curl --request DELETE 'http://localhost:4444/se/grid/newsessionqueue/queue' --header 'X-REGISTRATION-SECRET: ' -``` - -Grid の設定時に登録用の secret を設定していない場合は次のようにします: - -```shell -curl --request DELETE 'http:///se/grid/newsessionqueue/queue' --header 'X-REGISTRATION-SECRET;' -``` - -### 新規セッションリクエストの取得 - -新規セッションキューには、新規セッションリクエストが格納されます。 -キューにある現在のリクエストを取得するには、以下に挙げる curl コマンドを使用します。 -レスポンスはキュー内のリクエストの数とリクエストのペイロードを返します。 - -スタンドアロンモードでは、キューの URL はスタンドアロンサーバーのアドレスとなります。 - -ハブ&ノードモードでは、キューの URL は ハブのアドレスになります。 - -```shell -curl --request GET 'http://localhost:4444/se/grid/newsessionqueue/queue' -``` - -完全分散モードでは、キューの URL は 新規セッションキューのアドレスになります。 - -```shell -curl --request GET 'http://localhost:4444/se/grid/newsessionqueue/queue' -``` diff --git a/website_and_docs/content/documentation/grid/advanced_features/endpoints.pt-br.md b/website_and_docs/content/documentation/grid/advanced_features/endpoints.pt-br.md deleted file mode 100644 index 3988155f88b0..000000000000 --- a/website_and_docs/content/documentation/grid/advanced_features/endpoints.pt-br.md +++ /dev/null @@ -1,184 +0,0 @@ ---- -title: "Rotas da Grid" -linkTitle: "Rotas da Grid" -weight: 3 -aliases: [ -"/documentation/grid/advanced_features/grid_endpoints/" -] ---- - -## Grid - -### Status da Grid - -O status da Grid fornece o estado atual da grid. Consiste em detalhes sobre cada nó registrado. -Para cada nó, o status inclui informações sobre a disponibilidade, sessões e slots do nó. - -```shell -curl --request GET 'http://localhost:4444/status' -``` - -### Deletar sessão - -A exclusão da sessão encerra a sessão do WebDriver, fecha o driver e o remove do mapa de sessões ativas. -Qualquer solicitação usando o id de sessão removido ou reutilizando a instância do driver gerará um erro. - -```shell -curl --request DELETE 'http://localhost:4444/session/' -``` - -### Which URL should I use? - -No modo Standalone, o URL da Grid é o endereço do servidor Standalone. - -No modo Hub-Node, a URL da Grid é o endereço do servidor Hub. - -No modo totalmente distribuído, a URL da Grid é o endereço do servidor do roteador. - -A URL padrão para todos os modos acima é http://localhost:4444. - -## Distribuidor - -### Remover Nó - -Para remover o Nó da Grid, use o comando curl listado abaixo. -Ele não interrompe nenhuma sessão em andamento em execução nesse nó. -O Node continua rodando como está, a menos que seja explicitamente eliminado. -O Distribuidor não está mais ciente do Nó e, portanto, qualquer solicitação de nova sessão correspondente -não será encaminhado para esse Nó. - -No modo Standalone, a URL do distribuidor é o endereço do servidor Standalone. - -No modo Hub-Node, a URL do Distribuidor é o endereço do servidor Hub. -```shell -curl --request DELETE 'http://localhost:4444/se/grid/distributor/node/' --header 'X-REGISTRATION-SECRET: ' -``` -No modo totalmente distribuído, a URL é o endereço do servidor Router. -```shell -curl --request DELETE 'http://localhost:4444/se/grid/distributor/node/' --header 'X-REGISTRATION-SECRET: ' -``` -Se nenhum segredo de registro foi configurado durante a configuração da Grid, use -```shell -curl --request DELETE 'http:///se/grid/distributor/node/' --header 'X-REGISTRATION-SECRET;' -``` - -### Drenar Nó - -O comando de drenagem de nó é para desligamento normal de nó. -A drenagem para o Node após a conclusão de todas as sessões em andamento. -No entanto, ele não aceita novas solicitações de sessão. - -No modo Standalone, a URL do distribuidor é o endereço do servidor Standalone. - -No modo Hub-Node, a URL do Distribuidor é o endereço do servidor Hub. -```shell -curl --request POST 'http://localhost:4444/se/grid/distributor/node//drain' --header 'X-REGISTRATION-SECRET: ' -``` -No modo totalmente distribuído, a URL é o endereço do servidor Router. -```shell -curl --request POST 'http://localhost:4444/se/grid/distributor/node//drain' --header 'X-REGISTRATION-SECRET: ' -``` -Se nenhum segredo de registro foi configurado durante a configuração da Grid, use -```shell -curl --request POST 'http:///se/grid/distributor/node//drain' --header 'X-REGISTRATION-SECRET;' -``` - -## Nó - -Os terminais nesta seção são aplicáveis ao modo Hub-Node e ao modo Grid totalmente distribuída, onde o Nó é executado de forma independente. -A URL do Nó padrão é http://localhost:5555 no caso de um Nó. -No caso de vários Nós, use [Grid status](#grid-status) para obter todos os detalhes do Nó e localizar o endereço do Nó. - -### Status - -O status do Nó é essencialmente uma verificação de integridade do Nó. -O distribuidor executa ping no status do Nó em intervalos regulares e atualiza o modelo de Grid de acordo. -O status inclui informações sobre disponibilidade, sessões e slots. - -```shell -curl --request GET 'http://localhost:5555/status' -``` - -### Drenagem - -O Distribuidor passa o comando [drain](# drain-node) para o Nó apropriado identificado pelo ID do Nó. -Para drenar o Nó diretamente, use o comando curl listado abaixo. -Ambos as rotas são válidas e produzem o mesmo resultado. Drenar termina as sessões em andamento antes de interromper o Nó. - -```shell -curl --request POST 'http://localhost:5555/se/grid/node/drain' --header 'X-REGISTRATION-SECRET: ' -``` -Se nenhum segredo de registro foi configurado durante a configuração da Grid, use -```shell -curl --request POST 'http:///se/grid/node/drain' --header 'X-REGISTRATION-SECRET;' -``` - -### Checar dono da sessão - -Para verificar se uma sessão pertence a um Nó, use o comando curl listado abaixo. - -```shell -curl --request GET 'http://localhost:5555/se/grid/node/owner/' --header 'X-REGISTRATION-SECRET: ' -``` -Se nenhum segredo de registro foi configurado durante a configuração da Grid, use -```shell -curl --request GET 'http:///se/grid/node/owner/' --header 'X-REGISTRATION-SECRET;' -``` - -Ele retornará true se a sessão pertencer ao Nó, caso contrário, retornará false. - -### Deletar sessão - -A exclusão da sessão encerra a sessão do WebDriver, fecha o driver e o remove do mapa de sessões ativas. -Qualquer solicitação usando o id de sessão removido ou reutilizando a instância do driver gerará um erro. - -```shell -curl --request DELETE 'http://localhost:5555/se/grid/node/session/' --header 'X-REGISTRATION-SECRET: ' -``` -Se nenhum segredo de registro foi configurado durante a configuração da Grid, use -```shell -curl --request DELETE 'http:///se/grid/node/session/' --header 'X-REGISTRATION-SECRET;' -``` - -## Fila de Sessão - -### Limpar a Fila de Sessão - -A Fila de Sessão contém as novas solicitações de sessão. -Para limpar a fila, use o comando curl listado abaixo. -Limpar a fila rejeita todas as solicitações na fila. Para cada solicitação, o servidor retorna uma resposta de erro ao respectivo cliente. -O resultado do comando clear é o número total de solicitações excluídas. - -No modo Standalone, a URL Queue é o endereço do servidor Standalone. - -No modo Hub-Node, a URL do enfileirador é o endereço do servidor Hub. - -```shell -curl --request DELETE 'http://localhost:4444/se/grid/newsessionqueue/queue' --header 'X-REGISTRATION-SECRET: ' -``` - -No modo totalmente distribuído, a URL do enfileirador é o endereço do servidor do Enfileirador de Sessões. -```shell -curl --request DELETE 'http://localhost:4444/se/grid/newsessionqueue/queue' --header 'X-REGISTRATION-SECRET: ' -``` - -If no registration secret has been configured while setting up the Grid, then use -```shell -curl --request DELETE 'http:///se/grid/newsessionqueue/queue' --header 'X-REGISTRATION-SECRET;' -``` - -### Obter novos pedidos da Fila de Sessão - -Novos pedidos da Fila de Sessão contém os novos pedidos de sessão. -Para obter os pedidos na Fila, utiliza o comando curl listado abaixo. -É retornado o número total de pedidos na Fila. - -No modo Standalone, a URL é a do servidor, em modo Grid, a URL será a do HUB. - -```shell -curl --request GET 'http://localhost:4444/se/grid/newsessionqueue/queue' -``` - -No modo totalmente distribuido, a URL da Fila é a porta do servidor de Fila. -```shell -curl --request GET 'http://localhost:4444/se/grid/newsessionqueue/queue' diff --git a/website_and_docs/content/documentation/grid/advanced_features/endpoints.zh-cn.md b/website_and_docs/content/documentation/grid/advanced_features/endpoints.zh-cn.md deleted file mode 100644 index 3d170f94ecab..000000000000 --- a/website_and_docs/content/documentation/grid/advanced_features/endpoints.zh-cn.md +++ /dev/null @@ -1,178 +0,0 @@ ---- -title: "Grid端点" -linkTitle: "Grid端点" -weight: 3 -aliases: [ -"/documentation/grid/advanced_features/grid_endpoints/" -] ---- - -## Grid - -### Grid 状态 - -Grid状态提供Grid的当前状态. -它包含每个注册节点的详细信息. -对于每个节点, -状态包括有关节点可用性、会话和插槽的信息. - -```shell -curl --request GET 'http://localhost:4444/status' -``` - -### 删除会话 - -删除会话会终止 WebDriver 会话、退出驱动程序并将其从活动会话映射中删除。任何使用删除的会话标识或重新使用驱动程序实例的请求都会出错。 - -```shell -curl --request DELETE 'http://localhost:4444/session/' -``` - -### 我应该使用哪一个URL? - -在 Standalone 模式下, Grid URL是独立服务器的地址. - -在 Hub-Node 模式下, Grid URL是集线器服务器的地址. - -在完全分布式模式下, Grid URL是路由服务器的地址. - -以上所有模式的默认URL皆为http://localhost:4444. - -## 分发器 - -### 删除节点 - -要从网格中删除节点,请使用下面列出的 curl 命令。该命令不会停止正在该节点上运行的任何会话。除非显式终止, 否则节点将继续运行。分发器不再知道该节点,因此任何匹配的新会话请求都不会转发到该节点。 - -在 Standalone 模式下,分发器 URL 是独立服务器地址。 - -在 Hub-Node 模式下, 分发器 URL 是 Hub 服务器的地址。 - -```shell -curl --request DELETE 'http://localhost:4444/se/grid/distributor/node/' --header 'X-REGISTRATION-SECRET: ' -``` -在完全分布式模式下, URL是分发器的地址。 - -```shell -curl --request DELETE 'http://localhost:4444/se/grid/distributor/node/' --header 'X-REGISTRATION-SECRET: ' -``` -如果在设置Grid时未配置注册密码, 则使用 -```shell -curl --request DELETE 'http:///se/grid/distributor/node/' --header 'X-REGISTRATION-SECRET;' -``` - -### 释放节点 - -节点释放命令用于优雅地关闭节点。在所有正在进行的会话结束后,会停止该节点。并且,它不会接受任何新的会话请求。 - -在 Standalone 模式下,分发器 URL 是独立服务器地址。 - -在 Hub-Node 模式下, 分发器 URL 是 Hub 服务器的地址。 -```shell -curl --request POST 'http://localhost:4444/se/grid/distributor/node//drain' --header 'X-REGISTRATION-SECRET: ' -``` -在完全分布式模式下, URL是分发服务器的地址。 -```shell -curl --request POST 'http://localhost:4444/se/grid/distributor/node//drain' --header 'X-REGISTRATION-SECRET: ' -``` -如果在设置Grid时未配置注册密码, 则使用 -```shell -curl --request POST 'http:///se/grid/distributor/node//drain' --header 'X-REGISTRATION-SECRET;' -``` - -## 节点 - -本节中的端点适用于 Hub-Node 模式和节点独立运行的完全分布式网格模式。在一个节点的情况下, 默认节点的URL为 http://localhost:5555 。 -如果有多个节点,请使用 [Grid 状态](#grid-状态) 获取所有节点的详细信息并查找节点地址。 - -### 状态 - -节点状态本质上是节点的健康检查。分发程序会定期 ping 节点状态,并相应地更新 Grid 模型。状态包括有关可用性、会话和插槽的信息。 - -```shell -curl --request GET 'http://localhost:5555/status' -``` - -### 释放 - -分发器将 [释放](#释放节点) 命令传递给由node-id标识的相应节点。要直接释放节点,请使用下面列出的curl命令。 -两个端点都有效并产生相同的结果。释放会等待持续中的会话完成后才停止节点。 - -```shell -curl --request POST 'http://localhost:5555/se/grid/node/drain' --header 'X-REGISTRATION-SECRET: ' -``` -如果在设置Grid时未配置注册密码,则使用 -```shell -curl --request POST 'http:///se/grid/node/drain' --header 'X-REGISTRATION-SECRET;' -``` - -### 检查会话所有者 - -要检查会话是否属于某一节点, 请使用下面列出的curl命令. - -```shell -curl --request GET 'http://localhost:5555/se/grid/node/owner/' --header 'X-REGISTRATION-SECRET: ' -``` -如果在设置Grid时未配置注册密码, 则使用 -```shell -curl --request GET 'http:///se/grid/node/owner/' --header 'X-REGISTRATION-SECRET;' -``` - -如果会话属于该节点, -则返回true, -否则返回false。 - -### 删除会话 - -删除会话会终止 WebDriver 会话、退出驱动程序并将其从活动会话映射中删除。任何使用删除的会话标识或重新使用驱动程序实例的请求都会出错。 - -```shell -curl --request DELETE 'http://localhost:5555/se/grid/node/session/' --header 'X-REGISTRATION-SECRET: ' -``` -如果在设置Grid时未配置注册密码, 则使用 -```shell -curl --request DELETE 'http:///se/grid/node/session/' --header 'X-REGISTRATION-SECRET;' -``` - -## 新会话队列 - -### 清除新会话队列 - -新会话请求队列保存新会话请求。要清除队列,请使用下面列出的 curl 命令。清除队列会拒绝队列中的所有请求。对于每个此类请求,服务器都会向相应的客户端返回错误响应。清除命令的结果是被删除请求的总数。 - -在 Standalone 模式下, 队列URL是独立服务器的地址。 -在 Hub-Node 模式下, 队列URL是集线器服务器的地址。 - -```shell -curl --request DELETE 'http://localhost:4444/se/grid/newsessionqueue/queue' --header 'X-REGISTRATION-SECRET: ' -``` - -在完全分布式模式下, -队列URL是新会话队列服务器的地址。 -```shell -curl --request DELETE 'http://localhost:4444/se/grid/newsessionqueue/queue' --header 'X-REGISTRATION-SECRET: ' -``` - -如果在设置Grid时未配置注册密码, 则使用 -```shell -curl --request DELETE 'http:///se/grid/newsessionqueue/queue' --header 'X-REGISTRATION-SECRET;' -``` - -### 获取新会话队列请求 - -新会话请求队列保存新会话请求。 -要获取队列中的当前请求, -请使用下面列出的curl命令。 -响应会返回队列中的请求总数以及请求内容。 - -在 Standalone 模式下, 队列URL是独立服务器的地址。 -在 Hub-Node 模式下, 队列URL是集线器服务器的地址。 - -```shell -curl --request GET 'http://localhost:4444/se/grid/newsessionqueue/queue' -``` - -在完全分布式模式下, -队列URL是新会话队列服务器的地址。 -```shell -curl --request GET 'http://localhost:4444/se/grid/newsessionqueue/queue' diff --git a/website_and_docs/content/documentation/grid/advanced_features/graphql_support.en.md b/website_and_docs/content/documentation/grid/advanced_features/graphql_support.en.md index 8c27e3428d92..a862f251a55d 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/graphql_support.en.md +++ b/website_and_docs/content/documentation/grid/advanced_features/graphql_support.en.md @@ -2,7 +2,11 @@ title: "GraphQL query support" linkTitle: "GraphQL Support" weight: 2 -aliases: ["/documentation/en/grid/grid_4/graphql_support/", "/documentation/ja/grid/grid_4/graphql_support/", "/documentation/pt-br/grid/grid_4/graphql_support/", "/documentation/zh-cn/grid/grid_4/graphql_support/"] +aliases: ["/documentation/en/grid/grid_4/graphql_support/", "/documentation/ja/grid/grid_4/graphql_support/", "/documentation/pt-br/grid/grid_4/graphql_support/", "/documentation/zh-cn/grid/grid_4/graphql_support/", +"/ja/documentation/grid/advanced_features/graphql_support/", +"/pt-br/documentation/grid/advanced_features/graphql_support/", +"/zh-cn/documentation/grid/advanced_features/graphql_support/" +] --- GraphQL is a query language for APIs and a runtime for fulfilling those queries diff --git a/website_and_docs/content/documentation/grid/advanced_features/graphql_support.ja.md b/website_and_docs/content/documentation/grid/advanced_features/graphql_support.ja.md deleted file mode 100644 index 37c0495b2630..000000000000 --- a/website_and_docs/content/documentation/grid/advanced_features/graphql_support.ja.md +++ /dev/null @@ -1,184 +0,0 @@ ---- -title: "GraphQLクエリのサポート" -linkTitle: "GraphQLクエリのサポート" -weight: 2 ---- - -GraphQLは、APIのクエリ言語であり、既存のデータでこれらのクエリを実行するためのランタイムです。 -これにより、ユーザーは必要なものだけを正確に要求することができます。 - -## 列挙型(Enum) -列挙型は、フィールドの可能な値のセットを表します。 - -たとえば、 `Node` オブジェクトには `status` というフィールドがあります。 -`UP` 、 `DRAINING` 、または `UNAVAILABLE` の可能性があるため、状態は、 列挙型(具体的には、`Status` タイプ)です。 - -## スカラー -スカラーはプリミティブ値です: `Int` 、 `Float` 、 `String` 、 `Boolean` 、または `ID` 。 - -GraphQL APIを呼び出すときは、スカラーのみを返すまでネストされたサブフィールドを指定する必要があります。 - -## スキーマの構造 -グリッドスキーマの構造は次のとおりです。 - -```shell -{ - session(id: "") : { - id, - capabilities, - startTime, - uri, - nodeId, - nodeUri, - sessionDurationMillis - slot : { - id, - stereotype, - lastStarted - } - } - grid: { - uri, - totalSlots, - nodeCount, - maxSession, - sessionCount, - version, - sessionQueueSize - } - sessionsInfo: { - sessionQueueRequests, - sessions: [ - { - id, - capabilities, - startTime, - uri, - nodeId, - nodeUri, - sessionDurationMillis - slot : { - id, - stereotype, - lastStarted - } - } - ] - } - nodesInfo: { - nodes : [ - { - id, - uri, - status, - maxSession, - slotCount, - sessions: [ - { - id, - capabilities, - startTime, - uri, - nodeId, - nodeUri, - sessionDurationMillis - slot : { - id, - stereotype, - lastStarted - } - } - ], - sessionCount, - stereotypes, - version, - osInfo: { - arch, - name, - version - } - } - ] - } -} -``` -## GraphQLで照会する - -GraphQLをクエリする最良の方法は、 `curl` リクエストを使用することです。 -GraphQLを使用すると、必要なデータのみをフェッチできます。それ以上でもそれ以下でもありません。 - -GraphQLクエリの例のいくつかを以下に示します。 必要に応じて独自のクエリを作成できます。 - -### グリッド内の `maxSession`と` sessionCount`の数を照会する - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query": "{ grid { maxSession, sessionCount } }"}' -s -``` - -通常、ローカルマシンでは、 `` は `http://localhost:4444/graphql` になります。 - -### セッション、ノード、グリッドのすべての詳細を照会する - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ grid { uri, maxSession, sessionCount }, nodesInfo { nodes { id, uri, status, sessions { id, capabilities, startTime, uri, nodeId, nodeUri, sessionDurationMillis, slot { id, stereotype, lastStarted } }, slotCount, sessionCount }} }"}' -s -``` - -### グリッドで現在のセッション数を取得するためのクエリ - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ grid { sessionCount } }"}' -s -``` - -### グリッドで最大セッション数を取得するためのクエリ - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ grid { maxSession } }"}' -s -``` - -### グリッド内のすべてのノードのすべてのセッションの詳細を取得するためのクエリ - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ sessionsInfo { sessions { id, capabilities, startTime, uri, nodeId, nodeId, sessionDurationMillis } } }"}' -s -``` - -### グリッド内の各ノードのすべてのセッションのスロット情報を取得するためのクエリ - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ sessionsInfo { sessions { id, slot { id, stereotype, lastStarted } } } }"}' -s -``` - -### 特定のセッションのセッション情報を取得するためのクエリ - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ session (id: \"\") { id, capabilities, startTime, uri, nodeId, nodeUri, sessionDurationMillis, slot { id, stereotype, lastStarted } } } "}' -s -``` - -### グリッド内の各ノードのcapabilityを照会する - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query": "{ nodesInfo { nodes { stereotypes } } }"}' -s -``` - -### グリッド内の各ノードのステータスを照会する - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query": "{ nodesInfo { nodes { status } } }"}' -s -``` - -### 各ノードとグリッドのURIを照会する - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query": "{ nodesInfo { nodes { uri } } }"}' -s -``` - -### 新しいセッションキューで現在のリクエストを取得するためのクエリ - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ sessionsInfo { sessionQueueRequests } }"}' -s -``` - -### 新しいセッションキューのサイズを取得するためのクエリ - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ grid { sessionQueueSize } }"}' -s -``` diff --git a/website_and_docs/content/documentation/grid/advanced_features/graphql_support.pt-br.md b/website_and_docs/content/documentation/grid/advanced_features/graphql_support.pt-br.md deleted file mode 100644 index 495e9933e884..000000000000 --- a/website_and_docs/content/documentation/grid/advanced_features/graphql_support.pt-br.md +++ /dev/null @@ -1,183 +0,0 @@ ---- -title: "Suporte a buscas em GraphQL" -linkTitle: "Suporte a buscas em GraphQL" -weight: 2 ---- - -GraphQL é uma linguagem de consulta para APIs e um runtime para atender a essas consultas com seus dados existentes. Ele dá aos usuários o poder de pedir exatamente o que precisam e nada mais. - -## Enums -Enums representam possíveis conjuntos de valores para um campo. - -Por exemplo, o objeto `Node` possui um campo chamado` status`. O estado é um enum (especificamente, do tipo `Status`) porque pode ser` UP`, `DRAINING` ou` UNAVAILABLE`. - -## Escalares -Escalares são valores primitivos: `Int`,` Float`, `String`,` Boolean` ou `ID`. - -Ao chamar a API GraphQL, você deve especificar o subcampo aninhado até retornar apenas escalares. - - -## Estrutura do Schema -A estrutura do esquema de grade é a seguinte: - -```shell -{ - session(id: "") : { - id, - capabilities, - startTime, - uri, - nodeId, - nodeUri, - sessionDurationMillis - slot : { - id, - stereotype, - lastStarted - } - } - grid: { - uri, - totalSlots, - nodeCount, - maxSession, - sessionCount, - version, - sessionQueueSize - } - sessionsInfo: { - sessionQueueRequests, - sessions: [ - { - id, - capabilities, - startTime, - uri, - nodeId, - nodeUri, - sessionDurationMillis - slot : { - id, - stereotype, - lastStarted - } - } - ] - } - nodesInfo: { - nodes : [ - { - id, - uri, - status, - maxSession, - slotCount, - sessions: [ - { - id, - capabilities, - startTime, - uri, - nodeId, - nodeUri, - sessionDurationMillis - slot : { - id, - stereotype, - lastStarted - } - } - ], - sessionCount, - stereotypes, - version, - osInfo: { - arch, - name, - version - } - } - ] - } -} -``` - -## Consultando GraphQL - -O melhor jeito de consultar GraphQL é utilizando requisições `curl`. GraphQL permite que você busque apenas os dados que você quer, nada mais, anda menos. - -Alguns exemplos de buscas em GraphQL estão abaixo. Você pode montar as queries como quiser. - -### Buscando o número total de slots (`maxSession`) e slots usados (`sessionCount`) na Grid: - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query": "{ grid { maxSession, sessionCount } }"}' -s -``` - -Geralmente na máquina local o `` será `http://localhost:4444/graphql` - -### Buscando todos os detalhes da Sessão, Nó e Grid: - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ grid { uri, maxSession, sessionCount }, nodesInfo { nodes { id, uri, status, sessions { id, capabilities, startTime, uri, nodeId, nodeUri, sessionDurationMillis, slot { id, stereotype, lastStarted } }, slotCount, sessionCount }} }"}' -s -``` - -### Buscando o número de sessões atual na Grid: - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ grid { sessionCount } }"}' -s -``` - -### Buscando a contagem máxima de sessões na Grid: - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ grid { maxSession } }"}' -s -``` - -### Buscando todos os detalhes de todas as sessões de todos os nós na Grid: - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ sessionsInfo { sessions { id, capabilities, startTime, uri, nodeId, nodeId, sessionDurationMillis } } }"}' -s -``` - -### Buscando informações dos slots de todas as sessões de cada Nó na Grid: - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ sessionsInfo { sessions { id, slot { id, stereotype, lastStarted } } } }"}' -s -``` - -### Buscando informação da sessão para uma sessão específica: - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ session (id: \"\") { id, capabilities, startTime, uri, nodeId, nodeUri, sessionDurationMillis, slot { id, stereotype, lastStarted } } } "}' -s -``` - -### Buscando os recursos de cada nó na Grid: - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query": "{ nodesInfo { nodes { stereotypes } } }"}' -s -``` - -### Buscando o status de cada Nó na Grid: - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query": "{ nodesInfo { nodes { status } } }"}' -s -``` - -### Buscando a URI de cada Nó e da Grid: - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query": "{ nodesInfo { nodes { uri } } }"}' -s -``` - -### Query for getting the current requests in the New Session Queue: - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ sessionsInfo { sessionQueueRequests } }"}' -s -``` - -### Query for getting the New Session Queue size : - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ grid { sessionQueueSize } }"}' -s -``` diff --git a/website_and_docs/content/documentation/grid/advanced_features/graphql_support.zh-cn.md b/website_and_docs/content/documentation/grid/advanced_features/graphql_support.zh-cn.md deleted file mode 100644 index e1e418b6c49d..000000000000 --- a/website_and_docs/content/documentation/grid/advanced_features/graphql_support.zh-cn.md +++ /dev/null @@ -1,184 +0,0 @@ ---- -title: "GraphQL查询支持" -linkTitle: "GraphQL查询支持" -weight: 2 ---- - - -GraphQL 是一种用于API的查询语言, 也是用于使用现有数据完成这些查询的运行时. 其仅仅是使用户能够准确地获取所需. - -## 枚举 -枚举是表示字段的可能值的集合. - -例如, `Node`对象具有一个称为`status`的字段. 状态是一个枚举 (特别是`Status`类型) , 因为它可能是`UP` , `DRAINING` 或 `UNAVAILABLE`. - -## 标量 -标量是基本类型的值: `Int`, `Float`, `String`, `Boolean`, 或 `ID`. - -在调用GraphQL API时, 必须指定嵌套子字段, 直到只返回标量. - - -## 模式的结构 -网格模式的结构如下: - -```shell -{ - session(id: "") : { - id, - capabilities, - startTime, - uri, - nodeId, - nodeUri, - sessionDurationMillis - slot : { - id, - stereotype, - lastStarted - } - } - grid: { - uri, - totalSlots, - nodeCount, - maxSession, - sessionCount, - version, - sessionQueueSize - } - sessionsInfo: { - sessionQueueRequests, - sessions: [ - { - id, - capabilities, - startTime, - uri, - nodeId, - nodeUri, - sessionDurationMillis - slot : { - id, - stereotype, - lastStarted - } - } - ] - } - nodesInfo: { - nodes : [ - { - id, - uri, - status, - maxSession, - slotCount, - sessions: [ - { - id, - capabilities, - startTime, - uri, - nodeId, - nodeUri, - sessionDurationMillis - slot : { - id, - stereotype, - lastStarted - } - } - ], - sessionCount, - stereotypes, - version, - osInfo: { - arch, - name, - version - } - } - ] - } -} -``` - -## 查询 GraphQL - -查询GraphQL的最佳方法是使用`curl`请求. GraphQL允许您仅获取所需的数据, 仅此而已. - -下面给出了一些GraphQL查询的示例. 您可以根据需要构建自己的查询. - -### 查询网格中 `maxSession` 和 `sessionCount` 的数量: - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query": "{ grid { maxSession, sessionCount } }"}' -s -``` - -通常在本地机器上 `` 会是 `http://localhost:4444/graphql` - -### 查询全部会话、及节点以及网格的详情 : - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ grid { uri, maxSession, sessionCount }, nodesInfo { nodes { id, uri, status, sessions { id, capabilities, startTime, uri, nodeId, nodeUri, sessionDurationMillis, slot { id, stereotype, lastStarted } }, slotCount, sessionCount }} }"}' -s -``` - -### 查询以获取当前网格的会话总数 : - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ grid { sessionCount } }"}' -s -``` - -### 查询以获取网格中的最大会话数量 : - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ grid { maxSession } }"}' -s -``` - -### 查询以获取网格中所有节点的全部会话详情 : - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ sessionsInfo { sessions { id, capabilities, startTime, uri, nodeId, nodeId, sessionDurationMillis } } }"}' -s -``` - -### 查询以获取网格中每个节点中所有会话的插槽信息 : - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ sessionsInfo { sessions { id, slot { id, stereotype, lastStarted } } } }"}' -s -``` - -### 查询以获取给定会话的会话信息查询以获取给定会话的会话信息 : - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ session (id: \"\") { id, capabilities, startTime, uri, nodeId, nodeUri, sessionDurationMillis, slot { id, stereotype, lastStarted } } } "}' -s -``` - -### 查询网格中每个节点的功能 : - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query": "{ nodesInfo { nodes { stereotypes } } }"}' -s -``` - -### 查询网格中每个节点的状态 : - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query": "{ nodesInfo { nodes { status } } }"}' -s -``` - -### 查询每个节点和网格的 URI : - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query": "{ nodesInfo { nodes { uri } } }"}' -s -``` - -### Query for getting the current requests in the New Session Queue: - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ sessionsInfo { sessionQueueRequests } }"}' -s -``` - -### Query for getting the New Session Queue size : - -```shell -curl -X POST -H "Content-Type: application/json" --data '{"query":"{ grid { sessionQueueSize } }"}' -s -``` diff --git a/website_and_docs/content/documentation/grid/advanced_features/observability.en.md b/website_and_docs/content/documentation/grid/advanced_features/observability.en.md index 788bba74de3f..5b3046df413f 100644 --- a/website_and_docs/content/documentation/grid/advanced_features/observability.en.md +++ b/website_and_docs/content/documentation/grid/advanced_features/observability.en.md @@ -2,7 +2,11 @@ title: "Observability in Selenium Grid" linkTitle: "Observability" weight: 1 -aliases: ["/documentation/en/grid/grid_4/advanced_features/observability/", "/documentation/ja/grid/grid_4/advanced_features/observability/", "/documentation/pt-br/grid/grid_4/advanced_features/observability/", "/documentation/zh-cn/grid/grid_4/advanced_features/observability/"] +aliases: ["/documentation/en/grid/grid_4/advanced_features/observability/", "/documentation/ja/grid/grid_4/advanced_features/observability/", "/documentation/pt-br/grid/grid_4/advanced_features/observability/", "/documentation/zh-cn/grid/grid_4/advanced_features/observability/", +"/ja/documentation/grid/advanced_features/observability/", +"/pt-br/documentation/grid/advanced_features/observability/", +"/zh-cn/documentation/grid/advanced_features/observability/" +] --- ## Table of Contents diff --git a/website_and_docs/content/documentation/grid/advanced_features/observability.ja.md b/website_and_docs/content/documentation/grid/advanced_features/observability.ja.md deleted file mode 100644 index 25191d27f5cd..000000000000 --- a/website_and_docs/content/documentation/grid/advanced_features/observability.ja.md +++ /dev/null @@ -1,188 +0,0 @@ ---- -title: "可観測性" -linkTitle: "可観測性" -weight: 1 ---- - -## 目次 - -- [Selenium Grid](#selenium-grid) -- [可観測性](#可観測性) - - [分散トレーシング](#分散トレーシング) - - [イベントロギング](#イベントロギング) -- [Grid の可観測性](#Grid-の可観測性) - - [トレースの可視化](#トレースの可視化) - - [イベントログの活用](#イベントログの活用) -- [参考](#参考) - -## Selenium Grid - -Grid は、さまざまなブラウザとオペレーティングシステムの組み合わせでテストを実行することにより、テストのスケーリングと分散を支援します。 - -## 可観測性 - -可観測性(Observability) には、トレース、メトリクス、ログの 3 つの柱があります。 -Selenium Grid 4 は完全分散型に設計されているため、可観測性を確保することで内部を理解し、デバッグすることが容易になります。 - -## 分散トレーシング - -1 つのリクエストやトランザクションは、複数のサービスやコンポーネントにまたがります。 -トレースは、各サービスがリクエストを実行する際に、リクエストのライフサイクルをトラックします。これは、エラーシナリオのデバッグに有用です。 -トレースで使用される用語は次のとおりです: - -**トレース** -トレースでは、複数のサービスを通じてリクエストの出発点から最終地点までを追跡することができます。 -このリクエストの旅は、デバッグ、エンドツーエンドフローの監視、障害の特定に役立ちます。 -トレースは、エンドツーエンドのリクエストフローを描きます。 -各トレースは識別子としてユニークな ID を持っています。 - -**スパン** - -各トレースは、スパンと呼ばれる時間で区切られたオペレーションで構成されています。 -スパンには開始時刻と終了時刻があり、サービスによって実行される操作を表します。 -スパンの粒度は実装方法に依存します。各スパンは一意の識別子を持ちます。 -トレース内のすべてのスパンは、同じトレース ID を持ちます。 - -**スパン属性** -スパン属性は各スパンの付加的な情報を提供するキーと値のペアです。 - -**イベント** -イベントは、スパン内のタイムスタンプ付きログです。 -既存のスパンに追加のコンテキストを提供します。 -イベントには、イベント属性としてキーと値のペアも含まれます。 - -## イベントロギング - -アプリケーションのデバッグには、ロギングが欠かせません。 -ログの記録は多くの場合、人間が読める形式で行われます。 -しかし、機械がログを検索・分析するためには、明確に定義されたフォーマットである必要があります。 -構造化ロギングは、固定フォーマットで一貫してログを記録する一般的な方法です。 -一般的には次のようなフィールドが含まれます。 - -- タイムスタンプ -- ログレベル -- ロガークラス -- ログメッセージ (これはさらに、ログが記録された操作に関するフィールドに分解されます) - -ログとイベントは密接に関連しています。 -イベントは、1 つの処理を行うための情報を全てカプセル化します。 -ログは基本的にイベントのサブセットです。 -重要なのは、どちらもデバッグを支援することです。 -詳細については、以下のリソースを参照してください。 - -1. [https://www.honeycomb.io/blog/how-are-structured-logs-different-from-events/](https://www.honeycomb.io/blog/how-are-structured-logs-different-from-events/) -2. [https://charity.wtf/2019/02/05/logs-vs-structured-events/](https://charity.wtf/2019/02/05/logs-vs-structured-events/) - -## Grid の可観測性 - -Selenium サーバーは OpenTelemetry を使ってトレースできるようになっています。 -サーバへのすべてのリクエストは、最初から最後までトレースされます。 -各トレースは、リクエストがサーバ内で実行されるときの一連のスパンから構成されます。 -Selenium サーバのスパンのほとんどは、2 つのイベントから構成されています。 - -1. 通常イベント- 単一の処理に関するすべての情報を記録し、処理が正常に完了したことを知らせます。 -2. エラーイベント- エラーが発生するまでのすべての情報を記録し、エラー情報を記録します。例外イベントをマークします。 - -Selenium サーバーを起動する: - -1. [スタンドアロン](https://github.com/SeleniumHQ/selenium/wiki/Selenium-Grid-4#standalone-mode) -2. [ハブ・ノード](https://github.com/SeleniumHQ/selenium/wiki/Selenium-Grid-4#hub-and-node) -3. [完全分散モード](https://github.com/SeleniumHQ/selenium/wiki/Selenium-Grid-4#fully-distributed) -4. [Docker](https://github.com/SeleniumHQ/selenium/wiki/Selenium-Grid-4#using-docker) - -## トレースの可視化 - -すべてのスパン、イベント、およびそれぞれの属性がトレースの一部となります。 -トレースは、上記のすべてのモードでサーバを実行している間動作します。 -トレースはデフォルトで Selenium サーバで有効になっています。 - -Selenium サーバーは、2 つのエクスポーター経由でトレースをエクスポートします。 - -1. コンソール - すべてのトレースと、それに含まれるスパンを FINE レベルでログに出力します。デフォルトでは、Selenium サーバーは INFO レベル以上のログを出力します。 - **log-level** フラグを使うと、Selenium Grid jar を実行する際に任意のログレベルを指定することができます。 - -```shell -java -jar selenium-server-4.0.0-.jar standalone --log-level FINE -``` - -2. Jaeger UI - OpenTelemetry は、コード内のトレースを計測するための API と SDK を提供します。一方、Jaeger はトレースのバックエンドで、トレースのテレメトリデータを収集し、データのクエリ、フィルタリング、ビジュアライズの機能を提供します。 - -Jaeger UI を用いたトレースの可視化の詳細な手順を確認するには、次のコマンドを実行してください: - -```shell -java -jar selenium-server-4.0.0-.jar info tracing -``` - -[非常に参考になる例と、Jaeger にトレースを送信するスクリプトです](https://github.com/manoj9788/tracing-selenium-grid) - -## イベントログの活用 - -トレースを可視化しない場合でも、イベントロギングではトレースを有効にする必要があります。 -**デフォルトでは、トレースは有効です。コンソールでログを見るために、追加のパラメータを渡す必要はありません。** -スパン内のすべてのイベントは FINE レベルでログに記録されます。エラーイベントは、WARN レベルでログに記録されます。 - -全てのイベントは次のフィールドを持ちます: - -| フィールド | フィールド名 | 概要 | -| ------------ | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| イベント時刻 | eventId | イベントのタイムスタンプ(エポックナノ秒)。 | -| トレース ID | tracedId | 各トレースはトレース ID で一意に識別されます。 | -| スパン ID | spanId | トレース内の各スパンは、スパン ID により一意に識別されます。 | -| スパン種別 | spanKind | スパン種別は、スパンの種類を示すスパンのプロパティです。スパンの処理の性質を識別するのに役立ちます。 | -| イベント名 | eventName | ログメッセージにマッピングされます。 | -| イベント属性 | eventAttributes | イベントログの核となるもので、実行された操作に基づいて JSON フォーマットのキーと値のペアが用意されています。また、ロガークラスを表示するために、ハンドラークラスアトリビュートも含まれます。 | - -サンプルログ - - FINE [LoggingOptions$1.lambda$export$1] - { - "traceId": "fc8aef1d44b3cc8bc09eb8e581c4a8eb", - "spanId": "b7d3b9865d3ddd45", - "spanKind": "INTERNAL", - "eventTime": 1597819675128886121, - "eventName": "Session request execution complete", - "attributes": { - "http.status_code": 200, - "http.handler_class": "org.openqa.selenium.grid.router.HandleSession", - "http.url": "\u002fsession\u002fdd35257f104bb43fdfb06242953f4c85", - "http.method": "DELETE", - "session.id": "dd35257f104bb43fdfb06242953f4c85" - } - } - -上記のフィールドに加えて、[OpenTelemetry の仕様](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/exceptions.md)に基づきエラーログは以下のフィールドで構成されます: - -| フィールド | フィールド名 | 概要 | -| ---------------- | -------------------- | --------------------------------------------------------------------------------------- | -| 例外タイプ | exception.type | 例外クラス名。 | -| 例外メッセージ | exception.message | 例外の原因。 | -| スタックトレース | exception.stacktrace | 例外が発生した時点のコールスタックを表示します。 例外の発生源を把握するのに役立ちます。 | - -サンプルエラーログ - - WARN [LoggingOptions$1.lambda$export$1] - { - "traceId": "7efa5ea57e02f89cdf8de586fe09f564", - "spanId": "914df6bc9a1f6e2b", - "spanKind": "INTERNAL", - "eventTime": 1597820253450580272, - "eventName": "exception", - "attributes": { - "exception.type": "org.openqa.selenium.ScriptTimeoutException", - "exception.message": "Unable to execute request: java.sql.SQLSyntaxErrorException: Table 'mysql.sessions_mappa' doesn't exist ..." (full message will be printed), - "exception.stacktrace": "org.openqa.selenium.ScriptTimeoutException: java.sql.SQLSyntaxErrorException: Table 'mysql.sessions_mappa' doesn't exist\nBuild info: version: '4.0.0-alpha-7', revision: 'Unknown'\nSystem info: host: 'XYZ-MacBook-Pro.local', ip: 'fe80:0:0:0:10d5:b63a:bdc6:1aff%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '11.0.7'\nDriver info: driver.version: unknown ...." (full stack will be printed), - "http.handler_class": "org.openqa.selenium.grid.distributor.remote.RemoteDistributor", - "http.url": "\u002fsession", - "http.method": "POST" - } - } - -注: ログは読みやすさのためプリティプリントされています。Selenimu サーバーではぷるティプリントはオフになっています。 - -以上がトレースとログをセットアップするための手順です。 - -## 参考 - -1. [Understanding Tracing](https://lightstep.com/blog/opentelemetry-101-what-is-tracing/) -2. [OpenTelemetry Tracing API Specification](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#status) -3. [Selenium Wiki](https://github.com/SeleniumHQ/selenium/wiki) -4. [Structured logs vs events](https://www.honeycomb.io/blog/how-are-structured-logs-different-from-events/) -5. [Jaeger framework](https://github.com/jaegertracing/jaeger) diff --git a/website_and_docs/content/documentation/grid/advanced_features/observability.pt-br.md b/website_and_docs/content/documentation/grid/advanced_features/observability.pt-br.md deleted file mode 100644 index 740a07a69a42..000000000000 --- a/website_and_docs/content/documentation/grid/advanced_features/observability.pt-br.md +++ /dev/null @@ -1,172 +0,0 @@ ---- -title: "Observabilidade" -linkTitle: "Observabilidade" -weight: 1 ---- - - -## Índice - - [Selenium Grid](#selenium-grid) - - [Observabilidade](#observabilidade) - - [Rastreamento distribuído](#rastreamento-distribuído) - - [Registro de eventos](#Registro-de-eventos) - - [Observabilidade da Grade](#observabilidade-da-grade) - - [Visualizando Traços](#visualizando-traços) - - [Aproveitando logs de eventos](#Aproveitando-logs-de-eventos) - - [Referências](#referências) - -## Selenium Grid - -O Grid auxilia na escalabilidade e distribuição de testes, executando testes em várias combinações de navegadores e sistemas operacionais. - -## Observabilidade - -A observabilidade tem três pilares: rastreamentos, métricas e registros. Como o Selenium Grid 4 foi projetado para ser totalmente distribuído, a observabilidade tornará mais fácil entender e depurar os detalhes internos. - -## Rastreamento Distribuído -Uma única solicitação ou transação abrange vários serviços e componentes. O rastreamento acompanha o ciclo de vida da solicitação à medida que cada serviço a executa. Isso é útil para depurar cenários de erro. -Alguns termos-chave usados no contexto de rastreamento são: - - -**Rastreamento** -O rastreamento permite rastrear uma solicitação por meio de vários serviços, desde sua origem até seu destino final. A jornada dessa solicitação ajuda na depuração, no monitoramento do fluxo de ponta a ponta e na identificação de falhas. Um rastreamento representa o fluxo da solicitação de ponta a ponta. Cada rastreamento possui um identificador único. - - -**Segmento** -Cada rastreamento é composto por operações cronometradas chamadas segmentos. Um segmento possui um horário de início e término e representa operações realizadas por um serviço. A granularidade do segmento depende de como ele é instrumentado. Cada segmento possui um identificador único. Todos os segmentos dentro de um rastreamento têm o mesmo ID de rastreamento. - - -**Atributos de Segmento** -Atributos de segmento são pares de chave e valor que fornecem informações adicionais sobre cada segmento. - -**Eventos** -Eventos são registros com carimbo de data/hora dentro de um segmento. Eles fornecem contexto adicional para os segmentos existentes. Os eventos também contêm pares de chave e valor como atributos de evento. - -## Registro de Eventos - -O registro é essencial para depurar um aplicativo. O registro é frequentemente feito em um formato legível por humanos. Mas, para que as máquinas possam pesquisar e analisar os registros, é necessário ter um formato bem definido. O registro estruturado é uma prática comum de registrar logs de forma consistente em um formato fixo. Ele normalmente contém campos como: - - * Carimbo de data/horas - * Nível de registro - * Classe de registro - * Mensagem de registro (isso é detalhado em campos relevantes à operação em que o registro foi feito) - -Registros e eventos estão intimamente relacionados. Os eventos encapsulam todas as informações possíveis para realizar uma única unidade de trabalho. Os registros são essencialmente subconjuntos de um evento. No cerne, ambos auxiliam na depuração. - -Consulte os recursos a seguir para entender em detalhes: - - 1. [https://www.honeycomb.io/blog/how-are-structured-logs-different-from-events/](https://www.honeycomb.io/blog/how-are-structured-logs-different-from-events/) - 2. [https://charity.wtf/2019/02/05/logs-vs-structured-events/](https://charity.wtf/2019/02/05/logs-vs-structured-events/) - -## Observabilidade do Grid - - -O servidor Selenium é instrumentado com rastreamento usando o OpenTelemetry. Cada solicitação ao servidor é rastreada do início ao fim. Cada rastreamento consiste em uma série de segmentos à medida que uma solicitação é executada no servidor. A maioria dos segmentos no servidor Selenium consiste em dois eventos: - -1. Evento normal - registra todas as informações sobre uma unidade de trabalho e marca a conclusão bem-sucedida do trabalho. -2. Evento de erro - registra todas as informações até que ocorra o erro e, em seguida, registra as informações do erro. Marca um evento de exceção. - -Executando servidor Selenium - - 1. [Standalone](https://github.com/SeleniumHQ/selenium/wiki/Selenium-Grid-4#standalone-mode) - 2. [Hub and Node](https://github.com/SeleniumHQ/selenium/wiki/Selenium-Grid-4#hub-and-node) - 3. [Fully Distributed](https://github.com/SeleniumHQ/selenium/wiki/Selenium-Grid-4#fully-distributed) - 4. [Docker](https://github.com/SeleniumHQ/selenium/wiki/Selenium-Grid-4#using-docker) - -## Visualizando Rastreamentos -Todos os segmentos, eventos e seus respectivos atributos fazem parte de um rastreamento. O rastreamento funciona enquanto o servidor é executado em todos os modos mencionados acima. - -Por padrão, o rastreamento está habilitado no servidor Selenium. O servidor Selenium exporta os rastreamentos por meio de dois exportadores: - -1. Console - Registra todos os rastreamentos e os segmentos incluídos com nível FINE. Por padrão, o servidor Selenium imprime registros no nível INFO e acima. - -A opção **log-level** pode ser usada para definir um nível de registro de sua escolha ao executar o arquivo JAR do Selenium Grid jar/s. - -```shell -java -jar selenium-server-4.0.0-.jar standalone --log-level FINE -``` -2. Jaeger UI - OpenTelemetry fornece as APIs e SDKs para instrumentar rastreamentos no código. Enquanto o Jaeger é um sistema de rastreamento de backend que auxilia na coleta de dados de telemetria de rastreamento e oferece recursos de consulta, filtragem e visualização dos dados. - -Instruções detalhadas sobre como visualizar rastreamentos usando a interface do Jaeger podem ser obtidas executando o seguinte comando: - -```shell -java -jar selenium-server-4.0.0-.jar info tracing -``` - -[Um exemplo muito bom e scripts para executar o servidor e enviar rastreamentos para o Jaeger](https://github.com/manoj9788/tracing-selenium-grid) - -## Explorando logs de eventos -O rastreamento deve estar habilitado para o registro de eventos, mesmo que alguém não deseje exportar rastreamentos para visualizá-los. - -**Por padrão, o rastreamento está habilitado. Não é necessário passar parâmetros adicionais para ver os logs no console.** - -Todos os eventos dentro de um segmento são registrados no nível FINE. Eventos de erro são registrados no nível WARN.. - -| Campo | Valor do Campo | Descrição | -|------|------|------| -| Hora do Evento | eventId | Carimbo de data/hora do registro do evento em nanossegundos desde a época. | -| ID de Rastreamento | tracedId | Cada rastreamento é identificado exclusivamente por um ID de rastreamento. | -| ID de Segmento | spanId | Cada segmento dentro de um rastreamento é identificado exclusivamente por um ID de segmento. | -| Tipo de Segmento | spanKind | O tipo de segmento é uma propriedade do segmento que indica o tipo de segmento. Isso ajuda a entender a natureza da unidade de trabalho realizada pelo segmento. | -| Nome do Evento | eventName | Isso mapeia para a mensagem de registro. | -| Atributos do Evento | eventAttributes | Isso forma a essência dos registros de eventos, com base na operação executada, ele contém pares chave-valor formatados em JSON. Isso também inclui um atributo de classe do manipulador, para mostrar a classe do registro. | - - Simples log - - - - FINE [LoggingOptions$1.lambda$export$1] - { - "traceId": "fc8aef1d44b3cc8bc09eb8e581c4a8eb", - "spanId": "b7d3b9865d3ddd45", - "spanKind": "INTERNAL", - "eventTime": 1597819675128886121, - "eventName": "Session request execution complete", - "attributes": { - "http.status_code": 200, - "http.handler_class": "org.openqa.selenium.grid.router.HandleSession", - "http.url": "\u002fsession\u002fdd35257f104bb43fdfb06242953f4c85", - "http.method": "DELETE", - "session.id": "dd35257f104bb43fdfb06242953f4c85" - } - } - -Além dos campos mencionados anteriormente, com base na [especificação do OpenTelemetry](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/exceptions.md) os registros de erro consistem nos seguintes campos: : - -| Campo | Valor do Campo | Descrição | -|------|------|------| -| Tipo de Exceção | exception.type | O nome da classe da exceção. | -| Mensagem da Exceção | exception.message | Motivo da exceção. | -| Rastreamento de Exceção | exception.stacktrace | Imprime a pilha de chamadas no momento em que a exceção foi lançada. Ajuda a entender a origem da exceção. | - - - -Simples error log - - - WARN [LoggingOptions$1.lambda$export$1] - { - "traceId": "7efa5ea57e02f89cdf8de586fe09f564", - "spanId": "914df6bc9a1f6e2b", - "spanKind": "INTERNAL", - "eventTime": 1597820253450580272, - "eventName": "exception", - "attributes": { - "exception.type": "org.openqa.selenium.ScriptTimeoutException", - "exception.message": "Unable to execute request: java.sql.SQLSyntaxErrorException: Table 'mysql.sessions_mappa' doesn't exist ..." (full message will be printed), - "exception.stacktrace": "org.openqa.selenium.ScriptTimeoutException: java.sql.SQLSyntaxErrorException: Table 'mysql.sessions_mappa' doesn't exist\nBuild info: version: '4.0.0-alpha-7', revision: 'Unknown'\nSystem info: host: 'XYZ-MacBook-Pro.local', ip: 'fe80:0:0:0:10d5:b63a:bdc6:1aff%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '11.0.7'\nDriver info: driver.version: unknown ...." (full stack will be printed), - "http.handler_class": "org.openqa.selenium.grid.distributor.remote.RemoteDistributor", - "http.url": "\u002fsession", - "http.method": "POST" - } - } - - -**Observação:** Os logs são formatados acima para facilitar a leitura. A formatação de logs está desativada no servidor Selenium. - -Os passos acima devem configurá-lo para visualizar rastreamentos e logs. - -## Referências -1. [Compreendendo o Rastreamento](https://lightstep.com/blog/opentelemetry-101-what-is-tracing/) -2. [Especificação da API de Rastreamento do OpenTelemetry](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#status) -3. [Selenium Wiki](https://github.com/SeleniumHQ/selenium/wiki) -4. [Logs Estruturados vs. Eventos](https://www.honeycomb.io/blog/how-are-structured-logs-different-from-events/) -5. [Framework Jaeger](https://github.com/jaegertracing/jaeger) diff --git a/website_and_docs/content/documentation/grid/advanced_features/observability.zh-cn.md b/website_and_docs/content/documentation/grid/advanced_features/observability.zh-cn.md deleted file mode 100644 index 20fa7cf7209f..000000000000 --- a/website_and_docs/content/documentation/grid/advanced_features/observability.zh-cn.md +++ /dev/null @@ -1,167 +0,0 @@ ---- -title: "可观测性" -linkTitle: "可观测性" -weight: 1 ---- - - -{{% pageinfo color="warning" %}} -

- - Page being translated from - English to Chinese. Do you speak Chinese? Help us to translate - it by sending us pull requests! -

-{{% /pageinfo %}} - - -## Table of Contents - - [Selenium Grid](#selenium-grid) - - [Observability](#observability) - - [Distributed tracing](#distributed-tracing) - - [Event logging](#event-logging) - - [Grid Observability](#grid-observability) - - [Visualizing Traces](#visualizing-traces) - - [Leveraging event logs](#leveraging-event-logs) - - [References](#references) - -## Selenium Grid - -Grid aids in scaling and distributing tests by executing tests on various browser and operating system combinations. - -## Observability - -Observability has three pillars: traces, metrics and logs. Since Selenium Grid 4 is designed to be fully distributed, observability will make it easier to understand and debug the internals. - -## Distributed tracing -A single request or transaction spans multiple services and components. Tracing tracks the request lifecycle as each service executes the request. It is useful in debugging in an error scenario. -Some key terms used in tracing context are: - -**Trace** -Tracing allows one to trace a request through multiple services, starting from its origin to its final destination. This request's journey helps in debugging, monitoring the end-to-end flow, and identifying failures. A trace depicts the end-to-end request flow. Each trace has a unique id as its identifier. - -**Span** -Each trace is made up of timed operations called spans. A span has a start and end time and it represents operations done by a service. The granularity of span depends on how it is instrumented. Each span has a unique identifier. All spans within a trace have the same trace id. - -**Span Attributes** -Span attributes are key-value pairs which provide additional information about each span. - -**Events** -Events are timed-stamped logs within a span. They provide additional context to the existing spans. Events also contain key-value pairs as event attributes. - -## Event logging - -Logging is essential to debug an application. Logging is often done in a human-readable format. But for machines to search and analyze the logs, it has to have a well-defined format. Structured logging is a common practice of recording logs consistently in a fixed format. It commonly contains fields like: - * Timestamp - * Logging level - * Logger class - * Log message (This is further broken down into fields relevant to the operation where the log was recorded) - -Logs and events are closely related. Events encapsulate all the possible information available to do a single unit of work. Logs are essentially subsets of an event. At the crux, both aid in debugging. -Refer following resources for detailed understanding: - 1. [https://www.honeycomb.io/blog/how-are-structured-logs-different-from-events/](https://www.honeycomb.io/blog/how-are-structured-logs-different-from-events/) - 2. [https://charity.wtf/2019/02/05/logs-vs-structured-events/](https://charity.wtf/2019/02/05/logs-vs-structured-events/) - -## Grid Observability - -Selenium server is instrumented with tracing using OpenTelemetry. Every request to the server is traced from start to end. Each trace consists of a series of spans as a request is executed within the server. -Most spans in the Selenium server consist of two events: -1. Normal event - records all information about a unit of work and marks successful completion of the work. -2. Error event - records all information till the error occurs and then records the error information. Marks an exception event. - -Running Selenium server - 1. [Standalone](https://github.com/SeleniumHQ/selenium/wiki/Selenium-Grid-4#standalone-mode) - 2. [Hub and Node](https://github.com/SeleniumHQ/selenium/wiki/Selenium-Grid-4#hub-and-node) - 3. [Fully Distributed](https://github.com/SeleniumHQ/selenium/wiki/Selenium-Grid-4#fully-distributed) - 4. [Docker](https://github.com/SeleniumHQ/selenium/wiki/Selenium-Grid-4#using-docker) - -## Visualizing Traces -All spans, events and their respective attributes are part of a trace. Tracing works while running the server in all of the above-mentioned modes. - -By default, tracing is enabled in the Selenium server. Selenium server exports the traces via two exporters: -1. Console - Logs all traces and their included spans at FINE level. By default, Selenium server prints logs at INFO level and above. -The **log-level** flag can be used to pass a logging level of choice while running the Selenium Grid jar/s. -```shell -java -jar selenium-server-4.0.0-.jar standalone --log-level FINE -``` -2. Jaeger UI - OpenTelemetry provides the APIs and SDKs to instrument traces in the code. Whereas Jaeger is a tracing backend, that aids in collecting the tracing telemetry data and providing querying, filtering and visualizing features for the data. - -Detailed instructions of visualizing traces using Jaeger UI can be obtained by running the command : - -```shell -java -jar selenium-server-4.0.0-.jar info tracing -``` - -[A very good example and scripts to run the server and send traces to Jaeger](https://github.com/manoj9788/tracing-selenium-grid) - -## Leveraging event logs -Tracing has to be enabled for event logging as well, even if one does not wish to export traces to visualize them. -**By default, tracing is enabled. No additional parameters need to be passed to see logs on the console.** -All events within a span are logged at FINE level. Error events are logged at WARN level. - -All event logs have the following fields : - | Field | Field value | Description | -|-|-|-| -| Event time | eventId | Timestamp of the event record in epoch nanoseconds. | -| Trace Id | tracedId | Each trace is uniquely identified by a trace id. | -| Span Id | spanId | Each span within a trace is uniquely identified by a span id. | -| Span Kind | spanKind | Span kind is a property of span indicating the type of span. It helps in understanding the nature of the unit of work done by the Span. | -| Event name | eventName | This maps to the log message. | -| Event attributes | eventAttributes | This forms the crux of the event logs, based on the operation executed, it has JSON formatted key-value pairs. This also includes a handler class attribute, to show the logger class. | - - Sample log - - - - FINE [LoggingOptions$1.lambda$export$1] - { - "traceId": "fc8aef1d44b3cc8bc09eb8e581c4a8eb", - "spanId": "b7d3b9865d3ddd45", - "spanKind": "INTERNAL", - "eventTime": 1597819675128886121, - "eventName": "Session request execution complete", - "attributes": { - "http.status_code": 200, - "http.handler_class": "org.openqa.selenium.grid.router.HandleSession", - "http.url": "\u002fsession\u002fdd35257f104bb43fdfb06242953f4c85", - "http.method": "DELETE", - "session.id": "dd35257f104bb43fdfb06242953f4c85" - } - } - -In addition to the above fields, based on [OpenTelemetry specification](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/semantic_conventions/exceptions.md) error logs consist of : -| Field | Field value | Description | -|-|-|-| -| Exception type | exception.type | The class name of the exception. | -| Exception message | exception.message | Reason for the exception. | -| Exception stacktrace | exception.stacktrace | Prints the call stack at the point of time when the exception was thrown. Helps in understanding the origin of the exception. | - - -Sample error log - - - WARN [LoggingOptions$1.lambda$export$1] - { - "traceId": "7efa5ea57e02f89cdf8de586fe09f564", - "spanId": "914df6bc9a1f6e2b", - "spanKind": "INTERNAL", - "eventTime": 1597820253450580272, - "eventName": "exception", - "attributes": { - "exception.type": "org.openqa.selenium.ScriptTimeoutException", - "exception.message": "Unable to execute request: java.sql.SQLSyntaxErrorException: Table 'mysql.sessions_mappa' doesn't exist ..." (full message will be printed), - "exception.stacktrace": "org.openqa.selenium.ScriptTimeoutException: java.sql.SQLSyntaxErrorException: Table 'mysql.sessions_mappa' doesn't exist\nBuild info: version: '4.0.0-alpha-7', revision: 'Unknown'\nSystem info: host: 'XYZ-MacBook-Pro.local', ip: 'fe80:0:0:0:10d5:b63a:bdc6:1aff%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '11.0.7'\nDriver info: driver.version: unknown ...." (full stack will be printed), - "http.handler_class": "org.openqa.selenium.grid.distributor.remote.RemoteDistributor", - "http.url": "\u002fsession", - "http.method": "POST" - } - } - -Note: Logs are pretty printed above for readability. Pretty printing for logs is turned off in Selenium server. - -The steps above should set you up for seeing traces and logs. - -## References -1. [Understanding Tracing](https://lightstep.com/blog/opentelemetry-101-what-is-tracing/) -2. [OpenTelemetry Tracing API Specification](https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/trace/api.md#status) -3. [Selenium Wiki](https://github.com/SeleniumHQ/selenium/wiki) -4. [Structured logs vs events](https://www.honeycomb.io/blog/how-are-structured-logs-different-from-events/) -5. [Jaeger framework](https://github.com/jaegertracing/jaeger) diff --git a/website_and_docs/content/documentation/grid/applicability.en.md b/website_and_docs/content/documentation/grid/applicability.en.md index 77ace76df690..6f7c15315d41 100644 --- a/website_and_docs/content/documentation/grid/applicability.en.md +++ b/website_and_docs/content/documentation/grid/applicability.en.md @@ -9,7 +9,13 @@ aliases: [ "/documentation/grid/when_to_use_grid", "/documentation/ja/grid/when_to_use_grid/", "/documentation/pt-br/grid/when_to_use_grid/", -"/documentation/zh-cn/grid/when_to_use_grid/" +"/documentation/zh-cn/grid/when_to_use_grid/", +"/ja/documentation/grid/applicability/", +"/ja/documentation/grid/when_to_use_grid", +"/pt-br/documentation/grid/applicability/", +"/pt-br/documentation/grid/when_to_use_grid", +"/zh-cn/documentation/grid/applicability/", +"/zh-cn/documentation/grid/when_to_use_grid" ] --- diff --git a/website_and_docs/content/documentation/grid/applicability.ja.md b/website_and_docs/content/documentation/grid/applicability.ja.md deleted file mode 100644 index 74f41695df79..000000000000 --- a/website_and_docs/content/documentation/grid/applicability.ja.md +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: "いつGridを使用すべきか" -linkTitle: "いつGridを使用すべきか" -weight: 4 -description: > - Gridがあなたにとって最適なツールでしょうか? -aliases: [ -"/documentation/grid/when_to_use_grid" -] ---- - -Grid をいつ使うべきでしょうか? - -- 複数のブラウザー、異なるタイプまたは異なるバージョンのブラウザー、あるいは異なる OS 上でで実行されているブラウザーに対して並列でテストを実行したい場合 -- テストスイートの実行時間を減らしたい場合 - -Selenium Grid はノードと呼ばれる複数のマシンを使用して並列でテストスイートを実行します。 -大規模な長時間実行されるテストでは数分から数時間、あるいは数日単位での短縮が可能です。 -つまり、あなたのテスト対象のアプリケーションのテスト結果を得るまでの時間を短縮します。 - -Grid は複数の異なるブラウザーに対してテストを実行でき、また同じブラウザーインスタンスに対して複数のテストを実行することも可能です。 -たとえば 6 つのノードで構成された Grid があるとします。 -最初のマシンは FireFox の最新バージョン、2 つめは FireFox の最新から一つ前のバージョン、 -3 つめは 最新の Chrome、そして残りは Mac Mini で最新の Safari を使って 3 つのテストを並行して実行することができます。 - -実行時間は簡単な式で表すことができます: - -`テストの数 * 平均テスト時間 / ノード数 = 合計実行時間` - - 15 * 45s / 1 = 11m 15s // Grid なし - 15 * 45s / 5 = 2m 15s // 5 ノードの Grid - 15 * 45s / 15 = 45s // 15 ノードの Grid - 100 * 120s / 15 = 13m 20s // Grid なしの場合3時間以上かかります - -テストスイートが実行されると Grid はテストで設定されたブラウザに対して実行するテストを割り当てます。 - -このような設定により、大規模な Selenium テストスイートであっても実行時間を大幅に短縮することができます。 - -Selenium Grid は Selenium プロジェクトの一部であり、 -Selenium コアの開発コミッターと同じチームによってメンテナンスされています。 -テストの実行速度の重要性を認識し、Grid は Selenium プロジェクトの初期段階から重要な役割を担っています。 diff --git a/website_and_docs/content/documentation/grid/applicability.pt-br.md b/website_and_docs/content/documentation/grid/applicability.pt-br.md deleted file mode 100644 index 3f7e505902a3..000000000000 --- a/website_and_docs/content/documentation/grid/applicability.pt-br.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: "Quando usar a Grid" -linkTitle: "Quando usar a Grid" -weight: 4 -description: > - Será a Grid a melhor escolha para você? -aliases: [ -"/documentation/grid/when_to_use_grid" -] ---- - -Quando deve usar a Selenium Grid? - -* Para executar testes em paralelo, com vários tipos e versões de navegador e sistemas operativos -* Para reduzir o tempo necessário a executar uma bateria de testes - -A Selenium Grid executa baterias de testes em paralelo contra várias máquinas (chamadas Nodes). -Para testes longos, isto poderá poupar minutos, horas e talvez dias. -Isto encurta o tempo de espera para obter resultados dos testes de cada vez que sobre a aplicação -em testes é alterada. - -A Grid consegue executar testes (em paralelo) contra multiplos e diferentes navegadores, também -é capaz de executar contra várias instâncias do mesmo navegador. Como exemplo, vamos imaginar -uma Grid com seis Nodes. A primeira máquina tem a versão mais recente do Firefox, a segunda tem -a versão "mais recente -1", a terceira tem o Chrome mais recente e as restantes máquinas são Mac -Mini, que permitem três testes em paralelo com a versão mais recente to Safari. - -O tempo de execução pode ser expresso como uma fórmula simples: - -```Número de testes * Tempo médio de cada teste / Número de Nodes = Tempo total de execução``` - - 15 * 45s / 1 = 11m 15s // Sem Grid - 15 * 45s / 5 = 2m 15s // Grid com 5 Nodes - 15 * 45s / 15 = 45s // Grid com 15 Nodes - 100 * 120s / 15 = 13m 20s // Demoraria mais de 3 horas sem Grid - -À medida que a bateria de testes executa, a Grid vai alocando os testes contra estes navegadores -como está definido nos testes. - -Uma configuração deste tipo pode acelerar bastante o tempo de execução mesmo no caso de baterias de testes grandes. - -A Selenium Grid é uma parte integrante do projecto Selenium e é mantida em paralelo pela mesma equipa de developers -que desenvolvem o resto das funcionalidades base do projecto. Dada a importância da velocidade e desempenho da -execução dos testes, a Grid tem sido considerada desde o início como uma parte crítica e fundamental ao projecto. diff --git a/website_and_docs/content/documentation/grid/applicability.zh-cn.md b/website_and_docs/content/documentation/grid/applicability.zh-cn.md deleted file mode 100644 index e1f126d95f34..000000000000 --- a/website_and_docs/content/documentation/grid/applicability.zh-cn.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: "什么时候应该使用Grid" -linkTitle: "适用性" -weight: 4 -description: > - Grid适合您吗? -aliases: [ -"/documentation/grid/when_to_use_grid" -] ---- - - -什么情况下可以使用 `Selenium Grid` ? - -* 想要在不同的浏览器类型、浏览器版本和操作系统上并行运行测试时 -* 想要缩短执行测试案例所需的时间 - -`Selenium Grid` 可以并行地在多台计算机(称为节点)上运行测试案例. 对于大型和长时间运行的测试案例,这可以节省几分钟、几小时甚至几天的时间. - -这有效的缩短了测试结果的反馈时间,使得在测试的应用程序发生变化时能够更快地得到测试结果. - -`Grid` 可以并行地运行测试,支持多种不同的浏览器类型,并且可以同时运行多个相同浏览器的实例. - -举个例子,假设一个拥有六个节点的Grid. 第一台计算机拥有Firefox的最新版本,第二台拥有Firefox的上一个版本,第三台运行最新版Chrome,而其余三台机器是Mac Mini,允许在最新版本的Safari上并行运行三个测试. - -执行时间可以用一个简单的公式来表示: - -```测试次数 × 平均测试时间 / 节点数 = 总执行时间``` - - 15 * 45s / 1 = 11m 15s // 没有Grid - 15 * 45s / 5 = 2m 15s // 5节点的Grid - 15 * 45s / 15 = 45s // 15节点的Grid - 100 * 120s / 15 = 13m 20s // 如果没有Grid, 需要3个多小时 - -在测试案例执行时,`Grid` 会按照测试配置将测试分配到相应的浏览器上运行. - -即使对于比较复杂的 `Selenium` 测试案例,这样的配置也可以极大地加快执行时间. - -`Selenium Grid` 是 `Selenium` 项目中的重要组成部分,由同一团队的核心Selenium开发人员并行维护. -由于意识到测试执行速度的重要性,`Grid` 自设计之初就成为 `Selenium` 项目的关键部分. \ No newline at end of file diff --git a/website_and_docs/content/documentation/grid/components.en.md b/website_and_docs/content/documentation/grid/components.en.md index 895d120b55c7..26234af9566d 100644 --- a/website_and_docs/content/documentation/grid/components.en.md +++ b/website_and_docs/content/documentation/grid/components.en.md @@ -9,7 +9,13 @@ aliases: [ "/documentation/grid/components_of_a_grid/", "/documentation/ja/grid/grid_4/components_of_a_grid/", "/documentation/pt-br/grid/grid_4/components_of_a_grid/", -"/documentation/zh-cn/grid/grid_4/components_of_a_grid/" +"/documentation/zh-cn/grid/grid_4/components_of_a_grid/", +"/ja/documentation/grid/components/", +"/ja/documentation/grid/components_of_a_grid/", +"/pt-br/documentation/grid/components/", +"/pt-br/documentation/grid/components_of_a_grid/", +"/zh-cn/documentation/grid/components/", +"/zh-cn/documentation/grid/components_of_a_grid/" ] --- diff --git a/website_and_docs/content/documentation/grid/components.ja.md b/website_and_docs/content/documentation/grid/components.ja.md deleted file mode 100644 index 80112818d69d..000000000000 --- a/website_and_docs/content/documentation/grid/components.ja.md +++ /dev/null @@ -1,103 +0,0 @@ ---- -title: "Selenium Grid のコンポーネント" -linkTitle: "コンポーネント" -weight: 6 -description: > - Grid コンポーネントの使い方について -aliases: [ -"/documentation/grid/components_of_a_grid/" -] ---- - -Selenium Grid 4 は以前のバージョンから一新し、全面的に作り直されました。 -全体的なパフォーマンスの改善と標準の準拠に加え、より現代的なコンピューティングとソフトウェア開発 -に適応するために機能ごとに分割されました。 -コンテナ化とクラウド上での分散スケーラビリティのために構築された、現代に適した全く新しいソリューションです。 - -![Selenium Grid 4 Components](/images/documentation/grid/components.png) - -## ルーター - -これは Grid のエントリポイントであり、すべての外部リクエストを受信し正しいコンポーネントへルーティングします。 - -**ルーター**が**新規セッションリクエスト**を受信すると、**新規セッションキュー**に転送します。 - -リクエストが既存のセッションのものである場合、**ルーター**は**セッションマップ**に、 -セッションが実行されている **ノード** ID の取得を要求します。そして**ノード**にリクエストを直接転送します。 - -**ルーター**は、リクエストをより処理能力の高いコンポーネントに負荷を分散させます。 -この負荷分散処理自体もコンポーネントに不必要に負荷をかけることはありません。 - -## ディストリビューター - -**ディストリビューター**の主な責務は 2 つあります: - -#### すべてのノードとその capabilities を登録し追跡します - -**イベントバス**を通じて**ノード**登録イベントを贈ることで**ノード**を**ディストリビューター**に登録します。 -**ディストリビューター**はそのイベントを受けて**ノード**の存在を HTTP リクエストで確認します。 -リクエストが成功した場合、**ディストリビューター**は**ノード**を登録し、**Grid モデル**を通じて追跡を開始します。 - -#### 保留中の新規セッションリクエストを処理する - -新規セッションリクエストが**ルーター**に送信されると、リクエストは**新規セッションキュー**に転送されます。 -**ディストリビューター**は**新規セッションキュー**をポーリングし、保留中の新規セッションリクエストを見つけると、 -セッションが作成可能な**ノード**を探します。 セッションが作成されると**ディストリビューター**は -セッション ID とセッションが実行される**ノード**の紐付けを**セッションマップ**に保存します。 - -## セッションマップ - -**セッションマップ**はセッション ID とセッションが実行されている**ノード**の紐付けを保存します。 -これにより**ルーター**がリクエストを**ノード**に転送できるようにします。 -**ルーター**は**セッションマップ**にセッション ID に紐づく**ノード**を問い合わせます。 - -## 新規セッションキュー - -**新規セッションキュー**はすべての新規セッションリクエストを FIFO 順で保持します。 -リクエストのタイムアウトとリトライ間隔の設定が可能です。 - -**ルーター**は新規セッションリクエストを**新規セッションキュー**に追加し、レスポンスを待ちます。 -**新規セッションキュー**は定期的にキュー内のリクエストがタイムアウトしていないかをチェックし、 -タイムアウトしたリクエストがあればリクエストを拒否しキューから取り除きます。 - -**ディストリビューター**はスロットに空きがあるかを定期的にチェックします。 -もし空きがあれば、**新規セッションキュー**から最初にマッチするリクエストを取り出し、 -新規セッションの作成を試みます。 - -リクエストされた capabilities にマッチする空き**ノード**スロットがあれば、 -**ディストリビューター**は空きスロットの確保を試みます。全てのスロットがビジーだった場合、 -**ディストリビューター**はリクエストをキューに戻します。 -リトライ中やキューに戻す最中にリクエストがタイムアウトした場合リクエストは拒否されます。 - -セッションの作成に成功すると、**ディストリビューター**はセッションの情報を**新規セッションキュー**に送信し、 -これが**ルーター**へのレスポンスとして送信され、最終的にクライアントに返ります。 - -## ノード - -Grid は複数の**ノード**を持つことができます。 -**ノード**は、各**ノード**が実行されているマシン上の利用可能なブラウザのスロットを管理します。 - -**ノード**は、**イベントバス**を介して自身を**ディストリビューター**に登録します。 -構成情報は登録メッセージの一部として送信されます。 - -デフォルトでは、**ノード**はマシンのパス上に存在する全てのブラウザドライバーを自動で登録します。 -また FireFox と Chromium ベースブラウザの場合、CPU1 つにつき 1 スロットを作成します。 -Safari の場合は 1 つのスロットのみ作成します。 -[特定の設定によって]({{< ref "configuration" >}})セッションを Docker コンテナで実行したり、コマンドを中継したりすることも可能です。 - -**ノード**は受信したコマンドを実行するだけで、コマンドの評価・判断や、フロー制御以外の制御は行いません。 -**ノード**が実行されているマシンは、他のコンポーネントと同じ OS を持つ必要はありません。 -たとえば、Windows **ノード**には IE Mode on Edge をブラウザーオプションとして提供する機能がありますが、 -これは Linux または Mac では不可能です。 -Grid は 複数の Windows, Mac, Linux **ノード**で構成することが可能です。 - -## イベントバス - -**イベントバス**は**ノード**、**ディストリビューター**、セッションキュー、**セッションマップ**間の通信経路として機能します。 -Grid は内部通信のほとんどをメッセージで行うことで、負荷の高い HTTP 呼び出しを避けています。 -分散モードで Grid を起動する場合、**イベントバス**は最初に起動されるべきコンポーネントです。 - -{{% alert title="Gridを動かす" color="primary" %}} -これらのコンポーネントを使って Grid を実行してみたいですか? -["Grid を始める"]({{< ref "getting_started.md" >}}) でどのように設定するか見ることができます。 -{{% /alert %}} diff --git a/website_and_docs/content/documentation/grid/components.pt-br.md b/website_and_docs/content/documentation/grid/components.pt-br.md deleted file mode 100644 index e355343b6484..000000000000 --- a/website_and_docs/content/documentation/grid/components.pt-br.md +++ /dev/null @@ -1,106 +0,0 @@ ---- -title: "Componentes" -linkTitle: "Componentes" -weight: 6 -description: > - Compreender como usar os componentes da Grid -aliases: [ -"/documentation/grid/components_of_a_grid/" -] ---- - -A Selenium Grid 4 é uma re-escrita completa das versões anteriores. Além dos melhoramentos ao desempenho -e aos cumprimentos dos standards, várias funcionalidades da Grid foram separadas para reflectir uma -nova era de computação e desenvolvimento de software. Criada de raíz para containerização e -escalabilidade cloud, Selenium Grid 4 é uma nova solução para a era moderna. - - -![Selenium Grid 4 Components](/images/documentation/grid/components.png) - -## Router - -O **Router** é o ponto de entrada da Grid, recebendo todos os pedidos externos, reenviando para o componente correcto. - -Se o **Router** recebe um novo pedido de sessão, este será enviado para **New Session Queue**. - -Se o pedido recebido pertence a uma sessão existente, o **Router** irá inquirir o **Session Map** para obter -o **Node** ID onde esta sessão está em execução, enviando de seguida o pedido directamente para o **Node**. - -O **Router** balança a carga na Grid ao enviar o pedido ao componente que está em condições de o receber, -sem sobrecarregar qualquer outro componente que não faz parte do processo. - -## Distributor - -O **Distributor** tem duas responsabilidades: - -#### Resgistar e manter uma lista de todos os Nodes e as suas capacidades - -Um **Node** regista-se no **Distributor** enviando um evento de registo **Node** através do -**Event Bus**. O **Distributor** lê o pedido e tenta contactar o **Node** através de HTTP -para confirmar a sua existência. Se obtiver resposta com sucesso, o **Distributor** regista -o Node e mantém uma lista de todas as capacidades **Nodes** através do **GridModel**. - -#### Processar algum pedido pendente que tenha sido criado na New Session Queue - -Quando um novo pedido de sessão é enviado para o **Router**, ele é reenviado para a **New Session Queue**, -onde ficará na fila em espera. O **Distributor** irá processar pedidos pendentes que existam na **New Session Queue**, -encontrando um **Node** com as capacidades certas onde a sessão possa ser criada. Após esta nova -sessão ter sido criada, o **Distributor** guarda na **Session Map** a relação entre o id da sessão e -o **Node** onde a sessão está em execução. - -## Session Map - -A **Session Map** é uma data store que mantém a relação entre o id da sessão e o **Node** -onde a sessão está em execução. Apoia o **Router** no processo de envio do pedido para um **Node** -onde a sessão está em execução. O **Router** irá pedir ao **Session Map** qual o **Node** associado -ao id de sessão. - -## New Session Queue - -A **New Session Queue** contém todos os pedidos de novas sessões em ordem FIFO. Existem parametros -configuráveis para o timeout de sessão e para o número de tentativas. - -O **Router** adiciona um novo pedido de sessão em **New Session Queue** e aguarda uma resposta. -A **New Session Queue** verifica regularmente se algum pedido deu timeout e em caso afirmativo, -rejeita e remove o pedido da queue. - -O **Distributor** verifica regularmente se existe um slot disponível. Em caso afirmativo, o **Distributor** -obtém um pedido a partir de **New Session Queue** e tenta criar uma nova sessão. - -Assim que existam capacidades pedidas capazes de serem servidas por um dos **Node** que estejam livres, -o **Distributor** tenta obter o slot disponível. Caso todos os slots estejam ocupados, o **Distributor** -envia o pedido de volta para a queue. Se o pedido tiver timeout ao ser readicionado à queue, será rejeitado. - -Após um id de sessão ser criado, o **Distributor** envia a informação se sessão para **New Session Queue**, -que por sua vez irá enviar para o **Router** que finalmente entrega ao cliente. - -## Node - -A Grid pode ter múltiplos **Nodes**. Cada **Node** gere os slots de disponibilidade para os navegadores existentes -na máquina onde está a executar. - -O **Node** regista-se no **Distributor** através do **Event Bus**, sendo que a sua configuração é enviada -como parte da mensagem de registo. - -Por omissão, o **Node** regista automaticamente todos os navegadores que estejam disponíveis no PATH da máquina onde -executa. Cria também um slot de execução por cada CPU para os navegadores Chrome e Firefox. Para Safari, -apenas é criado um slot. Usando uma [configuração]({{< ref "configuration" >}}) específica, é também -possível executar sessões em containers Docker. - -O **Node** apenas executa os comandos que recebe, não avalia, faz julgamentos ou controla mais nada que não seja -o fluxo de comandos e respostas. A máquina onde o **Node** está a executar não necessita de ter o mesmo sistema -operativo do que os restantes componentes. Por exemplo, um Windows **Node** pode ter a capacidade de oferecer -IE Mode no Edge como opção de navegador, coisa que não é possível em Linux ou Mac. A Grid pode ter múltiplos -**Node** configurados com Windows, Mac ou Linux. - -## Event Bus - -O **Event Bus** serve de canal de comunicações entre **Nodes**, **Distributor**, **New Session Queue**, -e **Session Map**. A Grid usa mensagens para a maioria das comunicações internas. evitando chamadas HTTP. -Quando iniciar a Grid em modo distribuido, deverá iniciar o **Event Bus** antes dos restantes componentes. - -{{% alert title="Configurando a sua Grid" color="primary" %}} -Se pretende usar todos estes componentes para criar a sua Grid, -visite a secção ["configurando a sua"]({{< ref "getting_started.md" >}}) -para entender como ligar as peças todas. -{{% /alert %}} diff --git a/website_and_docs/content/documentation/grid/components.zh-cn.md b/website_and_docs/content/documentation/grid/components.zh-cn.md deleted file mode 100644 index 48c49491ddce..000000000000 --- a/website_and_docs/content/documentation/grid/components.zh-cn.md +++ /dev/null @@ -1,71 +0,0 @@ ---- -title: "服务网格的组件" -linkTitle: "组件" -weight: 6 -description: > - 检查不同的Grid组件以了解如何使用它们. -aliases: [ -"/documentation/grid/components_of_a_grid/" -] ---- - - -Selenium Grid 4 是对以前版本的彻底重写。除了对性能和标准合规性进行全面改进外,还分解了 `Grid` 的不同功能以反映更现代的计算和软件开发时代。 Selenium Grid 4 专为容器化和云分布式可扩展性而构建,是现代时代的全新解决方案。 - -![Selenium Grid 4 Components](/images/documentation/grid/components.png) - -## 路由器(Router) - -**路由器** 是 Grid 的入口点,接收所有外部请求,并将它们转发给正确的组件。 - -如果**路由器**收到新的会话请求,它将被转发到**新会话队列**。 - -如果请求属于一个已经存在的session,**路由器**会查询**Session Map**得到session运行所在的**Node** ID,然后将请求直接转发给**Node**。 - -**路由器**通过将请求发送到能够更好地处理它们的组件来平衡网格中的负载,而不会使过程中不需要的任何组件过载。 - -## 分发器(Distributor) - -**分发器**有两个主要职责: - -#### 注册并跟踪所有Node及其功能 - -**Node**通过**事件总线**发送**Node**注册事件来注册到**分发器**。**分发器**读取它,然后尝试通过 HTTP 到达**Node**以确认它的存在。如果请求成功,**Distributor**注册节点并通过 **GridModel** 跟踪所有**Node**功能。 - -#### 查询新会话队列并处理任何未决的新会话请求 - -当一个新的会话请求被发送到**路由器**时,它被转发到**新会话队列**,它将在队列中等待。 **Distributor** 将轮询**新会话队列**以查找未决的新会话请求,然后找到可以创建会话的合适**Node**。会话创建后,**分发器**将会话 ID 与正在执行会话的**Node**之间的关系存储在**会话映射**中。 - -## 会话映射(Session Map) - -**会话映射** 是一个数据存储,用于保存会话 ID 和运行会话的**Node**之间的关系。它支持**路由器**在将请求转发到**Node**的过程中进行查询。**路由器**将向**会话映射**询问与会话 ID 关联的**Node**。 - -## 新会话队列(New Session Queue) - -**新会话队列**按先进先出的顺序保存所有新会话请求。它具有可配置的参数,用于设置请求超时和请求重试间隔(检查超时的频率)。 - -**路由器**将**新会话请求**添加到**新会话队列**中并等待响应。**新会话队列**定期检查队列中是否有任何请求超时,如果是,则立即拒绝并将其删除。 - -**分发器**定期检查是否有可用的插槽。如果有可用的插槽,则**分发器**会轮询**新会话队列**以查找第一个匹配的请求。然后,**分发器**尝试创建**新会话**。 - -一旦请求的功能与任何空闲**Node**插槽的功能匹配,**分发器**将尝试获取可用插槽。如果所有插槽都已忙碌,则**分发器**将将请求发送回队列。如果请求在重试或添加到队列的前面时超时,则会被拒绝。 - -成功创建会话后,**分发器**将会话信息发送到**新会话队列**,该信息然后被发送回**路由器**,最终发送给客户端。 - -## 节点(Node) - -一个`Grid`可以包含多个**Node**。每个**Node**管理它所在机器上可用浏览器的插槽。 - -**Node**通过**事件总线**向**分发器**注册自己,并将其配置作为注册消息发送。 - -默认情况下,**Node**会自动注册其所在机器上路径中可用的所有浏览器驱动程序。它还为基于Chromium的浏览器和Firefox创建每个可用CPU一个插槽。对于Safari,只创建一个插槽。通过特定的[配置]({{< ref "configuration" >}}),它可以在Docker容器中运行会话或转发命令。 - -**Node**仅执行接收到的命令,不评估、不做出判断或控制任何除命令和响应流之外的东西。**Node**所在的机器不需要与其他组件具有相同的操作系统。例如,Windows节点可能具有在Edge上提供IE模式作为浏览器选项的能力,而在Linux或Mac上则不可能,网格可以配置多个具有Windows、Mac或Linux的**Node**。 - -## 事件总线(Event Bus) - -**事件总线**作为**节点**、**分发器**、**新会话队列**和**会话映射**之间的通信路径。`Grid` 的大部分内部通信都通过消息进行,避免了频繁的HTTP调用。在完全分布式模式下启动`Grid` 时,**事件总线**应该是第一个组件。 - -{{% alert title="运行自己的Grid" color="primary" %}} -想要使用所有这些组件并运行自己的网格?请前往["入门"]({{< ref "getting_started.md" >}})部分了解如何将所有这些部分组合在一起。 -{{% /alert %}} diff --git a/website_and_docs/content/documentation/grid/configuration/_index.en.md b/website_and_docs/content/documentation/grid/configuration/_index.en.md index abf4b08b427c..3360016d8ed9 100644 --- a/website_and_docs/content/documentation/grid/configuration/_index.en.md +++ b/website_and_docs/content/documentation/grid/configuration/_index.en.md @@ -10,6 +10,12 @@ aliases: [ "/documentation/grid/configuring_components/", "/documentation/ja/grid/grid_4/configuring_components/", "/documentation/pt-br/grid/grid_4/configuring_components/", -"/documentation/zh-cn/grid/grid_4/configuring_components/" +"/documentation/zh-cn/grid/grid_4/configuring_components/", +"/ja/documentation/grid/configuration/", +"/ja/documentation/grid/configuring_components/", +"/pt-br/documentation/grid/configuration/", +"/pt-br/documentation/grid/configuring_components/", +"/zh-cn/documentation/grid/configuration/", +"/zh-cn/documentation/grid/configuring_components/" ] --- diff --git a/website_and_docs/content/documentation/grid/configuration/_index.ja.md b/website_and_docs/content/documentation/grid/configuration/_index.ja.md deleted file mode 100644 index 4f2037af0a80..000000000000 --- a/website_and_docs/content/documentation/grid/configuration/_index.ja.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "コンポーネントの構成" -linkTitle: "コンポーネントの構成" -weight: 8 -description: > - ここでは、各コンポーネントを、共通の設定とコンポーネント固有の設定で個別に設定する方法を確認できます。 -aliases: [ -"/documentation/grid/configuring_components/" -] ---- diff --git a/website_and_docs/content/documentation/grid/configuration/_index.pt-br.md b/website_and_docs/content/documentation/grid/configuration/_index.pt-br.md deleted file mode 100644 index 0e3b5d056273..000000000000 --- a/website_and_docs/content/documentation/grid/configuration/_index.pt-br.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "Configurando componentes" -linkTitle: "Configurando componentes" -weight: 8 -description: > - Leia aqui como pode configurar cada um dos componentes Grid com base em - valores comuns ou específicos para o componente. -aliases: [ -"/documentation/grid/configuring_components/" -] ---- - diff --git a/website_and_docs/content/documentation/grid/configuration/_index.zh-cn.md b/website_and_docs/content/documentation/grid/configuration/_index.zh-cn.md deleted file mode 100644 index ac80faac7a99..000000000000 --- a/website_and_docs/content/documentation/grid/configuration/_index.zh-cn.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "配置组件" -linkTitle: "配置" -weight: 8 -description: > - 在这里,您可以看到如何根据公共配置值和特定于组件的配置值分别配置每个网格组件. -aliases: [ -"/documentation/grid/configuring_components/" -] ---- diff --git a/website_and_docs/content/documentation/grid/configuration/cli_options.ja.md b/website_and_docs/content/documentation/grid/configuration/cli_options.ja.md index a2f8e874c715..1b54052b4c66 100644 --- a/website_and_docs/content/documentation/grid/configuration/cli_options.ja.md +++ b/website_and_docs/content/documentation/grid/configuration/cli_options.ja.md @@ -16,7 +16,7 @@ Grid の設定には、さまざまなセクションが用意されています {{% pageinfo color="primary" %}} オプションが変更、または追加されたが文書化されていない場合、 このドキュメントは古くなる可能性があることに注意してください。 -もしそのような状況を見つけたら、["構成ヘルプ"]({{< ref "help.md" >}})を確認し、 +もしそのような状況を見つけたら、["構成ヘルプ"]({{< ref path="help.md" lang="en" >}})を確認し、 ドキュメントを更新するプルリクエストを気軽に送ってください。 {{% /pageinfo %}} diff --git a/website_and_docs/content/documentation/grid/configuration/cli_options.pt-br.md b/website_and_docs/content/documentation/grid/configuration/cli_options.pt-br.md index 0b5a08f91d27..003e7d2b5e86 100644 --- a/website_and_docs/content/documentation/grid/configuration/cli_options.pt-br.md +++ b/website_and_docs/content/documentation/grid/configuration/cli_options.pt-br.md @@ -18,7 +18,7 @@ Pode ver abaixo um mapeamento entre o componente e a secção respectiva. {{% pageinfo color="primary" %}} Note que esta documentação pode estar desactualizada se uma opção foi adicionada ou modificada, mas ainda não ter havido oportunidade de actualizar a documentação. -Caso depare com esta situação, verifique a secção ["ajuda de configuração"]({{< ref "help.md" >}}) +Caso depare com esta situação, verifique a secção ["ajuda de configuração"]({{< ref path="help.md" lang="en" >}}) e esteja à vontade para nos enviar um pull request com alterações a esta página. {{% /pageinfo %}} diff --git a/website_and_docs/content/documentation/grid/configuration/cli_options.zh-cn.md b/website_and_docs/content/documentation/grid/configuration/cli_options.zh-cn.md index e6bd8565739f..7620da9e33f2 100644 --- a/website_and_docs/content/documentation/grid/configuration/cli_options.zh-cn.md +++ b/website_and_docs/content/documentation/grid/configuration/cli_options.zh-cn.md @@ -25,7 +25,7 @@ A complete description of the component to section mapping can be seen below. {{% pageinfo color="primary" %}} Note that this documentation could be outdated if an option was modified or added but has not been documented yet. In case you bump into this situation, please check -the ["Config help"]({{< ref "help.md" >}}) section and feel free to send us a +the ["Config help"]({{< ref path="help.md" lang="en" >}}) section and feel free to send us a pull request updating this page. {{% /pageinfo %}} diff --git a/website_and_docs/content/documentation/grid/configuration/help.en.md b/website_and_docs/content/documentation/grid/configuration/help.en.md index 51f3386a4bfb..a3679c6efcba 100644 --- a/website_and_docs/content/documentation/grid/configuration/help.en.md +++ b/website_and_docs/content/documentation/grid/configuration/help.en.md @@ -8,7 +8,13 @@ aliases: [ "/documentation/grid/configuring_components/config_help/", "/documentation/ja/grid/grid_4/configuring_components/config_help/", "/documentation/pt-br/grid/grid_4/configuring_components/config_help/", -"/documentation/zh-cn/grid/grid_4/configuring_components/config_help/" +"/documentation/zh-cn/grid/grid_4/configuring_components/config_help/", +"/ja/documentation/grid/configuration/help/", +"/ja/documentation/grid/configuring_components/config_help/", +"/pt-br/documentation/grid/configuration/help/", +"/pt-br/documentation/grid/configuring_components/config_help/", +"/zh-cn/documentation/grid/configuration/help/", +"/zh-cn/documentation/grid/configuring_components/config_help/" ] --- diff --git a/website_and_docs/content/documentation/grid/configuration/help.ja.md b/website_and_docs/content/documentation/grid/configuration/help.ja.md deleted file mode 100644 index 65a3ffee3ebf..000000000000 --- a/website_and_docs/content/documentation/grid/configuration/help.ja.md +++ /dev/null @@ -1,113 +0,0 @@ ---- -title: "構成ヘルプ" -linkTitle: "構成ヘルプ" -weight: 1 -description: Gridの設定に利用可能なオプション -aliases: [ -"/documentation/grid/configuring_components/config_help/" -] ---- - -{{% pageinfo color="primary" %}} -ヘルプコマンドは、現在のコード実装に基づいて情報を表示します。 -したがって、ドキュメントが更新されない場合に備えて、正確な情報を提供します。 -それは、新しいバージョンのグリッド 4 の構成について学習する最も簡単な方法です。 -{{% /pageinfo %}} - -## Info コマンド - -info コマンドは、次のトピックに関する詳細なドキュメントを提供します。 - -- Selenium の構成 -- セキュリティ -- セッションマップの設定 -- トレース - -### 構成ヘルプ - -クイック設定のヘルプと概要は、以下を実行することで提供されます。 - -```shell -java -jar selenium-server-.jar info config -``` - -### セキュリティ - -安全な通信とノード登録のためのグリッドサーバーの設定の詳細を取得するには、以下を実行します。 - -```shell -java -jar selenium-server-.jar info security -``` - -### セッションマップの設定 - -デフォルトでは、グリッドはローカルセッションマップを使用してセッション情報を保存します。 -グリッドは、Redis や JDBC-SQL がサポートするデータベースなどの追加のストレージオプションをサポートしています。 -別のセッションストレージをセットアップするには、次のコマンドを使用してセットアップ手順を取得します。 - -```shell -java -jar selenium-server-.jar info sessionmap -``` - -### OpenTelemetry と Jaeger を使用したトレースの設定 - -デフォルトでは、トレースは有効になっています。 -トレースをエクスポートして Jaeger 経由で視覚化するには、次のコマンドを使用して手順を実行します。 - -```shell -java -jar selenium-server-.jar info tracing -``` - -## SeleniumGrid コマンドを一覧表示する - -```shell -java -jar selenium-server-.jar --config-help -``` - -使用可能なすべてのコマンドとそれぞれの説明が表示されます。 - -## コンポーネントヘルプコマンド - -Selenium ロールの後に–help config オプションを渡して、コンポーネント固有の構成情報を取得します。 - -### スタンドアロン - -```shell -java -jar selenium-server-.jar standalone --help -``` - -### ハブ - -```shell -java -jar selenium-server-.jar hub --help -``` - -### セッション - -```shell -java -jar selenium-server-.jar sessions --help -``` - -### 新規セッションキュー - -```shell -java -jar selenium-server-.jar sessionqueue --help -``` - -### ディストリビューター - -```shell -java -jar selenium-server-.jar distributor --help -``` - -### ルーター - -```shell -java -jar selenium-server-.jar router --help -``` - -### ノード - -```shell -java -jar selenium-server-.jar node --help -``` diff --git a/website_and_docs/content/documentation/grid/configuration/help.pt-br.md b/website_and_docs/content/documentation/grid/configuration/help.pt-br.md deleted file mode 100644 index f363db58517e..000000000000 --- a/website_and_docs/content/documentation/grid/configuration/help.pt-br.md +++ /dev/null @@ -1,116 +0,0 @@ ---- -title: "Ajuda de configuração" -linkTitle: "Ajuda de configuração" -weight: 1 -description: Obtenha ajuda sobre todas as opções disponíveis para configurar a Grid. -aliases: [ -"/documentation/grid/configuring_components/config_help/" -] ---- - -{{% pageinfo color="primary" %}} -Os comandos de ajuda (help) mostram informação baseada na implementação de código em vigor. -Desta forma, irá obter informação potencialmente mais actual do que esta documentação. -Embora possa não ser a mais detalhada, é sempre a forma mais simples de aprender sobre -as configurações da Grid 4 em qualquer nova versão. -{{% /pageinfo %}} - -## Commando info - -O comando `info` fornece detalhes de documentação sobre os seguintes tópicos: -* Configurar Selenium -* Segurança -* Setup Session Map -* Traceamento - -### Ajuda sobre configuração - -Ajuda rápida e resumo pode ser obtida com: - -```shell -java -jar selenium-server-.jar info config -``` - -### Segurança - -Para obter detalhes em como configurar os servidores Grid para comunicação segura -e para o registo de **Nodes**: - -```shell -java -jar selenium-server-.jar info security -``` - -### Configuração Session Map - -Por omissão, a Grid usa um `local session map` para armazenar informação de sessões. -A Grid permite armazenamento opcional em Redis ou bancos de dados JDBC SQL. -Para obter informação de como usar, use o seguinte comando: - -```shell -java -jar selenium-server-.jar info sessionmap -``` - -### Traceamento com OpenTelemetry e Jaeger - -Por omissao, traceamento está activo. Para exportar e visualizar através de Jaeger, use o -comando seguinte para instruções de como o efectuar: - -```shell -java -jar selenium-server-.jar info tracing -``` - -## Lista de comandos Selenium Grid - -Irá mostrar todos os comandos disponíveis e também a descrição de cada um. - -```shell -java -jar selenium-server-.jar --config-help -``` - -## Comandos de ajuda para componente - -Adicione `--help` após o Selenium role para obter informação específica de configuração do componente. - -### Standalone - -```shell -java -jar selenium-server-.jar standalone --help -``` -### Hub - -```shell -java -jar selenium-server-.jar hub --help -``` - -### Sessions - -```shell -java -jar selenium-server-.jar sessions --help -``` - -### New Session Queue - -```shell -java -jar selenium-server-.jar sessionqueue --help -``` - -### Distributor - -```shell -java -jar selenium-server-.jar distributor --help -``` - -### Router - -```shell -java -jar selenium-server-.jar router --help -``` - -### Node - -```shell -java -jar selenium-server-.jar node --help -``` - - - diff --git a/website_and_docs/content/documentation/grid/configuration/help.zh-cn.md b/website_and_docs/content/documentation/grid/configuration/help.zh-cn.md deleted file mode 100644 index af88313d1a56..000000000000 --- a/website_and_docs/content/documentation/grid/configuration/help.zh-cn.md +++ /dev/null @@ -1,120 +0,0 @@ ---- -title: "配置帮助" -linkTitle: "帮助" -weight: 1 -description: 获取有关配置网格的所有可用选项的信息. -aliases: [ -"/documentation/grid/configuring_components/config_help/" -] ---- - -{{% pageinfo color="primary" %}} -Help命令显示基于当前代码实现的信息. -因此, 如果文档没有更新, 它将提供准确的信息. -这是了解任何新版本Grid4配置的最便捷方法. -{{% /pageinfo %}} - - -## 信息命令 - -Info命令提供以下主题的详细文档: -* 配置Selenium -* 安全 -* 会话表配置 -* 追踪 - -### 配置帮助 - -通过运行以下命令快速获取配置帮助: - -```shell -java -jar selenium-server-.jar info config -``` - -### 安全 - -获取构建网格服务器的详细信息, -用于安全通信和节点注册. - - -```shell -java -jar selenium-server-.jar info security -``` - -### 会话表配置 - -默认情况下, -网格使用本地会话表来存储会话信息. -网格支持额外的存储选项, -比如Redis和JDBC-SQL支持的数据库. -要设置不同的会话存储, -请使用以下命令获取设置步骤: - -```shell -java -jar selenium-server-.jar info sessionmap -``` - -### 基于OpenTelemetry和Jaeger的追踪配置 - -默认情况下, 追踪是启用的. -要通过Jaeger导出追踪并将其可视化, -请使用以下命令进行说明: - -```shell -java -jar selenium-server-.jar info tracing -``` - -## 列出Selenium网格的命令 - - -```shell -java -jar selenium-server-.jar --config-help -``` - -上述命令将显示所有可用的命令及其描述. - -## 组件帮助命令 - -在Selenium后面键入--help的配置选项, -以获取特定组件的配置信息. - -### Standalone - -```shell -java -jar selenium-server-.jar standalone --help -``` -### Hub - -```shell -java -jar selenium-server-.jar hub --help -``` - -### Sessions - -```shell -java -jar selenium-server-.jar sessions --help -``` - -### 队列器 - -```shell -java -jar selenium-server-.jar sessionqueue --help -``` - -### Distributor - -```shell -java -jar selenium-server-.jar distributor --help -``` - -### Router - -```shell -java -jar selenium-server-.jar router --help -``` - -### Node - -```shell -java -jar selenium-server-.jar node --help -``` diff --git a/website_and_docs/content/documentation/grid/configuration/toml_options.ja.md b/website_and_docs/content/documentation/grid/configuration/toml_options.ja.md index 14809c96acfe..b88baeeaa269 100644 --- a/website_and_docs/content/documentation/grid/configuration/toml_options.ja.md +++ b/website_and_docs/content/documentation/grid/configuration/toml_options.ja.md @@ -15,7 +15,7 @@ aliases: [ {{% pageinfo color="primary" %}} オプションが変更、または追加されたが文書化されていない場合、 このドキュメントは古くなる可能性があることに注意してください。 -もしそのような状況を見つけたら、["構成ヘルプ"]({{< ref "help.md" >}})を確認し、 +もしそのような状況を見つけたら、["構成ヘルプ"]({{< ref path="help.md" lang="en" >}})を確認し、 ドキュメントを更新するプルリクエストを気軽に送ってください。 {{% /pageinfo %}} diff --git a/website_and_docs/content/documentation/grid/configuration/toml_options.pt-br.md b/website_and_docs/content/documentation/grid/configuration/toml_options.pt-br.md index 77c090c8c235..e318f85d5727 100644 --- a/website_and_docs/content/documentation/grid/configuration/toml_options.pt-br.md +++ b/website_and_docs/content/documentation/grid/configuration/toml_options.pt-br.md @@ -24,7 +24,7 @@ different Grid components. {{% pageinfo color="primary" %}} Note that this documentation could be outdated if an option was modified or added but has not been documented yet. In case you bump into this situation, please check -the ["Config help"]({{< ref "help.md" >}}) section and feel free to send us a +the ["Config help"]({{< ref path="help.md" lang="en" >}}) section and feel free to send us a pull request updating this page. {{% /pageinfo %}} diff --git a/website_and_docs/content/documentation/grid/configuration/toml_options.zh-cn.md b/website_and_docs/content/documentation/grid/configuration/toml_options.zh-cn.md index 3a5be7fcfacd..b320b2794490 100644 --- a/website_and_docs/content/documentation/grid/configuration/toml_options.zh-cn.md +++ b/website_and_docs/content/documentation/grid/configuration/toml_options.zh-cn.md @@ -19,7 +19,7 @@ requiresTranslation: true 请注意, 如果修改或添加了选项, 但尚未记录, 则此文档可能已过时. 如果您遇到这种情况, -请查看 ["配置帮助"]({{< ref "help.md" >}}) 部分, +请查看 ["配置帮助"]({{< ref path="help.md" lang="en" >}}) 部分, 并随时向我们发送更新此页面的请求. {{% /pageinfo %}} diff --git a/website_and_docs/content/documentation/grid/getting_started.en.md b/website_and_docs/content/documentation/grid/getting_started.en.md index e8e5f921fa8c..2bc630922d7b 100644 --- a/website_and_docs/content/documentation/grid/getting_started.en.md +++ b/website_and_docs/content/documentation/grid/getting_started.en.md @@ -9,7 +9,13 @@ aliases: [ "/documentation/grid/setting_up_your_own_grid/", "/documentation/ja/grid/grid_4/setting_up_your_own_grid/", "/documentation/pt-br/grid/grid_4/setting_up_your_own_grid/", -"/documentation/zh-cn/grid/grid_4/setting_up_your_own_grid/" +"/documentation/zh-cn/grid/grid_4/setting_up_your_own_grid/", +"/ja/documentation/grid/getting_started/", +"/ja/documentation/grid/setting_up_your_own_grid/", +"/pt-br/documentation/grid/getting_started/", +"/pt-br/documentation/grid/setting_up_your_own_grid/", +"/zh-cn/documentation/grid/getting_started/", +"/zh-cn/documentation/grid/setting_up_your_own_grid/" ] --- diff --git a/website_and_docs/content/documentation/grid/getting_started.ja.md b/website_and_docs/content/documentation/grid/getting_started.ja.md deleted file mode 100644 index 84efd5576f4e..000000000000 --- a/website_and_docs/content/documentation/grid/getting_started.ja.md +++ /dev/null @@ -1,314 +0,0 @@ ---- -title: "Gridを始める" -linkTitle: "Gridを始める" -weight: 2 -needsTranslation: true -description: > - Selenium Gridの導入方法 -aliases: [ -"/documentation/grid/setting_up_your_own_grid/" -] ---- - -## クイックスタート - -1. 事前条件 - - - Java 11 もしくはそれ以上がインストールされていること - - ブラウザーがインストールされていること - - ブラウザードライバー - - [Selenium Manager]({{< ref "../selenium_manager/" >}}) will configure the drivers automatically if you add `--selenium-manager true`. - - [`PATH` が通っているインストール済みのもの]({{< ref "../webdriver/troubleshooting/errors/driver_location.md#use-the-path-environment-variable" >}}) - - [最新の](https://github.com/SeleniumHQ/selenium/releases/latest) Selenium Server jar ファイルをダウンロードしていること - -1. Grid の起動 - - - `java -jar selenium-server-.jar standalone` - -1. あなたの WebDriver テストの対象を [http://localhost:4444](http://localhost:4444) に向ける - -1. (必要があれば) ブラウザで[http://localhost:4444](http://localhost:4444)を開いて実行中のテストや利用可能な capabilities を確認する。 - -さらにオプションを知りたい場合は以降のセクションに進んでください。 - -## Grid コンポーネントロール - -Grid は 6 つの異なる[コンポーネント]({{< ref "components.md" >}})で構成され、様々な方法でデプロイすることができます。 - -必要に応じて、それぞれ個別に起動する(分散)か、ハブ&ノードのグループに分けるか、 -全てを一つのマシンで起動する(**スタンドアロン**)かを選べます。 - -### **スタンドアロン** - -**スタンドアロン**は全ての Grid[コンポーネント]({{< ref "components.md" >}})を 1 つに連結します。 -**スタンドアロン**モードはシングルプロセスで動き、Grid の全機能を利用することができます。 -**スタンドアロン**は単一のマシン上でのみ動かすことができます。 - -**スタンドアロン**は Selenium Grid を起動する最も簡単な方法でもあります。 -デフォルトではサーバーは[http://localhost:4444](http://localhost:4444) で `RemoteWebDriver` リクエストをリッスンします。 -サーバーはデフォルトでシステム[パス]({{< ref "../webdriver/troubleshooting/errors/driver_location.md#use-the-path-environment-variable" >}})上の利用可能なドライバーを検出します。 - -```shell -java -jar selenium-server-.jar standalone -``` - -**スタンドアロン**で Grid のを起動したら、WebDriver テストの対象を[http://localhost:4444](http://localhost:4444)に向けてください。 - -**スタンドアロン**の一般的なユースケースは: - -- `RemoteWebDriver` を使用したローカルでの開発やデバッグ -- コードをプッシュする前の簡易なテスト実行 -- CI/CD 向けの Grid のセットアップ(GitHub Actions, Jenkins など) - -### ハブ&ノード - -**ハブ&ノード**は最も利用されているロールです。その理由は: - -- 様々なマシンを Grid に統合できます - - 様々な OS やブラウザーバージョンを持つマシンなど -- WebDriver テストのエントリーポイントを持っています -- Grid を停止せずにキャパシティのスケールアップ・ダウンが可能です - -#### ハブ - -ハブは以下の[コンポーネント]({{< ref "components.md" >}})で構成されています。 -ルーター、ディストリビューター、セッションマップ、新規セッションキュー、イベントバス。 - -```shell -java -jar selenium-server-.jar hub -``` - -デフォルトでは、サーバーは[http://localhost:4444](http://localhost:4444)にて `RemoteWebDriver` リクエストを待ち受けます。 - -#### ノード - -**ノード**は起動時にシステムの[パス]({{< ref "../webdriver/troubleshooting/errors/driver_location.md#use-the-path-environment-variable" >}}) -が通っている利用可能なドライバーを検出します。 - -次のコマンドは**ノード**が**ハブ**と同じマシン上で動作していることを前提としています。 - -```shell -java -jar selenium-server-.jar node -``` - -##### 同一マシン上での複数ノード - -ノード 1 - -```shell -java -jar selenium-server-.jar node --port 5555 -``` - -ノード 2 - -```shell -java -jar selenium-server-.jar node --port 6666 -``` - -##### 異なるマシンでノードとハブを動かす - -**ハブ**と**ノード**は HTTP と[**イベントバス**]({{< ref "components.md#event-bus" >}})を介して通信します (**イベントバス**は**ハブ**の一部として存在します)。 -**ノード**は**イベントバス**を通じてメッセージを送信し、登録処理を開始します。 -**ハブ**がメッセージを受け取り、**ノード**の存在を確かめるため HTTP を使って**ノード**にアクセスします。 - -**ハブ**がデフォルトのポートを使用していれば、 `--hub` フラグで**ノード**を登録することができます。 - -```shell -java -jar selenium-server-.jar node --hub http://:4444 -``` - -**ハブ**がデフォルトのポートを使用していない場合、`--publish-events` と `--subscribe-events` のフラグが必要です。 - -例えば**ハブ**が `8886` `8887` `8888` ポートを利用している場合、 - -```shell -java -jar selenium-server-.jar hub --publish-events tcp://:8886 --subscribe-events tcp://:8887 --port 8888 -``` - -**ノード**はこれらのポートを登録する際に使用します。 - -```shell -java -jar selenium-server-.jar node --publish-events tcp://:8886 --subscribe-events tcp://:8887 -``` - -### 分散 - -分散 Grid を利用すると、各コンポーネントは別々に起動され異なるマシン上で動作します。 - -{{% alert color="primary" %}} -コンポーネント間で通信をするために、全てのポートを適切に公開することが重要です。 -{{% /alert %}} - -1. **イベントバス**は Grid コンポーネント間での内部通信を可能にします。 - -デフォルトポートは `4442`, `4443`, `5557` です。 - -```shell -java -jar selenium-server-.jar event-bus --publish-events tcp://:4442 --subscribe-events tcp://:4443 --port 5557 -``` - -2. **新規セッションキュー**は新規セッションリクエストをキューに積み、ディストリビューターがリクエストを取得できるようにします。 - -デフォルトポートは `5559` です。 - -```shell -java -jar selenium-server-.jar sessionqueue --port 5559 -``` - -3. **セッションマップ**はセッション ID とそのセッションが実行中の**ノード**のマップを持ちます。 - -デフォルトの**セッションマップ**のポートは `5556` です。 -**セッションマップ**は**イベントバス**と通信します。 - -```shell -java -jar selenium-server-.jar sessions --publish-events tcp://:4442 --subscribe-events tcp://:4443 --port 5556 -``` - -4. **ディストリビューター**は**新規セッションキュー**に新規セッションリクエストを問い合わせ、 capabilities がマッチする**ノード**にアサインします。**ノード**は、**ハブ&ノード**構成の Grid における**ハブ**の登録と同じように、**ディストリビューター**に登録します。 - -デフォルトの**ディストリビューター**のポートは `5553` です。 -**ディストリビューター**は**新規セッションキュー**、**セッションマップ**、**イベントバス**、**ノード**と通信します。 - -```shell -java -jar selenium-server-.jar distributor --publish-events tcp://:4442 --subscribe-events tcp://:4443 --sessions http://:5556 --sessionqueue http://:5559 --port 5553 --bind-bus false -``` - -5. **ルーター**は**新規セッションリクエスト**をキューに、既存セッションのリクエストをそのセッションが実行中の**ノード**に転送します。 - -デフォルトの**ルーター**のポートは `4444` です。 -**ルーター**は**新規セッションキュー**、**セッションマップ**、**ディストリビューター**と通信します。 - -```shell -java -jar selenium-server-.jar router --sessions http://:5556 --distributor http://:5553 --sessionqueue http://:5559 --port 4444 -``` - -6. ノード - -デフォルトの**ノード**のポートは `5555` です。 - -```shell -java -jar selenium-server-.jar node --publish-events tcp://:4442 --subscribe-events tcp://:4443 -``` - -## テストメタデータ - -テストにメタデータを追加して、[GraphQL]({{< ref "advanced_features/graphql_support.md" >}}) 経由で使用するか、Selenium Grid UI 経由でその一部( `se:name` など) を可視化します。 - -メタデータは capability に`se:`プリフィックスをつけることで追加できます。 -Java での簡単な例を紹介します。 - -```java -ChromeOptions chromeOptions = new ChromeOptions(); -chromeOptions.setCapability("browserVersion", "100"); -chromeOptions.setCapability("platformName", "Windows"); -// Showing a test name instead of the session id in the Grid UI -chromeOptions.setCapability("se:name", "My simple test"); -// Other type of metadata can be seen in the Grid UI by clicking on the -// session info or via GraphQL -chromeOptions.setCapability("se:sampleMetadata", "Sample metadata value"); -WebDriver driver = new RemoteWebDriver(new URL("http://gridUrl:4444"), chromeOptions); -driver.get("http://www.google.com"); -driver.quit(); -``` - -## Selenium Grid のクエリ - -Grid 起動後、ステータスを問い合わせる方法は、 -Grid UI と API 呼び出しの主に 2 通りあります。 - -Grid UI は、お好みのブラウザで[http://localhost:4444](http://localhost:4444) -にアクセスすることで見られます。 - -API 呼び出しは[http://localhost:4444/status](http://localhost:4444/status)のエンドポイントか、 -[GraphQL]({{< ref "advanced_features/graphql_support.md" >}})が利用できます。 - -{{% pageinfo color="primary" %}} -このページで紹介するコマンドの例は、わかりやすくするために -コンポーネントがローカルで動作していると仮定しています。 -より詳細な例と使用方法は[コンポーネント]({{< ref "components.md" >}})の章を参照してください。 -{{% /pageinfo %}} - -## Java 11 の HTTP クライアントを利用する {{% badge-version version="4.5" %}} - -デフォルトでは Grid は[AsyncHttpClient](https://github.com/AsyncHttpClient/async-http-client)を使用します。 -AsyncHttpClient は Netty を使ったオープンソースのライブラリで、非同期での HTTP リクエストを実現します。 -さらに WebSocket をサポートするため Grid に適しています。 - -しかし、AsyncHttpClient は 2021 年からあまり活発にメンテナンスされていません。 -そして Java 11+ではビルトインの HTTP と WebSocket のクライアントを提供しています。 -現在 Selenium はサポートする最小バージョンを Java11 にアップグレードする計画をしていますが、 -それにはかなりの労力が必要です。メジャーリリースに合わせることはユーザー体験にとって重要です。 - -Java11 のクライアントを利用するには`selenium-http-jdk-client`jar ファイルをダウンロードし、 -`--ext`フラグで Grid の jar のクラスパスに通す必要があります。 - -jar ファイルは[repo1.maven.org](https://repo1.maven.org/maven2/org/seleniumhq/selenium/selenium-http-jdk-client/)から直接ダウンロードできます。 -Grid を起動する方法は以下の通りです: - -```bash -java -Dwebdriver.http.factory=jdk-http-client -jar selenium-server-.jar --ext selenium-http-jdk-client-.jar standalone -``` - -`selenium-http-jdk-client`をダウンロードする別の方法として[Coursier](https://get-coursier.io/docs/cli-installation)を使う方法があります。 - -```bash -java -Dwebdriver.http.factory=jdk-http-client -jar selenium-server-.jar --ext $(coursier fetch -p org.seleniumhq.selenium:selenium-http-jdk-client:) standalone -``` - -ハブ&ノードか分散モードで動かす場合、`-Dwebdriver.http.factory=jdk-http-client`と -`--ext`フラグの設定が各コンポーネントに必要になります。 - -## Grid サイズ - -Grid ロールの選択は、どのような OS やブラウザをサポートする必要があるかによって決まります。 -どの OS、ブラウザをサポートするか、どのくらいの並列セッションを実行するか、マシンの数とそれらの性能(CPU、RAM)に依存します。 - -セッションを並列で作成するのは、**ディストリビューター**が利用可能なプロセッサーに依存します。たとえば、 -マシンに 4 つの CPU がある場合、**ディストリビューター**は同時に最大 4 つのセッションしか作成できません。 - -デフォルトでは、ノードがサポートする同時セッションの最大数は、利用可能な CPU の数によって制限されます。 -たとえば、ノードのマシンに 8CPU がある場合、同時に最大 8 つのブラウザセッションを実行できます(ただし、Safari は常に 1 つです)。 -また各ブラウザセッションは約 1GB の RAM を使用することが期待されます。 - -一般的にノードはできるだけ小さくすることが推奨されます。32CPU と 32GB の RAM を持つマシンで -32 の同時ブラウザセッションを実行するよりも、 32 の小さな プロセスをよりよく分離するために、 -32 の小さなノードを持つことが推奨されます。これによって、もしノードに障害が発生しても、分離されて処理されます。 -Docker はこの方法を実現するための優れたツールです。 - -デフォルト値(ブラウザあたり 1CPU/1GB RAM)は推奨値であり、あなたの用途に沿わない可能性があることに注意してください。 -この値は参考値としての推奨であり、継続的にパフォーマンスを測定することで、あなたの環境にとって理想的な値を見つけることができるでしょう。 - -Grid のサイズは、サポートされる同時セッションの数と、ノードの数に関連しており、 -万能なサイズというものはありません。以下のサイズは概算で、環境が違えば変わる可能性があります。 -例えば、120 台のノードを持つハブ&ノードの場合、ハブが十分なリソースを持っていればうまく機能するかもしれません。 -また、この数値は確定したものではありません。フィードバックをお待ちしています。 - -### Small - -5 台以下の**ノード**で、**スタンドアロン**か**ハブ&ノード** - -### Middle - -6〜60 台の**ノード**で、**ハブ&ノード** - -### Large - -60〜100 台の**ノード**で、**ハブ&ノード**、あるいは 100 台以上の**ノード**で**分散** - -## 警告 - -Grid を保護しないと、以下のような問題が発生する可能性があります。 - -- Grid インフラストラクチャへのオープンアクセスを許容してしまう。 -- サードパーティが内部 Web アプリケーションやファイルにアクセスすることを許可してしまう。 -- サードパーティにカスタムバイナリの実行を許可してしまう。 - -Detectify Labs, のブログで公開されてしまった Grid が -どのように悪用されるかを紹介しています: [Don't Leave your Grid Wide Open](//labs.detectify.com/2017/10/06/guest-blog-dont-leave-your-grid-wide-open/) - -## 参考文献 - -- [Components]({{< ref "components.md" >}}): 内部のコンポーネントの仕組みを知る -- [Configuration]({{< ref "configuration" >}}): Grid の設定をカスタマイズする -- [Architecture]({{< ref "architecture.md" >}}): Grid のコンセプトを理解する -- [Advanced Features]({{< ref "advanced_features" >}}): Grid のさらなる可能性を探る diff --git a/website_and_docs/content/documentation/grid/getting_started.pt-br.md b/website_and_docs/content/documentation/grid/getting_started.pt-br.md deleted file mode 100644 index 698fc30d9942..000000000000 --- a/website_and_docs/content/documentation/grid/getting_started.pt-br.md +++ /dev/null @@ -1,311 +0,0 @@ ---- -title: "Configurando a sua" -linkTitle: "Configurando a sua" -weight: 2 -needsTranslation: true -description: > - Instruções para criar uma Selenium Grid simples -aliases: [ -"/documentation/grid/setting_up_your_own_grid/" -] ---- - -## Início rápido - -1. Pré-requisitos - * Java 11 ou superior instalado - * Navegador(es) instalados - * Drivers do(s) navegador(es) - * [Selenium Manager]({{< ref "../selenium_manager/" >}}) will configure the drivers automatically if you add `--selenium-manager true`. - * [Installed and on the `PATH`]({{< ref "../webdriver/troubleshooting/errors/driver_location.md#use-the-path-environment-variable" >}}) - * Obter o ficheiro Selenium Server Jar a partir da [última release](https://github.com/SeleniumHQ/selenium/releases/latest) -1. Iniciar a Grid - * `java -jar selenium-server-.jar standalone` -1. Aponte* os seus testes WebDriver para [http://localhost:4444](http://localhost:4444) -1. (Opcional) Verifique os testes que estão em execução abrindo o navegador em [http://localhost:4444](http://localhost:4444) - -*Se quer saber como direcionar os seus testes para [http://localhost:4444](http://localhost:4444), veja a secção [`RemoteWebDriver`]({{< ref "../webdriver/drivers/#remote-webdriver" >}}). - -Para aprender mais sobre as diferentes opções de configuração, veja as secções seguintes. - -## Grid roles - -A Grid é composta de seis [componentes]({{< ref "components.md" >}}) diferentes, o que permite ser -instalada de várias formas. - -Dependendo das necessidades, podemos iniciar cada um dos componentes (Distribuido) ou agrupar no formato -Hub e Node ou ainda numa única máquina (Standalone). - -### Standalone - -**Standalone** combina todos os [componentes]({{< ref "components.md" >}}) num só sitio. -Executar uma Grid em modo **Standalone** permite uma Grid totalmente funcionar com um único -comando, num único processo. **Standalone** só funcionará numa única máquina. - -**Standalone** é também a forma mais simples de colocar uma Selenium Grid em funcionamento. -Por omissão, o servidor irá escutar por pedidos `RemoteWebDriver` em [http://localhost:4444](http://localhost:4444). -O servidor irá também detectar os drivers disponíveis no -[`PATH`]({{< ref "../webdriver/troubleshooting/errors/driver_location.md#3-a-variável-de-ambiente--path" >}}). - -```shell -java -jar selenium-server-.jar standalone -``` - -Após iniciar a Selenium Grid no modo Standalone, aponte os seus WebDriver tests para -[http://localhost:4444](http://localhost:4444). - -Alguns casos de uso para **Standalone** são: -* Desenvolver ou debugar testes usando `RemoteWebDriver` localmente -* Executar baterias de testes rapidamente antes de fazer commit de código -* Ter uma Grid simples de montar numa ferramenta CI/CD (GitHub Actions, Jenkins, etc...) - -### Hub e Node - -**Hub e Node** é uma das formas mais usadas porque permite: -* Combinar máquinas diferentes na mesma Grid - * Máquinas com sistemas operativos diferentes e/ou versões de navegadores diferentes -* Ter um ponto único de entrada para executar testes WebDriver em ambientes diferentes -* Escalar a capacidade para cima ou para baixo sem ter que parar a Grid - -#### Hub - -O Hub é composto pelos seguintes [componentes]({{< ref "components.md" >}}): -Router, Distributor, Session Map, New Session Queue, e Event Bus. - -```shell -java -jar selenium-server-.jar hub -``` - -Por omissão, o servidor irá estar à escuta por pedidos de sessão `RemoteWebDriver` em [http://localhost:4444](http://localhost:4444). - -#### Node - -Ao iniciar, o **Node** irá detectar os drivers disponíveis através do -[`PATH`]({{< ref "../webdriver/troubleshooting/errors/driver_location.md#3-a-variável-de-ambiente--path" >}}). - -O comando exemplo seguinte assume que o **Node** está a executar na mesma máquina onde o **Hub** está em execução. -```shell -java -jar selenium-server-.jar node -``` - -##### Mais do que um Node na mesma máquina - -**Node** 1 -```shell -java -jar selenium-server-.jar node --port 5555 -``` - -**Node** 2 -```shell -java -jar selenium-server-.jar node --port 6666 -``` - -##### Node e Hub em máquinas diferentes - -A comunicação entre **Hub** e **Nodes** ocorre via HTTP. Para iniciar o processo de registo, o **Node** envia -uma mensagem para o **Hub** através do [**Event Bus**]({{< ref "components.md#event-bus" >}}) -(o **Event Bus** reside dentro do **Hub**). Quando o **Hub** recebe a mensagem, tenta comunicar com o **Node** -para confirmar a sua existencia. - -Para que um **Node** se consiga registar no **Hub**, é importante que as portas do **Event Bus** sejam expostas -na máquina **Hub**. As portas por omissão são 4442 e 4443 para o **Event Bus** e 4444 para o **Hub**. - -Se o **Hub** estiver a usar as portas por omissão, pode usar a flag `--hub` para registar o **Node** -```shell -java -jar selenium-server-.jar node --hub http://:4444 -``` - -Quando o **Hub** não estiver a usar as portas por omissão, necessita usar as flags`--publish-events` e `--subscribe-events`. - -Por exemplo, se o **Hub** usar as portas`8886`, `8887`, e `8888` -```shell -java -jar selenium-server-.jar hub --publish-events tcp://:8886 --subscribe-events tcp://:8887 --port 8888 -``` -O **Node** necessita de especificar as portas para conseguir registar-se com sucesso -```shell -java -jar selenium-server-.jar node --publish-events tcp://:8886 --subscribe-events tcp://:8887 -``` - -### Distribuida - -Quando usar uma Grid distribuida, cada componente é iniciado separadamente e preferencialmente em máquinas diferentes. - -{{% alert color="primary" %}} -É de extrema importância expor todas as portas necessárias de forma a que a comunicação flua correctamente entre todos os componentes. -{{% /alert %}} - -1. **Event Bus**: permite comunicação interna entre os diferentes componentes da Grid. - -As portas por omissão são: `4442`, `4443`, and `5557`. -```shell -java -jar selenium-server-.jar event-bus --publish-events tcp://:4442 --subscribe-events tcp://:4443 --port 5557 -``` - -2. **New Session Queue**: adiciona novos pedidos de sessão a uma queue, que serão consultadas pelo Distributor - -A porta por omissão é `5559`. -```shell -java -jar selenium-server-.jar sessionqueue --port 5559 -``` - -3. **Session Map**: estabelece um mapa entre id de sessão e o **Node** onde a sessão está a executar - -A porta por omissão é `5556`. **Session Map** interage com o **Event Bus**. -```shell -java -jar selenium-server-.jar sessions --publish-events tcp://:4442 --subscribe-events tcp://:4443 --port 5556 -``` - -4. **Distributor**: consulta **New Session Queue** para novos pedidos de sessão, que entrega ao um **Node** quando encontra um capacidade -correspondente. **Nodes** registam-se no **Distributor** da mesma forma como numa Grid do tipo **Hub/Node**. - -A porta por omissão é `5553`. **Distributor** interage com **New Session Queue**, **Session Map**, **Event Bus**, e **Node(s)**. - -```shell -java -jar selenium-server-.jar distributor --publish-events tcp://:4442 --subscribe-events tcp://:4443 --sessions http://:5556 --sessionqueue http://:5559 --port 5553 --bind-bus false -``` - -5. **Router**: redirecciona novos pedidos de sessão para a queue, e redirecciona pedidos de sessões para o **Node** que estiver a executar a sessão. - -A porta por omissão é `4444`. **Router** interage com **New Session Queue**, **Session Map**, e **Distributor**. -```shell -java -jar selenium-server-.jar router --sessions http://:5556 --distributor http://:5553 --sessionqueue http://:5559 --port 4444 -``` - -6. **Node(s)** - -A porta por omissão é `5555`. -```shell -java -jar selenium-server-.jar node --publish-events tcp://:4442 --subscribe-events tcp://:4443 -``` - -## Adicionar Metadata nos testes - -Adicione Metadata aos testes, através de [GraphQL]({{< ref "advanced_features/graphql_support.md" >}}) -ou visualize parcialmente (como `se:name`) através da Selenium Grid UI. - -Metadata pode ser adicionada como uma capacidade com o prefixo `se:`. Eis um pequeno exemplo em Java. - -```java -ChromeOptions chromeOptions = new ChromeOptions(); -chromeOptions.setCapability("browserVersion", "100"); -chromeOptions.setCapability("platformName", "Windows"); -// Mostrando na Grid UI o nome de um teste ao invés de uma session id -chromeOptions.setCapability("se:name", "My simple test"); -// Outros tipos de metadara podem ser visualizados na Grid UI -// ao clicar na informação de sessão ou via GraphQL -chromeOptions.setCapability("se:sampleMetadata", "Valor exemplo de Metadata"); -WebDriver driver = new RemoteWebDriver(new URL("http://gridUrl:4444"), chromeOptions); -driver.get("http://www.google.com"); -driver.quit(); -``` - -## Questionando a Selenium Grid - -Após iniciar a Gris, existem duas formas de saber o seu estado, através da Grid UI ou -por chamada API. - -A Grid UI pode ser acedida pelo seu navegador preferido em [http://localhost:4444](http://localhost:4444). -As chamadas API podem ser feitas para o endpoint [http://localhost:4444/status](http://localhost:4444/status) ou -através de [GraphQL]({{< ref "advanced_features/graphql_support.md" >}}). - -{{% pageinfo color="primary" %}} -Para simplificar, todos os exemplos apresentados assumem que os componentes estão a ser executados localmente. -Exemplos mais detalhados podem ser encontrados na secção [Configurando Componentes]({{< ref "configuration" >}}). -{{% /pageinfo %}} - -## Usando o cliente HTTP nativo Java 11 {{% badge-version version="4.5" %}} - -Por omissão, a Grid irá usar [AsyncHttpClient](https://github.com/AsyncHttpClient/async-http-client). -AsyncHttpClient é uma biblioteca open-source library criada em cima do Netty. Isto permite a -execução de pedidos e respostas HTTP de forma assíncrona. Esta biblioteca é uma boa escolha -pois além de permitir pedidos assíncronos, também suporta WebSockets. - -No entanto, a biblioteca AsyncHttpClient não é mantida activamente desde Junho de 2021. Isto coincide com -o facto de que a partir do Java 11, a JVM tem um cliente nativo que suporta camadas assíncronas -e contém um cliente WebSocket. - -Atualmente, o projecto Selenium tem planos de atualizar a versão mínima suportada para Java 11. -No entanto, isto é um esforço considerável. Alinhá-lo com os principais lançamentos e anúncios -acompanhados é crucial para garantir que a experiência do usuário esteja intacta. - -Para usar o cliente Java 11, terá que baixar o ficheiro jar `selenium-http-jdk-client` e usar -a flag `--ext` para funcionar na Grid. - -Este ficheiro pode ser obtido directamente de [repo1.maven.org](https://repo1.maven.org/maven2/org/seleniumhq/selenium/selenium-http-jdk-client/) -e depois pode iniciar a Grid com: - -```bash -java -Dwebdriver.http.factory=jdk-http-client -jar selenium-server-.jar --ext selenium-http-jdk-client-.jar standalone -``` - -Uma alternativa a baixar o ficheiro jar `selenium-http-jdk-client` é usar [Coursier](https://get-coursier.io/docs/cli-installation). - -```bash -java -Dwebdriver.http.factory=jdk-http-client -jar selenium-server-.jar --ext $(coursier fetch -p org.seleniumhq.selenium:selenium-http-jdk-client:) standalone -``` - -Se está a usar a Grid em modo **Hub/Node** ou **Distributed**, terá que usar as flags -`-Dwebdriver.http.factory=jdk-http-client` e `--ext` em cada um dos componentes. - -## Dimensionar Grid - -A escolha de Grid depende de quais sistemas operacionais e navegadores precisam ser suportados, -quantas sessões paralelas precisam ser executadas, a quantidade de máquinas disponíveis e quão -poderosas (CPU, RAM) essas máquinas são. - -A criação de sessões simultaneas depende dos processadores disponíveis para o **Distributor**. -Por exemplo, se uma máquina tiver 4 CPUs, o **Distributor** só poderá criar quatro sessões -em simultâneo. - -Por omissão, a quantidade máxima de sessões simultâneas que um **Node** suporta é limitada pelo -número de CPUs disponíveis. Por exemplo, se a máquina **Node** tiver 8 CPUs, ela poderá executar -até 8 sessões de navegador simultâneas (com exceção do Safari, que é sempre uma). -Além disso, espera-se que cada sessão do navegador use cerca de 1 GB de RAM. - -Em geral, é recomendado ter **Nodes** o mais pequenos possíveis. Em vez de ter -uma máquina com 32CPUs e 32GB de RAM para executar 32 sessões de navegador simultâneas, é melhor -tem 32 pequenos **Nodes** para isolar melhor os processos. Com isso, se um **Node** -falhar, será de forma isolada. Docker é uma boa ferramenta para alcançar essa abordagem. - -Note que os valores 1CPU/1GB RAM por navegador são uma recomendação e podem não ser os mais indicados -para o seu contexto. Recomenda-se que use estea valores como referência, mas meça o desempenho -continuamente para ajudar a determinar os valores ideais para o seu ambiente. - -Os tamanhos da Grid são relativos à quantidade de sessões simultâneas suportadas e à quantidade de -**Nodes**, não existindo um "tamanho único". Os tamanhos mencionados abaixo são estimativas aproximadas -que podem variar entre diferentes ambientes. Por exemplo, um **Hub/Node** com 120 **Nodes** -pode funcionar bem quando o **Hub** tiver recursos suficientes. Os valores abaixo não são gravados em pedra, -e comentários são bem-vindos! - -### Pequena - -**Standalone** e **Hub/Node** com cinco **Nodes** ou menos. - -### Média - -**Hub/Node** entre 6 e 60 **Nodes**. - -### Grande - -**Hub/Node** entre 60 e 100 **Nodes**. **Distributed** com mais de 100 **Nodes**. - -## AVISO - -Deve proteger a Selenium Grid de acesso externo, usando regras de firewall apropriadas. - -Se falhar em proteger a Grid uma ou mais coisas poderão ocorrer: - -* Permite acesso aberto à sua infraestrutura da Grid -* Permitir acesso de terceiros a aplicativos web e a ficheiros -* Permitir execução remota de ficheiros binários por terceiros - -Leia este artigo (em Inglês) em Detectify Labs, que dá um bom resumo -de como uma Grid exposta publicamente pode ser abusada: -[Don't Leave your Grid Wide Open](//labs.detectify.com/2017/10/06/guest-blog-dont-leave-your-grid-wide-open/) - -## Leituras adicionais - -* [Componentes]({{< ref "components.md" >}}): compreender como usar os componentes da Grid -* [Configuração]({{< ref "configuration" >}}): personalize a sua configuração Grid. -* [Arquitectura]({{< ref "architecture.md" >}}): entenda conceitos chave da Grid. -* [Advanced Features]({{< ref "advanced_features" >}}): explore mais possibilidades da Grid. diff --git a/website_and_docs/content/documentation/grid/getting_started.zh-cn.md b/website_and_docs/content/documentation/grid/getting_started.zh-cn.md deleted file mode 100644 index edf048955ac7..000000000000 --- a/website_and_docs/content/documentation/grid/getting_started.zh-cn.md +++ /dev/null @@ -1,281 +0,0 @@ ---- -title: "Selenium Grid快速起步" -linkTitle: "快速起步" -weight: 2 -needsTranslation: true -description: > - 一步一步地说明如何运行简单的Selenium Grid. -aliases: [ -"/documentation/grid/setting_up_your_own_grid/" -] ---- - -{{% pageinfo color="warning" %}} -

- - Page being translated from English to Chinese. - Do you speak Chinese? Help us to translate - it by sending us pull requests! -

-{{% /pageinfo %}} - -## 快速开始 - -1. 先决条件 - * 需要安装 Java 11 或更高版本 - * 需要安装浏览器 - * 需要安装浏览器驱动程序 - * [Selenium Manager]({{< ref "../selenium_manager/" >}}) will configure the drivers automatically if you add `--selenium-manager true`. - * [需要已经安装并配置了 PATH 环境变量]({{< ref "../webdriver/troubleshooting/errors/driver_location.md#3-path-环境变量" >}}) - * 从[最新的发布版本](https://github.com/SeleniumHQ/selenium/releases/latest)下载 Selenium Server jar 文件 -1. 启动 Grid - * `java -jar selenium-server-.jar standalone` -1. 将您的 WebDriver 测试指向 [http://localhost:4444](http://localhost:4444) -1. (可选) 通过在浏览器中打开 [http://localhost:4444](http://localhost:4444) 检查正在运行的测试和可用的功能 - -*想知道如何将您的测试指向 [http://localhost:4444](http://localhost:4444)吗? -请查看 [`RemoteWebDriver` section]({{< ref "../webdriver/drivers/#远程驱动" >}})。 - -要了解更多不同的配置选项,请查看以下各小节。 - -## Grid 角色 - -Grid由六个不同的[组件]({{< ref "components.md" >}})组成,这使您可以以不同的方式部署它。 - -根据您的需求,您可以单独启动每个组件(分布式),将它们分组为Hub和Node,或者全部在单个机器上运行(独立)。 - -### 单机部署(Standalone) - -**Standalone** 可以将所有 Grid [组件]({{< ref "components.md" >}}) 无缝地整合成一个单独的实体。在 **Standalone** 模式下运行 Grid,只需一个命令即可获得一个完整的 Grid,并在一个进程中运行。**Standalone** 只能在一台机器上运行。 - -**Standalone** 模式也是最容易启动 Selenium Grid 的模式。默认情况下,服务器将在 [http://localhost:4444](http://localhost:4444) 上监听 `RemoteWebDriver` 请求,并且服务器将从系统 [PATH]({{< ref "../webdriver/troubleshooting/errors/driver_location.md#3-path-环境变量" >}}) 中检测可以使用的驱动程序。 - -```shell -java -jar selenium-server-.jar standalone -``` - -成功启动 Standalone 模式的 Grid 后,将你的 WebDriver 测试指向 [http://localhost:4444](http://localhost:4444)。 - -**Standalone** 的常见用途包括: -* 本地使用 `RemoteWebDriver` 开发或调试测试 -* 推送代码之前运行快速测试套件 -* 在 CI/CD 工具(GitHub Actions、Jenkins 等)中设置简单的 Grid - -### Hub and Node - -**Hub和Node**是最常用的角色,因为它允许: -* 将不同的机器组合成一个单一的Grid - * 例如拥有不同操作系统和/或浏览器版本的机器 -* 在不同的环境中运行WebDriver测试有一个单一的入口点 -* 在不破坏Grid的情况下增加或减少容量。 - -#### Hub - -一个Hub由以下[组件]({{< ref "components.md" >}})组成: -路由器(Router)、分发器(Distributor)、会话映射(Session Map)、新会话队列(New Session Queue)和事件总线(Event Bus)。 - -```shell -java -jar selenium-server-.jar hub -``` - -默认情况下,服务器将在 [http://localhost:4444](http://localhost:4444) 上监听`RemoteWebDriver`请求。 - -#### Node - -在启动时,**Node**将从系统的[`PATH`]({{< ref "../webdriver/troubleshooting/errors/driver_location.md#3-path-环境变量" >}})中检测可用的驱动程序。 - -以下命令假设**Node**正在运行的机器与**Hub**在同一台机器上。 - -```shell -java -jar selenium-server-.jar node -``` - -##### 同一台机器上的多个Node - -**Node** 1 -```shell -java -jar selenium-server-.jar node --port 5555 -``` - -**Node** 2 -```shell -java -jar selenium-server-.jar node --port 6666 -``` - -##### 不同机器上的Node和Hub - -**Hub**和**Nodes**通过HTTP和[**事件总线**]({{< ref "components.md#event-bus" >}})(**事件总线**位于**Hub**内部)进行通信。 - -**Node**通过事件总线向**Hub**发送消息以开始注册过程。当**Hub**收到消息时,通过HTTP与**Node**联系以确认其存在。 - -要成功将**Node**注册到**Hub**,重要的是要在**Hub**机器上公开**事件总线**端口(默认为4442和4443)。这也适用于**Node**端口。有了这个,**Hub**和**Node**都能够通信。 - -如果**Hub**使用默认端口,则可以使用 `--hub` 注册**Node**。 -```shell -java -jar selenium-server-.jar node --hub http://:4444 -``` - -当**Hub**未使用默认端口时,需要使用`--publish-events`和`--subscribe-events`。 - -例如,如果**Hub**使用端口8886、8887和8888。 -```shell -java -jar selenium-server-.jar hub --publish-events tcp://:8886 --subscribe-events tcp://:8887 --port 8888 -``` -**Node**需要使用这些端口才能成功注册。 -```shell -java -jar selenium-server-.jar node --publish-events tcp://:8886 --subscribe-events tcp://:8887 -``` - -### 分部署部署(Distributed) - -在使用分布式Grid时,每个组件都需要单独启动,并且理想情况下应该在不同的机器上。 - -{{% alert color="primary" %}} -重要的是要正确暴露所有端口,以允许所有组件之间的流畅通信。 -{{% /alert %}} - -1. **事件总线(Event Bus)**: 使不同网格组件之间的内部通信成为可能。 - -默认端口为:`4442`、`4443`和`5557`。 -```shell -java -jar selenium-server-.jar event-bus --publish-events tcp://:4442 --subscribe-events tcp://:4443 --port 5557 -``` - -2. **新会话队列(New Session Queue)**: 将新的会话请求添加到一个队列中,Distributor将查询该队列。 - -默认端口为`5559`。 -```shell -java -jar selenium-server-.jar sessionqueue --port 5559 -``` - -3. **会话映射(Session Map)**: 将会话ID映射到运行该会话的节点。 - -默认**会话映射**端口为`5556`。**会话映射**与**事件总线**进行交互。 - -```shell -java -jar selenium-server-.jar sessions --publish-events tcp://:4442 --subscribe-events tcp://:4443 --port 5556 -``` - -4. **分配器(Distributor)**: 查询新 **会话队列(New Session Queue)** 以获取新会话请求,并在能力匹配时将其分配给 **Node**。 **Nodes** 注册到 **Distributor** 的方式与在 **Hub/Node** 网格中注册到 **Hub** 相同。 - -默认**分配器**端口为`5553`。**分配器** 与 **新会话队列**、**会话映射**、**事件总线** 和 **Node(s)** 进行交互。 - -```shell -java -jar selenium-server-.jar distributor --publish-events tcp://:4442 --subscribe-events tcp://:4443 --sessions http://:5556 --sessionqueue http://:5559 --port 5553 --bind-bus false -``` - -5. **路由器(Router)**: 将新会话请求重定向到队列,并将正在运行的会话请求重定向到运行该会话的**Node**。 - -默认**路由器**端口为`4444`。**路由器** 与 **新会话队列**、**会话映射**和**分配器** 进行交互。 - -```shell -java -jar selenium-server-.jar router --sessions http://:5556 --distributor http://:5553 --sessionqueue http://:5559 --port 4444 -``` - -6. **Node(s)** - -默认 **Node** 端口是 `5555`. -```shell -java -jar selenium-server-.jar node --publish-events tcp://:4442 --subscribe-events tcp://:4443 -``` - -## 测试中的 Metadata - -向测试中添加 `Metadata` 并通过[GraphQL]({{< ref "advanced_features/graphql_support.md" >}})进行消费,或通过 `Selenium Grid UI` 可视化其部分内容(例如`se:name`)。 - -可以通过在 `capability` 前加上 `se:` 来添加元数据。以下是一个Java的快速示例。 - -```java -ChromeOptions chromeOptions = new ChromeOptions(); -chromeOptions.setCapability("browserVersion", "100"); -chromeOptions.setCapability("platformName", "Windows"); -// Showing a test name instead of the session id in the Grid UI -chromeOptions.setCapability("se:name", "My simple test"); -// Other type of metadata can be seen in the Grid UI by clicking on the -// session info or via GraphQL -chromeOptions.setCapability("se:sampleMetadata", "Sample metadata value"); -WebDriver driver = new RemoteWebDriver(new URL("http://gridUrl:4444"), chromeOptions); -driver.get("http://www.google.com"); -driver.quit(); -``` - -## 查询 Selenium Grid 相关状态 - -启动 `Grid` 后,主要有两种方式查询其状态,通过 `Grid UI` 或通过 `API` 调用。 - -可以通过打开您喜欢的浏览器并前往[http://localhost:4444](http://localhost:4444)。 - -`API` 调用可以通过 [http://localhost:4444/status](http://localhost:4444/status) 端点或使用 [GraphQL]({{< ref "advanced_features/graphql_support.md" >}}) - -{{% pageinfo color="primary" %}} -为简单起见,本页中显示的所有命令示例均假定组件正在运行在本地。更详细的示例和用法可以在[配置组件]({{< ref "configuration" >}}) 部分。 -{{% /pageinfo %}} - -## 使用 Java 11 中的 HTTP Client {{% badge-version version="4.5" %}} - -默认情况下,Grid 将使用 [AsyncHttpClient](https://github.com/AsyncHttpClient/async-http-client)。 AsyncHttpClient 是一个建立在 Netty 之上的开源库。 它允许异步执行 HTTP 请求和响应。 此外,它还提供 WebSocket 支持。 因此它很合适。 - -然而,AsyncHttpClient 从 2021 年 6 月开始就没有主动维护了。恰逢 Java 11+ 提供了内置的 HTTP 和 WebSocket 客户端。 - -目前,Selenium 计划将支持的最低版本升级到 Java 11。然而,这需要大量的工作。为了确保用户体验不受影响,将其与主要发布版本和相应的公告对齐是至关重要的。 - -要使用 Java 11 客户端,您需要下载 `selenium-http-jdk-client` jar文件并使用 `--ext` 参数使其在 Grid jar 的类路径中可用。 - -jar文件可以直接从 [repo1.maven.org](https://repo1.maven.org/maven2/org/seleniumhq/selenium/selenium-http-jdk-client/) 下载,然后使用以下方式启动Grid: - -```bash -java -Dwebdriver.http.factory=jdk-http-client -jar selenium-server-.jar --ext selenium-http-jdk-client-.jar standalone -``` - -下载 `selenium-http-jdk-client` jar 文件的替代方法是使用 [Coursier](https://get-coursier.io/docs/cli-installation)。 - -```bash -java -Dwebdriver.http.factory=jdk-http-client -jar selenium-server-.jar --ext $(coursier fetch -p org.seleniumhq.selenium:selenium-http-jdk-client:) standalone -``` - -如果您使用的是集线器/节点模式或分布式模式,则需要为每个组件设置 `-Dwebdriver.http.factory=jdk-http-client` 和 `--ext` 参数。 - -## Grid 的规模 - -选择 `Grid` 角色取决于需要支持什么操作系统和浏览器、需要执行多少个并行会话、可用机器的数量以及这些机器的配置(CPU、RAM)。 - -并发创建会话依赖于 **分配器** 的可用处理器。 例如,如果一台机器有 4 个 CPU,则 **分配器** 最多只能同时创建 4 个会话。 - -默认情况下,**Node** 支持的最大并发会话数受可用 CPU 数量的限制。 例如,如果 **Node** 机器有 8 个 CPU,它最多可以运行 8 个并发浏览器会话(Safari 除外,它始终是一个)。 此外,预计每个浏览器会话应使用大约 1GB 的 RAM。 - -通常,建议 **Nodes** 尽可能小。 与其让机器有 32 个 CPU 和 32GB RAM 来运行 32 个并发浏览器会话,不如有 32 个小的 **Node**,以便更好地隔离进程。 有了这个,如果一个 **Node** 发生故障,它将以孤立的方式进行。 Docker 是实现这种方法的好工具。 - -请注意,默认值(每个浏览器 1 个 CPU/1GB RAM)是建议值,它们不适用于您的上下文。 建议将它们用作参考,但持续测量性能将有助于确定您的环境的理想值。 - -`Grid` 大小与支持的并发会话数量和 **Node** 数量有关,没有“一刀切”的说法。 下面提到的尺寸是粗略的估计,不同环境之间可能会有所不同。 例如,当 **Hub** 具有足够的资源时,具有 120 个 **Nodes** 的 **Hub/Node** 可能运行良好。 以下值并非一成不变,欢迎提供反馈! - -### 小规模 - -**Standalone** 或 **Hub/Node** 不超过5个 **Nodes**. - -### 中等规模 - -**Hub/Node** 介于6到60个 **Nodes** 之间。 - -### 大规模 - -**Hub/Node** 介于60到100个 **Nodes** 之间, **Distributed** 超过100个 **Nodes**。 - -## 请注意 - -必须使用适当的防火墙权限保护Selenium Grid免受外部访问。 - -以下一种或多种情况可能会导致你的 `Grid` 处于一个不安全的状态: - -* 您提供对您的 `Grid` 基础设施的开放访问 -* 您允许第三方访问内部网络应用程序和文件 -* 您允许第三方运行自定义二进制文件 - -请参阅 Detectify Labs, 上的这篇博文,它提供了一个很好的公开暴露的 `Grid` 如何被滥用的概述:[不要让你的 `Grid` 暴露在外](//labs.detectify.com/2017/10/06/guest-blog-dont-leave-your-grid-wide-open/) - -## 延伸阅读 - -* [Components]({{< ref "components.md" >}}):了解 `Grid` 的内部组件如何相互关联。 -* [Configuration]({{< ref "configuration" >}}): 自定义您的 `Grid` 设置。 -* [Architecture]({{< ref "architecture.md" >}}): 理解 `Grid` 中的关键概念。 -* [Advanced Features]({{< ref "advanced_features" >}}): 通过Grid的特性探索更多的可能性。 diff --git a/website_and_docs/content/documentation/legacy/_index.en.md b/website_and_docs/content/documentation/legacy/_index.en.md index f162ddbbcac4..9472aaade099 100644 --- a/website_and_docs/content/documentation/legacy/_index.en.md +++ b/website_and_docs/content/documentation/legacy/_index.en.md @@ -5,5 +5,9 @@ weight: 14 description: > Documentation related to the legacy components of Selenium. Meant to be kept purely for historical reasons and not as a incentive to use deprecated components. -aliases: ["/documentation/en/legacy_docs/", "/documentation/ja/legacy_docs/", "/documentation/pt-br/legacy_docs/", "/documentation/zh-cn/legacy_docs/"] +aliases: ["/documentation/en/legacy_docs/", "/documentation/ja/legacy_docs/", "/documentation/pt-br/legacy_docs/", "/documentation/zh-cn/legacy_docs/", +"/ja/documentation/legacy/", +"/pt-br/documentation/legacy/", +"/zh-cn/documentation/legacy/" +] --- diff --git a/website_and_docs/content/documentation/legacy/_index.ja.md b/website_and_docs/content/documentation/legacy/_index.ja.md deleted file mode 100644 index e3d8801c7b9a..000000000000 --- a/website_and_docs/content/documentation/legacy/_index.ja.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "レガシー" -linkTitle: "レガシー" -weight: 14 -description: > - このセクションでは、Seleniumのレガシーコンポーネントに関連するすべてのドキュメントを見つけることができます。 - これは、非推奨コンポーネントを使用する動機としてではなく、純粋に歴史的な理由で保持されることを意図しています。 ---- - -{{% pageinfo color="warning" %}} -

- - Most of the documentation found in this section is still in English. - Please note we are not accepting pull requests to translate this content - as translating documentation of legacy components does not add value to - the community nor the project. -

-{{% /pageinfo %}} - diff --git a/website_and_docs/content/documentation/legacy/_index.pt-br.md b/website_and_docs/content/documentation/legacy/_index.pt-br.md deleted file mode 100644 index 8e044a69fe1d..000000000000 --- a/website_and_docs/content/documentation/legacy/_index.pt-br.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "Legado" -linkTitle: "Legado" -weight: 14 -description: > - Nesta seção você pode encontrar toda a documentação relacionada aos componentes legados do Selenium. - Isso deve ser mantido puramente por razões históricas e não como um incentivo para o uso obsoleto - componentes. ---- - -{{% pageinfo color="warning" %}} -

- - Most of the documentation found in this section is still in English. - Please note we are not accepting pull requests to translate this content - as translating documentation of legacy components does not add value to - the community nor the project. -

-{{% /pageinfo %}} - - diff --git a/website_and_docs/content/documentation/legacy/_index.zh-cn.md b/website_and_docs/content/documentation/legacy/_index.zh-cn.md deleted file mode 100644 index e50cb0017481..000000000000 --- a/website_and_docs/content/documentation/legacy/_index.zh-cn.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "Legacy" -linkTitle: "Legacy" -weight: 14 -description: > - 在此部分,您可以找到与Selenium的旧组件有关的所有文档. - 这样做纯粹是出于历史原因,而不是鼓励使用已废弃的组件. ---- - - diff --git a/website_and_docs/content/documentation/legacy/selenium_1.en.md b/website_and_docs/content/documentation/legacy/selenium_1.en.md index fb39b47dbdad..99bd358828d5 100644 --- a/website_and_docs/content/documentation/legacy/selenium_1.en.md +++ b/website_and_docs/content/documentation/legacy/selenium_1.en.md @@ -9,7 +9,13 @@ aliases: [ "/documentation/legacy/selenium_rc/", "/documentation/ja/legacy_docs/selenium_rc/", "/documentation/pt-br/legacy_docs/selenium_rc/", -"/documentation/zh-cn/legacy_docs/selenium_rc/" +"/documentation/zh-cn/legacy_docs/selenium_rc/", +"/ja/documentation/legacy/selenium_1/", +"/ja/documentation/legacy/selenium_rc/", +"/pt-br/documentation/legacy/selenium_1/", +"/pt-br/documentation/legacy/selenium_rc/", +"/zh-cn/documentation/legacy/selenium_1/", +"/zh-cn/documentation/legacy/selenium_rc/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_1.ja.md b/website_and_docs/content/documentation/legacy/selenium_1.ja.md deleted file mode 100644 index a50dd2d1e81e..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_1.ja.md +++ /dev/null @@ -1,1509 +0,0 @@ ---- -title: "Selenium RC (Selenium 1)" -linkTitle: "Selenium 1" -weight: 2 -description: > - The original version of Selenium -aliases: [ -"/documentation/legacy/selenium_rc/" -] ---- - - -## 紹介 -Selenium RCは長い間メインのSeleniumプロジェクトでしたが、WebDriver/Seleniumを併合したより強力なツールであるSelenium 2が登場しました。 -Selenium 1はもうサポートされていないことを強調する価値があります。 - -## Selenium RCの仕組み -はじめに、Selenium RCのコンポーネントがどのように動作するか、およびテストスクリプトの実行でそれぞれが果たす役割について説明します。 - -### RCコンポーネント - -SeleniumRCコンポーネントは、以下のとおりです。 - -* ブラウザを起動および終了し、テストプログラムから渡されたSeleneseコマンドを解釈および実行し、ブラウザとAUTの間で渡されるHTTPメッセージをインターセプトおよび検証するSeleniumサーバー -* 各プログラミング言語とSelenium RC Server間のインターフェイスを提供するクライアントライブラリ - -これは簡略化されたアーキテクチャ図です。 - -![簡略化されたアーキテクチャ図](/images/documentation/legacy/selenium_rc_architecture_diagram_simple.png) - -この図は、クライアントライブラリが実行される各Seleniumコマンドを渡すサーバーと通信することを示しています。 -次に、サーバーはSelenium-Core JavaScriptコマンドを使用してSeleniumコマンドをブラウザーに渡します。 -ブラウザは、JavaScriptインタープリターを使用して、Seleniumコマンドを実行します。 -これにより、テストスクリプトで指定したSeleneseアクションまたは検証が実行されます。 - -### Seleniumサーバー - -Seleniumサーバーは、テストプログラムからSeleniumコマンドを受信して解釈し、それらのテストの実行結果をプログラムに報告します。 - -RCサーバーはSelenium Coreをバンドルし、ブラウザーに自動的に挿入します。 -これは、テストプログラムがブラウザを開いたときに発生します(クライアントライブラリのAPI関数を使用)。 -Selenium-CoreはJavaScriptプログラムです。 -実際には、ブラウザの組み込みJavaScriptインタープリターを使用してSeleneseコマンドを解釈および実行するJavaScript関数のセットです。 - -サーバーは、単純なHTTP GET/POSTリクエストを使用して、テストプログラムからSeleneseコマンドを受け取ります。 -これは、HTTPリクエストを送信できるプログラミング言語を使用して、ブラウザーでのSeleniumテストを自動化できることを意味します。 - -### クライアントライブラリ - -クライアントライブラリは、独自の設計のプログラムからSeleniumコマンドを実行できるプログラミングサポートを提供します。 -サポートされる言語ごとに異なるクライアントライブラリがあります。 -Seleniumクライアントライブラリは、プログラミングインターフェイス(API)、つまり、独自のプログラムからSeleniumコマンドを実行する一連の関数を提供します。 -各インターフェイス内には、各Seleneseコマンドをサポートするプログラミング関数があります。 - -クライアントライブラリは、Seleneseコマンドを受け取り、それをSeleniumサーバーに渡して、特定のアクションまたはテスト対象アプリケーション(AUT)に対するテストを処理します。 -クライアントライブラリは、そのコマンドの結果も受け取り、プログラムに返します。 -プログラムは結果を受け取ってプログラム変数に保存し、成功または失敗として報告するか、予期しないエラーの場合は修正アクションを実行できます。 - -したがって、テストプログラムを作成するには、クライアントライブラリAPIを使用して一連のSeleniumコマンドを実行するプログラムを作成するだけです。 -また、オプションで、Selenium-IDEでSeleneseテストスクリプトを既に作成している場合は、Selenium RCコードを生成できます。 -Selenium-IDEは、(エクスポートメニュー項目を使用して)SeleniumコマンドをクライアントドライバーのAPI関数呼び出しに変換できます。 -Selenium-IDEからRCコードをエクスポートする詳細については、Selenium-IDEの章を参照してください。 - -## インストール - -インストールというのは、Seleniumの誤った呼び名です。 -Seleniumには、選択したプログラミング言語で利用可能な一連のライブラリがあります。 -[ダウンロードページ](https://selenium.dev/downloads/)からダウンロードできます。 - -使用する言語を選択したら、次のことを行う必要があります。 - -* Selenium RCサーバーをインストールします。 -* 言語固有のクライアントドライバーを使用してプログラミングプロジェクトをセットアップします。 - -### Seleniumサーバーのインストール - -Selenium RCサーバーは単なるJava jarファイル(selenium-server-standalone-<version-number>.jar)であり、特別なインストールは不要です。 -zipファイルをダウンロードして、目的のディレクトリにサーバーを展開するだけで十分です。 - -### Seleniumサーバーを実行する - -テストを開始する前に、サーバーを起動する必要があります。 -Selenium RCのサーバーがあるディレクトリに移動し、コマンドラインコンソールから次を実行します。 - -```shell - java -jar selenium-server-standalone-.jar -``` - -これは、上記のコマンドを含むバッチまたはシェル実行可能ファイル(Windowsでは.bat、Linuxでは.sh)を作成することで簡素化できます。 -次に、デスクトップ上でその実行可能ファイルへのショートカットを作成し、アイコンをダブルクリックしてサーバーを起動します。 - -サーバーを実行するには、Javaをインストールし、PATH環境変数をコンソールから実行するように正しく構成する必要があります。 -コンソールで次を実行すると、Javaが正しくインストールされていることを確認できます。 - -```shell - java -version -``` - -バージョン番号(1.5以降である必要があります)を取得したら、Selenium RCの使用を開始できます。 - -### Javaクライアントドライバーの使用 - -* SeleniumHQ[ダウンロードページ](https://selenium.dev/downloads/)からSelenium Javaクライアントドライバーのzipファイルをダウンロードします。 -* selenium-java-<version-number> .jarファイルを解凍します。 -* Open your desired Java IDE (Eclipse, NetBeans, IntelliJ, Netweaver, etc.) -* 希望するJava IDE(Eclipse、NetBeans、IntelliJ、Netweaverなど)を開きます。 -* Javaプロジェクトを作成します。 -* selenium-java-<version-number>.jarファイルをプロジェクトの参照先に追加します。 -* selenium-java-<version-number>.jarファイルをプロジェクトのクラスパスに追加します。 -* Selenium-IDEから、スクリプトをJavaファイルにエクスポートしてJavaプロジェクトに含めるか、selenium-java-client APIを使用してJavaでSeleniumテストを記述します。 -APIについては、この章の後半で説明します。 -JUnitまたはTestNgを使用してテストを実行するか、独自の単純なmain()プログラムを作成できます。 -これらの概念については、このセクションの後半で説明します。 -* コンソールからSeleniumサーバーを実行します。 -* Java IDEまたはコマンドラインからテストを実行します。 - -Javaテストプロジェクトの設定詳細については、付録セクションの「EclipseでのSelenium RCの設定」および「IntellijでのSelenium RCの設定」を参照してください。 - -### Pythonクライアントドライバーの使用 - -* SeleniumをPIP経由でインストールします。手順はSeleniumHQ[ダウンロードページ](https://selenium.dev/downloads/)にリンクされています。 -* SeleniumテストをPythonで作成するか、Selenium-IDEからPythonファイルにスクリプトをエクスポートします。 -* コンソールからSeleniumサーバーを実行します。 -* コンソールまたはPython IDEからテストを実行します。 - -Pythonクライアントドライバーの設定詳細については、付録「Pythonクライアントドライバーの設定」を参照してください。 - -### .NETクライアントドライバーの使用 - -* SeleniumHQ[ダウンロードページ](https://selenium.dev/downloads/)からSelenium RCをダウンロードします。 -* フォルダーを解凍します。 -* [NUnit](https://nunit.org/download/)をダウンロードしてインストールします。 -(注:テストエンジンとしてNUnitを使用できます。 -NUnitにまだ慣れていない場合は、簡単なmain()関数を作成してテストを実行することもできますが、NUnitはテストエンジンとして非常に便利です。) -* 希望した.Net IDE(Visual Studio、SharpDevelop、MonoDevelop)を開きます。 -* クラスライブラリ(.dll)を作成します。 -* 次のDLLへの参照を追加します。 -nmock.dll、nunit.core.dll、nunit、framework.dll、ThoughtWorks.Selenium.Core.dll、ThoughtWorks.Selenium.IntegrationTests.dll、ThoughtWorks.Selenium.UnitTests.dll -* Seleniumテストを.Net言語(C#、VB.Net)で記述するか、Selenium-IDEからC#ファイルにスクリプトをエクスポートし、このコードを作成したクラスファイルにコピーします。 -* 独自の単純なmain()プログラムを作成するか、テストを実行するためにプロジェクトにNUnitを含めることができます。 -これらの概念については、この章の後半で説明します。 -* コンソールからSeleniumサーバーを実行します。 -* IDE、NUnit GUI、またはコマンドラインからテストを実行します。 - -Visual Studioを使用した.NETクライアントドライバーの設定詳細については、付録の.NETクライアントドライバー設定を参照してください。 - -### Rubyクライアントドライバーの使用 - -* RubyGemsがまだない場合は、RubyForgeからインストールします。 -* 次のコマンドを実行します。 ``gem install selenium-client`` -* テストスクリプトの上部に次の行を追加します。 ``require "selenium/client"`` -* Rubyテストハーネス(Test :: Unit、Mini :: Test、RSpecなど)を使用してテストスクリプトを記述します。 -* コンソールからSeleniumサーバーを実行します。 -* 他のRubyスクリプトを実行するのと同じ方法でテストを実行します。 - -Rubyクライアントドライバーの構成の詳細については、`Selenium-Clientのドキュメント` を参照してください。 - -## Seleneseからプログラムへ - -Selenium RCを使用する主なタスクは、Seleneseをプログラミング言語に変換することです。 -このセクションでは、言語固有の例をいくつか示します。 - -### サンプルテストスクリプト - -Seleneseテストスクリプトの例から始めましょう。 -Selenium-IDEで次のテストを記録することを想像してください。 - -| | | | -| -------- | ---------------------------- | ----------- | -| open | / | | -| type | q | selenium rc | -| clickAndWait | btnG | | -| assertTextPresent | Results * for selenium rc | | - -注:この例は、Google検索ページ http://www.google.com で機能します。 - -### プログラミングコードとしてのSelenese - -サポートされている各プログラミング言語に(Selenium-IDE経由で)エクスポートされたテストスクリプトを次に示します。 -オブジェクト指向プログラミング言語の少なくとも基本的な知識がある場合は、これらの例のいずれかを読むことで、SeleniumがSeleneseコマンドを実行する方法を理解できます。 -特定の言語の例を表示するには、これらのボタンのいずれかを選択します。 - -#### CSharp -``` csharp - - using System; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using NUnit.Framework; - using Selenium; - - namespace SeleniumTests - { - [TestFixture] - public class NewTest - { - private ISelenium selenium; - private StringBuilder verificationErrors; - - [SetUp] - public void SetupTest() - { - selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.google.com/"); - selenium.Start(); - verificationErrors = new StringBuilder(); - } - - [TearDown] - public void TeardownTest() - { - try - { - selenium.Stop(); - } - catch (Exception) - { - // Ignore errors if unable to close the browser - } - Assert.AreEqual("", verificationErrors.ToString()); - } - - [Test] - public void TheNewTest() - { - selenium.Open("/"); - selenium.Type("q", "selenium rc"); - selenium.Click("btnG"); - selenium.WaitForPageToLoad("30000"); - Assert.AreEqual("selenium rc - Google Search", selenium.GetTitle()); - } - } - } - -``` - -#### Java - -```java - - /** Add JUnit framework to your classpath if not already there - * for this example to work - */ - package com.example.tests; - - import com.thoughtworks.selenium.*; - import java.util.regex.Pattern; - - public class NewTest extends SeleneseTestCase { - public void setUp() throws Exception { - setUp("http://www.google.com/", "*firefox"); - } - public void testNew() throws Exception { - selenium.open("/"); - selenium.type("q", "selenium rc"); - selenium.click("btnG"); - selenium.waitForPageToLoad("30000"); - assertTrue(selenium.isTextPresent("Results * for selenium rc")); - } - } - -``` - -#### Php - -```php - setBrowser("*firefox"); - $this->setBrowserUrl("http://www.google.com/"); - } - - function testMyTestCase() - { - $this->open("/"); - $this->type("q", "selenium rc"); - $this->click("btnG"); - $this->waitForPageToLoad("30000"); - $this->assertTrue($this->isTextPresent("Results * for selenium rc")); - } - } - ?> - -``` - -#### Python - -```python - - from selenium import selenium - import unittest, time, re - - class NewTest(unittest.TestCase): - def setUp(self): - self.verificationErrors = [] - self.selenium = selenium("localhost", 4444, "*firefox", - "http://www.google.com/") - self.selenium.start() - - def test_new(self): - sel = self.selenium - sel.open("/") - sel.type("q", "selenium rc") - sel.click("btnG") - sel.wait_for_page_to_load("30000") - self.failUnless(sel.is_text_present("Results * for selenium rc")) - - def tearDown(self): - self.selenium.stop() - self.assertEqual([], self.verificationErrors) - -``` - -#### Ruby - -```ruby - - require "selenium/client" - require "test/unit" - - class NewTest < Test::Unit::TestCase - def setup - @verification_errors = [] - if $selenium - @selenium = $selenium - else - @selenium = Selenium::Client::Driver.new("localhost", 4444, "*firefox", "http://www.google.com/", 60); - @selenium.start - end - @selenium.set_context("test_new") - end - - def teardown - @selenium.stop unless $selenium - assert_equal [], @verification_errors - end - - def test_new - @selenium.open "/" - @selenium.type "q", "selenium rc" - @selenium.click "btnG" - @selenium.wait_for_page_to_load "30000" - assert @selenium.is_text_present("Results * for selenium rc") - end - end - -``` - -次のセクションでは、生成されたコードを使用してテストプログラムを構築する方法を説明します。 - -## テストをプログラミングする - -次に、サポートされている各プログラミング言語の例を使用して、独自のテストをプログラミングする方法を説明します。 -基本的に2つのタスクがあります。 - -* Selenium-IDEからスクリプトをプログラミング言語に生成し、必要に応じて結果を変更します。 -* 生成されたコードを実行する非常に単純なmainプログラムを記述します。 - -必要に応じて、JUnitまたはJava用のTestNG、またはこれらの言語のいずれかを使用している場合は.NET用のNUnitなどのテストエンジンプラットフォームを採用できます。 - -ここでは、言語固有の例を示します。 -言語固有のAPIはそれぞれ異なっている傾向があるため、それぞれに個別の説明があります。 - -* Java -* C# -* Python -* Ruby -* Perl, PHP - - -### Java - -Javaの場合、テストエンジンとしてJUnitまたはTestNGを使用します。 -Eclipseは、プラグインを介してこれらを直接サポートしています。 -これにより、さらに簡単になります。 -JUnitまたはTestNGの指導はこのドキュメントの範囲外ですが、資料はオンラインで入手でき、利用可能な出版物があります。 -すでに"java-shop"であれば、開発者がこれらのテストフレームワークのいずれかで既にある程度の経験を持っている可能性があります。 - -おそらく、テストクラスの名前を"NewTest"から独自の名前に変更する必要があります。 -また、ステートメント内のブラウザを開くパラメーターを変更する必要があります。 - -```java - selenium = new DefaultSelenium("localhost", 4444, "*iehta", "http://www.google.com/"); -``` - -Selenium-IDEで生成されたコードは次のようになります。 -この例では、わかりやすくするためにコメントを手動で追加しています。 - -```java - package com.example.tests; - // We specify the package of our tests - - import com.thoughtworks.selenium.*; - // This is the driver's import. You'll use this for instantiating a - // browser and making it do what you need. - - import java.util.regex.Pattern; - // Selenium-IDE add the Pattern module because it's sometimes used for - // regex validations. You can remove the module if it's not used in your - // script. - - public class NewTest extends SeleneseTestCase { - // We create our Selenium test case - - public void setUp() throws Exception { - setUp("http://www.google.com/", "*firefox"); - // We instantiate and start the browser - } - - public void testNew() throws Exception { - selenium.open("/"); - selenium.type("q", "selenium rc"); - selenium.click("btnG"); - selenium.waitForPageToLoad("30000"); - assertTrue(selenium.isTextPresent("Results * for selenium rc")); - // These are the real test steps - } - } -``` - - -### `C#` - -.NETクライアントドライバーはMicrosoft.NETで動作します。 -NUnitやVisual Studio 2005 Team Systemなどの.NETテストフレームワークで利用できます。 - -Selenium-IDEは、テストフレームワークとしてNUnitを使用することを想定しています。 -以下の生成コードでこれを確認できます。 -NUnitの *using* ステートメントと、テストクラスの各メンバー関数の役割を識別する対応するNUnit属性が含まれています。 - -おそらく、テストクラスの名前を"NewTest"から独自の選択に変更する必要があります。 -また、ステートメントのブラウザで開くパラメーターを変更する必要があります。 - -```csharp - selenium = new DefaultSelenium("localhost", 4444, "*iehta", "http://www.google.com/"); -``` - -生成されたコードは次のようになります。 - -```csharp - - using System; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using NUnit.Framework; - using Selenium; - - namespace SeleniumTests - - { - [TestFixture] - - public class NewTest - - { - private ISelenium selenium; - - private StringBuilder verificationErrors; - - [SetUp] - - public void SetupTest() - - { - selenium = new DefaultSelenium("localhost", 4444, "*iehta", - "http://www.google.com/"); - - selenium.Start(); - - verificationErrors = new StringBuilder(); - } - - [TearDown] - - public void TeardownTest() - { - try - { - selenium.Stop(); - } - - catch (Exception) - { - // Ignore errors if unable to close the browser - } - - Assert.AreEqual("", verificationErrors.ToString()); - } - [Test] - - public void TheNewTest() - { - // Open Google search engine. - selenium.Open("http://www.google.com/"); - - // Assert Title of page. - Assert.AreEqual("Google", selenium.GetTitle()); - - // Provide search term as "Selenium OpenQA" - selenium.Type("q", "Selenium OpenQA"); - - // Read the keyed search term and assert it. - Assert.AreEqual("Selenium OpenQA", selenium.GetValue("q")); - - // Click on Search button. - selenium.Click("btnG"); - - // Wait for page to load. - selenium.WaitForPageToLoad("5000"); - - // Assert that "www.openqa.org" is available in search results. - Assert.IsTrue(selenium.IsTextPresent("www.openqa.org")); - - // Assert that page title is - "Selenium OpenQA - Google Search" - Assert.AreEqual("Selenium OpenQA - Google Search", - selenium.GetTitle()); - } - } - } -``` - -NUnitにテストの実行を管理させることができます。 -または、テストオブジェクトをインスタンス化し、`SetupTest()`、`TheNewTest()`、`TeardownTest()` の各メソッドを順番に実行する単純な `main()` プログラムを作成することもできます。 - -### Python - -Pyunitは、Pythonで使用するテストフレームワークです。 - -基本的なテスト構造は次のとおりです。 - -```python - - from selenium import selenium - # This is the driver's import. You'll use this class for instantiating a - # browser and making it do what you need. - - import unittest, time, re - # This are the basic imports added by Selenium-IDE by default. - # You can remove the modules if they are not used in your script. - - class NewTest(unittest.TestCase): - # We create our unittest test case - - def setUp(self): - self.verificationErrors = [] - # This is an empty array where we will store any verification errors - # we find in our tests - - self.selenium = selenium("localhost", 4444, "*firefox", - "http://www.google.com/") - self.selenium.start() - # We instantiate and start the browser - - def test_new(self): - # This is the test code. Here you should put the actions you need - # the browser to do during your test. - - sel = self.selenium - # We assign the browser to the variable "sel" (just to save us from - # typing "self.selenium" each time we want to call the browser). - - sel.open("/") - sel.type("q", "selenium rc") - sel.click("btnG") - sel.wait_for_page_to_load("30000") - self.failUnless(sel.is_text_present("Results * for selenium rc")) - # These are the real test steps - - def tearDown(self): - self.selenium.stop() - # we close the browser (I'd recommend you to comment this line while - # you are creating and debugging your tests) - - self.assertEqual([], self.verificationErrors) - # And make the test fail if we found that any verification errors - # were found -``` - -### Ruby - -Selenium-IDEの古い(2.0より前の)バージョンは、古いSelenium gemを必要とするRubyコードを生成します。 -したがって、IDEによって生成されたRubyスクリプトを次のように更新することをお勧めします。 - -1. 1行目を ``require "selenium"`` から ``require "selenium/client"`` に変更 - -2. 11行目を ``Selenium::SeleniumDriver.new`` から ``Selenium::Client::Driver.new`` に変更 - -クラス名を"Untitled"よりもわかりやすい名前に変更し、テストメソッドの名前を"test_untitled"以外の名前に変更することもできます。 - -上記のように、Selenium IDEによって生成されたRubyコードを変更して作成された簡単な例を次に示します。 - -```ruby - - # load the Selenium-Client gem - require "selenium/client" - - # Load Test::Unit, Ruby's default test framework. - # If you prefer RSpec, see the examples in the Selenium-Client - # documentation. - require "test/unit" - - class Untitled < Test::Unit::TestCase - - # The setup method is called before each test. - def setup - - # This array is used to capture errors and display them at the - # end of the test run. - @verification_errors = [] - - # Create a new instance of the Selenium-Client driver. - @selenium = Selenium::Client::Driver.new \ - :host => "localhost", - :port => 4444, - :browser => "*chrome", - :url => "http://www.google.com/", - :timeout_in_second => 60 - - # Start the browser session - @selenium.start - - # Print a message in the browser-side log and status bar - # (optional). - @selenium.set_context("test_untitled") - - end - - # The teardown method is called after each test. - def teardown - - # Stop the browser session. - @selenium.stop - - # Print the array of error messages, if any. - assert_equal [], @verification_errors - end - - # This is the main body of your test. - def test_untitled - - # Open the root of the site we specified when we created the - # new driver instance, above. - @selenium.open "/" - - # Type 'selenium rc' into the field named 'q' - @selenium.type "q", "selenium rc" - - # Click the button named "btnG" - @selenium.click "btnG" - - # Wait for the search results page to load. - # Note that we don't need to set a timeout here, because that - # was specified when we created the new driver instance, above. - @selenium.wait_for_page_to_load - - begin - - # Test whether the search results contain the expected text. - # Notice that the star (*) is a wildcard that matches any - # number of characters. - assert @selenium.is_text_present("Results * for selenium rc") - - rescue Test::Unit::AssertionFailedError - - # If the assertion fails, push it onto the array of errors. - @verification_errors << $! - - end - end - end - -``` - -### Perl, PHP - -ドキュメントチームのメンバーは、PerlまたはPHPでSelenium RCを使用していません。 -これらの2つの言語のいずれかでSelenium RCを使用している場合は、ドキュメントチームに連絡してください(貢献に関する章を参照)。 -PerlおよびPHPユーザーをサポートするために、あなたとあなたの経験からいくつかの例を含めたいと思います。 - -## APIを学ぶ - -Selenium RC APIは、Seleneseを理解していると仮定すると、インターフェイスのほとんどが自明である命名規則を使用します。 -ただし、ここでは、最も重要で、おそらくそれほど明白ではない側面について説明します。 - -### ブラウザーを起動する - -#### CSharp -```csharp - selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.google.com/"); - selenium.Start(); -``` - -#### Java -```java - - setUp("http://www.google.com/", "*firefox"); -``` - -#### Perl -```perl - my $sel = Test::WWW::Selenium->new( host => "localhost", - port => 4444, - browser => "*firefox", - browser_url => "http://www.google.com/" ); -``` - -#### Php -```php - $this->setBrowser("*firefox"); - $this->setBrowserUrl("http://www.google.com/"); -``` - -#### Python -```python - self.selenium = selenium("localhost", 4444, "*firefox", - "http://www.google.com/") - self.selenium.start() -``` - -#### Ruby -```ruby - @selenium = Selenium::ClientDriver.new("localhost", 4444, "*firefox", "http://www.google.com/", 10000); - @selenium.start -``` - -これらの各例はブラウザを開き、"ブラウザーインスタンス"をプログラム変数に割り当てることでそのブラウザを表します。 -このプログラム変数は、ブラウザからメソッドを呼び出すために使用されます。 -これらのメソッドは、Seleniumコマンドを実行します。 -つまり、 *open* コマンドや *type* コマンド、 *verify* コマンドなどです。 - -ブラウザーインスタンスの作成時に必要なパラメーターは次のとおりです。 - -* **host** - サーバーが配置されているコンピューターのIPアドレスを指定します。 - 通常、これはクライアントが実行されているマシンと同じマシンであるため、この場合は *localhost* が渡されます。 - 一部のクライアントでは、これは任意のパラメーターです。 - -* **port** - サーバーがクライアントが接続を確立するのを待機しているTCP/IPソケットを指定します。 - これは、一部のクライアントドライバーでは任意です。 - -* **browser** - テストを実行するブラウザー。 - これは必須パラメーターです。 - -* **url** - テスト対象のアプリケーションのベースURL。 - これは、すべてのクライアントライブラリに必要であり、ブラウザプロキシAUT通信を開始するための不可欠な情報です。 - -一部のクライアントライブラリでは、 `start()` メソッドを呼び出してブラウザーを明示的に起動する必要があります。 - -### コマンドを実行する - -ブラウザを初期化して変数(一般的に"selenium"という名前)に割り当てたら、ブラウザ変数からそれぞれのメソッドを呼び出してSeleneseコマンドを実行させることができます。 -たとえば、Seleniumオブジェクトの *type* メソッドを呼び出すには、以下のように記述します。 - -``` - selenium.type("field-id","string to type") -``` - -バックグラウンドで、ブラウザは、メソッド呼び出し中に指定したロケーターと文字列を使用して、ユーザーがブラウザーに入力を入力するのと本質的に同じタイプ操作を実際に実行します。 - -## 結果を報告する - -Selenium RCには、結果を報告するための独自のメカニズムがありません。 -むしろ、選択したプログラミング言語の機能を使用して、ニーズに合わせてカスタマイズしたレポートを作成できます。 -それは素晴らしいことですが、すでにあなたのために行われている何かを簡単にしたい場合はどうでしょうか? -多くの場合、既存のライブラリまたはテストフレームワークは、独自のテストレポートコードを開発するよりも早くニーズを満たすことができます。 - -### テストフレームワークのレポートツール - -テストフレームワークは、多くのプログラミング言語で使用できます。 -これらは、テストを実行するための柔軟なテストエンジンを提供する主な機能とともに、結果を報告するためのライブラリコードを含んでいます。 -たとえば、Javaには一般的に使用される2つのテストフレームワーク、JUnitとTestNGがあります。 -.NETには独自のNUnitもあります。 - -ここではフレームワーク自体を教えません。 -これはこのユーザーガイドの範囲外です。 -Seleniumに関連するフレームワーク機能と、適用可能ないくつかのテクニックを簡単に紹介します。 -ただし、これらのテストフレームワークに関する優れた書籍は、インターネット上の情報とともに入手できます。 - -### テストレポートライブラリ - -選択したプログラミング言語でテスト結果を報告するために特別に作成されたサードパーティライブラリも利用できます。 -これらは多くの場合、HTMLやPDFなどのさまざまな形式をサポートします。 - -### 最良のアプローチは何ですか? - -テストフレームワークを初めて使用するほとんどの人は、フレームワークに組み込まれているレポート機能から始めます。 -独自のライブラリを開発するよりも時間がかかりません。 -Seleniumを使用し始めたら、進捗を報告するための独自の"印刷したステートメント"を入力し始めることは間違いありません。 -それにより、ライブラリまたはテストフレームワークの使用と並行して、独自のレポートの開発に徐々につながる可能性があります。 -とにかく、最初の、しかし短い学習曲線の後、あなたは自分の状況に最適なものを自然に開発します。 - -### テストレポートの例 - -説明のために、Seleniumでサポートされている他の言語のいくつかの特定のツールを紹介します。 -ここにリストされているものは一般的に使用されており、このガイドの著者によって広く使用されています(したがって、推奨されています)。 - -#### Javaのテストレポート - -* SeleniumテストケースがJUnitを使用して開発されている場合、JUnitレポートを使用してテストレポートを生成できます。 - -* TestNGを使用してSeleniumテストケースを開発する場合、テストレポートを生成するために外部タスクは必要ありません。 -TestNGフレームワークは、テストの詳細をリストするHTMLレポートを生成します。 - -* ReportNGは、TestNGフレームワーク用のHTMLレポートプラグインです。 -これは、デフォルトのTestNG HTMLレポートの代替として意図されています。 -ReportNGは、テスト結果の色分けされたシンプルなビューを提供します。 - -##### Seleneseコマンドのロギング - -* Seleniumのロギングを使用して、テスト内のすべてのSeleneseコマンドのレポートを、それぞれの成功または失敗とともに生成できます。 -ロギングSeleniumはJavaクライアントドライバーを拡張して、このSeleneseロギング機能を追加します。 - -#### Pythonのテストレポート - -* Pythonクライアントドライバーを使用する場合、HTMLTestRunnerを使用してテストレポートを生成できます。 - -#### Rubyのテストレポート - -* RSpecフレームワークをRubyでのSeleniumテストケースの作成に使用する場合、そのHTMLレポートを使用してテストレポートを生成できます。 - -## テストにスパイスを追加する - -次に、テストにプログラミングロジックを追加して、Selenium RCを使用するすべての理由を説明します。 -他のプログラムと同じです。 -プログラムフローは、条件ステートメントと反復を使用して制御されます。 -さらに、I/Oを使用して進捗情報を報告できます。 -このセクションでは、プログラミング言語の構成要素をSeleniumと組み合わせて、一般的なテストの問題を解決する方法の例をいくつか示します。 - -ページ要素の存在の単純なテストから、予想される結果を検証するためにプログラミングロジックを必要とする複数のWebページとさまざまなデータを含む動的機能のテストに移行するときにわかります。 -基本的に、Selenium-IDEは反復および標準条件ステートメントをサポートしていません。 -Seleneseパラメーターにjavascriptを埋め込むことでいくつかの条件を実行できますが、反復は不可能であり、プログラミング言語ではほとんどの条件がはるかに簡単になります。 -さらに、エラー回復のために例外処理が必要になる場合があります。 -これらの理由およびその他の理由により、自動テストでの"検証力"を高めるための一般的なプログラミング手法の使用を説明するために、このセクションを作成しました。 - -このセクションの例はC#とJavaで記述されていますが、コードはシンプルであり、サポートされている他の言語に簡単に適合させることができます。 -オブジェクト指向プログラミング言語の基本的な知識があれば、このセクションを理解するのに困難はないはずです。 - -### 反復 - -反復は、テストで行う必要がある最も一般的なことの1つです。 -たとえば、検索を複数回実行したい場合があります。 -または、おそらくテスト結果を検証するために、データベースから返された"結果セット"を処理する必要があります。 - -前に使用したのと同じGoogle検索の例を使用して、Seleniumの検索結果を確認しましょう。 -このテストではSeleneseを使用できます。 - -| | | | -| -------- | ---------------------------- | ------------- | -| open | / | | -| type | q | selenium rc | -| clickAndWait | btnG | | -| assertTextPresent | Results * for selenium rc | | -| type | q | selenium ide | -| clickAndWait | btnG | | -| assertTextPresent | Results * for selenium ide | | -| type | q | selenium grid | -| clickAndWait | btnG | | -| assertTextPresent | Results * for selenium grid | | - -同じ手順を3回実行するためにコードが繰り返されています。 -ただし、同じコードのコピーを複数作成することは、維持する作業が増えるため、プログラムとしては適切ではありません。 -プログラミング言語を使用することで、検索結果を反復処理して、より柔軟で保守可能なソリューションを実現できます。 - -#### `C#` の場合 - -```csharp - // Collection of String values. - String[] arr = {"ide", "rc", "grid"}; - - // Execute loop for each String in array 'arr'. - foreach (String s in arr) { - sel.open("/"); - sel.type("q", "selenium " +s); - sel.click("btnG"); - sel.waitForPageToLoad("30000"); - assertTrue("Expected text: " +s+ " is missing on page." - , sel.isTextPresent("Results * for selenium " + s)); - } -``` - -### 条件ステートメント - -テストでの条件の使用を説明するために、例から始めます。 -Seleniumテストの実行中に発生する一般的な問題は、ページで予期される要素が利用できない場合に発生します。 -たとえば、次の行を実行する場合です。 - -``` - selenium.type("q", "selenium " +s); -``` - -要素 'q'がページにない場合、例外がスローされます。 - -```java - com.thoughtworks.selenium.SeleniumException: ERROR: Element q not found -``` - -これにより、テストが中断する可能性があります。 -いくつかのテストでは、それがあなたの望むものです。 -しかし、多くの場合、テストスクリプトには実行する他の多くのテストがあるため、これは望ましくありません。 - -より良いアプローチは、まず要素が実際に存在するかどうかを検証し、次に存在しない場合に代替手段を取ることです。 -Javaを使用してこれを見てみましょう。 - -```java - // If element is available on page then perform type operation. - if(selenium.isElementPresent("q")) { - selenium.type("q", "Selenium rc"); - } else { - System.out.printf("Element: " +q+ " is not available on page.") - } -``` - -このアプローチの利点は、ページで一部のUI要素が利用できない場合でも、テストの実行を続行できることです。 - -### テストからJavaScriptを実行する - -JavaScriptは、セレンによって直接サポートされていないアプリケーションを実行する際に非常に便利です。 -Selenium APIの **getEval** メソッドを使用して、Selenium RCからJavaScriptを実行できます。 - -静的な識別子のないチェックボックスを持つアプリケーションを考えてください。 -この場合、Selenium RCからJavaScriptを評価して、すべてのチェックボックスのIDを取得し、それらを実行できます。 - -```java - public static String[] getAllCheckboxIds () { - String script = "var inputId = new Array();";// Create array in java script. - script += "var cnt = 0;"; // Counter for check box ids. - script += "var inputFields = new Array();"; // Create array in java script. - script += "inputFields = window.document.getElementsByTagName('input');"; // Collect input elements. - script += "for(var i=0; i.jar -``` - -オプションのリストを表示するには、 ``-h`` オプションを指定してサーバーを実行します。 - -```bash - $ java -jar selenium-server-standalone-.jar -h -``` - -サーバーで使用できるすべてのオプションのリストとそれぞれの簡単な説明が表示されます。 -提供された説明では必ずしも十分ではないため、いくつかのより重要なオプションについて説明しました。 - -### プロキシ設定 - -AUTが認証を必要とするHTTPプロキシの後ろにある場合、次のコマンドを使用してhttp.proxyHost、http.proxyPort、http.proxyUserおよびhttp.proxyPasswordを設定する必要があります。 - -```bash - $ java -jar selenium-server-standalone-.jar -Dhttp.proxyHost=proxy.com -Dhttp.proxyPort=8080 -Dhttp.proxyUser=username -Dhttp.proxyPassword=password -``` - -### マルチウィンドウモード - -Selenium 1.0を使用している場合は、マルチウィンドウモードがデフォルトの動作であるため、おそらくこのセクションをスキップできます。 -ただし、バージョン1.0より前は、Seleniumはデフォルトで、ここに示すようにサブフレームでテスト対象のアプリケーションを実行していました。 - -![シングルウィンドウモード](/images/documentation/legacy/selenium_rc_single_window_mode.png) - -一部のアプリケーションはサブフレームで正しく実行されず、ウィンドウの上部フレームにロードする必要がありました。 -マルチウィンドウモードオプションにより、AUTはデフォルトフレームではなく別のウィンドウで実行でき、そこで必要なトップフレームを取得できました。 - -![マルチウィンドウモード](/images/documentation/legacy/selenium_rc_multi_window_mode.png) - -Seleniumの古いバージョンでは、次のオプションで明示的にマルチウィンドウモードを指定する必要があります。 - -```bash - -multiwindow -``` - -Selenium RC 1.0の時点で、単一のフレーム内でテストを実行する場合(つまり、以前のSeleniumバージョンの標準を使用する場合)、オプションを使用してこれをSelenium Serverに指定できます。 - -```bash - -singlewindow -``` - -### Firefoxプロファイルの指定 - -Firefoxは、インスタンスごとに個別のプロファイルを指定しない限り、2つのインスタンスを同時に実行しません。 -Selenium RC 1.0以降は個別のプロファイルで自動的に実行されるため、Selenium 1.0を使用している場合は、このセクションをスキップできます。 -ただし、Seleniumの古いバージョンを使用している場合、またはテストに特定のプロファイルを使用する必要がある場合(https証明書の追加やアドオンのインストールなど)、プロファイルを明示的に指定する必要があります。 - -最初に、別のFirefoxプロファイルを作成するには、次の手順に従います。 Windowsのスタートメニューを開き、"実行"を選択して、次のいずれかを入力します。 - -```bash - firefox.exe -profilemanager -``` - -```bash - firefox.exe -P -``` - -ダイアログを使用して新しいプロファイルを作成します。 -次に、Seleniumサーバーを実行するときに、サーバーのコマンドラインオプション *\-firefoxProfileTemplate* でこの新しいFirefoxプロファイルを使用し、ファイル名とディレクトリパスを使用してプロファイルへのパスを指定するように指示します。 - -```bash - -firefoxProfileTemplate "path to the profile" -``` - -**警告**: 必ずデフォルトとは別の新しいフォルダーにプロファイルを入れてください!!! -Firefoxプロファイルマネージャーツールは、プロファイルを削除すると、プロファイルファイルであるかどうかに関係なく、フォルダー内のすべてのファイルを削除します。 - -Firefoxプロファイルの詳細については、[Mozillaのナレッジベース](http://support.mozilla.com/en/kb/Managing+profiles)をご覧ください。 - -### -htmlSuiteを使用してサーバー内でSeleneseを直接実行する - -HTMLファイルをサーバーのコマンドラインに渡すことで、Selenese HTMLファイルをSelenium Server内で直接実行できます。 -例えば、 - -```bash - java -jar selenium-server-standalone-.jar -htmlSuite "*firefox" - "http://www.google.com" "c:\absolute\path\to\my\HTMLSuite.html" - "c:\absolute\path\to\my\results.html" -``` - -これにより、HTMLスイートが自動的に起動され、すべてのテストが実行され、結果とともにHTMLレポートが保存されます。 - -*注意:* このオプションを使用すると、サーバーはテストを開始し、テストが完了するまで指定された秒数待機します。 その時間内にテストが完了しない場合、コマンドはゼロ以外の終了コードで終了し、結果ファイルは生成されません。 - -このコマンドラインは非常に長いため、入力するときは注意してください。 -これには、単一のテストではなく、HTML Seleneseスイートを渡す必要があることに注意してください。 -また、 -htmlSuite オプションは``-interactive``と互換性がないことに注意してください。 -両方を同時に実行することはできません。 - -### Seleniumサーバーのログ - -#### サーバー側のログ - -Seleniumサーバーを起動するときに、 **-log** オプションを使用して、Seleniumサーバーによってレポートされた貴重なデバッグ情報をテキストファイルに記録できます。 - -```bash - java -jar selenium-server-standalone-.jar -log selenium.log -``` - -このログファイルは、標準のコンソールログよりも詳細です(DEBUGレベルのログメッセージが含まれます)。 -ログファイルには、ロガー名、およびメッセージを記録したスレッドのID番号も含まれます。 -例えば、 - -```bash - 20:44:25 DEBUG [12] org.openqa.selenium.server.SeleniumDriverResourceHandler - - Browser 465828/:top frame1 posted START NEW -``` - -メッセージの形式は、以下のとおりです。 - -```bash - TIMESTAMP(HH:mm:ss) LEVEL [THREAD] LOGGER - MESSAGE -``` - -このメッセージは複数行の場合があります。 - -#### ブラウザ側のログ - -ブラウザ側のJavaScript(Selenium Core)も重要なメッセージを記録します。 -多くの場合、これらは通常のSeleniumサーバーログよりもエンドユーザーにとって有用です。 -ブラウザ側のログにアクセスするには、 **-browserSideLog** 引数をSeleniumサーバーに渡します。 - - -```bash - java -jar selenium-server-standalone-.jar -browserSideLog -``` - -**-browserSideLog** を **-log** 引数と組み合わせて、browserSideLogs(および他のすべてのDEBUGレベルのログメッセージ)をファイルに記録する必要があります。 - - -## 特定のブラウザへのパスを指定する - -特定のブラウザーへのパスをSelenium RCに指定できます。 -これは、同じブラウザーの異なるバージョンがあり、特定のブラウザーを使用する場合に便利です。 -また、これは、Selenium RCで直接サポートされていないブラウザーに対してテストを実行できるようにするために使用されます。 -実行モードを指定するときは、ブラウザの実行可能ファイルへのフルパスが後に続く \*custom 指定子を使用します。 - -```bash - *custom -``` - - -## Selenium RCアーキテクチャ - -*注意:* このトピックでは、Selenium RCの背後にある技術的な実装について説明します。 - Seleniumユーザーがこれを知ることは基本的なことではありませんが、将来発生する可能性のある問題の一部を理解するのに役立ちます。 - -Selenium RC Serverがどのように機能し、プロキシインジェクションと高度な特権モードを使用する理由を詳細に理解するには、最初に `同一オリジンポリシー` を理解する必要があります。 - -### 同一オリジンポリシー - -Seleniumが直面する主な制限は、同一オリジンポリシーです。 -このセキュリティ制限は、市場のすべてのブラウザーによって適用され、その目的は、サイトのコンテンツが別のサイトのスクリプトによってアクセスされないようにすることです。 -同一オリジンポリシーでは、ブラウザ内にロードされたコードはすべて、そのウェブサイトのドメイン内でのみ動作することが規定されています。 -別のWebサイトで関数を実行することはできません。 -たとえば、ブラウザが www.mysite.com を読み込むときにJavaScriptコードを読み込むと、それが別のサイトであっても、読み込まれたコードを www.mysite2.com に対して実行できません。 -これが可能な場合、他のタブで口座ページを開いていれば、開いているウェブサイトに配置されたスクリプトは銀行口座の情報を読み取ることができます。 -これはXSS(クロスサイトスクリプティング)と呼ばれます。 - -このポリシー内で機能するには、Selenium-Core(およびすべての魔法を発生させるJavaScriptコマンド)をテスト対象アプリケーション(同じURL)と同一オリジンに配置する必要があります。 - -歴史的に、Selenium-CoreはJavaScriptで実装されていたため、この問題によって制限されていました。 -ただし、Selenium RCは同一オリジンポリシーによって制限されていません。 -Seleniumサーバーをプロキシとして使用すると、この問題を回避できます。 -基本的に、ブラウザがサーバーが提供する単一の"なりすまし"ウェブサイトで動作していることをブラウザに伝えます。 - -*注意:* このトピックに関する追加情報は、同一オリジンポリシーおよびXSSに関するWikipediaページで見つけることができます。 - -### プロキシインジェクション - -同一オリジンポリシーを回避するためにSeleniumが使用した最初の方法は、プロキシインジェクションでした。 -プロキシインジェクションモードでは、Selenium Serverはブラウザと テスト対象アプリケーション[^1] の間にあるクライアント設定の **HTTPプロキシ**[^2]として機能します。 -次に、架空のURLでテスト対象アプリケーションをマスクします(Selenium-Coreと一連のテストを埋め込み、同一オリジンから来ているかのように配信します)。 - -[^1]: ブラウザーは、 localhost:4444 をHTTPプロキシーとして設定した構成プロファイルで起動されます。 -これが、ブラウザーが行うHTTP要求がSeleniumサーバーを通過し、レスポンスが実サーバーからではなく通過する理由です。 - -[^2]: プロキシは、2つの部分の間でボールを渡す中間の第三者です。 -AUTをブラウザに配信する"Webサーバー"として機能します。 -プロキシであるため、Seleniumサーバーはテスト対象アプリケーションの実際のURLについて"嘘をつく"機能を提供します。 - -これがアーキテクチャ図です。 - -![これがアーキテクチャ図 1](/images/documentation/legacy/selenium_rc_architecture_diagram_1.png) - -お気に入りの言語でテストスイートが開始されると、次のようになります。 - -1. クライアント/ドライバーは、selenium-RCサーバーとの接続を確立します。 -2. Selenium RCサーバーは、Selenium-CoreのJavaScriptをブラウザーがロードしたWebページに挿入するURLを使用してブラウザーを起動します(または古いブラウザーを再利用します)。 -3. クライアントドライバーはSeleneseコマンドをサーバーに渡します。 -4. サーバーはコマンドを解釈し、対応するJavaScript実行をトリガーして、ブラウザー内でそのコマンドを実行します。 Selenium-Coreは、ブラウザーに最初の命令に基づいて動作するよう指示し、通常はテスト対象アプリケーションのページを開きます。 -5. ブラウザーはオープンリクエストを受信し、Selenium RCサーバー(使用するブラウザーのHTTPプロキシとして設定)からWebサイトのコンテンツを要求します。 -6. Selenium RCサーバーはWebサーバーと通信してページを要求し、ページを受信すると、ブラウザーにページを送信し、オリジンをマスクしてページがSelenium-Coreと同じサーバーからのものであるように見えます(これにより、Selenium-Coreは 同一オリジンポリシーを使用)。 -7. ブラウザーはWebページを受信し、そのページ用に予約されているフレーム/ウィンドウにレンダリングします。 - -### Heightened Privileges でブラウザーを起動する - -この方法のこのワークフローは、プロキシインジェクションに非常に似ていますが、主な違いは、ブラウザが *Heightened Privileges* と呼ばれる特別なモードで起動されることです。 -これにより、Webサイトは一般に許可されていないこと(SeleniumにXSSを実行したり、ファイルのアップロード入力を入力したり)を許可します。 -これらのブラウザーモードを使用することで、Selenium CoreはAUT全体をSelenium RCサーバーに渡すことなく、テスト対象アプリケーションを直接開き、コンテンツを読み取り/操作できます。 - -これがアーキテクチャ図です。 - -![アーキテクチャ図 1](/images/documentation/legacy/selenium_rc_architecture_diagram_2.png) - -お気に入りの言語でテストスイートが開始されると、次のようになります。 - -1. クライアント/ドライバーは、selenium-RCサーバーとの接続を確立します。 -2. Selenium RCサーバーは、WebページにSelenium-CoreをロードするURLを使用してブラウザーを起動します(または古いブラウザーを再利用します)。 -3. Selenium-Coreは、クライアント/ドライバーから最初の命令を取得します(Selenium RCサーバーへの別のHTTP要求を介して)。 -4. Selenium-Coreはその最初の命令に基づいて動作し、通常はテスト対象アプリケーションのページを開きます。 -5. ブラウザはオープン要求を受信し、Webサーバーにページを要求します。 -ブラウザがWebページを受信すると、そのページ用に予約されたフレーム/ウィンドウにレンダリングします。 - -## HTTPSおよびセキュリティポップアップの処理 - -多くのアプリケーションは、パスワードやクレジットカード情報などの暗号化された情報を送信する必要がある場合、HTTPからHTTPSに切り替えます。 -これは、今日の多くのWebアプリケーションに共通しています。 -Selenium RCはこれをサポートしています。 - -HTTPSサイトが本物であることを確認するには、ブラウザにセキュリティ証明書が必要です。 -そうでない場合、ブラウザがHTTPSを使用してテスト対象アプリケーションにアクセスすると、アプリケーションが'信頼されていない'と見なされます。 -これが発生すると、ブラウザにセキュリティポップアップが表示され、Selenium RCを使用してこれらのポップアップを閉じることはできません。 - -Selenium RCテストでHTTPSを扱う場合、これをサポートし、セキュリティ証明書を処理する実行モードを使用する必要があります。 -テストプログラムでSeleniumを初期化するときに、実行モードを指定します。 - -Selenium RC 1.0ベータ2以降では、実行モードに* firefoxまたは* iexploreを使用します。 -Selenium RC 1.0 beta 1を含む以前のバージョンでは、実行モードに\*chromeまたは \*iehtaを使用します。 -これらの実行モードを使用すると、特別なセキュリティ証明書をインストールする必要はありません。 -Selenium RCがそれを処理します。 - -バージョン1.0では、実行モード\*firefoxまたは\*iexploreが推奨されます。 -ただし、\*iexploreproxyおよび\*firefoxproxyの追加の実行モードがあります。 -これらは後方互換性のためにのみ提供されており、レガシーテストプログラムで必要でない限り使用しないでください。 -アプリケーションが追加のブラウザウィンドウを開く場合、セキュリティ証明書の処理と複数のウィンドウの実行に制限があります。 - -Selenium RCの以前のバージョンでは、 \*chromeまたは\*iehtaは、HTTPSおよびセキュリティポップアップの処理をサポートする実行モードでした。 -これらは'実験モード'と見なされましたが、非常に安定し、多くの人が使用していました。 -Selenium 1.0を使用している場合、これらの古い実行モードは不要であり、使用すべきではありません。 - -### セキュリティ証明書の説明 - -通常、ブラウザは、既に所有しているセキュリティ証明書をインストールすることで、テストしているアプリケーションを信頼します。 -ブラウザのオプションまたはインターネットのプロパティでこれを確認できます(テスト対象アプリケーションのセキュリティ証明書がわからない場合は、システム管理者に問い合わせてください)。 -Seleniumがブラウザーをロードすると、ブラウザーとサーバー間のメッセージをインターセプトするコードを挿入します。 -ブラウザーは、信頼されていないソフトウェアがアプリケーションのように見えると解釈するようになりました。 -ポップアップメッセージで警告することで応答します。 - -これを回避するために、Selenium RC(これをサポートする実行モードを使用する場合)は、ブラウザーがアクセスできる場所でクライアントコンピューターに独自のセキュリティ証明書を一時的にインストールします。 -これにより、ブラウザはテスト対象アプリケーションとは異なるサイトにアクセスしていると思わせ、ポップアップを効果的に抑制します。 - -Seleniumの以前のバージョンで使用された別の方法は、Seleniumのインストールで提供されるCybervilliansセキュリティ証明書をインストールすることでした。 -ただし、ほとんどのユーザーはこれを行う必要がなくなります。 -Selenium RCをプロキシインジェクションモードで実行している場合、このセキュリティ証明書を明示的にインストールする必要があるかもしれません。 - -## 追加のブラウザーとブラウザー構成のサポート - -Selenium APIは、Internet ExplorerとMozilla Firefoxに加えて、複数のブラウザーに対する実行をサポートしています。 -サポートされるブラウザーについては、 https://selenium.dev Webサイトを参照してください。 -さらに、ブラウザーが直接サポートされていない場合でも、テストアプリケーションがブラウザーを起動する時に"\*custom"実行モード(すなわち、\*firefoxまたは\*iexploreの代わり)を使用して、選択したブラウザーに対してSeleniumテストを実行できます。 -これにより、API呼び出し内で実行可能なブラウザーへのパスを渡します。 -これは、対話モードのサーバーからも実行できます。 - -```bash - cmd=getNewBrowserSession&1=*custom c:\Program Files\Mozilla Firefox\MyBrowser.exe&2=http://www.google.com -``` - -### 異なるブラウザー設定でテストを実行する - -通常、Selenium RCはブラウザーを自動的に設定しますが、"\*custom" 実行モードを使用してブラウザーを起動する場合、自動設定を使用せずにSelenium RCにブラウザーをそのまま強制的に起動させることができます。 - -たとえば、次のようなカスタム設定でFirefoxを起動できます。 - -```bash - cmd=getNewBrowserSession&1=*custom c:\Program Files\Mozilla Firefox\firefox.exe&2=http://www.google.com -``` - -この方法でブラウザーを起動する場合、Selenium Serverをプロキシとして使用するようにブラウザーを手動で設定する必要があることに注意してください。 -通常、これはブラウザーの設定を開き、"localhost:4444"をHTTPプロキシとして指定することを意味しますが、この手順はブラウザーごとに根本的に異なる場合があります。 -詳細については、ブラウザーのドキュメントを参照してください。 - -Mozillaブラウザは、起動と停止の方法が異なる場合があることに注意してください。 -Mozillaブラウザの動作をもう少し予測可能にするために、MOZ_NO_REMOTE環境変数を設定する必要があるかもしれません。 -Unixユーザーは、シェルスクリプトを使用してブラウザを起動しないでください。 -一般に、バイナリ実行可能ファイル(firefox-binなど)を直接使用することをお勧めします。 - -## 一般的な問題のトラブルシューティング - -Selenium RCの使用を開始すると、一般的に発生する可能性のある問題がいくつかあります。 -ここでそれらとその解決策を紹介します。 - -### サーバーに接続できません - -テストプログラムがSeleniumサーバーに接続できない場合、Seleniumはテストプログラムで例外をスローします。 -このメッセージまたは同様のメッセージが表示されるはずです。 - -```bash - "Unable to connect to remote server (Inner Exception Message: - No connection could be made because the target machine actively - refused it )" - - (using .NET and XP Service Pack 2) -``` - -このようなメッセージが表示された場合は、必ずSeleniumサーバーを起動してください。 -その場合、SeleniumクライアントライブラリとSeleniumサーバー間の接続に問題があります。 - -Selenium RCを使用する場合、ほとんどの人は、同じマシンでテストプログラム(Seleniumクライアントライブラリを使用)とSeleniumサーバーを実行することから始めます。 -これを行うには、接続パラメーターとして"localhost"を使用します。 -開始する潜在的なネットワークの問題の影響を軽減するため、この方法で開始することをお勧めします。 -オペレーティングシステムに一般的なネットワーク設定とTCP/IP設定があると仮定すると、ほとんど問題はありません。 -実際、多くの人がこの方法でテストを実行することを選択します。 - -ただし、リモートマシンでSeleniumサーバーを実行する場合は、2台のマシン間に有効なTCP/IP接続があると仮定すると、接続は良好です。 - -接続に問題がある場合は、 *ping* 、*telnet* 、 *ifconfig(Unix)/ipconfig(Windows)* などの一般的なネットワークツールを使用して、有効なネットワーク接続を確保できます。 -これらに不慣れな場合は、システム管理者が支援できます。 - -### ブラウザをロードできません - -わかりやすいエラーメッセージではありません。 -申し訳ありませんが、Seleniumサーバーがブラウザをロードできない場合、このエラーが表示される可能性があります。 - -```bash - (500) Internal Server Error -``` - -これは、下記が原因の可能性があります。 - -* Firefox(Selenium 1.0より前)は、ブラウザーが既に開いており、別のプロファイルを指定していないため、起動できません。 - サーバーオプションのFirefoxプロファイルのセクションを参照してください。 -* 使用している実行モードは、マシン上のどのブラウザとも一致しません。 - プログラムでブラウザーを開いたときに、Seleniumに渡したパラメーターを確認してください。 -* ブラウザーへのパスを明示的に指定しました( "\*custom" を使用 - 上記を参照)が、パスが正しくありません。 - パスが正しいことを確認してください。 - また、ユーザーグループをチェックして、ブラウザーと "\*custom" パラメーターに既知の問題がないことを確認します。 - -### SeleniumはAUTを見つけることができません - -テストプログラムがブラウザを正常に起動したが、テストしているWebサイトがブラウザに表示されない場合、最も可能性の高い原因は、テストプログラムが正しいURLを使用していないことです。 - -これは簡単に起きます。 -Selenium-IDEを使用してスクリプトをエクスポートすると、ダミーのURLが挿入されます。 -アプリケーションをテストするには、URLを手動で正しいものに変更する必要があります。 - -### Firefoxはプロファイルの準備中にシャットダウンを拒否しました - -これはほとんどの場合、Selenium RCテストプログラムをFirefoxに対して実行しますが、Firefoxブラウザーセッションが既に実行されており、Selenium Serverの起動時に別のプロファイルを指定しなかった場合に発生します。 -テストプログラムからのエラーは次のようになります。 - -```bash - Error: java.lang.RuntimeException: Firefox refused shutdown while - preparing a profile -``` - -サーバーからの完全なエラーメッセージを次に示します。 - -```bash - 16:20:03.919 INFO - Preparing Firefox profile... - 16:20:27.822 WARN - GET /selenium-server/driver/?cmd=getNewBrowserSession&1=*fir - efox&2=http%3a%2f%2fsage-webapp1.qa.idc.com HTTP/1.1 - java.lang.RuntimeException: Firefox refused shutdown while preparing a profile - at org.openqa.selenium.server.browserlaunchers.FirefoxCustomProfileLaunc - her.waitForFullProfileToBeCreated(FirefoxCustomProfileLauncher.java:277) - ... - Caused by: org.openqa.selenium.server.browserlaunchers.FirefoxCustomProfileLaunc - her$FileLockRemainedException: Lock file still present! C:\DOCUME~1\jsvec\LOCALS - ~1\Temp\customProfileDir203138\parent.lock -``` - -これを解決するには、個別のFirefoxプロファイルの指定に関するセクションを参照してください。 - -### バージョン管理の問題 - -Seleniumのバージョンがブラウザのバージョンをサポートしていることを確認してください。 -たとえば、Selenium RC 0.92はFirefox 3をサポートしていません。 -時には幸運かもしれません(私はそうでした)。 -ただし、使用しているSeleniumのバージョンでサポートされているブラウザのバージョンを確認することを忘れないでください。 -疑わしい場合は、ブラウザの最も広く使用されているバージョンでSeleniumの最新リリースバージョンを使用してください。 - -### サーバーの起動中のエラーメッセージ: "(Unsupported major.minor version 49.0)" - -このエラーは、正しいバージョンのJavaを使用していないことを示しています。 -Selenium ServerにはJava 1.5以降が必要です。 - -Javaバージョンを再確認するには、コマンドラインからこれを実行します。 - -```bash - java -version -``` - -Javaバージョンを示すメッセージが表示されます。 - -```bash - java version "1.5.0_07" - Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03) - Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode) -``` - -低いバージョン番号が表示される場合は、JREを更新するか、単に更新したJREをPATH環境変数に追加する必要があります。 - -### getNewBrowserSessionコマンドの実行時の404エラー - -"http://www.google.com/selenium-server/" でページを開こうとしているときに404エラーが表示される場合は、Seleniumサーバーがプロキシとして正しく構成されていないことが原因である必要があります。 -"selenium-server" ディレクトリはgoogle.comには存在しません。 -プロキシが適切に設定されている場合にのみ存在します。 -プロキシ設定は、Firefox、iexplore、opera、またはカスタムでブラウザを起動する方法に大きく依存します。 - -* iexplore: \*iexplore を使用してブラウザを起動した場合、Internet Explorerのプロキシ設定に問題がある可能性があります。 -Seleniumサーバーは、インターネットオプションコントロールパネルでグローバルプロキシ設定を構成しようとします。 -Seleniumサーバーがブラウザーを起動するときに、これらが正しく構成されていることを確認する必要があります。 -インターネットオプションコントロールパネルを見てみてください。 -"接続"タブをクリックし、"LAN設定"をクリックします。 - * プロキシを使用してテストするアプリケーションにアクセスする必要がある場合は、"-Dhttp.proxyHost"でSeleniumサーバーを起動する必要があります。 - 詳細については、`Proxy Configuration`_ を参照してください。 - * プロキシを手動で設定してから、 \*custom または \*iehta ブラウザーランチャーでブラウザーを起動することもできます。 - -* custom: \*customを使用する場合、プロキシを正しく(手動で)設定する必要があります。 - そうしないと、404エラーが発生します。 - プロキシ設定が正しく構成されていることを再確認してください。 - プロキシを正しく設定したかどうかを確認するには、意図的にブラウザを誤って設定しようとします。 - 間違ったプロキシサーバーのホスト名または間違ったポートを使用するようにブラウザーを構成してください。 - ブラウザのプロキシ設定を正しく構成しなかった場合、ブラウザーはインターネットに接続できなくなります。 - これは、関連する設定を調整していることを確認する1つの方法です。 - -* 他のブラウザ(\*firefox、\*opera)では、プロキシが自動的にハードコード化されるため、この機能に関する既知の問題はありません。 - 404エラーが発生し、このユーザーガイドに従っている場合は、ユーザーコミュニティからの助けを得るために、ユーザーグループに結果を慎重に投稿してください。 - -### パーミッション拒否エラー - -このエラーの最も一般的な理由は、セッションがドメインの境界を越える(たとえば、 -http://domain1 から、http://domain2 のページにアクセスします)かプロトコルを切り替える(http://domainX から https://domainX に移動する)ことで同一オリジンポリシーに違反しようとしていることです。 - -このエラーは、JavaScriptがまだ使用可能でないUIページ(ページが完全にロードされる前)または使用できなくなった(ページのアンロードが開始された後)UIオブジェクトを見つけようとした場合にも発生します。 -これは、AJAXページで最も一般的に発生します。 -AJAXページは、大きなページとは独立してロードおよび/またはリロードするページまたはサブフレームのセクションで動作します。 - -このエラーは断続的に発生する場合があります。 -問題はデバッガーのオーバーヘッドがシステムに追加されたときに再現できない競合状態に起因するため、デバッガーで問題を再現することはできません。 -パーミッションの問題については、チュートリアルで詳しく説明します。 -`The Same Origin Policy`、`Proxy Injection`に関する章を注意深くお読みください。 - -### ブラウザーポップアップウィンドウの処理 - -Seleniumテスト中に取得できる"ポップアップ"にはいくつかの種類があります。 -テスト対象アプリケーションではなくブラウザによって開始されたSeleniumコマンドを実行しても、これらのポップアップを閉じることができない場合があります。 -これらの管理方法を知る必要があるかもしれません。 -ポップアップの種類ごとに異なる方法で対処する必要があります。 - -* HTTP基本認証ダイアログ:これらのダイアログは、サイトにログインするためのユーザー名/パスワードの入力を求めます。 - HTTP基本認証を必要とするサイトにログインするには、次のように、`RFC 1738`で説明されているように、URLでユーザー名とパスワードを使用します。 open("http://myusername:myuserpassword@myexample.com/blah/blah/blah"). - -* SSL証明書の警告:Selenium RCは、SSL証明書がプロキシとして有効になっている場合、自動的になりすまそうとします。 - 詳細については、HTTPSの章を参照してください。 - ブラウザーが正しく設定されている場合、SSL証明書の警告は表示されませんが、危険な"CyberVillains"SSL認証局を信頼するようにブラウザーを設定する必要があります。 - 繰り返しますが、これを行う方法についてはHTTPSセクションを参照してください。 - -* モーダルJavaScriptアラート/確認/プロンプトダイアログ:Seleniumはそれらのダイアログを(window.alert、window.confirm、window.promptを置き換えることで)隠そうとするため、ページの実行が停止されません。 - アラートポップアップが表示されている場合は、ページの読み込みプロセス中に発生した可能性があります。 - 通常、ページを保護するには早すぎます。 - Seleneseには、アラートと確認のポップアップをアサートまたは検証するためのコマンドが含まれています。 - 第4章のこれらのトピックに関する章を参照してください。 - -### Linuxで、Firefoxブラウザーセッションが閉じないのはなぜですか? - -Unix/Linuxでは、"firefox-bin"を直接呼び出す必要があるため、実行可能ファイルがパス上にあることを確認してください。 -シェルスクリプトを介してFirefoxを実行している場合、ブラウザーを終了するときが来ると、Selenium RCはシェルスクリプトを終了し、ブラウザーを実行したままにします。 -このように、firefox-binへのパスを直接指定できます。 - -```bash - cmd=getNewBrowserSession&1=*firefox /usr/local/firefox/firefox-bin&2=http://www.google.com -``` - -### Firefox \*chrome はカスタムプロファイルでは機能しません - -Firefoxプロファイルのフォルダー -> prefs.js -> user_pref("browser.startup.page", 0); を確認してください。 -次の行を "//user_pref("browser.startup.page", 0);" のようにコメントアウトして、再度試してください。 - -### 親ページの読み込み中にカスタムポップアップを読み込むことはできますか(つまり、親ページのjavascript window.onload()関数が実行される前)? - -いいえ。Seleniumはインターセプターに依存しており、ロード中のウィンドウ名を決定します。 -これらのインターセプターは、ウィンドウがonload()関数の後にロードされた場合、新しいウィンドウをキャッチするのに最適に機能します。 -Seleniumは、onload関数の前にロードされたウィンドウを認識しない場合があります。 - -### Linux上のFirefox - -Unix/Linuxでは、1.0より前のSeleniumのバージョンは "firefox-bin" を直接呼び出す必要があったため、以前のバージョンを使用している場合は、実際の実行可能ファイルがパス上にあることを確認してください。 - -ほとんどのLinuxディストリビューションでは、実際の *firefox-bin* は次の場所にあります。 - -```bash - /usr/lib/firefox-x.x.x/ -``` - -x.x.xは現在使用しているバージョン番号です。 -そのため、そのパスをユーザーのパスに追加します。 -以下を.bashrcファイルに追加する必要があります。 - -```bash - export PATH="$PATH:/usr/lib/firefox-x.x.x/" -``` - -必要に応じて、次のようにテストで直接firefox-binへのパスを指定できます。 - -```bash - "*firefox /usr/lib/firefox-x.x.x/firefox-bin" -``` - -### IEおよびスタイル属性 - -Internet Explorerでテストを実行していて、style属性を使用して要素を見つけられない場合、例えば、次のような場合があります。 - -```bash - //td[@style="background-color:yellow"] -``` - -これはFirefox、Opera、またはSafariで完全に機能しますが、IEでは機能しません。 -IEは `@style` のキーを大文字として解釈します。 -したがって、ソースコードが小文字であっても、下記のように使用したほうがよいです。 - -```bash - //td[@style="BACKGROUND-COLOR:yellow"] -``` - -テストが複数のブラウザーで動作することを意図している場合、これは問題ですが、簡単にテストをコーディングして状況を検出し、IEでのみ動作する代替ロケーターを試すことができます。 - -### エラーが発生しました-\*googlechromeブラウザーのシャットダウン時に"Cannot convert object to primitive value" - -このエラーを回避するには、同一オリジンポリシーチェックを無効にするオプションでブラウザを起動する必要があります。 - -```bash - selenium.start("commandLineFlags=--disable-web-security"); -``` - -### IEでエラーが発生しました - "Couldn't open app window; is the pop-up blocker enabled?" - -このエラーを回避するには、ブラウザを設定する必要があります。 -ポップアップブロッカーを無効にし、ツール >> オプション >>セキュリティで'保護モードを有効にする'オプションをオフにします。 diff --git a/website_and_docs/content/documentation/legacy/selenium_1.pt-br.md b/website_and_docs/content/documentation/legacy/selenium_1.pt-br.md deleted file mode 100644 index 6b2f902095d0..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_1.pt-br.md +++ /dev/null @@ -1,1701 +0,0 @@ ---- -title: "Selenium RC (Selenium 1)" -linkTitle: "Selenium 1" -weight: 2 -description: > - The original version of Selenium -aliases: [ -"/documentation/legacy/selenium_rc/" -] ---- - -## Introdução -Selenium RC foi o principal projeto da Selenium por muito tempo, antes da -fusão WebDriver / Selenium trazer o Selenium 2, uma ferramenta mais poderosa. -Vale ressaltar que não há mais suporte para Selenium 1. - -## Como o Selenium RC funciona -Primeiro, vamos descrever como os componentes do Selenium RC operam e o papel que cada um desempenha na execução -de seus scripts de teste. - -### Componentes do RC - -Os componentes do Selenium RC são: - -* O servidor Selenium que inicia e mata navegadores, interpreta e executa os comandos em Selenese passados do programa de teste e atua como um *proxy HTTP*, interceptando e verificando mensagens HTTP passadas entre o navegador e a aplicação sendo testada. -* Bibliotecas de cliente que fornecem a interface entre cada linguagem de programação e o Selenium RC Server. - -Aqui está um diagrama de arquitetura simplificado: - -![Architecture Diagram Simple](/images/documentation/legacy/selenium_rc_architecture_diagram_simple.png) - -O diagrama mostra que as bibliotecas cliente se comunicam com o -servidor passando cada comando Selenium para execução. Então o servidor passa o -comando Selenium para o navegador usando comandos Selenium-Core JavaScript. O -navegador, usando seu interpretador JavaScript, executa o comando Selenium. Este -executa a ação em Selenese ou verificação que você especificou em seu script de teste. - -### Servidor Selenium - -O servidor Selenium recebe comandos Selenium do seu programa de teste, -os interpreta e reporta ao seu programa os resultados da -execução desses testes. - -O servidor RC agrupa o Selenium Core e o injeta automaticamente -no navegador. Isso ocorre quando seu programa de teste abre o -navegador (usando uma função API de biblioteca cliente). -Selenium-Core é um programa JavaScript, na verdade um conjunto de funções JavaScript que interpretam e executam comandos em Selenese usando o -interpretador de JavaScript embutido do navegador. - -O servidor recebe os comandos em Selenese do seu programa de teste -usando solicitações HTTP GET/POST simples. Isso significa que você pode usar qualquer -linguagem de programação que pode enviar solicitações HTTP para automatizar -os testes Selenium no navegador. - -### Bibliotecas Cliente - -As bibliotecas cliente fornecem suporte de programação que permite que você -execute comandos Selenium a partir de um programa de seu próprio projeto. Existe um -biblioteca cliente diferente para cada linguagem compatível. Um cliente Selenium -biblioteca fornece uma interface de programação (API), ou seja, um conjunto de funções, -que executam comandos Selenium de seu próprio programa. Dentro de cada interface, -existe uma função de programação que suporta cada comando em Selenese. - -A biblioteca cliente pega um comando em Selenese e o passa para o servidor Selenium -para processar uma ação específica ou teste no aplicativo em teste -(AUT). A biblioteca cliente -também recebe o resultado desse comando e o devolve ao seu programa. -Seu programa pode receber o resultado e armazená-lo em uma variável de programa e -relatá-lo como um sucesso ou fracasso, -ou possivelmente executar uma ação corretiva se for um erro inesperado. - -Então, para criar um programa de teste, você simplesmente escreve um programa que executa -um conjunto de comandos Selenium usando uma API de biblioteca cliente. E, opcionalmente, se -você já tem um script de teste em Selenese criado na Selenium-IDE, você pode -*gerar o código Selenium RC*. A Selenium-IDE pode traduzir (usando seu item de menu -Exportar) seus comandos Selenium em chamadas de função de uma API de driver de cliente. -Consulte o capítulo Selenium-IDE para obter detalhes sobre a exportação de código RC a partir da -Selenium-IDE. - -## Instalação - -A instalação é um nome impróprio para Selenium. Selenium tem um conjunto de bibliotecas disponíveis -na linguagem de programação de sua escolha. Você pode baixá-los na [página de downloads](https://selenium.dev/downloads/). - -Depois de escolher uma linguagem para trabalhar, você só precisa: - -* Instalar o Selenium RC Server. -* Configurar um projeto de programação usando um driver cliente específico de linguagem. - -### Instalando o servidor Selenium - -O servidor Selenium RC é simplesmente um arquivo Java *jar* (*selenium-server-standalone-.jar*), que não -requer qualquer instalação especial. Basta baixar o arquivo zip e extrair o -servidor no diretório desejado. - -### Executando o servidor Selenium - -Antes de iniciar qualquer teste, você deve iniciar o servidor. Vá para o diretório -onde o servidor Selenium RC está localizado e execute o seguinte a partir da linha de comando. - -```shell - java -jar selenium-server-standalone-.jar -``` - -Isso pode ser simplificado criando -um arquivo executável em lote ou shell (.bat no Windows e .sh no Linux) contendo o comando -acima. Em seguida, faça um atalho para esse executável em seu -desktop e simplesmente clique duas vezes no ícone para iniciar o servidor. - -Para o servidor funcionar, você precisa do Java instalado -e a variável de ambiente PATH configurada corretamente para executá-lo a partir do console. -Você pode verificar se o Java está instalado corretamente executando o seguinte -em um console. - -```shell - java -version -``` - -Se você obtiver um número de versão (que precisa ser 1.5 ou posterior), você está pronto para começar a usar o Selenium RC. - -### Usando o driver cliente para Java - -* Baixe o zip do driver do cliente Selenium Java na [página de downloads do SeleniumHQ](https://selenium.dev/downloads/). -* Extraia o arquivo selenium-java-.jar -* Abra a IDE Java desejada (Eclipse, NetBeans, IntelliJ, Netweaver, etc.) -* Crie um projeto Java. -* Adicione os arquivos selenium-java-.jar ao seu projeto como referências. -* Adicione ao classpath do projeto o arquivo selenium-java-.jar. -* Na Selenium-IDE, exporte um script para um arquivo Java e inclua-o em seu projeto Java -ou escreva seu teste Selenium em Java usando a API selenium-java-client. - A API é apresentada posteriormente neste capítulo. Você pode usar JUnit ou TestNg - para executar seu teste, ou você pode escrever seu próprio programa main() simples. Esses conceitos são - explicados mais para frente nesta seção. -* Execute o servidor Selenium a partir do console. -* Execute seu teste na Java IDE ou na linha de comando. - -Para obter detalhes sobre a configuração do projeto de teste Java, consulte as seções do Apêndice -Configurando Selenium RC com Eclipse e Configurando Selenium RC com Intellij. - -### Usando o driver cliente para Python - -* Instale o Selenium via pip, instruções no link da [página de downloads do SeleniumHQ](https://selenium.dev/downloads/) -* Escreva seu teste Selenium em Python ou exporte - um script da Selenium-IDE para um arquivo python. -* Execute o servidor Selenium a partir do console -* Execute seu teste em um console ou IDE Python - -Para obter detalhes sobre a configuração do driver cliente Python, consulte o apêndice Configuração do driver cliente Python. - -### Usando o driver cliente para .NET - -* Baixe o Selenium RC na [página de downloads do SeleniumHQ](https://selenium.dev/downloads/) -* Extraia a pasta -* Baixe e instale o [NUnit](https://nunit.org/download/) ( - Nota: você pode usar o NUnit como seu mecanismo de teste. Se você ainda não está familiarizado com - NUnit, você também pode escrever uma função main() simples para executar seus testes; - no entanto, o NUnit é muito útil como um mecanismo de teste.) -* Abra a IDE .Net desejado (Visual Studio, SharpDevelop, MonoDevelop) -* Crie uma biblioteca de classes (.dll) -* Adicione referências às seguintes DLLs: nmock.dll, nunit.core.dll, nunit.framework.dll, ThoughtWorks.Selenium.Core.dll, ThoughtWorks.Selenium.IntegrationTests.dll - e ThoughtWorks.Selenium.UnitTests.dll -* Escreva seu teste Selenium em uma linguagem .Net (C#, VB.Net) ou exporte - um script da Selenium-IDE para um arquivo C# e copie este código para o arquivo de classe - você acabou de criar. -* Escreva seu próprio programa main() simples ou você pode incluir NUnit em seu projeto - para executar seu teste. Esses conceitos são explicados posteriormente neste capítulo. -* Execute o servidor Selenium a partir do console -* Execute seu teste a partir da IDE, da GUI do NUnit ou da linha de comando - -Para obter detalhes específicos sobre a configuração do driver cliente .NET com Visual Studio, consulte o apêndice -Configuração do driver cliente .NET. - -### Usando o driver cliente para Ruby - -* Se você ainda não tem RubyGems, instale-o do RubyForge. -* Execute ``gem install selenium-client`` -* No topo do seu script de teste, adicione ``require "selenium / client"`` -* Escreva seu script de teste usando qualquer função de teste Ruby (por exemplo, Test::Unit, - Mini::Test ou RSpec). -* Execute o servidor Selenium RC a partir do console. -* Execute seu teste da mesma forma que você executaria qualquer outro script Ruby. - - -Para obter detalhes sobre a configuração do driver do cliente Ruby, consulte a `documentação do Selenium-Client` - -## Do Selenese ao Programa - -A principal tarefa para usar o Selenium RC é converter seu Selenese em uma linguagem de programação. Nesta seção, fornecemos vários exemplos específicos de linguagens diferentes. - -### Exemplo de script de teste - -Vamos começar com um exemplo de script de teste em Selenese. Imagine gravar -o seguinte teste com Selenium-IDE. - -| | | | -| -------- | ---------------------------- | ----------- | -| open | / | | -| type | q | selenium rc | -| clickAndWait | btnG | | -| assertTextPresent | Results * for selenium rc | | - - -Observação: este exemplo funcionaria com a página de pesquisa do Google http://www.google.com - -### Selenese como código - -Aqui está o script de teste exportado (via Selenium-IDE) para cada uma das -linguagens de programação. Se você tem pelo menos conhecimento básico de linguagem de programação orientada a objetos (OOP), você vai entender como o Selenium -executa comandos em Selenese lendo um destes -exemplos. Para ver um exemplo em uma linguagem específica, selecione um desses botões. - -#### CSharp -``` csharp - - using System; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using NUnit.Framework; - using Selenium; - - namespace SeleniumTests - { - [TestFixture] - public class NewTest - { - private ISelenium selenium; - private StringBuilder verificationErrors; - - [SetUp] - public void SetupTest() - { - selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.google.com/"); - selenium.Start(); - verificationErrors = new StringBuilder(); - } - - [TearDown] - public void TeardownTest() - { - try - { - selenium.Stop(); - } - catch (Exception) - { - // Ignore errors if unable to close the browser - } - Assert.AreEqual("", verificationErrors.ToString()); - } - - [Test] - public void TheNewTest() - { - selenium.Open("/"); - selenium.Type("q", "selenium rc"); - selenium.Click("btnG"); - selenium.WaitForPageToLoad("30000"); - Assert.AreEqual("selenium rc - Google Search", selenium.GetTitle()); - } - } - } - -``` - -#### Java - -```java - - /** Add JUnit framework to your classpath if not already there - * for this example to work - */ - package com.example.tests; - - import com.thoughtworks.selenium.*; - import java.util.regex.Pattern; - - public class NewTest extends SeleneseTestCase { - public void setUp() throws Exception { - setUp("http://www.google.com/", "*firefox"); - } - public void testNew() throws Exception { - selenium.open("/"); - selenium.type("q", "selenium rc"); - selenium.click("btnG"); - selenium.waitForPageToLoad("30000"); - assertTrue(selenium.isTextPresent("Results * for selenium rc")); - } - } - -``` - -#### Php - -```php - setBrowser("*firefox"); - $this->setBrowserUrl("http://www.google.com/"); - } - - function testMyTestCase() - { - $this->open("/"); - $this->type("q", "selenium rc"); - $this->click("btnG"); - $this->waitForPageToLoad("30000"); - $this->assertTrue($this->isTextPresent("Results * for selenium rc")); - } - } - ?> - -``` - -#### Python - -```python - - from selenium import selenium - import unittest, time, re - - class NewTest(unittest.TestCase): - def setUp(self): - self.verificationErrors = [] - self.selenium = selenium("localhost", 4444, "*firefox", - "http://www.google.com/") - self.selenium.start() - - def test_new(self): - sel = self.selenium - sel.open("/") - sel.type("q", "selenium rc") - sel.click("btnG") - sel.wait_for_page_to_load("30000") - self.failUnless(sel.is_text_present("Results * for selenium rc")) - - def tearDown(self): - self.selenium.stop() - self.assertEqual([], self.verificationErrors) - -``` - -#### Ruby - -```ruby - - require "selenium/client" - require "test/unit" - - class NewTest < Test::Unit::TestCase - def setup - @verification_errors = [] - if $selenium - @selenium = $selenium - else - @selenium = Selenium::Client::Driver.new("localhost", 4444, "*firefox", "http://www.google.com/", 60); - @selenium.start - end - @selenium.set_context("test_new") - end - - def teardown - @selenium.stop unless $selenium - assert_equal [], @verification_errors - end - - def test_new - @selenium.open "/" - @selenium.type "q", "selenium rc" - @selenium.click "btnG" - @selenium.wait_for_page_to_load "30000" - assert @selenium.is_text_present("Results * for selenium rc") - end - end - -``` - -Na próxima seção, explicaremos como construir um programa de teste usando o código gerado. - -## Programando seu teste - -Agora vamos ilustrar como programar seus próprios testes usando exemplos em cada uma das -linguagens de programação suportadas. -Existem essencialmente duas tarefas: - -*Gerar seu script em uma - linguagem de programação a partir da Selenium-IDE, opcionalmente modificando o resultado. -*Escrever um programa principal muito simples que execute o código gerado. - -Opcionalmente, você pode adotar uma plataforma de mecanismo de teste como JUnit ou TestNG para Java, -ou NUnit para .NET se você estiver usando uma dessas linguagens. - -Aqui, mostramos exemplos específicos de cada linguagem. As APIs específicas do idioma tendem a -diferir de um para o outro, então você encontrará uma explicação separada para cada um. - -* Java -* C# -* Python -* Ruby -* Perl, PHP - - -### Java - -Para Java, as pessoas usam JUnit ou TestNG como mecanismo de teste. -Alguns ambientes de desenvolvimento como o Eclipse têm suporte direto para eles via -plug-ins. Isso torna tudo ainda mais fácil. Ensinar JUnit ou TestNG está além do escopo de -este documento, no entanto, os materiais podem ser encontrados online e há publicações -acessíveis. Se você já é uma "loja de Java", é provável que seus desenvolvedores -já tem alguma experiência com uma dessas estruturas de teste. - -Você provavelmente vai querer renomear a classe de teste de "NewTest" para algo -de sua própria escolha. Além disso, você precisará alterar os -parâmetros abertos pelo navegador na declaração: - -```java - selenium = new DefaultSelenium("localhost", 4444, "*iehta", "http://www.google.com/"); -``` - -O código gerado pela Selenium-IDE terá a seguinte aparência. Este exemplo -tem comentários adicionados manualmente para maior clareza. - -```java - package com.example.tests; - // We specify the package of our tests - - import com.thoughtworks.selenium.*; - // This is the driver's import. You'll use this for instantiating a - // browser and making it do what you need. - - import java.util.regex.Pattern; - // Selenium-IDE add the Pattern module because it's sometimes used for - // regex validations. You can remove the module if it's not used in your - // script. - - public class NewTest extends SeleneseTestCase { - // We create our Selenium test case - - public void setUp() throws Exception { - setUp("http://www.google.com/", "*firefox"); - // We instantiate and start the browser - } - - public void testNew() throws Exception { - selenium.open("/"); - selenium.type("q", "selenium rc"); - selenium.click("btnG"); - selenium.waitForPageToLoad("30000"); - assertTrue(selenium.isTextPresent("Results * for selenium rc")); - // These are the real test steps - } - } -``` - - -### `C#` - -O driver do cliente .NET funciona com o Microsoft.NET. -Pode ser usado com qualquer framework de teste .NET -como o NUnit ou o Visual Studio 2005 Team System. - -Selenium-IDE assume que você usará NUnit como sua estrutura de teste. -Você pode ver isso no código gerado abaixo. Inclui a declaração *using* -para NUnit junto com os atributos NUnit correspondentes que identificam -o papel de cada função-membro da classe de teste. - -Você provavelmente terá que renomear a classe de teste de "NewTest" para -algo de sua própria escolha. Além disso, você precisará alterar os -parâmetros abertos pelo navegador na declaração - -```csharp - selenium = new DefaultSelenium("localhost", 4444, "*iehta", "http://www.google.com/"); -``` - -O código gerado será semelhante a este. - -```csharp - - using System; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using NUnit.Framework; - using Selenium; - - namespace SeleniumTests - - { - [TestFixture] - - public class NewTest - - { - private ISelenium selenium; - - private StringBuilder verificationErrors; - - [SetUp] - - public void SetupTest() - - { - selenium = new DefaultSelenium("localhost", 4444, "*iehta", - "http://www.google.com/"); - - selenium.Start(); - - verificationErrors = new StringBuilder(); - } - - [TearDown] - - public void TeardownTest() - { - try - { - selenium.Stop(); - } - - catch (Exception) - { - // Ignore errors if unable to close the browser - } - - Assert.AreEqual("", verificationErrors.ToString()); - } - [Test] - - public void TheNewTest() - { - // Open Google search engine. - selenium.Open("http://www.google.com/"); - - // Assert Title of page. - Assert.AreEqual("Google", selenium.GetTitle()); - - // Provide search term as "Selenium OpenQA" - selenium.Type("q", "Selenium OpenQA"); - - // Read the keyed search term and assert it. - Assert.AreEqual("Selenium OpenQA", selenium.GetValue("q")); - - // Click on Search button. - selenium.Click("btnG"); - - // Wait for page to load. - selenium.WaitForPageToLoad("5000"); - - // Assert that "www.openqa.org" is available in search results. - Assert.IsTrue(selenium.IsTextPresent("www.openqa.org")); - - // Assert that page title is - "Selenium OpenQA - Google Search" - Assert.AreEqual("Selenium OpenQA - Google Search", - selenium.GetTitle()); - } - } - } -``` - -Você pode permitir que o NUnit gerencie a execução -de seus testes. Ou, alternativamente, você pode escrever um programa `main()` simples que -instancia o objeto de teste e executa cada um dos três métodos, `SetupTest()`, -`TheNewTest()` e `TeardownTest()` por sua vez. - - -### Python - -Pyunit é a estrutura de teste a ser usada para Python. - -A estrutura básica do teste é: - -```python - - from selenium import selenium - # This is the driver's import. You'll use this class for instantiating a - # browser and making it do what you need. - - import unittest, time, re - # This are the basic imports added by Selenium-IDE by default. - # You can remove the modules if they are not used in your script. - - class NewTest(unittest.TestCase): - # We create our unittest test case - - def setUp(self): - self.verificationErrors = [] - # This is an empty array where we will store any verification errors - # we find in our tests - - self.selenium = selenium("localhost", 4444, "*firefox", - "http://www.google.com/") - self.selenium.start() - # We instantiate and start the browser - - def test_new(self): - # This is the test code. Here you should put the actions you need - # the browser to do during your test. - - sel = self.selenium - # We assign the browser to the variable "sel" (just to save us from - # typing "self.selenium" each time we want to call the browser). - - sel.open("/") - sel.type("q", "selenium rc") - sel.click("btnG") - sel.wait_for_page_to_load("30000") - self.failUnless(sel.is_text_present("Results * for selenium rc")) - # These are the real test steps - - def tearDown(self): - self.selenium.stop() - # we close the browser (I'd recommend you to comment this line while - # you are creating and debugging your tests) - - self.assertEqual([], self.verificationErrors) - # And make the test fail if we found that any verification errors - # were found -``` - -### Ruby - - -Versões antigas (pré 2.0) da Selenium-IDE geram código Ruby que requer o *gem* antigo do Selenium. Portanto, é aconselhável atualizar todos os scripts Ruby gerados pela -IDE da seguinte forma: - -1. Na linha 1, altere ``require "selenium"`` para ``require "selenium/client"`` - -2. Na linha 11, altere ``Selenium::SeleniumDriver.new`` para -``Selenium::Client::Driver.new`` - -Você provavelmente também deseja alterar o nome da classe para algo mais -informativo do que "Untitled" e alterar o nome do método de teste para -algo diferente de "test_untitled." - -Aqui está um exemplo simples criado pela modificação do código Ruby gerado -pela Selenium IDE, conforme descrito acima. - -```ruby - - # load the Selenium-Client gem - require "selenium/client" - - # Load Test::Unit, Ruby's default test framework. - # If you prefer RSpec, see the examples in the Selenium-Client - # documentation. - require "test/unit" - - class Untitled < Test::Unit::TestCase - - # The setup method is called before each test. - def setup - - # This array is used to capture errors and display them at the - # end of the test run. - @verification_errors = [] - - # Create a new instance of the Selenium-Client driver. - @selenium = Selenium::Client::Driver.new \ - :host => "localhost", - :port => 4444, - :browser => "*chrome", - :url => "http://www.google.com/", - :timeout_in_second => 60 - - # Start the browser session - @selenium.start - - # Print a message in the browser-side log and status bar - # (optional). - @selenium.set_context("test_untitled") - - end - - # The teardown method is called after each test. - def teardown - - # Stop the browser session. - @selenium.stop - - # Print the array of error messages, if any. - assert_equal [], @verification_errors - end - - # This is the main body of your test. - def test_untitled - - # Open the root of the site we specified when we created the - # new driver instance, above. - @selenium.open "/" - - # Type 'selenium rc' into the field named 'q' - @selenium.type "q", "selenium rc" - - # Click the button named "btnG" - @selenium.click "btnG" - - # Wait for the search results page to load. - # Note that we don't need to set a timeout here, because that - # was specified when we created the new driver instance, above. - @selenium.wait_for_page_to_load - - begin - - # Test whether the search results contain the expected text. - # Notice that the star (*) is a wildcard that matches any - # number of characters. - assert @selenium.is_text_present("Results * for selenium rc") - - rescue Test::Unit::AssertionFailedError - - # If the assertion fails, push it onto the array of errors. - @verification_errors << $! - - end - end - end - -``` - -### Perl, PHP - -Os membros da equipe de documentação -não usaram Selenium RC com Perl ou PHP. Se você estiver usando Selenium RC com qualquer um desses dois idiomas, entre em contato com a Equipe de Documentação (consulte o capítulo sobre Contribuições). -Gostaríamos muito de incluir alguns exemplos seus e de suas experiências, para oferecer suporte a usuários Perl e PHP. - - -## Aprendendo a API - -A API Selenium RC usa convenções de nomenclatura -que, supondo que você entenda Selenese, será em grande parte autoexplicativo. -Aqui, no entanto, explicamos os aspectos mais críticos e -possivelmente menos óbvios. - -### Iniciando o navegador - -#### CSharp -```csharp - selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.google.com/"); - selenium.Start(); -``` - -#### Java -```java - - setUp("http://www.google.com/", "*firefox"); -``` - -#### Perl -```perl - my $sel = Test::WWW::Selenium->new( host => "localhost", - port => 4444, - browser => "*firefox", - browser_url => "http://www.google.com/" ); -``` - -#### Php -```php - $this->setBrowser("*firefox"); - $this->setBrowserUrl("http://www.google.com/"); -``` - -#### Python -```python - self.selenium = selenium("localhost", 4444, "*firefox", - "http://www.google.com/") - self.selenium.start() -``` - -#### Ruby -```ruby - @selenium = Selenium::ClientDriver.new("localhost", 4444, "*firefox", "http://www.google.com/", 10000); - @selenium.start -``` - -Cada um desses exemplos abre o navegador e representa esse navegador -atribuindo uma "instância do navegador" a uma variável de programa. Esta variável de programa é então usada para chamar métodos do navegador. -Esses métodos executam os comandos Selenium, ou seja, como *open* ou *type* ou *verify*. - -Os parâmetros necessários ao criar a instância do navegador -são: - -* **host** - Especifica o endereço IP do computador onde o servidor está localizado. Normalmente, esta é - a mesma máquina em que o cliente está sendo executado, portanto, neste caso, *localhost* é passado. Em alguns clientes, este é um parâmetro opcional. - -* **port** - Especifica o socket TCP/IP onde o servidor está escutando, esperando - para o cliente estabelecer uma conexão. Isso também é opcional em alguns - drivers do cliente. - -* **browser** - O navegador no qual você deseja executar os testes. Este é um parâmetro obrigatório. - -* **url** - A url base do aplicativo em teste. Isso é exigido por todas as - libs de cliente e é uma informação integral para iniciar a comunicação entre navegador-proxy-aplicação. - -Observe que algumas das bibliotecas cliente exigem que o navegador seja iniciado explicitamente chamando -seu método `start ()`. - -### Executando comandos - -Depois de ter o navegador inicializado e atribuído a uma variável (geralmente -chamada "selenium"), você pode fazê-lo executar comandos Selenese chamando os respectivos -métodos a partir da variável do navegador. Por exemplo, para chamar o método *type* -do objeto selenium: - -``` - selenium.type("field-id", "string to type") -``` - -Em segundo plano, o navegador realmente realizará uma operação *type*, -essencialmente idêntico a um usuário digitando uma entrada no navegador, -usando o localizador e a string que você especificou durante a chamada do método. - -## Reportando resultados - -O Selenium RC não tem seu próprio mecanismo para relatar os resultados. Em vez disso, -você pode construir seus relatórios personalizados de acordo com suas necessidades, usando recursos de sua -linguagem de programação escolhida. Isso é ótimo, mas e se você simplesmente quiser algo -rápido que já foi feito para você? Muitas vezes, uma biblioteca existente ou estrutura de teste pode -atender às suas necessidades mais rapidamente do que desenvolver seu próprio código de relatório de teste. - -### Ferramentas de reporte dos frameworks de teste - -Frameworks de teste estão disponíveis para muitas linguagens de programação. Estes, junto com -sua função principal de fornecer um mecanismo de teste flexível para executar seus testes, -incluem o código da biblioteca para relatar os resultados. Por exemplo, Java tem dois -frameworks de teste comumente usados, JUnit e TestNG. .NET também tem seu próprio, NUnit. - -Não ensinaremos os frameworks aqui; e que está além do escopo deste -guia de usuário. Vamos simplesmente apresentar os recursos do framework relacionados ao Selenium -junto com algumas técnicas que você pode aplicar. Existem bons livros disponíveis sobre estas -estruturas de teste, juntamente com informações na Internet. - -### Bibliotecas de relatórios de teste - -Também estão disponíveis bibliotecas de terceiros criadas especificamente para reportar -os resultados dos testes na linguagem de programação escolhida. Estes geralmente suportam uma -variedade de formatos, como HTML ou PDF. - -### Qual a melhor técnica? - -A maioria das pessoas novas no uso dos frameworks de teste começarão com os -recursos de relatórios integrados no framework. A partir daí, a maioria examinará todas as bibliotecas disponíveis -pois isso consome menos tempo do que desenvolver a sua própria. Quando você começa a usar o -Selenium, sem dúvida, você vai começar a colocar seus próprios "prints" para -relatar o progresso. Isso pode levá-lo gradualmente a desenvolver seus próprios -relatórios, possivelmente em paralelo ao uso de uma biblioteca ou estrutura de teste. Independentemente, -após a curta curva de aprendizado inicial você desenvolverá naturalmente o que funciona -melhor para sua própria situação. - -### Exemplos de relatórios de teste - -Para ilustrar, iremos direcioná-lo para algumas ferramentas específicas em algumas das outras linguagens -apoiadas pelo Selenium. As listadas aqui são comumente usadas e têm sido usadas -extensivamente (e portanto recomendadas) pelos autores deste guia. - -#### Relatórios de teste em Java - -* Se os casos de teste Selenium forem desenvolvidos usando JUnit, então o relatório JUnit pode ser usado - para gerar relatórios de teste. - -* Se os casos de teste Selenium forem desenvolvidos usando TestNG, então nenhuma tarefa externa - é necessária para gerar relatórios de teste. A estrutura TestNG gera um - Relatório HTML que lista os detalhes dos testes. - -* ReportNG é um plug-in de relatório HTML para a estrutura TestNG. - Destina-se a substituir o relatório HTML padrão do TestNG. - O ReportNG fornece uma visualização simples e codificada por cores dos resultados do teste. - -##### Registrando os comandos Selenese - -* O Logging Selenium pode ser usado para gerar um relatório de todos os comandos Selenese - em seu teste junto com o sucesso ou fracasso de cada um. Logging Selenium estende - o driver do cliente Java para adicionar esta capacidade de registro do Selenese. - -#### Relatórios de teste em Python - -* Ao usar o driver de cliente para Python, HTMLTestRunner pode ser usado para - gerar um relatório de teste. - -#### Relatórios de teste em Ruby - -* Se o framework RSpec for usado para escrever Casos de Teste Selenium em Ruby - então seu relatório HTML pode ser usado para gerar um relatório de teste. - - -## Adicionando algum tempero aos seus testes - -Agora veremos toda a razão de usar Selenium RC, adicionando lógica de programação aos seus testes. -É o mesmo que para qualquer programa. O fluxo do programa é controlado por meio de declarações de condição -e iteração. Além disso, você pode relatar informações de progresso usando I/O. Nesta secção -vamos mostrar alguns exemplos de como construções de linguagem de programação podem ser combinadas com -Selenium para resolver problemas de teste comuns. - -Você vai descobrir ao fazer a transição dos testes simples da existência de -elementos de página para testes de funcionalidade dinâmica envolvendo várias páginas da web e -dados variáveis que você exigirá lógica de programação para verificar -resultados. Basicamente, a Selenium-IDE não suporta iteração e -declarações de condição padrão. Você pode fazer algumas condições incorporando JavaScript -em parâmetros Selenese, no entanto -iteração é impossível, e a maioria das condições será muito mais fácil em uma -linguagem de programação. Além disso, você pode precisar de tratamento de exceção para -recuperação de erros. Por essas e outras razões, escrevemos esta seção -para ilustrar o uso de técnicas de programação comuns para -dar a você maior 'poder de verificação' em seus testes automatizados. - -Os exemplos nesta seção são escritos -em C# e Java, embora o código seja simples e possa ser facilmente adaptado às demais -linguagens. Se você tem algum conhecimento básico -de uma linguagem de programação orientada a objetos, você não deve ter dificuldade em entender esta seção. - -### Iteração - -A iteração é uma das coisas mais comuns que as pessoas precisam fazer em seus testes. -Por exemplo, você pode querer executar uma pesquisa várias vezes. Ou, talvez -para verificar os resultados do teste, você precisa processar um "conjunto de resultados" retornado de um banco de dados. - -Usando o mesmo exemplo de pesquisa do Google que usamos anteriormente, vamos -verificar os resultados da pesquisa Selenium. Este teste pode usar o Selenese: - -| | | | -| -------- | ---------------------------- | ------------- | -| open | / | | -| type | q | selenium rc | -| clickAndWait | btnG | | -| assertTextPresent | Results * for selenium rc | | -| type | q | selenium ide | -| clickAndWait | btnG | | -| assertTextPresent | Results * for selenium ide | | -| type | q | selenium grid | -| clickAndWait | btnG | | -| assertTextPresent | Results * for selenium grid | | - - -O código foi repetido para executar as mesmas etapas 3 vezes. Mas ter múltiplas -cópias do mesmo código não é uma boa prática de programação porque é mais -trabalhoso para manter. Usando uma linguagem de programação, podemos iterar -sobre os resultados da pesquisa para uma solução mais flexível e sustentável. - -#### In `C#` - -```csharp - // Collection of String values. - String[] arr = {"ide", "rc", "grid"}; - - // Execute loop for each String in array 'arr'. - foreach (String s in arr) { - sel.open("/"); - sel.type("q", "selenium " +s); - sel.click("btnG"); - sel.waitForPageToLoad("30000"); - assertTrue("Expected text: " +s+ " is missing on page." - , sel.isTextPresent("Results * for selenium " + s)); - } -``` - -### Declarações de condição - -Para ilustrar o uso de condições em testes, começaremos com um exemplo. -Um problema comum encontrado durante a execução de testes Selenium ocorre quando -o elemento esperado não está disponível na página. Por exemplo, ao executar a -seguinte linha: - -``` - selenium.type("q", "selenium " +s); -``` - -Se o elemento 'q' não estiver na página, então uma exceção é -lançada: - -```java - com.thoughtworks.selenium.SeleniumException: ERROR: Element q not found -``` - -Isso pode fazer com que seu teste seja interrompido. Para alguns testes, é isso que você deseja. Mas -frequentemente isso não é desejável, pois seu script de teste tem muitos outros testes subsequentes para realizar. - -Uma abordagem melhor é primeiro validar se o elemento está realmente presente -e então escolher alternativas quando não estiver. Vejamos isso usando Java. - -```java - // If element is available on page then perform type operation. - if(selenium.isElementPresent("q")) { - selenium.type("q", "Selenium rc"); - } else { - System.out.printf("Element: " +q+ " is not available on page.") - } -``` - -A vantagem desta abordagem é continuar com a execução do teste, mesmo se alguns elementos de IU não estão disponíveis na página. - - -### Executando JavaScript a partir do seu teste - -JavaScript é muito útil para exercitar uma aplicação que não é diretamente suportada -por Selenium. O método **getEval** da API Selenium pode ser usado para executar JavaScript a partir de -Selenium RC. - -Considere um aplicativo com caixas de seleção sem identificadores estáticos. -Neste caso, pode-se avaliar o JavaScript do Selenium RC para obter ids de todas -caixas de seleção e, em seguida, exercitá-las. - -```java - public static String[] getAllCheckboxIds () { - String script = "var inputId = new Array();";// Create array in java script. - script += "var cnt = 0;"; // Counter for check box ids. - script += "var inputFields = new Array();"; // Create array in java script. - script += "inputFields = window.document.getElementsByTagName('input');"; // Collect input elements. - script += "for(var i=0; i.jar -``` - -Para ver a lista de opções, execute o servidor com a opção ``-h``. - -```bash - $ java -jar selenium-server-standalone-.jar -h -``` - -Você verá uma lista de todas as opções que pode usar com o servidor e uma breve -descrição de cada. As descrições fornecidas nem sempre serão suficientes, então -fornecemos explicações para algumas das opções mais importantes. - - -### Configuração do Proxy - -Se o seu aplicação estiver atrás de um proxy HTTP que requer autenticação, você deve -configurar http.proxyHost, http.proxyPort, http.proxyUser e http.proxyPassword -usando o seguinte comando. - -```bash - $ java -jar selenium-server-standalone-.jar -Dhttp.proxyHost=proxy.com -Dhttp.proxyPort=8080 -Dhttp.proxyUser=username -Dhttp.proxyPassword=password -``` - -### Modo multi-janela - -Se você estiver usando Selenium 1.0, você provavelmente pode pular esta seção, uma vez que o modo multijanela é -o comportamento padrão. No entanto, antes da versão 1.0, o Selenium executava por padrão o -aplicativo em teste em um subquadro, conforme mostrado aqui. - -![Single window mode](/images/documentation/legacy/selenium_rc_single_window_mode.png) - -Alguns aplicativos não funcionavam corretamente em um subquadro e precisavam ser -carregados no quadro superior da janela. A opção de modo multi-janela permitida -a aplicação testada ser executada em uma janela separada, em vez do quadro -padrão onde poderia então ter o quadro superior necessário. - -![Multiwindow Mode](/images/documentation/legacy/selenium_rc_multi_window_mode.png) - -Para versões mais antigas do Selenium você deve especificar o modo multijanela explicitamente -com a seguinte opção: - -```bash - -multiwindow -``` - -A partir do Selenium RC 1.0, se você deseja executar seu teste dentro de um -quadro único (ou seja, usando o padrão para versões anteriores do Selenium) -você pode declarar isso ao servidor Selenium usando a opção - -```bash - -singlewindow -``` - -### Especificando o perfil do Firefox - -O Firefox não executará duas instâncias simultaneamente, a menos que você especifique um -perfil separado para cada instância. Selenium RC 1.0 e posterior é executado em um perfil separado automaticamente, então se você estiver usando Selenium 1.0, você pode -provavelmente pular esta seção. No entanto, se você estiver usando uma versão mais antiga do -Selenium ou se você precisar usar um perfil específico para seus testes -(como adicionar um certificado https ou ter alguns complementos instalados), você -precisa especificar explicitamente o perfil. - -Primeiro, para criar um perfil separado do Firefox, siga este procedimento. -Abra o menu Iniciar do Windows, selecione "Executar", digite e entre um dos -seguintes: - -```bash - firefox.exe -profilemanager -``` - -```bash - firefox.exe -P -``` - -Crie o novo perfil usando a caixa de diálogo. Então, quando você executar o Selenium Server, -diga a ele para usar este novo perfil do Firefox com a opção de linha de comando do servidor -*\-firefoxProfileTemplate* e especifique o caminho para o perfil usando seu nome de arquivo -e o caminho do diretório. - -```bash - -firefoxProfileTemplate "path to the profile" -``` - -**Aviso**: certifique-se de colocar seu perfil em uma nova pasta separada da padrão!!! - A ferramenta gerenciadora de perfil do Firefox irá deletar todos os arquivos em uma pasta se você - excluir um perfil, independentemente de serem arquivos de perfil ou não. - -Mais informações sobre os perfis do Firefox podem ser encontradas em [Mozilla's Knowledge Base](http://support.mozilla.com/en/kb/Managing+profiles) - -### Execute Selenese diretamente dentro do servidor usando -htmlSuite - -Você pode executar arquivos Selenese html diretamente no servidor Selenium -passando o arquivo html para a linha de comando do servidor. Por exemplo: - -```bash - java -jar selenium-server-standalone-.jar -htmlSuite "*firefox" - "http://www.google.com" "c:\absolute\path\to\my\HTMLSuite.html" - "c:\absolute\path\to\my\results.html" -``` - -Isso iniciará automaticamente seu pacote HTML, executará todos os testes e salvará um -bom relatório HTML com os resultados. - -*Nota:* ao usar esta opção, o servidor irá iniciar os testes e aguardar um - número especificado de segundos para o teste ser concluído; se o teste não - completar dentro desse período de tempo, o comando sairá com um código de saída diferente de zero - e nenhum arquivo de resultados será gerado. - -Esta linha de comando é muito longa, então tome cuidado com o que -você digita. Observe que isso requer que você passe uma suíte de arquivos HTML Selenese, não um único teste. Também esteja ciente de que a opção -htmlSuite é incompatível com ``-interactive``. -Você não pode executar os dois ao mesmo tempo. - -### Logging do servidor Selenium - -#### logs do lado do servidor - -Ao iniciar o servidor Selenium, a opção **-log** pode ser usada para gravar -informações valiosas de depuração relatadas pelo servidor Selenium em um arquivo de texto. - -```bash - java -jar selenium-server-standalone-.jar -log selenium.log -``` - -Este arquivo de log é mais detalhado do que os logs do console padrão (inclui mensagens de registro de nível DEBUG -). O arquivo de log também inclui o nome do registrador e o -número do thread que registrou a mensagem. Por exemplo: - -```bash - 20:44:25 DEBUG [12] org.openqa.selenium.server.SeleniumDriverResourceHandler - - Browser 465828/:top frame1 posted START NEW -``` - -O formato da mensagem é - -```bash - TIMESTAMP(HH:mm:ss) LEVEL [THREAD] LOGGER - MESSAGE -``` - -Esta mensagens pode ter múltiplas linhas. - -#### Logs do lado do navegador - -O JavaScript no lado do navegador (Selenium Core) também registra mensagens importantes; -em muitos casos, eles podem ser mais úteis para o usuário final do que os -Logs normais do servidor. Para acessar os registros do lado do navegador, passe o argumento **-browserSideLog** para o servidor Selenium. - - -```bash - java -jar selenium-server-standalone-.jar -browserSideLog -``` - -**-browserSideLog** deve ser combinado com o argumento **-log**, para registrar -browserSideLogs (bem como todas as outras mensagens de log de nível DEBUG) em um arquivo. - - -## Especificando o caminho para um navegador específico - -Você pode especificar para o Selenium RC o caminho para um navegador. Isto -é útil se você possui diferentes versões do mesmo navegador e você deseja usar -uma em específico. Isto também pode ser usado para executar seus testes em um navegador -que não é suportado diretamente pelo Selenium RC. Quando especificar o modo -de execução, use o especificador \*custom seguido do caminho completo para o -executável do navegador. - -```bash - *custom -``` - - -## Arquitetura do Selenium RC - -*Nota:* este tópico tenta explicar a implementação técnica por trás do Selenium RC. - Não é fundamental para um usuário Selenium saber disso, mas - pode ser útil para entender alguns dos problemas que você pode encontrar no - futuro. - -Para entender em detalhes como o Selenium RC Server funciona e porque ele usa injeção de proxy -e modos de privilégio elevado você deve primeiro entender _`the same origin policy`_. - -### A política de mesma origem (Same Origin Policy) - -A principal restrição que o Selenium enfrenta é a -política de mesma origem. Esta restrição de segurança é aplicada por todos os navegadores -no mercado e seu objetivo é garantir que o conteúdo de um site nunca -esteja acessível por um script de outro site. A política da mesma origem determina que -qualquer código carregado no navegador só pode operar dentro do domínio desse site. -Ele não pode executar funções em outro site. Por exemplo, se o navegador -carrega o código JavaScript quando carrega www.mysite.com, ele não pode executar esse código carregado -em www.mysite2.com - mesmo que seja outro de seus sites. Se isso fosse possível, -um script colocado em qualquer site que você abrir seria capaz de ler informações sobre -sua conta bancária se você tivesse a página da conta -aberto em outra guia. Isso é chamado de XSS (Cross-site Scripting). - -Para trabalhar dentro desta política, Selenium-Core (e seus comandos JavaScript que -fazem toda a mágica acontecer) deve ser colocado na mesma origem do aplicativo testado (mesmo URL). - -Historicamente, Selenium-Core era limitado por este problema, uma vez que foi implementado em -JavaScript. O Selenium RC não é, entretanto, restringido pela Política da Mesma Origem. -Seu uso do Selenium Server como proxy evita esse problema. Essencialmente, diz ao -navegador que o navegador está funcionando em um único site "falsificado" que o servidor -fornece. - -*Nota:* você pode encontrar informações adicionais sobre este tópico nas páginas da Wikipedia -sobre a política da mesma origem e XSS. - - -### Injeção de Proxy - -O primeiro método que o Selenium usou para evitar a Política de Mesma Origem foi a injeção de proxy. -No modo de injeção de proxy, o servidor Selenium atua como um **HTTP configurado pelo cliente -proxy** [^1], que fica entre o navegador e o aplicativo em teste [^2]. -Em seguida, ele mascara a aplicação testada sob uma URL fictícia (incorporação -Selenium-Core e o conjunto de testes e entregando-os como se estivessem chegando -da mesma origem). - -[^1]: O proxy é uma terceira pessoa no meio que passa a bola entre as duas partes. Ele atua como um "servidor da web" que entrega a aplicação ao navegador. Ser um proxy dá ao Selenium Server a capacidade de "mentir" sobre a URL real da aplicação. - -[^2]: O navegador é iniciado com um perfil de configuração que definiu localhost:4444 como o proxy HTTP, é por isso que qualquer solicitação HTTP que o navegador fizer passará pelo servidor Selenium e a resposta passará por ele e não pelo servidor real. - -Aqui está um diagrama da arquitetura. - -![Architectural Diagram 1](/images/documentation/legacy/selenium_rc_architecture_diagram_1.png) - -Quando um conjunto de testes começa em sua linguagem favorita, acontece o seguinte: - -1. O cliente/driver estabelece uma conexão com o servidor selenium-RC. -2. O servidor Selenium RC inicia um navegador (ou reutiliza um antigo) com uma URL - que injeta o JavaScript do Selenium-Core na página da web carregada pelo navegador. -3. O driver do cliente passa um comando Selenese para o servidor. -4. O servidor interpreta o comando e então aciona a execução correspondente - de JavaScript para executar esse comando no navegador. - Selenium-Core instrui o navegador a agir sobre a primeira instrução, normalmente abrindo uma página da - aplicação testada. -5. O navegador recebe a solicitação de abertura e pede o conteúdo do site do - servidor Selenium RC (definido como o proxy HTTP para o navegador usar). -6. O servidor Selenium RC se comunica com o servidor Web solicitando a página e uma vez que - recebe, envia a página para o navegador mascarando a origem para parecer - que a página vem do mesmo servidor que Selenium-Core (isso permite - Selenium-Core para cumprir a Política da Mesma Origem). -7. O navegador recebe a página da web e a renderiza no quadro/janela reservado - para isso. - -### Navegadores com privilégio elevado - -Este fluxo de trabalho neste método é muito semelhante à injeção de proxy, mas a principal -diferença é que os navegadores são iniciados em um modo especial chamado de *Privilégios Aumentados*, que permite que os sites façam coisas que normalmente não são permitidas -(como fazer _XSS_, ou preencher entradas de upload de arquivos e coisas muito úteis para o -Selenium). Ao usar esses modos de navegador, o Selenium Core é capaz de abrir diretamente -a aplicação testada e ler/interagir com seu conteúdo sem ter que passar a aplicação inteira -através do servidor Selenium RC. - -Aqui está um diagrama da arquitetura. - -![Architectural Diagram 1](/images/documentation/legacy/selenium_rc_architecture_diagram_2.png) - -Quando um conjunto de testes começa em sua linguagem favorita, acontece o seguinte: - -1. O cliente/driver estabelece uma conexão com o servidor selenium-RC. -2. O servidor Selenium RC inicia um navegador (ou reutiliza um antigo) com uma URL - que irá carregar o Selenium-Core na página da web. -3. Selenium-Core obtém a primeira instrução do cliente/driver (através de outra - solicitação HTTP feita ao servidor Selenium RC). -4. Selenium-Core atua na primeira instrução, normalmente abrindo uma página da aplicação. -5. O navegador recebe a solicitação de abertura e solicita a página ao servidor da Web. - Assim que o navegador recebe a página da web, a renderiza no quadro / janela reservado - para isso. - -## Lidando com HTTPS e Popups de segurança - -Muitos aplicativos mudam de HTTP para HTTPS quando precisam enviar -informações criptografadas, como senhas ou informações de cartão de crédito. Isto é -comum com muitos dos aplicativos da web de hoje. Selenium RC apoia isso. - -Para garantir que o site HTTPS seja genuíno, o navegador precisará de um certificado de segurança. -Caso contrário, quando o navegador acessar a aplicação testada usando HTTPS, ele irá -presumir que o aplicativo não é 'confiável'. Quando isso ocorre, o navegador -exibe pop-ups de segurança e esses pop-ups não podem ser fechados usando o Selenium RC. - -Ao lidar com HTTPS em um teste Selenium RC, você deve usar um modo de execução que suporte isso e controle -o certificado de segurança para você. Você especifica o modo de execução quando seu programa de teste -inicializa o Selenium. - -No Selenium RC 1.0 beta 2 e posterior, use \*firefox ou \*iexplore para o modo de execução. -Em versões anteriores, incluindo Selenium RC 1.0 beta 1, use \*chrome ou -\*iehta, para o modo de execução. Usando esses modos de execução, você não precisará instalar -quaisquer certificados de segurança especiais; Selenium RC cuidará disso para você. - -Na versão 1.0, os modos de execução \*firefox ou \*iexplore são -recomendados. No entanto, existem modos de execução adicionais de \*iexploreproxy e -\*firefoxproxy. Eles são fornecidos apenas para compatibilidade com versões anteriores, e -não devem ser usados, a menos que exigido por programas de teste legados. Seu uso vai -apresentar limitações com o manuseio do certificado de segurança e com o funcionamento -de várias janelas se seu aplicativo abrir janelas adicionais do navegador. - -Em versões anteriores do Selenium RC, \*chrome ou \*iehta eram os modos de execução que suportavam -HTTPS suportado e o tratamento de popups de segurança. Estes foram considerados 'modos experimentais', embora tenham se tornado bastante estáveis e muitas pessoas os usaram. Se você estiver usando -Selenium 1.0 você não precisa, e não deve usar, esses modos de execução mais antigos. - -### Certificados de Segurança explicados - -Normalmente, seu navegador confiará no aplicativo que você está testando -instalando um certificado de segurança que você já possui. Você pode -verificar isso nas opções do seu navegador ou propriedades da Internet (se você não -conheça o certificado de segurança da sua aplicação, pergunte ao administrador do sistema). -Quando o Selenium carrega seu navegador, ele injeta um código para interceptar -mensagens entre o navegador e o servidor. O navegador agora pensa que algum -software não confiável está tentando se parecer com o seu aplicativo. Ele responde alertando você com mensagens pop-up. - -Para contornar isso, Selenium RC, (novamente ao usar um modo de execução que suporta -isso) instalará seu próprio certificado de segurança, temporariamente, em sua -máquina cliente em um local onde o navegador possa acessá-lo. Isso engana -o navegador a pensar que está acessando um site diferente da sua aplicação e suprime efetivamente os pop-ups. - -Outro método usado com versões anteriores do Selenium era -instalar o certificado de segurança Cybervillians fornecido com sua instalação do Selenium. -A maioria dos usuários não deve mais precisar fazer isso; se você está -executando o Selenium RC no modo de injeção de proxy, você pode precisar instalar -explicitamente este certificado de segurança. - - -## Suportando navegadores e configurações adicionais - -A API Selenium suporta a execução em vários navegadores, além de -Internet Explorer e Mozilla Firefox. Veja o site https://selenium.dev para -navegadores compatíveis. Além disso, quando um navegador não é diretamente compatível, -você ainda pode executar seus testes Selenium em um navegador de sua escolha -usando o modo de execução "\*custom" (ou seja, no lugar de \*firefox ou \*iexplore) quando -seu aplicativo de teste inicia o navegador. Com isso, você passa no caminho para -os navegadores executáveis na chamada de API. Isso também pode ser feito a partir do -servidor em modo interativo. - -```bash - cmd=getNewBrowserSession&1=*custom c:\Program Files\Mozilla Firefox\MyBrowser.exe&2=http://www.google.com -``` - - -### Executando testes com diferentes configurações de navegador - -Normalmente o Selenium RC configura automaticamente o navegador, mas se você iniciar -o navegador usando o modo de execução "\*custom", você pode forçar o Selenium RC -a iniciar o navegador como está, sem usar uma configuração automática. - -Por exemplo, você pode iniciar o Firefox com uma configuração personalizada como esta: - -```bash - cmd=getNewBrowserSession&1=*custom c:\Program Files\Mozilla Firefox\firefox.exe&2=http://www.google.com -``` - -Observe que ao iniciar o navegador desta forma, você deve manualmente -configurar o navegador para usar o servidor Selenium como proxy. Normalmente, isso apenas -significa abrir as preferências do navegador e especificar "localhost: 4444" como -um proxy HTTP, mas as instruções para isso podem diferir radicalmente de navegador para -navegador. Consulte a documentação do seu navegador para obter detalhes. - -Esteja ciente de que os navegadores Mozilla podem variar em como eles iniciam e param. -Pode ser necessário definir a variável de ambiente MOZ_NO_REMOTE para fazer com que os navegadores Mozilla -se comportem de maneira mais previsível. Os usuários Unix devem evitar iniciar o navegador usando -um script de shell; geralmente é melhor usar o executável binário (por exemplo, firefox-bin) diretamente. - - -## Resolução de problemas comuns - -Ao começar a usar o Selenium RC, há alguns problemas potenciais -que são comumente encontrados. Nós os apresentamos junto com suas soluções aqui. - -### Incapaz de conectar ao servidor - -Quando seu programa de teste não pode se conectar ao servidor Selenium, o Selenium lança uma exceção em seu programa de teste. -Ele deve exibir esta mensagem ou outra semelhante: - -```bash - "Unable to connect to remote server (Inner Exception Message: - No connection could be made because the target machine actively - refused it )" - - (using .NET and XP Service Pack 2) -``` - -Se você vir uma mensagem como esta, certifique-se de iniciar o servidor Selenium. E se -então, há um problema com a conectividade entre a biblioteca cliente Selenium e o servidor Selenium. - -Ao começar com Selenium RC, a maioria das pessoas começa executando seu programa de teste -(com uma biblioteca de cliente Selenium) e o servidor Selenium na mesma máquina. Para -fazer isso use "localhost" como parâmetro de conexão. -Recomendamos começar dessa forma, pois reduz a influência de possíveis problemas de rede -que você está começando. Supondo que seu sistema operacional tenha uma rede típica -e configurações TCP/IP, você deve ter pouca dificuldade. Na verdade, muitas pessoas -optam por executar os testes desta forma. - -Se, no entanto, você deseja executar o Selenium Server -em uma máquina remota, a conectividade deve ser boa, -supondo que você tenha uma conexão TCP/IP válida entre as duas máquinas. - -Se tiver dificuldade para se conectar, você pode usar ferramentas de rede comuns como *ping*, -*telnet*, *ifconfig (Unix) / ipconfig* (Windows), etc para garantir que você tenha uma -conexão de rede. Se não estiver familiarizado com eles, o administrador do sistema pode ajudá-lo. - -### Incapaz de carregar o navegador - -Ok, não é uma mensagem de erro amigável, desculpe, mas se o servidor Selenium não pode carregar o navegador -você provavelmente verá este erro. - -```bash - (500) Internal Server Error -``` - -Isso pode ser causado por - -* O Firefox (anterior ao Selenium 1.0) não pode iniciar porque o navegador já está aberto e você o fez - não especificar um perfil separado. Consulte a seção sobre perfis do Firefox em Opções do servidor. -* O modo de execução que você está usando não corresponde a nenhum navegador em sua máquina. Verifique os parâmetros que você - passou para o Selenium quando seu programa abre o navegador. -* Você especificou o caminho para o navegador explicitamente (usando "\*custom" - veja acima), mas o caminho é - incorreto. Verifique se o caminho está correto. Verifique também o grupo de usuários para ter certeza de que há - nenhum problema conhecido com seu navegador e os parâmetros "\*custom". - -### Selenium não consegue achar a aplicação testada - -Se o seu programa de teste iniciar o navegador com sucesso, mas o navegador não -exibir o site que você está testando, a causa mais provável é que o seu programa de teste não está usando a URL correta. - -Isso pode acontecer facilmente. Quando você usa Selenium-IDE para exportar seu script, -ela insere uma URL fictícia. Você deve alterar manualmente a URL para a correta -para que seu aplicativo seja testado. - -### O Firefox recusou o desligamento ao preparar um perfil - -Isso ocorre com mais frequência quando você executa o programa de teste Selenium RC no Firefox, -mas você já tem uma sessão do navegador Firefox em execução e não especificou -um perfil separado quando você iniciou o servidor Selenium. O erro do -programa de teste tem a seguinte aparência: - -```bash - Error: java.lang.RuntimeException: Firefox refused shutdown while - preparing a profile -``` - -Esta é a mensagem de erro completa do servidor: - -```bash - 16:20:03.919 INFO - Preparing Firefox profile... - 16:20:27.822 WARN - GET /selenium-server/driver/?cmd=getNewBrowserSession&1=*fir - efox&2=http%3a%2f%2fsage-webapp1.qa.idc.com HTTP/1.1 - java.lang.RuntimeException: Firefox refused shutdown while preparing a profile - at org.openqa.selenium.server.browserlaunchers.FirefoxCustomProfileLaunc - her.waitForFullProfileToBeCreated(FirefoxCustomProfileLauncher.java:277) - ... - Caused by: org.openqa.selenium.server.browserlaunchers.FirefoxCustomProfileLaunc - her$FileLockRemainedException: Lock file still present! C:\DOCUME~1\jsvec\LOCALS - ~1\Temp\customProfileDir203138\parent.lock -``` - -Para resolver isso, consulte a seção Especificando um perfil separado do Firefox - -### Problemas de versionamento - -Certifique-se de que sua versão do Selenium é compatível com a versão do seu navegador. Por -exemplo, Selenium RC 0.92 não suporta Firefox 3. Às vezes você pode ter sorte -(eu tive). Mas não se esqueça de verificar quais -versões do navegador são compatíveis com a versão do Selenium que você está usando. Quando em -dúvida, use a versão mais recente do Selenium com a versão mais usada -do seu navegador. - -### Mensagem de erro: "(Unsupported major.minor version 49.0)" ao inicializar o servidor - -Este erro diz que você não está usando uma versão correta do Java. -O Selenium Server requer Java 1.5 ou superior. - -Para verificar novamente sua versão java, execute na linha de comando: - -```bash - java -version -``` - -Você deve ver uma mensagem mostrando a versão do Java. - -```bash - java version "1.5.0_07" - Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03) - Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode) -``` - -Se você vir um número de versão inferior, pode ser necessário atualizar o JRE, -ou você pode simplesmente precisar adicioná-lo à sua variável de ambiente PATH. - - -### Erro 404 ao executar o comando getNewBrowserSession - -Se você receber um erro 404 ao tentar abrir uma página em -"http://www.google.com/selenium-server/", então deve ser porque o servidor Selenium não foi configurado corretamente como proxy. O diretório "selenium-server" -não existe no google.com; só parece existir quando o proxy é -configurado corretamente. A configuração do proxy depende muito de como o navegador é -lançado com firefox, iexplore, opera ou custom. - -* iexplore: se o navegador for iniciado usando \*iexplore, você pode estar - tendo um problema com as configurações de proxy do Internet Explorer. - O servidor Selenium tenta definir as configurações globais de proxy no painel de controle Opções da Internet. - Você deve se certificar de que elas estão corretamente - configuradas quando o servidor Selenium inicia o navegador. Tente olhar para - seu painel de controle Opções da Internet. Clique na guia "Conexões" - e clique em "Configurações da LAN". - * Se você precisar usar um proxy para acessar o aplicativo que deseja testar, - você precisará iniciar o Selenium Server com "-Dhttp.proxyHost"; - veja _`Configuração de Proxy`_ para mais detalhes. - * Você também pode tentar configurar seu proxy manualmente e, em seguida, iniciar - o navegador com \*custom ou com o iniciador de navegador \*iehta. - -* custom: ao usar \*custom, você deve configurar o proxy corretamente (manualmente), - caso contrário, você obterá um erro 404. Verifique novamente se você configurou seu proxy corretamente. - Verificar se você configurou o proxy corretamente é configurar intencionalmente o navegador de forma incorreta. Tente configurar o - navegador para usar o nome de host do servidor proxy errado ou a porta errada. Se você tinha - configurado com sucesso as configurações de proxy do navegador incorretamente, então o - navegador não conseguirá se conectar à Internet, o que é uma maneira de - certificar-se de que está ajustando as configurações relevantes. - -* Para outros navegadores (\*firefox, \*opera), codificamos automaticamente - o proxy para você e, portanto, não há problemas conhecidos com essa funcionalidade. - Se você estiver encontrando erros 404 e tiver seguido este guia do usuário cuidadosamente - publique seus resultados no grupo de usuários para obter ajuda da comunidade de usuários. - -### Erro de permissão negada - -O motivo mais comum para esse erro é que sua sessão está tentando violar -a política de mesma origem cruzando os limites do domínio (por exemplo, acessa uma página de -http://domínio1 e, em seguida, acessa uma página de http://domínio2) ou troca de protocolos -(passando de http://domainX para https://domainX). - -Este erro também pode ocorrer quando o JavaScript tenta encontrar objetos de IU -que ainda não estão disponíveis (antes que a página seja completamente carregada), ou -não estão mais disponíveis (após a página -começar a ser descarregada). Isso é mais comumente encontrado com páginas AJAX -que estão trabalhando com seções de uma página ou subframes que carregam e / ou recarregam -independentemente da página maior. - -Este erro pode ser intermitente. Muitas vezes é impossível reproduzir o problema -com um depurador porque o problema decorre de condições de corrida que -não são reproduzíveis quando a sobrecarga do depurador é adicionada ao sistema. -As questões de permissão são abordadas com alguns detalhes no tutorial. Leia a seção -sobre a _`Política da Mesma Origem`_, _`Injeção de Proxy`_ com cuidado. - - -### Gerenciando janelas pop-up do navegador - -Existem vários tipos de "Popups" que você pode obter durante um teste Selenium. -Você pode não conseguir fechar esses pop-ups executando comandos do Selenium se -eles são iniciados pelo navegador e não pela aplicação testada. Você pode -precisar saber como gerenciá-los. Cada tipo de pop-up precisa ser tratado de maneira diferente. - -* Diálogos de autenticação básica de HTTP: esses diálogos solicitam um - nome de usuário / senha para fazer o login no site. Para fazer login em um site que requer - autenticação básica HTTP, use um nome de usuário e senha no URL, como - descrito em _`RFC 1738`_, assim: open("http://myusername:myuserpassword@myexample.com/blah/blah/blah"). - -* Avisos de certificado SSL: Selenium RC tenta automaticamente falsificar certificados SSL - quando está habilitado como proxy; veja mais sobre isso - na seção HTTPS. Se o seu navegador estiver configurado corretamente, - você nunca deve ver avisos de certificado SSL, mas pode ser necessário - configurar seu navegador para confiar em nossa perigosa CA SSL "CyberVillains". - Novamente, consulte a seção HTTPS para saber como fazer isso. - -* caixas de diálogo de alerta / confirmação / prompt de JavaScript modais: Selenium tenta ocultar - essas caixas de diálogo de você (substituindo window.alert, window.confirm e - window.prompt) para que não parem a execução da sua página. Se você está - vendo um pop-up de alerta, provavelmente é porque ele disparou durante o processo de carregamento da página, - o que geralmente é muito cedo para protegermos a página. Selenese contém comandos - para afirmar ou verificar pop-ups de alerta e confirmação. Veja as seções sobre estes - tópicos no Capítulo 4. - - -### No Linux, por que minha sessão do navegador Firefox não está fechando? - -No Unix / Linux, você deve invocar "firefox-bin" diretamente, então certifique-se de que este -executável está no *path*. Se estiver executando o Firefox por meio de um -script de shell, quando chegar a hora de encerrar o navegador, o Selenium RC irá encerrar -o script de shell, deixando o navegador em execução. Você pode especificar o caminho -para o firefox-bin diretamente, assim: - -```bash - cmd=getNewBrowserSession&1=*firefox /usr/local/firefox/firefox-bin&2=http://www.google.com -``` - -### Firefox \*chrome não funciona com perfil personalizado - -Verifique a pasta de perfil do Firefox -> prefs.js -> user_pref ("browser.startup.page", 0); -Comente esta linha assim: "//user_pref("browser.startup.page", 0); " e tente novamente. - - -### Posso carregar um pop-up personalizado enquanto a página pai está carregando (ou seja, antes que a função javascript window.onload() da página principal seja executada)? - -Não. O Selenium depende de interceptadores para determinar os nomes das janelas à medida que são carregadas. -Esses interceptores funcionam melhor na captura de novas janelas se as janelas forem carregadas DEPOIS -a função onload(). O Selenium pode não reconhecer as janelas carregadas antes da função onload. - -### Firefox no Linux - -No Unix / Linux, versões do Selenium anteriores a 1.0 precisavam invocar "firefox-bin" -diretamente, então, se você estiver usando uma versão anterior, certifique-se de que o real -executável está no caminho. - -Na maioria das distribuições Linux, o verdadeiro *firefox-bin* está localizado em: - -```bash - /usr/lib/firefox-x.x.x/ -``` - -Onde x.x.x é o número da versão que você possui atualmente. Então, para adicionar esse caminho -no *path* do usuário. você terá que adicionar o seguinte ao seu arquivo .bashrc: - -```bash - export PATH="$PATH:/usr/lib/firefox-x.x.x/" -``` - -Se necessário, você pode especificar o caminho para o firefox-bin diretamente em seu teste, -assim: - -```bash - "*firefox /usr/lib/firefox-x.x.x/firefox-bin" -``` - -### IE e atributos de estilo - -Se você estiver executando seus testes no Internet Explorer e não conseguir localizar -elementos usando seu atributo `style`. -Por exemplo: - -```bash - //td[@style="background-color:yellow"] -``` - -Isso funcionaria perfeitamente no Firefox, Opera ou Safari, mas não com o IE. -O IE interpreta as chaves em `@style` como maiúsculas. Então, mesmo que o -o código-fonte está em letras minúsculas, você deve usar: - -```bash - //td[@style="BACKGROUND-COLOR:yellow"] -``` - -Isso é um problema se o seu teste se destina a funcionar em vários navegadores, mas -você pode facilmente codificar seu teste para detectar a situação e tentar o localizador alternativo -que só funciona no IE. - -### Erro encontrado - "Cannot convert object to primitive value" no delsigamento do navegador \*googlechrome - -Para evitar esse erro, você deve iniciar o navegador com uma opção que desativa as verificações da política de mesma origem: - -```bash - selenium.start("commandLineFlags=--disable-web-security"); -``` - - -### Erro encontrado no IE - "Couldn't open app window; is the pop-up blocker enabled?" - -Para evitar esse erro, você deve configurar o navegador: desative o bloqueador de pop-ups -e desmarque a opção 'Ativar modo protegido' em Ferramentas >> Opções >> Segurança. diff --git a/website_and_docs/content/documentation/legacy/selenium_1.zh-cn.md b/website_and_docs/content/documentation/legacy/selenium_1.zh-cn.md deleted file mode 100644 index 07aa1ef8899a..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_1.zh-cn.md +++ /dev/null @@ -1,1825 +0,0 @@ ---- -title: "Selenium RC (Selenium 1)" -linkTitle: "Selenium 1" -weight: 2 -description: > - 原始版本的Selenium -aliases: [ -"/documentation/legacy/selenium_rc/" -] ---- - - -## 介绍 -在WebDriver / Selenium合并产生功能更强大的Selenium 2之前, -Selenium RC一直是Selenium的主要项目. -再次特意强调的是, Selenium 1不再享有技术支持. - -## Selenium RC 的工作原理 -首先, 我们将描述Selenium RC的组件如何运行 -以及每个组件在运行测试脚本中所扮演的角色. - -### RC 组件 - -Selenium RC 组件包括: - -* Selenium 服务器, 用于启动并关闭浏览器, -解释运行从测试程序传递来的Selenese命令, -并充当 *HTTP代理* , -拦截和验证在浏览器和AUT之间传递的HTTP消息. -* 客户端库, 提供每种编程语言和 -Selenium RC 服务器之间的接口. - -以下是一个简化的架构图: - -![Architecture Diagram Simple](/images/documentation/legacy/selenium_rc_architecture_diagram_simple.png) - -该图显示了客户端库与服务器通信, -并传递了用来执行的每个Selenium命令. -然后, 服务器使用Selenium-Core的JavaScript命令 -将Selenium命令传递到浏览器. -浏览器使用其JavaScript解释器执行Selenium命令. -这将运行您在测试脚本中指定的Selenese操作或验证行为. - -### Selenium 服务器 - -Selenium 服务器从您的测试程序接收Selenium命令, -对其进行解释, -然后将运行这些测试的结果报告给您的程序. - -RC服务器捆绑了Selenium Core并将其自动注入浏览器. -当您的测试程序打开浏览器(使用客户端库API函数)时, -会发生这种情况. -Selenium-Core是一个JavaScript程序, -实际上是一组JavaScript函数, -这些函数使用浏览器的内置JavaScript解释器来解释 -和执行Selenese命令. - -服务器使用简单的HTTP GET / POST请求从您的测试程序接收Selenese命令. -这意味着您可以使用任何可以发送HTTP请求的编程语言 -来自动执行浏览器中的Selenium测试. - -### 客户端库 - -客户端库提供了编程支持, -使您可以从自己设计的程序中运行Selenium命令. -每种受支持的语言都有一个不同的客户端库. -Selenium客户端库提供了一个编程接口(API), -即一组函数, 可从您自己的程序中运行Selenium命令. -在每个界面中, 都有一个支持每个Selenese命令的编程功能. - -客户端库接受Selenese命令, -并将其传递给Selenium 服务器, -以针对被测应用程序(AUT)处理特定操作或测试. -客户端库还接收该命令的结果, 并将其传递回您的程序. -您的程序可以接收结果并将其存储到程序变量中, -并将其报告为成功或失败, -或者如果是意外错误, -则可以采取纠正措施. - -因此, 要创建测试程序, -只需编写一个使用客户端库API运行一组Selenium命令的程序. -并且, 可选地, 如果您已经在Selenium-IDE中创建了Selenese测试脚本, -则可以 *生成Selenium RC代码* . -Selenium-IDE可以(使用其"导出"菜单项) -将其Selenium命令转换为客户端驱动程序的API函数调用. -有关从Selenium-IDE导出RC代码的详细信息, -请参见Selenium-IDE章节. - -## 安装 - -安装对于Selenium来说是谬称. -Selenium具有一组可用您选择的编程语言提供的库. 您可以从 [下载页面](https://selenium.dev/downloads/)下载它们. - -选择了要使用的语言后, 您只需要: - -* 安装Selenium RC服务器. -* 使用特定语言的客户端驱动程序设置编程项目. - -### 安装Selenium服务器 - -Selenium RC服务器只是一个Java *jar* 文件 -( *selenium-server-standalone-.jar* ), -不需要任何特殊的安装. -只需下载zip文件并将服务器提取到所需目录中就足够了. - -### 运行Selenium服务器 - -在开始任何测试之前, 您必须启动服务器. -转到Selenium RC服务器所在的目录, -然后从命令行控制台运行以下命令. - -```shell - java -jar selenium-server-standalone-.jar -``` - -通过创建包含上述命令的批处理或Shell可执行文件 -(Windows上为.bat, Linux上为.sh), -可以简化此操作. -然后在桌面上对该可执行文件创建快捷方式, -只需双击该图标即可启动服务器. - -为了使服务器运行, -您需要安装Java并正确配置PATH环境变量才能从控制台运行它. -您可以通过在控制台上运行以下命令来检查是否正确安装了Java. - -```shell - java -version -``` - -如果您查看到预期的版本号(必须为1.5或更高版本), -就可以开始使用Selenium RC了. - -### 使用Java客户端驱动程序 - -* 从SeleniumHQ [下载页面](https://selenium.dev/downloads/) 下载Selenium Java客户端驱动程序zip -* 解压 selenium-java-.jar 文件 -* 打开所需的Java IDE(Eclipse, NetBeans, IntelliJ, Netweaver等) -* 创建一个Java项目. -* 将selenium-java-.jar文件添加到您的项目中作为依赖. -* 将文件selenium-java-.jar添加到您的项目类路径中. -* 从Selenium-IDE中, 将脚本导出到Java文件并将其包含在Java项目中, -或者使用selenium-java-client API用Java编写Selenium测试. -该API将在本章稍后介绍. -您可以使用JUnit或TestNg来运行测试, -也可以编写自己的简单main()程序. -这些概念将在本节稍后说明. -* 从控制台运行Selenium服务器. -* 从Java IDE或命令行执行测试. - -有关Java测试项目配置的详细信息, -请参阅附录部分. -使用Eclipse配置Selenium RC和使用Intellij配置Selenium RC. - -### 使用Python客户端驱动程序 - -* 通过PIP安装Selenium, 说明链接在SeleniumHQ [下载页面](https://selenium.dev/downloads/) -* 用Python编写Selenium测试 -或将脚本从Selenium-IDE导出到python文件. -* 从控制台运行Selenium服务器 -* 从控制台或Python IDE执行测试 - -有关Python客户端驱动程序配置的详细信息, -请参见附录Python客户端驱动程序配置. - -### 使用.NET客户端驱动程序 - -* 从SeleniumHQ [下载页面](https://selenium.dev/downloads/) 下载Selenium RC -* 解压缩文件夹 -* 下载并安装[NUnit](https://nunit.org/download/) -(注意:您可以将NUnit用作测试引擎. -如果您还不熟悉NUnit, -还可以编写一个简单的main()函数来运行测试; -但是NUnit作为测试引擎非常有用) -* 打开所需的.Net IDE(Visual Studio, SharpDevelop, MonoDevelop) -* 创建一个类库(.dll) -* 添加对以下DLL的引用: -nmock.dll, -nunit.core.dll, -nunit.framework.dll, -ThoughtWorks.Selenium.Core.dll, -ThoughtWorks.Selenium.IntegrationTests.dll -和ThoughtWorks.Selenium.UnitTests.dll -* 用.Net语言(C#, VB.Net)编写Selenium测试, -或将脚本从Selenium-IDE导出到C#文件, -然后将此代码复制到刚创建的类文件中. -* 编写自己的简单main()程序, -或者可以在项目中包含NUnit来运行测试. -这些概念将在本章稍后说明. -* 从控制台运行Selenium服务器 -* 从IDE, NUnit GUI或命令行运行测试 - -有关使用Visual Studio配置.NET客户端驱动程序的详细信息, -请参阅附录.NET客户端驱动程序配置. - -### 使用Ruby客户端驱动程序 - -* 如果您还没有RubyGems, 请从RubyForge安装它. -* 运行 ``gem install selenium-client`` -* 在测试脚本的顶部, 添加 ``require "selenium/client"`` -* 使用任何Ruby测试工具 -(例如Test::Unit, Mini::Test或RSpec)编写测试脚本. -* 从控制台运行Selenium RC服务器. -* 以与运行其他任何Ruby脚本相同的方式执行测试. - - -有关Ruby客户端驱动程序配置的详细信息, 请参见 `Selenium-Client documentation`_ - -## 从 Selenese 到程序 - -使用Selenium RC的主要任务 -是将您的Selenese转换为编程语言. -在本节中, 我们提供了几种不同的特定于语言的示例. - -### 示例测试脚本 - -让我们从一个Selenese测试脚本示例开始. 试想用Selenium-IDE录制以下测试. - -| | | | -| -------- | ---------------------------- | ----------- | -| open | / | | -| type | q | selenium rc | -| clickAndWait | btnG | | -| assertTextPresent | Results * for selenium rc | | - - -注意:此示例适用于Google搜索页面 http://www.google.com - -### Selenese作为编程代码 - -这是(通过Selenium-IDE)导出到每种支持的编程语言的测试脚本. -如果您具有基本的面向对象编程语言的基础知识, -则可以通过阅读以下示例之一 -来了解Selenium如何运行Selenese命令. -要查看特定语言的示例, -请选择以下按钮之一. - -#### CSharp -``` csharp - - using System; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using NUnit.Framework; - using Selenium; - - namespace SeleniumTests - { - [TestFixture] - public class NewTest - { - private ISelenium selenium; - private StringBuilder verificationErrors; - - [SetUp] - public void SetupTest() - { - selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.google.com/"); - selenium.Start(); - verificationErrors = new StringBuilder(); - } - - [TearDown] - public void TeardownTest() - { - try - { - selenium.Stop(); - } - catch (Exception) - { - // Ignore errors if unable to close the browser - } - Assert.AreEqual("", verificationErrors.ToString()); - } - - [Test] - public void TheNewTest() - { - selenium.Open("/"); - selenium.Type("q", "selenium rc"); - selenium.Click("btnG"); - selenium.WaitForPageToLoad("30000"); - Assert.AreEqual("selenium rc - Google Search", selenium.GetTitle()); - } - } - } - -``` - -#### Java - -```java - - /** Add JUnit framework to your classpath if not already there - * for this example to work - */ - package com.example.tests; - - import com.thoughtworks.selenium.*; - import java.util.regex.Pattern; - - public class NewTest extends SeleneseTestCase { - public void setUp() throws Exception { - setUp("http://www.google.com/", "*firefox"); - } - public void testNew() throws Exception { - selenium.open("/"); - selenium.type("q", "selenium rc"); - selenium.click("btnG"); - selenium.waitForPageToLoad("30000"); - assertTrue(selenium.isTextPresent("Results * for selenium rc")); - } - } - -``` - -#### Php - -```php - setBrowser("*firefox"); - $this->setBrowserUrl("http://www.google.com/"); - } - - function testMyTestCase() - { - $this->open("/"); - $this->type("q", "selenium rc"); - $this->click("btnG"); - $this->waitForPageToLoad("30000"); - $this->assertTrue($this->isTextPresent("Results * for selenium rc")); - } - } - ?> - -``` - -#### Python - -```python - - from selenium import selenium - import unittest, time, re - - class NewTest(unittest.TestCase): - def setUp(self): - self.verificationErrors = [] - self.selenium = selenium("localhost", 4444, "*firefox", - "http://www.google.com/") - self.selenium.start() - - def test_new(self): - sel = self.selenium - sel.open("/") - sel.type("q", "selenium rc") - sel.click("btnG") - sel.wait_for_page_to_load("30000") - self.failUnless(sel.is_text_present("Results * for selenium rc")) - - def tearDown(self): - self.selenium.stop() - self.assertEqual([], self.verificationErrors) - -``` - -#### Ruby - -```ruby - - require "selenium/client" - require "test/unit" - - class NewTest < Test::Unit::TestCase - def setup - @verification_errors = [] - if $selenium - @selenium = $selenium - else - @selenium = Selenium::Client::Driver.new("localhost", 4444, "*firefox", "http://www.google.com/", 60); - @selenium.start - end - @selenium.set_context("test_new") - end - - def teardown - @selenium.stop unless $selenium - assert_equal [], @verification_errors - end - - def test_new - @selenium.open "/" - @selenium.type "q", "selenium rc" - @selenium.click "btnG" - @selenium.wait_for_page_to_load "30000" - assert @selenium.is_text_present("Results * for selenium rc") - end - end - -``` - -在下一节中, -我们将说明如何使用生成的代码来构建测试程序. - -## 编写测试程序 - -现在, 我们将使用每种受支持的编程语言的示例 -来说明如何对自己的测试进行编程. -本质上有两个任务: - -* 从Selenium-IDE将脚本生成为代码, -可以选择修改结果. -* 编写一个非常简单的执行生成代码的主程序. - -(可选)您可以采用测试引擎平台, -例如JUnit或Java的TestNG, -或使用NUnit的.NET -(如果使用的是其中一种语言). - -在这里, 我们显示特定于语言的示例. -特定语言的API彼此之间往往有所不同, -因此您会为每个API找到单独的解释 - -* Java -* C# -* Python -* Ruby -* Perl, PHP - - -### Java - -对于Java, 人们使用JUnit或TestNG作为测试引擎. -某些开发环境(如Eclipse)通过插件直接支持这些环境. -这使它变得更加容易. -讲授JUnit或TestNG不在本文档的范围之内, -但是可以在网上找到资料, -并且可以找到出版物. -如果您恰巧熟悉Java全家桶, -那么您的开发人员将已经具有使用某种测试框架的经验. - -您可能需要将测试类从" NewTest"重命名为您自己选择的名称. -另外, 您将需要在语句中更改浏览器打开参数: - -```java - selenium = new DefaultSelenium("localhost", 4444, "*iehta", "http://www.google.com/"); -``` - -Selenium-IDE生成的代码将如下所示. -此示例具有手动添加的注释, -以提高清晰度. - -```java - package com.example.tests; - // We specify the package of our tests - - import com.thoughtworks.selenium.*; - // This is the driver's import. You'll use this for instantiating a - // browser and making it do what you need. - - import java.util.regex.Pattern; - // Selenium-IDE add the Pattern module because it's sometimes used for - // regex validations. You can remove the module if it's not used in your - // script. - - public class NewTest extends SeleneseTestCase { - // We create our Selenium test case - - public void setUp() throws Exception { - setUp("http://www.google.com/", "*firefox"); - // We instantiate and start the browser - } - - public void testNew() throws Exception { - selenium.open("/"); - selenium.type("q", "selenium rc"); - selenium.click("btnG"); - selenium.waitForPageToLoad("30000"); - assertTrue(selenium.isTextPresent("Results * for selenium rc")); - // These are the real test steps - } - } -``` - - -### `C#` - -.NET客户端驱动程序可与Microsoft.NET一起使用. -它可以与任何.NET测试框架( -如NUnit或Visual Studio 2005 Team System)一起使用. - -Selenium-IDE假定您将使用NUnit作为测试框架. -您可以在下面的生成的代码中看到这一点. -它包含NUnit的using语句以及相应的NUnit属性, -这些属性标识测试类的每个成员函数的角色. - -您可能必须将测试类从" NewTest"重命名为您自己选择的名称. -另外, 您将需要在语句中更改浏览器打开参数: - -```csharp - selenium = new DefaultSelenium("localhost", 4444, "*iehta", "http://www.google.com/"); -``` - -生成的代码将类似于此. - -```csharp - - using System; - using System.Text; - using System.Text.RegularExpressions; - using System.Threading; - using NUnit.Framework; - using Selenium; - - namespace SeleniumTests - - { - [TestFixture] - - public class NewTest - - { - private ISelenium selenium; - - private StringBuilder verificationErrors; - - [SetUp] - - public void SetupTest() - - { - selenium = new DefaultSelenium("localhost", 4444, "*iehta", - "http://www.google.com/"); - - selenium.Start(); - - verificationErrors = new StringBuilder(); - } - - [TearDown] - - public void TeardownTest() - { - try - { - selenium.Stop(); - } - - catch (Exception) - { - // Ignore errors if unable to close the browser - } - - Assert.AreEqual("", verificationErrors.ToString()); - } - [Test] - - public void TheNewTest() - { - // Open Google search engine. - selenium.Open("http://www.google.com/"); - - // Assert Title of page. - Assert.AreEqual("Google", selenium.GetTitle()); - - // Provide search term as "Selenium OpenQA" - selenium.Type("q", "Selenium OpenQA"); - - // Read the keyed search term and assert it. - Assert.AreEqual("Selenium OpenQA", selenium.GetValue("q")); - - // Click on Search button. - selenium.Click("btnG"); - - // Wait for page to load. - selenium.WaitForPageToLoad("5000"); - - // Assert that "www.openqa.org" is available in search results. - Assert.IsTrue(selenium.IsTextPresent("www.openqa.org")); - - // Assert that page title is - "Selenium OpenQA - Google Search" - Assert.AreEqual("Selenium OpenQA - Google Search", - selenium.GetTitle()); - } - } - } -``` - -您可以允许NUnit管理测试的执行. -或者, 您可以编写一个简单的 `main()` 程序, -该程序实例化测试对象并依次运行三个方法 `SetupTest()`, -`TheNewTest()`和 `TeardownTest()` . - - -### Python - -Pyunit是用于Python的测试框架. - -基本测试结构是: - -```python - - from selenium import selenium - # This is the driver's import. You'll use this class for instantiating a - # browser and making it do what you need. - - import unittest, time, re - # This are the basic imports added by Selenium-IDE by default. - # You can remove the modules if they are not used in your script. - - class NewTest(unittest.TestCase): - # We create our unittest test case - - def setUp(self): - self.verificationErrors = [] - # This is an empty array where we will store any verification errors - # we find in our tests - - self.selenium = selenium("localhost", 4444, "*firefox", - "http://www.google.com/") - self.selenium.start() - # We instantiate and start the browser - - def test_new(self): - # This is the test code. Here you should put the actions you need - # the browser to do during your test. - - sel = self.selenium - # We assign the browser to the variable "sel" (just to save us from - # typing "self.selenium" each time we want to call the browser). - - sel.open("/") - sel.type("q", "selenium rc") - sel.click("btnG") - sel.wait_for_page_to_load("30000") - self.failUnless(sel.is_text_present("Results * for selenium rc")) - # These are the real test steps - - def tearDown(self): - self.selenium.stop() - # we close the browser (I'd recommend you to comment this line while - # you are creating and debugging your tests) - - self.assertEqual([], self.verificationErrors) - # And make the test fail if we found that any verification errors - # were found -``` - -### Ruby - - -Selenium-IDE的旧版本(2.0之前的版本)生成 -需要旧Selenium gem的Ruby代码. -因此, 建议如下更新IDE生成的所有Ruby脚本: - -1. 在第一行, 修改 ``require "selenium"`` 为 ``require -"selenium/client"`` - -2. 在第十一行, 修改 ``Selenium::SeleniumDriver.new`` 为 -``Selenium::Client::Driver.new`` - -您可能还希望将类名更改为比"无标题"更具信息性的名称, -并将测试方法的名称更改为 -"test_untitled"以外的名称. - -这是一个通过修改Selenium IDE -生成的Ruby代码创建的简单示例, -如上所述. - -```ruby - - # load the Selenium-Client gem - require "selenium/client" - - # Load Test::Unit, Ruby's default test framework. - # If you prefer RSpec, see the examples in the Selenium-Client - # documentation. - require "test/unit" - - class Untitled < Test::Unit::TestCase - - # The setup method is called before each test. - def setup - - # This array is used to capture errors and display them at the - # end of the test run. - @verification_errors = [] - - # Create a new instance of the Selenium-Client driver. - @selenium = Selenium::Client::Driver.new \ - :host => "localhost", - :port => 4444, - :browser => "*chrome", - :url => "http://www.google.com/", - :timeout_in_second => 60 - - # Start the browser session - @selenium.start - - # Print a message in the browser-side log and status bar - # (optional). - @selenium.set_context("test_untitled") - - end - - # The teardown method is called after each test. - def teardown - - # Stop the browser session. - @selenium.stop - - # Print the array of error messages, if any. - assert_equal [], @verification_errors - end - - # This is the main body of your test. - def test_untitled - - # Open the root of the site we specified when we created the - # new driver instance, above. - @selenium.open "/" - - # Type 'selenium rc' into the field named 'q' - @selenium.type "q", "selenium rc" - - # Click the button named "btnG" - @selenium.click "btnG" - - # Wait for the search results page to load. - # Note that we don't need to set a timeout here, because that - # was specified when we created the new driver instance, above. - @selenium.wait_for_page_to_load - - begin - - # Test whether the search results contain the expected text. - # Notice that the star (*) is a wildcard that matches any - # number of characters. - assert @selenium.is_text_present("Results * for selenium rc") - - rescue Test::Unit::AssertionFailedError - - # If the assertion fails, push it onto the array of errors. - @verification_errors << $! - - end - end - end - -``` - -### Perl, PHP - -文档团队的成员尚未将Selenium RC与Perl或PHP一起使用. -如果您将Selenium RC和这两种语言一起使用, -请联系文档团队(请参阅贡献一章). -我们很乐意提供一些您的经验和示例, 以支持Perl和PHP用户. - - -## 学习 API - -Selenium RC API使用命名约定, -假设您了解Selenese, -则大部分接口将是不言自明的. -但是, 在这里, -我们解释了最关键且可能不太明显的方面. - -### 启动浏览器 - -#### CSharp -```csharp - selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.google.com/"); - selenium.Start(); -``` - -#### Java -```java - - setUp("http://www.google.com/", "*firefox"); -``` - -#### Perl -```perl - my $sel = Test::WWW::Selenium->new( host => "localhost", - port => 4444, - browser => "*firefox", - browser_url => "http://www.google.com/" ); -``` - -#### Php -```php - $this->setBrowser("*firefox"); - $this->setBrowserUrl("http://www.google.com/"); -``` - -#### Python -```python - self.selenium = selenium("localhost", 4444, "*firefox", - "http://www.google.com/") - self.selenium.start() -``` - -#### Ruby -```ruby - @selenium = Selenium::ClientDriver.new("localhost", 4444, "*firefox", "http://www.google.com/", 10000); - @selenium.start -``` - -这些示例中的每一个都打开浏览器 -并通过为程序变量分配"浏览器实例"来表示该浏览器. -然后, 该程序变量用于从浏览器调用方法. -这些方法执行Selenium命令, -即 *open* 或 *type* 或 *verify* 命令. - -创建浏览器实例时所需的参数是: - -* **host** - 指定服务器所在计算机的IP地址. - 通常, 这是与客户端运行所在的计算机相同的主机, - 因此在这种情况下, - 将传递本地主机. - 在某些客户端中, - 这是可选参数 - -* **port** - 指定服务器正在侦听的TCP/IP套接字, - 以等待客户端建立连接. - 在某些客户端驱动程序中这也是可选的. - -* **browser** - 您要在其中运行测试的浏览器. - 这是一个必需的参数. - -* **url** - 被测应用程序的基本URL. - 这是所有客户端库所必需的, - 并且是启动浏览器-代理-AUT通信所必需的信息 - -请注意, 某些客户端库要求通过调用浏览器的 `start()` 方法 -来明确启动浏览器. - -### 运行命令 - -将浏览器初始化并分配给变量(通常称为"Selenium")后, -可以通过从浏览器变量调用相应的方法来使其运行Selenese命令. -例如, 调用Selenium对象的 *type* 方法: - -``` - selenium.type("field-id","string to type") -``` - -在后台, 浏览器实际上将执行 *type* 操作, -该操作基本上与用户通过以下方式在浏览器中键入输入相同: -使用定位符和您在方法调用期间指定的字符串. - -## 报告结果 - -Selenium RC没有自己的报告结果机制. -相反, 它允许您使用所选编程语言的功能来构建根据需要定制的报告. -太好了, 但是如果您只是想快速地为您完成某件事, 该怎么办? -与开发自己的测试报告代码相比, -现有的库或测试框架通常可以更快地满足您的需求. - -### 测试框架报告工具 - -测试框架可用于许多编程语言. -这些功能以及提供用于执行测试的灵活测试引擎的主要功能, -包括用于报告结果的库代码. -例如, Java有两个常用的测试框架, -即JUnit和TestNG. -.NET也有自己的NUnit - -我们不会在这里教框架本身; -这超出了本用户指南的范围. -我们将简单介绍与Selenium相关的框架功能以及您可以应用的一些技术. -这些测试框架上都有不错的书籍, -但是互联网上的信息也很多. - -### 测试报告库 - -还提供了专门创建的第三方库, -用于以您选择的编程语言报告测试结果. -这些通常支持多种格式, 例如HTML或PDF. - -### 最好的方法是什么? - -大多数测试框架的新手都将从框架的内置报告功能开始. -从那里开始, 大多数人会检查任何可用的库, -因为与开发自己的库相比, 这样做所花的时间更少. -毫无疑问, 当您开始使用Selenium时, -您将开始输入自己的"打印报表"来报告进度. -这可能会逐渐导致您开发自己的报告, -这可能与使用库或测试框架同时进行. -无论如何, 经过最初但短暂的学习后, -您自然会开发出最适合自己情况的方法. - -### 测试报告示例 - -为了说明, 我们将指导您使用Selenium支持的其他一些语言的一些特定工具. -此处列出的是常用的, -并且由本指南的作者广泛使用(因此建议使用). - -#### Java测试报告 - -* 如果使用JUnit开发了Selenium测试用例, -则可以使用JUnit报告生成测试报告. - -* 如果使用TestNG开发了Selenium测试用例, -则无需外部任务即可生成测试报告. -TestNG框架生成一个HTML报告, -其中列出了测试的详细信息. - -* ReportNG是用于TestNG框架的HTML报告插件. -它旨在替代默认的TestNG HTML报告. -ReportNG提供了简单的, 以颜色编码的测试结果视图. - -##### 记录Selenese命令 - -* 记录Selenium可以用于生成测试中所有Selenese命令 -以及每个命令的成功或失败的报告. -记录Selenium扩展了Java客户端驱动程序 -以添加此Selenese记录功能. - -#### Python测试报告 - -* 使用Python客户端驱动程序时, -可以使用HTMLTestRunner生成测试报告. - -#### Ruby测试报告 - -* 如果RSpec框架用于在Ruby中编写Selenium测试用例, -则其HTML报告可用于生成测试报告. - - -## 为测试加料 - -现在, 我们将介绍使用Selenium RC的全部原因, -并在测试中添加编程逻辑. -与任何程序相同. -程序流使用条件语句和迭代进行控制. -另外, 您可以使用I/O报告进度信息. -在本节中, 我们将展示一些示例, -说明如何将编程语言构造与Selenium结合以解决常见的测试问题. - -当您从对页面元素存在的简单测试 -过渡到涉及多个网页和变化数据的动态功能测试时, -您将需要编程逻辑来验证预期结果. -基本上, Selenium-IDE不支持迭代和标准条件语句. -您可以通过将Javascript嵌入 -Selenese参数中来执行某些条件, -但是迭代是不可能的, 并且大多数条件在编程语言. -此外, 您可能需要进行异常处理才能恢复错误. -出于这些原因及其他原因, -我们在本节中进行了说明, -以说明如何使用常见的编程技术为您的自动化测试提供更大的"验证能力". - -本节中的示例使用C#和Java编写, -尽管代码很简单并且可以轻松地适应其他受支持的语言. -如果您对面向对象的编程语言有一些基本的了解, -那么本部分将不难理解. - -### 迭代 - -迭代是人们在测试中需要做的最常见的事情之一. -例如, 您可能要多次执行搜索. -或者, 可能是为了验证测试结果, -您需要处理从数据库返回的"结果集". - -使用我们之前使用的相同Google搜索示例, -让我们检查Selenium搜索结果. -该测试可以使用Selenese: - -| | | | -| -------- | ---------------------------- | ------------- | -| open | / | | -| type | q | selenium rc | -| clickAndWait | btnG | | -| assertTextPresent | Results * for selenium rc | | -| type | q | selenium ide | -| clickAndWait | btnG | | -| assertTextPresent | Results * for selenium ide | | -| type | q | selenium grid | -| clickAndWait | btnG | | -| assertTextPresent | Results * for selenium grid | | - - -该代码已重复执行3次相同的步骤. -但是, 同一代码的多个副本不是良好的编程习惯, -因为维护起来需要做更多的工作. -通过使用编程语言, -我们可以遍历搜索结果以提供更灵活和可维护的解决方案. - -#### 在 `C#` 中 - -```csharp - // Collection of String values. - String[] arr = {"ide", "rc", "grid"}; - - // Execute loop for each String in array 'arr'. - foreach (String s in arr) { - sel.open("/"); - sel.type("q", "selenium " +s); - sel.click("btnG"); - sel.waitForPageToLoad("30000"); - assertTrue("Expected text: " +s+ " is missing on page." - , sel.isTextPresent("Results * for selenium " + s)); - } -``` - -### 条件陈述 - -为了说明在测试中的使用条件, -我们将从一个示例开始. -当页面上没有预期的元素时, -会发生运行Selenium测试时遇到的常见问题. -例如, 当运行以下行时: - -``` - selenium.type("q", "selenium " +s); -``` - -如果页面上没有元素"q", -则抛出异常: - -```java - com.thoughtworks.selenium.SeleniumException: ERROR: Element q not found -``` - -这可能会导致测试中止. -对于某些测试, 这就是您想要的. -但是通常这是不希望的, -因为您的测试脚本还有许多其他后续测试需要执行. - -更好的方法是先验证元素是否确实存在, -然后在元素不存在时采取替代方法. -让我们用Java看一下 - -```java - // If element is available on page then perform type operation. - if(selenium.isElementPresent("q")) { - selenium.type("q", "Selenium rc"); - } else { - System.out.printf("Element: " +q+ " is not available on page.") - } -``` - -这种方法的优点是即使页面上某些UI元素不可用, -也可以继续执行测试. - - -### 从测试中执行JavaScript - -在执行Selenium不直接支持的应用程序时, -JavaScript非常方便. -Selenium API的 **getEval** 方法. - -考虑具有复选框的应用程序, -该复选框没有静态标识符. -在这种情况下, -可以评估Selenium RC中的JavaScript以获取所有复选框的ID, -然后执行它们. - -```java - public static String[] getAllCheckboxIds () { - String script = "var inputId = new Array();";// Create array in java script. - script += "var cnt = 0;"; // Counter for check box ids. - script += "var inputFields = new Array();"; // Create array in java script. - script += "inputFields = window.document.getElementsByTagName('input');"; // Collect input elements. - script += "for(var i=0; i.jar -``` - -要查看选项列表, -请使用 ``-h`` 选项运行服务器. - -```bash - $ java -jar selenium-server-standalone-.jar -h -``` - -您会看到服务器可以使用的所有选项的列表 -以及每个选项的简要说明. -提供的描述并不总是足够的, -因此我们提供了一些更重要选项的解释. - - -### 代理配置 - -如果您的AUT在需要身份验证的HTTP代理后面, -则应使用以下命令配置http.proxyHost, -http.proxyPort, -http.proxyUser -和http.proxyPassword. - -```bash - $ java -jar selenium-server-standalone-.jar -Dhttp.proxyHost=proxy.com -Dhttp.proxyPort=8080 -Dhttp.proxyUser=username -Dhttp.proxyPassword=password -``` - -### 多窗口模式 - -如果您使用的是Selenium 1.0, -则可能会跳过本节, 因为多窗口模式是默认行为. -但是, 在版本1.0之前, -Selenium默认在子frame中运行测试中的应用程序, -如下所示. - -![单窗口模式](/images/documentation/legacy/selenium_rc_single_window_mode.png) - -某些应用程序无法在子框架中正常运行, -需要将其加载到窗口的顶部框架中. -多窗口模式选项允许AUT在单独的窗口中运行, -而不是在默认帧中运行, -然后在默认帧中可以拥有所需的顶部帧. - -![多窗口模式](/images/documentation/legacy/selenium_rc_multi_window_mode.png) - -对于旧版本的Selenium, -您必须使用以下选项明确指定多窗口模式: - -```bash - -multiwindow -``` - -从Selenium RC 1.0开始, -如果您想在一个框架内运行测试(即使用早期Selenium版本的标准), -则可以使用选项将此状态指定给Selenium服务器 - -```bash - -singlewindow -``` - -### 指定Firefox配置文件 - -除非您为每个实例分别指定一个配置文件, -否则Firefox将不会同时运行两个实例. -Selenium RC 1.0和更高版本会自动在单独的配置文件中运行, -因此, 如果您使用的是Selenium 1.0, 则可以跳过本节. -但是, 如果您使用的是旧版本的Selenium, -或者需要使用特定的配置文件进行测试 -(例如添加https证书或安装了一些插件), -则需要明确指定配置文件. - -首先, 要创建一个单独的Firefox配置文件, -请遵循以下步骤. -打开Windows"开始"菜单, 选择"运行", -然后键入并输入以下内容之一: - -```bash - firefox.exe -profilemanager -``` - -```bash - firefox.exe -P -``` - -使用对话框创建新的配置文件. -然后, 当您运行Selenium服务器时, -告诉它使用带有服务器命令行选项 *\-firefoxProfileTemplate* 的 -新Firefox配置文件, -并使用其文件名和目录路径指定配置文件的路径. - -```bash - -firefoxProfileTemplate "path to the profile" -``` - -**注意**: 确保将您的个人资料放在默认文件夹之外的新文件夹中!!!! -如果删除配置文件, -则Firefox配置文件管理器工具将删除文件夹中的所有文件, -无论它们是否是配置文件. - -有关Firefox配置文件的更多信息, -请参见 [Mozilla的知识库](http://support.mozilla.com/en/kb/Managing+profiles) - -### 使用-htmlSuite在服务器内直接运行Selenese - -通过将html文件传递到服务器的命令行, -可以直接在Selenium 服务器中运行Selenese html文件. 例如: - -```bash - java -jar selenium-server-standalone-.jar -htmlSuite "*firefox" - "http://www.google.com" "c:\absolute\path\to\my\HTMLSuite.html" - "c:\absolute\path\to\my\results.html" -``` - -这将自动启动您的HTML套件, -运行所有测试并保存带有结果的漂亮HTML报告. - -*注意:* 使用此选项时, -服务器将启动测试并等待指定的秒数以完成测试; -否则, 服务器将停止测试. -如果在这段时间内未完成测试, -则该命令将以非零的退出代码退出, -并且不会生成任何结果文件. - -此命令行很长, 因此在键入时要小心. -请注意, 这要求您传递HTML Selenese套件, -而不是单个测试. -另请注意-htmlSuite选项与 ``-interactive``不兼容, -您不能同时运行两者e. - -### Selenium 服务器日志 - -#### 服务端日志 - -启动Selenium服务器时, **-log** 选项可用于 -将Selenium服务器报告的有价值的调试信息 -记录到文本文件中. - -```bash - java -jar selenium-server-standalone-.jar -log selenium.log -``` - -该日志文件比标准控制台日志更详细 -(它包含DEBUG级别的日志消息). -日志文件还包括记录器名称和记录消息的线程的ID号. 例如: - -```bash - 20:44:25 DEBUG [12] org.openqa.selenium.server.SeleniumDriverResourceHandler - - Browser 465828/:top frame1 posted START NEW -``` - -消息格式为 - -```bash - TIMESTAMP(HH:mm:ss) LEVEL [THREAD] LOGGER - MESSAGE -``` - -此消息可能是多行. - -#### 浏览器端日志 - -浏览器端的JavaScript(Selenium Core)也记录重要消息. -在许多情况下, 这些对于最终用户比常规的Selenium 服务器日志更有用. -要访问浏览器端日志, -请将 **-browserSideLog**参数传递给Selenium服务器. - - -```bash - java -jar selenium-server-standalone-.jar -browserSideLog -``` - -**-browserSideLog** 必须与 **-log** 参数结合使用, -以将browserSideLogs(以及所有其他DEBUG级别的日志记录消息)记录到文件中. - - -## 指定特定浏览器的路径 - -您可以为Selenium RC指定到特定浏览器的路径. -如果您使用同一浏览器的不同版本, -并且希望使用特定的浏览器, 这将很有用. -另外, 它用于允许您的测试在Selenium RC不直接支持的浏览器上运行. -在指定运行模式时, -请使用*custom说明符, -后跟浏览器可执行文件的完整路径: - -```bash - *custom -``` - - -## Selenium RC 架构 - -*注意:* 本主题试图说明Selenium RC背后的技术实现. -Selenium用户了解这一点并不是基本知识, -但对于理解您将来可能会发现的一些问题可能很有用. - -要详细了解Selenium RC Server的工作原理 -以及为什么使用代理注入和增强特权模式, -您必须首先了解 `同源政策`. - -### 同源策略 - -Selenium面临的主要限制是同源策略. -此安全限制适用于市场上的每个浏览器, -其目的是确保一个站点的内容永远不会被另一个站点的脚本访问. -同源策略规定, 浏览器中加载的任何代码只能在该网站的域内运行. -它无法在其他网站上执行功能. -因此, 例如, 如果浏览器在加载www.mysite.com时加载了JavaScript代码, -则即使该网站是您的另一个网站, -也无法针对www.mysite2.com运行该加载的代码. -如果可能的话, 如果您在其他标签上打开了帐户页面, -则在您打开的任何网站上放置的脚本都将能够读取银行帐户上的信息. -这称为XSS(跨站点脚本). - -要在此政策下工作, -必须将Selenium-Core(及其实现所有魔术的JavaScript命令) -放置在与被测应用程序相同的来源(相同的URL)中. - -从历史上看, Selenium-Core受此问题限制, -因为它是用JavaScript实现的. -但是, Selenium RC不受"同一来源"政策的限制. -它使用Selenium服务器作为代理可以避免此问题. -从本质上讲, 它告诉浏览器该浏览器正在服务器提供的单个"欺骗"网站上工作. - -*注意:* 您可以在Wikipedia页面上找到有关此主题的其他信息, -这些信息与同源策略和XSS有关. - - -### 代理注入 - -Selenium用来避免"同源策略"的第一种方法是代理注入. -在代理注入模式下, -Selenium 服务器充当客户端配置的 **HTTP proxy** [^1] -位于浏览器和Test[^2]中. -然后, 它在虚构的URL下掩盖AUT -(嵌入Selenium-Core和测试集, 并像它们来自同一来源一样进行交付). - - -[^1]: 代理人是中间的第三人, 两人之间传球. 它充当将AUT传送到浏览器的"网络服务器". 作为代理, Selenium服务器可以"说谎"AUT的真实URL. - -[^2]: 启动浏览器时使用的配置文件将localhost:4444设置为HTTP代理, 这就是为什么浏览器执行的任何HTTP请求都将通过Selenium服务器并且响应将通过它而不是真实服务器通过的原因. - -以下是架构图. - -![架构图 1](/images/documentation/legacy/selenium_rc_architecture_diagram_1.png) - -当测试套件以您喜欢的语言开始时, 会发生以下情况: - -1. 客户端/驱动程序与Selenium-RC服务器建立连接. -2. Selenium RC服务器启动带有URL的浏览器(或重用旧的浏览器), -该URL将Selenium-Core的JavaScript注入浏览器加载的网页中. -3. 客户端驱动程序将Selenese命令传递到服务器. -4. 服务器解释命令, 然后触发相应的JavaScript执行以在浏览器中执行该命令. -Selenium-Core指示浏览器按照第一条指令操作, -通常会打开AUT的页面. -5. 浏览器收到打开的请求, -并从Selenium RC服务器 -(设置为供浏览器使用的HTTP代理) -中请求网站的内容. -6. Selenium RC服务器与Web服务器进行通信以请求页面, -并在收到页面后将页面发送给浏览器, -以掩盖其来源, 以使页面看起来与Selenium-Core来自同一服务器 -(这使Selenium-Core可以遵从使用同源策略). -7. 浏览器接收网页并将其呈现在为其保留的框架/窗口中. - -### 特权浏览器 - -此方法中的此工作流程与代理注入非常相似, -但主要区别在于浏览器以一种称为 *增强特权* 的特殊模式启动, -该模式允许网站执行通常不允许的操作 -(例如XSS_或填充文件上传输入)和对Selenium非常有用的东西). -通过使用这些浏览器模式, -Selenium Core能够直接打开AUT并与其内容进行读取/交互, -而不必将整个AUT传递给Selenium RC服务器. - -以下是架构图. - -![架构图 1](/images/documentation/legacy/selenium_rc_architecture_diagram_2.png) - -当测试套件以您喜欢的语言开始时, -会发生以下情况: - -1. 客户端/驱动程序与Selenium-RC服务器建立连接. -2. Selenium RC服务器启动一个带有URL的浏览器(或重用旧的浏览器), -该URL将在网页中加载Selenium-Core. -3. Selenium-Core从客户端/驱动程序获取第一条指令 -(通过向Selenium RC服务器发出的另一个HTTP请求). -4. Selenium-Core对该第一条指令起作用, -通常会打开AUT的页面. -5. 浏览器收到打开请求, -并向Web服务器询问该页面. -浏览器收到网页后, 将其呈现在为其保留的框架/窗口中. - -## 处理HTTPS和安全弹出窗口 - -当许多应用程序需要发送加密的信息(例如密码或信用卡信息)时, -它们从使用HTTP切换到HTTPS. -这在当今的许多网络应用程序中很常见. -Selenium RC支持这一点. - -为了确保HTTPS站点是真实的, 浏览器将需要安全证书. -否则, 当浏览器使用HTTPS访问AUT时, -将假定该应用程序不被"信任". -发生这种情况时, 浏览器将显示安全弹出窗口, -并且无法使用Selenium RC关闭这些弹出窗口 - -在Selenium RC测试中处理HTTPS时, -必须使用支持该模式并为您处理安全证书的运行模式. -您在测试程序初始化Selenium时指定运行模式. - -在Selenium RC 1.0 beta 2和更高版本中, -将\*firefox或\*iexplore用于运行模式. -在早期版本中, 包括Selenium RC 1.0 beta 1, -在运行模式中使用\*chrome或\*iehta. -使用这些运行模式, 您将不需要安装任何特殊的安全证书. -Selenium RC会为您处理. - -在1.0版中, 建议使用运行模式\*firefox或\*iexplore. -但是, 还有\*iexploreproxy和\*firefoxproxy的其他运行模式. -提供这些仅是为了向后兼容, -除非传统测试程序要求, 否则不应使用它们. -如果您的应用程序打开其他浏览器窗口, -则它们的使用将对安全证书处理和多个窗口的运行产生限制. - -在早期版本的Selenium RC中, -\*chrome或\*iehta是支持HTTPS和安全弹出窗口处理的运行模式. -尽管它们变得相当稳定并且许多人使用了它们, -但这些被认为是"实验模式". -如果使用的是Selenium 1.0, -则不需要, 也不应使用这些较早的运行模式. - -### 安全证书说明 - -通常, 浏览器将通过安装您已经拥有的安全证书来信任您正在测试的应用程序. -您可以在浏览器的选项或Internet属性中进行检查 -(如果您不知道AUT的安全证书, 请咨询系统管理员). -当Selenium加载浏览器时, -它将注入代码以拦截浏览器和服务器之间的消息. -浏览器现在认为不受信任的软件正试图看起来像您的应用程序. -它通过弹出消息提醒您. - -为解决此问题, Selenium RC(再次使用支持此功能的运行模式时) -将在浏览器可以访问它的位置临时将其自己的安全证书安装到客户端计算机上. -这会欺骗浏览器以使其正在访问的网站与您的AUT不同, -从而有效地抑制了弹出窗口. - -Selenium早期版本使用的另一种方法是安装Selenium安装随附的Cybervillians安全证书. -但是, 大多数用户不再需要这样做. -如果您以代理注入模式运行Selenium RC, -则可能需要显式安装此安全证书. - - -## 支持其他浏览器和浏览器配置 - -除了Internet Explorer和Mozilla Firefox外, -Selenium API还支持在多种浏览器上运行. -请访问https://selenium.dev网站以获取受支持的浏览器. -另外, 当不直接支持浏览器时, -您仍然可以在测试应用程序启动时通过使用 -"\*custom"运行模式(即代替\*firefox或\*iexplore) -对所选浏览器运行Selenium测试. -这样, 您可以将路径传递到API调用内的浏览器可执行文件. -也可以从服务器以交互方式完成此操作. - -```bash - cmd=getNewBrowserSession&1=*custom c:\Program Files\Mozilla Firefox\MyBrowser.exe&2=http://www.google.com -``` - - -### 使用不同的浏览器配置运行测试 - -通常, Selenium RC自动配置浏览器, -但是如果您使用"\*custom"运行模式启动浏览器, -则可以强制Selenium RC照原样启动浏览器, -而无需使用自动配置. - -例如, 您可以使用这样的自定义配置启动Firefox: - -```bash - cmd=getNewBrowserSession&1=*custom c:\Program Files\Mozilla Firefox\firefox.exe&2=http://www.google.com -``` - -请注意, 以这种方式启动浏览器时, -必须手动配置浏览器以将Selenium服务器用作代理. -通常, 这仅意味着打开浏览器首选项并将"localhost:4444"指定为HTTP代理, -但是不同浏览器的说明可能会有根本不同. -有关详细信息, 请查阅浏览器的文档. - -请注意, Mozilla浏览器的启动和停止方式可能会有所不同. -可能需要设置MOZ_NO_REMOTE环境变量, -以使Mozilla浏览器的行为更加可预测. -Unix用户应避免使用Shell脚本启动浏览器. -通常最好直接使用二进制可执行文件(例如firefox-bin). - - -## 解决常见问题 - -在开始使用Selenium RC时, -通常会遇到一些潜在的问题. -我们在这里介绍它们及其解决方案. - -### 无法连接到服务器 - -当您的测试程序无法连接到Selenium 服务器时, -Selenium会在您的测试程序中引发异常. -它应该显示此消息或类似的消息: - -```bash - "Unable to connect to remote server (Inner Exception Message: - No connection could be made because the target machine actively - refused it )" - - (using .NET and XP Service Pack 2) -``` - -如果看到这样的消息, 请确保已启动Selenium服务器. -如果是这样, 则Selenium客户端库和Selenium服务器之间的连接存在问题. - -从Selenium RC开始时, -大多数人开始是在同一台计算机上运行测试程序(带有Selenium客户端库) -和Selenium服务器. -为此, 请使用"localhost"作为连接参数. -我们建议您以这种方式开始, -因为它可以减少您入门时可能出现的网络问题的影响. -假设您的操作系统具有典型的网络和TCP/IP设置, -那么您应该没有什么困难. -实际上, 许多人选择以这种方式运行测试. - -但是, 如果您确实想在远程计算机上运行Selenium服务器, -则假设两台计算机之间具有有效的TCP/IP连接, -则连接应该很好. - -如果连接困难, 可以使用常用的网络工具, -例如*ping*, - *telnet*, *ifconfig(Unix)/ipconfig* (Windows) 等, -以确保您具有有效的网络连接. -如果不熟悉这些, 则系统管理员可以为您提供帮助. - -### 无法加载浏览器 - -好的, 这并非友好的错误消息, -很抱歉, 但是如果Selenium服务器无法加载浏览器, -您可能会看到此错误. - -```bash - (500) Internal Server Error -``` - -这可能是由于 - -* Firefox(Selenium 1.0之前的版本)无法启动, -因为浏览器已经打开, -并且您未指定单独的配置文件. -请参阅"服务器选项"下有关Firefox配置文件的部分 -* 您使用的运行模式与您计算机上的任何浏览器都不匹配. -程序打开浏览器时检查您传递给Selenium的参数. -* 您已明确指定浏览器的路径(使用"\*custom" –参见上文), -但该路径不正确. 检查以确保路径正确. -还要检查用户组, 以确保浏览器和"\*custom"参数没有已知问题. - -### Selenium 找不到AUT - -如果您的测试程序成功启动了浏览器, -但是浏览器未显示您正在测试的网站, -则最可能的原因是您的测试程序未使用正确的URL. - -这很容易发生. -当您使用Selenium-IDE导出脚本时, -它会插入一个虚拟URL. -您必须手动将URL更改为正确的URL才能测试您的应用程序. - -### Firefox在准备配置文件时拒绝关闭 - -最常见的情况是在Firefox上运行Selenium RC测试程序, -但是已经运行了Firefox浏览器会话, -并且在启动Selenium服务器时未指定单独的配置文件. -测试程序中的错误如下所示: - -```bash - Error: java.lang.RuntimeException: Firefox refused shutdown while - preparing a profile -``` - -以下是来自服务器的完整错误消息: - -```bash - 16:20:03.919 INFO - Preparing Firefox profile... - 16:20:27.822 WARN - GET /selenium-server/driver/?cmd=getNewBrowserSession&1=*fir - efox&2=http%3a%2f%2fsage-webapp1.qa.idc.com HTTP/1.1 - java.lang.RuntimeException: Firefox refused shutdown while preparing a profile - at org.openqa.selenium.server.browserlaunchers.FirefoxCustomProfileLaunc - her.waitForFullProfileToBeCreated(FirefoxCustomProfileLauncher.java:277) - ... - Caused by: org.openqa.selenium.server.browserlaunchers.FirefoxCustomProfileLaunc - her$FileLockRemainedException: Lock file still present! C:\DOCUME~1\jsvec\LOCALS - ~1\Temp\customProfileDir203138\parent.lock -``` - -要解决此问题, -请参阅"指定单独的Firefox配置文件"部分 - -### 版本问题 - -确保您的Selenium版本支持您的浏览器版本. -例如, Selenium RC 0.92不支持Firefox3. -有时您可能很幸运(例如我). -但不要忘记检查您使用的Selenium版本支持哪些浏览器版本. -如有疑问, 请使用最新版本的Selenium和浏览器使用最广泛的版本. - -### 启动服务器时出现错误消息: "(不支持的major.minor版本49.0)" - -此错误表明您使用的Java版本不正确. -Selenium服务器需要Java 1.5或更高版本. - -要检查您的Java版本, 请从命令行运行. - -```bash - java -version -``` - -您应该看到一条消息, 显示Java版本. - -```bash - java version "1.5.0_07" - Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03) - Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode) -``` - -如果看到较低的版本号, 则可能需要更新JRE, -或者只需将其添加到PATH环境变量中即可. - - -### 404 error when running the getNewBrowserSession command - -如果尝试打开" http://www.google.com/selenium-server/"上的页面时遇到404错误, -则一定是因为Selenium服务器未正确配置为代理. -Selenium-server"目录在google.com上不存在; -仅当正确配置了代理后, 该目录才存在. -代理配置在很大程度上取决于如何使用firefox, -iexplore, opera或custom启动浏览器. - -* iexplore:如果使用\*iexplore启动浏览器, -则可能是Internet Explorer的代理设置有问题. -Selenium服务器尝试在Internet选项控制面板中配置全局代理设置. -您必须确保在Selenium服务器启动浏览器时正确配置了这些配置. -尝试查看" Internet选项"控制面板. -单击"连接"选项卡, 然后单击"局域网设置". - * 如果您需要使用代理来访问要测试的应用程序, - 则需要使用" -Dhttp.proxyHost"启动Selenium服务器. - 有关更多详细信息, 请参见 `代理配置` . - * 您也可以尝试手动配置代理, 然后使用\*custom或\*iehta浏览器启动器启动浏览器. - -* custom: 使用\*custom时, 必须正确(手动)配置代理, -否则会出现404错误. -仔细检查您是否正确配置了代理设置. -要检查您是否正确配置了代理, -则是试图故意不正确地配置浏览器. -尝试将浏览器配置为使用错误的代理服务器主机名或错误的端口. -如果您错误地成功配置了浏览器的代理设置, -则浏览器将无法连接到Internet, -这是一种确保正在调整相关设置的方法. - -* 对于其他浏览器(\*firefox, \*opera), -我们会自动为您硬编码代理, -因此此功能没有已知问题. -如果您遇到404错误, -并已按照本用户指南进行操作, -请仔细将结果发布到用户组, -以获取用户社区的帮助. - -### 权限被拒绝错误 - -发生此错误的最常见原因是您的会话试图跨域 -(例如, 从http://domain1访问页面, -然后从http://domain2访问页面)来违反同源策略. -协议(从http://domainX移至https://domainX). - -当JavaScript尝试查找尚不可用 -(在页面完全加载之前)或不再可用 -(在页面开始卸载之后)的UI对象时, -也会发生此错误. -最常见的情况是AJAX页面正在处理页面的某些部分 -或独立于较大页面而加载和/或重新加载的子frame. - -该错误可能是间歇性的. -通常, 用调试器不可能重现该问题, -因为问题是由于竞争条件引起的, -当将调试器的开销添加到系统中时, -这些竞争条件是无法再现的. -许可问题在本教程中进行了详细介绍. -仔细阅读有关`同源策略`, `代理注入`的部分. - - -### 处理浏览器弹出窗口 - -在Selenium测试中可以得到几种"弹出窗口". -如果Selenium命令是由浏览器而不是AUT发起的, -则可能无法通过运行Selenium命令来关闭这些弹出窗口. -您可能需要知道如何进行管理. -每种类型的弹出窗口都需要以不同的方式处理. - -* HTTP基本身份验证对话框: -这些对话框提示输入用户名/密码登录到站点. -要登录到需要HTTP基本身份验证的站点, -请使用 `RFC 1738`中所述的URL中的用户名和密码, -如下所示:open -(" http//myusername:myuserpassword@myexample.com/blah/blah/blah"). - -* SSL证书警告: -当Selenium RC启用为代理时, -它会自动尝试欺骗SSL证书. -请参阅HTTPS部分中的更多内容. -如果您的浏览器配置正确, 您将永远不会看到SSL证书警告, -但是您可能需要将浏览器配置为信任我们危险的"CyberVillains" SSL证书颁发机构. -再次, 请参阅HTTPS部分以了解如何执行此操作. - -* 模态JavaScript警报/确认/提示对话框: -Selenium试图向您隐藏这些对话框 -(通过替换window.alert, window.confirm和window.prompt), -以便它们不会停止您页面的执行. -如果您看到警告弹出窗口, -可能是因为它是在页面加载过程中触发的, -对于我们而言, 保护该页面通常为时过早. -Selenese包含用于断言或验证警报和确认弹出窗口的命令. -请参阅第4章中有关这些主题的部分. - - -### 在Linux上, 为什么我的Firefox浏览器会话没有关闭? - -在Unix/Linux上, 您必须直接调用"firefox-bin", -因此请确保路径中包含可执行文件. -如果通过外壳程序脚本执行Firefox, 则该终止浏览器了. -SeleniumRC将终止该外壳程序脚本, -使浏览器保持运行状态. -您可以像这样直接指定firefox-bin的路径. - -```bash - cmd=getNewBrowserSession&1=*firefox /usr/local/firefox/firefox-bin&2=http://www.google.com -``` - -### Firefox \*chrome不适用于自定义配置文件 - -检查Firefox配置文件文件夹 --> prefs.js-> "//user_pref("browser.startup.page", 0);" -像这样注释此行:"//user_pref("browser.startup.page", 0);" -然后再试一次. - - -### 是否可以在加载父页面时加载自定义弹出窗口(即, 在父页面的javascript window.onload()函数运行之前) - -否. Selenium依靠拦截器来确定正在加载的窗口名称. -如果在onload()函数之后加载窗口, -则这些拦截器最适合捕获新窗口. -Selenium可能无法识别在onload功能之前加载的Windows. - -### Linux上的Firefox - -在Unix/Linux上, Selenium 1.0之前的版本需要直接调用"firefox-bin", -因此, 如果您使用的是以前的版本, -请确保路径中包含真正的可执行文件. - -在大多数Linux发行版中, 真正的 *firefox-bin* 位于: - -```bash - /usr/lib/firefox-x.x.x/ -``` - -其中x.x.x是您当前拥有的版本号. -因此, 要将该路径添加到用户的路径. -您将必须将以下内容添加到您的.bashrc文件中: - -```bash - export PATH="$PATH:/usr/lib/firefox-x.x.x/" -``` - -如有必要, 您可以在测试中直接指定firefox-bin的路径, 如下所示: - -```bash - "*firefox /usr/lib/firefox-x.x.x/firefox-bin" -``` - -### IE和样式属性 - -如果您在Internet Explorer上运行测试, -则无法使用其 `style` 属性来查找元素. 例如: - -```bash - //td[@style="background-color:yellow"] -``` - -这将在Firefox, Opera或Safari中完美运行, 但不适用于IE. -IE将 `@style` 中的键解释为大写. -因此, 即使源代码是小写的, 您也应该使用: - -```bash - //td[@style="BACKGROUND-COLOR:yellow"] -``` - -如果您的测试打算在多个浏览器上运行, -那么这将是一个问题, -但是您可以轻松地对测试进行编码以检测情况 -并尝试仅在IE中运行的替代定位器. - -### 遇到错误-随着\*googlechrome浏览器的关闭, "无法将对象转换为原始值" - -为避免此错误, 您必须使用禁用 -同源策略检查的选项启动浏览器: - -```bash - selenium.start("commandLineFlags=--disable-web-security"); -``` - - -### IE中遇到的错误-"无法打开应用程序窗口;弹出窗口阻止程序已启用?" - -为避免此错误, 您必须配置浏览器: -禁用弹出窗口阻止程序, -并取消选中工具>>选项>>安全中的"启用保护模式"选项. diff --git a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.en.md b/website_and_docs/content/documentation/legacy/selenium_2/remote_server.en.md index bba4647cb297..1b07f8a90084 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.en.md +++ b/website_and_docs/content/documentation/legacy/selenium_2/remote_server.en.md @@ -9,7 +9,13 @@ aliases: [ "/documentation/legacy/remote_webdriver_server/", "/documentation/ja/legacy_docs/remote_webdriver_server/", "/documentation/pt-br/legacy_docs/remote_webdriver_server/", -"/documentation/zh-cn/legacy_docs/remote_webdriver_server/" +"/documentation/zh-cn/legacy_docs/remote_webdriver_server/", +"/ja/documentation/legacy/remote_webdriver_server/", +"/ja/documentation/legacy/selenium_2/remote_server/", +"/pt-br/documentation/legacy/remote_webdriver_server/", +"/pt-br/documentation/legacy/selenium_2/remote_server/", +"/zh-cn/documentation/legacy/remote_webdriver_server/", +"/zh-cn/documentation/legacy/selenium_2/remote_server/" ] --- This documentation previously located [on the wiki](https://github.com/SeleniumHQ/selenium/wiki/RemoteWebDriverServer) diff --git a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.ja.md b/website_and_docs/content/documentation/legacy/selenium_2/remote_server.ja.md deleted file mode 100644 index 003818c47d52..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.ja.md +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: "リモートWebDriverサーバー" -linkTitle: "リモートWebDriverサーバー" -weight: 6 -aliases: [ -"/documentation/legacy/remote_webdriver_server/" -] ---- - -サーバーは、テストするブラウザーがインストールされたマシンで常に実行されます。 -サーバーは、コマンドラインから、またはコード設定を通じて使用できます。 - -## コマンドラインからサーバーを起動する - -一旦、`selenium-server-standalone-{VERSION}.jar`をダウンロードしたら、テストしたいブラウザーのあるコンピューターに配置します。 -次に、jarを含むディレクトリから、次のコマンドを実行します。 - -```shell -java -jar selenium-server-standalone-{VERSION}.jar -``` - -## サーバーを実行するにあたって考慮すること - -呼び出し元は、`Selenium#stop()`または`WebDriver#quit`を呼び出して、各セッションを適切に終了すべきです。 - -selenium-serverは、進行中の各セッションのメモリ内ログを保持します。 -これらのログは、`Selenium#stop()`または`WebDriver#quit`が呼び出されるとクリアされます。 -これらのセッションの終了を忘れると、サーバーでメモリリークが発生する可能性があります。 -非常に長時間実行されるセッションを維持する場合は、時々停止または終了する必要があります(または-Xmx jvmオプションでメモリを増やします)。 - -## タイムアウト (version 2.21以降) - -サーバーには2つの異なるタイムアウトがあり、次のように設定できます。 - -```shell -java -jar selenium-server-standalone-{VERSION}.jar -timeout=20 -browserTimeout=60 -``` - -* browserTimeout - * ブラウザーのハングを許可する時間を制御します(値は秒単位)。 -* timeout - * セッションが回収されるまでにクライアントがいなくなる時間を制御します(値は秒単位)。 - -システムプロパティ`selenium.server.session.timeout`は、2.21からサポートされなくなりました。 - -`browserTimeout`は、通常のタイムアウトメカニズムが失敗した場合の予備のタイムアウトメカニズムであることに注意してください。これは主にグリッド/サーバー環境で使用され、クラッシュ/失われたプロセスが長く滞留、ランタイム環境を汚染しないようにします。 - -## プログラムでサーバーを構成する - -理論的には、プロセスは`DriverServlet`をURLにマッピングするのと同じくらい簡単ですが、ページを全体的にコードで構成されたJettyなどの軽量コンテナでホストすることもできます。これを行う手順は次のとおりです。 - -`selenium-server.zip`をダウンロードして解凍します。 -JARをCLASSPATHに配置します。 -`AppServer`という新しいクラスを作成します。 -ここでは、Jettyを使用しているので、それも[ダウンロード](//www.eclipse.org/jetty/download.html)する必要があります。 - -```java -import org.mortbay.jetty.Connector; -import org.mortbay.jetty.Server; -import org.mortbay.jetty.nio.SelectChannelConnector; -import org.mortbay.jetty.security.SslSocketConnector; -import org.mortbay.jetty.webapp.WebAppContext; - -import javax.servlet.Servlet; -import java.io.File; - -import org.openqa.selenium.remote.server.DriverServlet; - -public class AppServer { - private Server server = new Server(); - - public AppServer() throws Exception { - WebAppContext context = new WebAppContext(); - context.setContextPath(""); - context.setWar(new File(".")); - server.addHandler(context); - - context.addServlet(DriverServlet.class, "/wd/*"); - - SelectChannelConnector connector = new SelectChannelConnector(); - connector.setPort(3001); - server.addConnector(connector); - - server.start(); - } -} -``` diff --git a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.pt-br.md b/website_and_docs/content/documentation/legacy/selenium_2/remote_server.pt-br.md deleted file mode 100644 index d119e24cb91a..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.pt-br.md +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: "Servidor do WebDriver remoto" -linkTitle: "Servidor do WebDriver remoto" -weight: 6 -aliases: [ -"/documentation/legacy/remote_webdriver_server/" -] ---- - -O servidor sempre será executado na máquina com o navegador que você deseja -testar. O servidor pode ser usado a partir da linha de comando ou por meio de configuração de código. - - -## Iniciando o servidor a partir da linha de comando - -Depois de fazer o download do `selenium-server-standalone-{VERSION}.jar`, -coloque-o no computador com o navegador que deseja testar. Então, a partir -do diretório com o jar, execute o seguinte: - -```shell -java -jar selenium-server-standalone-{VERSION}.jar -``` - -## Considerações para executar o servidor - -O chamador deve encerrar cada sessão adequadamente, chamando -ou `Selenium#stop()` ou `WebDriver#quit`. - -O selenium-server mantém registros na memória para cada sessão em andamento, -que são apagados quando `Selenium#stop()` ou `WebDriver#quit` é chamado. E se -você se esquecer de encerrar essas sessões, seu servidor pode vazar memória. E se -você mantém sessões de duração extremamente longa, você provavelmente precisará -parar / sair de vez em quando (ou aumentar a memória com a opção -Xmx jvm). - - -## Timeouts (a partir da versão 2.21) - -O servidor tem dois timeouts diferentes, que podem ser definidos da seguinte forma: - -```shell -java -jar selenium-server-standalone-{VERSION}.jar -timeout=20 -browserTimeout=60 -``` - -* browserTimeout - * Controla por quanto tempo o navegador pode travar (valor em segundos). -* timeout - * Controla por quanto tempo o cliente pode ficar fora - antes que a sessão seja recuperada (valor em segundos). - -A propriedade do sistema `selenium.server.session.timeout` -não é mais compatível a partir da versão 2.21. - -Observe que o `browserTimeout` -destina-se a ser um mecanismo de timeout de backup -quando o mecanismo de timeout comum falha, -e deve ser usado principalmente em ambientes de Grid / servidor -para garantir que processos travados / perdidos não permaneçam por muito tempo -poluindo o ambiente de execução. - - -## Configurando o servidor programaticamente - -Em teoria, o processo é tão simples quanto mapear o `DriverServlet` para -uma URL, mas também é possível hospedar a página em um formato leve de -container, como Jetty, configurado inteiramente em código. - -* Baixe o `selenium-server.zip` e descompacte. -* Coloque os JARs no CLASSPATH. -* Crie uma nova classe chamada `AppServer`. -Aqui, estamos usando Jetty, então você precisará [baixar](//www.eclipse.org/jetty/download.html) -isso também: - -```java -import org.mortbay.jetty.Connector; -import org.mortbay.jetty.Server; -import org.mortbay.jetty.nio.SelectChannelConnector; -import org.mortbay.jetty.security.SslSocketConnector; -import org.mortbay.jetty.webapp.WebAppContext; - -import javax.servlet.Servlet; -import java.io.File; - -import org.openqa.selenium.remote.server.DriverServlet; - -public class AppServer { - private Server server = new Server(); - - public AppServer() throws Exception { - WebAppContext context = new WebAppContext(); - context.setContextPath(""); - context.setWar(new File(".")); - server.addHandler(context); - - context.addServlet(DriverServlet.class, "/wd/*"); - - SelectChannelConnector connector = new SelectChannelConnector(); - connector.setPort(3001); - server.addConnector(connector); - - server.start(); - } -} -``` - diff --git a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.zh-cn.md b/website_and_docs/content/documentation/legacy/selenium_2/remote_server.zh-cn.md deleted file mode 100644 index 1fe0d3cde112..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.zh-cn.md +++ /dev/null @@ -1,104 +0,0 @@ ---- -title: "远程WebDriver服务器" -linkTitle: "远程WebDriver服务器" -weight: 6 -aliases: [ -"/documentation/legacy/remote_webdriver_server/" -] ---- - -服务器将始终在安装了待测浏览器的机器上运行. -可以从命令行或通过代码配置来使用服务器. - - -## 从命令行启动服务器 - -下载 `selenium-server-standalone-{VERSION}.jar` 后, -将其传到具有待测浏览器的电脑上. -然后, 切换到包含此jar文件的目录中, 运行以下命令: - -```shell -java -jar selenium-server-standalone-{VERSION}.jar -``` - -## 运行服务器的注意事项 - -调用者应调用 `Selenium#stop()` 或 `WebDriver#quit` 以结束每次会话. - -Selenium服务器在内存中保留每个运行会话的日志, -这些日志将在调用 `Selenium#stop()` 或 `WebDriver#quit` 时清除. -如果您忘记终止这些会话, 则可能会造成服务器内存泄漏. -如果您保持运行时间非常长的会话, -则可能需要不时执行停止或退出的操作 (或使用-Xmx jvm选项增加内存) . - - -## 超时 (自2.21版本) - -服务器有两种不同的超时, 可以按如下设置: - -```shell -java -jar selenium-server-standalone-{VERSION}.jar -timeout=20 -browserTimeout=60 -``` - -* browserTimeout - * 控制允许浏览器挂起的时间 - (以秒为单位的值) . -* timeout - * 控制在回收会话之前允许客户端离开的时间 - (以秒为单位的值) . - -从2.21版本开始不再支持系统属性 - `selenium.server.session.timeout`. - -请注意, 当常规超时机制发生故障时, -`browserTimeout`旨在用作备份超时机制, -该机制应主要在网格和服务器的环境中使用, -以确保崩溃或丢失的进程不会驻留太长时间, -从而干扰了运行时环境. - - -## 以编程方式配置服务器 - -从理论上讲, 此过程就像将 `DriverServlet`映射到URL一样简单, -但是也可以将页面托管在轻量级容器中, -例如完全用代码配置的Jetty. -步骤如下. - -* 下载并解压 `selenium-server.zip`. -* 将这些Jar设置在CLASSPATH中. -* 创建一个名为 `AppServer`的新类. -在这里, 我使用Jetty, -因此您也需要[download](//www.eclipse.org/jetty/download.html): - -```java -import org.mortbay.jetty.Connector; -import org.mortbay.jetty.Server; -import org.mortbay.jetty.nio.SelectChannelConnector; -import org.mortbay.jetty.security.SslSocketConnector; -import org.mortbay.jetty.webapp.WebAppContext; - -import javax.servlet.Servlet; -import java.io.File; - -import org.openqa.selenium.remote.server.DriverServlet; - -public class AppServer { - private Server server = new Server(); - - public AppServer() throws Exception { - WebAppContext context = new WebAppContext(); - context.setContextPath(""); - context.setWar(new File(".")); - server.addHandler(context); - - context.addServlet(DriverServlet.class, "/wd/*"); - - SelectChannelConnector connector = new SelectChannelConnector(); - connector.setPort(3001); - server.addConnector(connector); - - server.start(); - } -} -``` - diff --git a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.en.md b/website_and_docs/content/documentation/legacy/selenium_2/upgrading.en.md index fd56fe4d2c5b..15def3ba6087 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.en.md +++ b/website_and_docs/content/documentation/legacy/selenium_2/upgrading.en.md @@ -9,7 +9,13 @@ aliases: [ "/documentation/legacy/migrating_from_rc_to_webdriver/", "/documentation/ja/legacy_docs/migrating_from_rc_to_webdriver/", "/documentation/pt-br/legacy_docs/migrating_from_rc_to_webdriver/", -"/documentation/zh-cn/legacy_docs/migrating_from_rc_to_webdriver/" +"/documentation/zh-cn/legacy_docs/migrating_from_rc_to_webdriver/", +"/ja/documentation/legacy/migrating_from_rc_to_webdriver/", +"/ja/documentation/legacy/selenium_2/upgrading/", +"/pt-br/documentation/legacy/migrating_from_rc_to_webdriver/", +"/pt-br/documentation/legacy/selenium_2/upgrading/", +"/zh-cn/documentation/legacy/migrating_from_rc_to_webdriver/", +"/zh-cn/documentation/legacy/selenium_2/upgrading/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.ja.md b/website_and_docs/content/documentation/legacy/selenium_2/upgrading.ja.md deleted file mode 100644 index a6c2bac4e274..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.ja.md +++ /dev/null @@ -1,223 +0,0 @@ ---- -title: "RCからWebDriverへの移行" -linkTitle: "RCからWebDriverへの移行" -weight: 2 -aliases: [ -"/documentation/legacy/migrating_from_rc_to_webdriver/" -] ---- - - -## Selenium WebDriverに移行する方法 - - -Selenium 2を採用する際によくある質問は、「既存のテストセットに新しいテストを追加するときに正しいことは何ですか?」ということです。 -フレームワークを初めて使用するユーザーは、新しいWebDriver APIを使用してテストを作成することから始めることができます。 -しかし、既存のテストスイートを既に持っているユーザーはどうでしょうか? -このガイドは、既存のテストを新しいAPIに移行し、WebDriverが提供する新機能を使用してすべての新しいテストを作成する方法を示すことを目的としています。 - -ここで紹介する方法は、1回の大規模なプッシュですべてをやり直す必要のない、WebDriver APIへの断片的な移行について説明しています。 -これは、既存のテストの移行により多くの時間を割り当てることができることを意味します。 -これにより、どこに労力を費やすかを決定しやすくなります。 - -このガイドは、移行を行うための最良のサポートがあるため、Javaを使用して書かれています。 -他の言語用のより優れたツールを提供するため、このガイドはそれらの言語を含むように拡張されます。 - -## WebDriverに移行する理由 - - -一連のテストをあるAPIから別のAPIに移動するには、多大な労力が必要です。 -なぜあなたとあなたのチームはこの動きを検討するのですか? -WebDriverを使用するためにSeleniumテストを移行することを検討する必要があるいくつかの理由を以下に示します。 - -* 小さくコンパクトなAPI。 - WebDriverのAPIは、元のSelenium RC APIよりもオブジェクト指向です。 - これにより、作業が容易になります。 -* ユーザー操作のより良いエミュレーション。 - 可能な場合、WebDriverはWebページと対話するためにネイティブイベントを使用します。 - これは、ユーザーがサイトやアプリを操作する方法をより厳密に模倣しています。 - さらに、WebDriverは、サイトとの複雑な相互作用をモデル化できる高度なユーザーインタラクションAPIを提供します。 -* ブラウザーベンダーによるサポート。 - Opera、Mozilla、GoogleはすべてWebDriverの開発に積極的に参加しており、それぞれにフレームワークの改善に取り組んでいるエンジニアがいます。 - 多くの場合、これはWebDriverのサポートがブラウザー自体に組み込まれていることを意味します。 - テストは可能な限り高速で安定して実行されます。 - - -## はじめる前に - - -移行プロセスを可能な限り簡単にするために、すべてのテストが最新のSeleniumリリースで正しく実行されることを確認してください。 -これは当たり前のように聞こえるかもしれませんが、言ってもらうのが最善です! - - -## はじめに - - -移行を開始する最初の手順は、Seleniumのインスタンスの取得方法を変更することです。 -Selenium RCを使用する場合、これは次のように行われます。 - -```java -Selenium selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.yoursite.com"); -selenium.start(); -``` - -これは次のように置き換える必要があります。 - -```java -WebDriver driver = new FirefoxDriver(); -Selenium selenium = new WebDriverBackedSelenium(driver, "http://www.yoursite.com"); -``` - -## 次のステップ - - -テストがエラーなしで実行されたら、次の段階は実際のテストコードを移行してWebDriver APIを使用することです。 -コードがどれだけ適切に抽象化されているかによって、これは短いプロセスまたは長いプロセスになります。 -どちらの場合でも、アプローチは同じであり、簡単に要約できます。 -編集するときに新しいAPIを使用するようにコードを変更します。 - -基になるWebDriver実装をSeleniumインスタンスから抽出する必要がある場合は、WrapsDriverにキャストするだけです。 - -```java -WebDriver driver = ((WrapsDriver) selenium).getWrappedDriver(); -``` - -これにより、通常どおりSeleniumインスタンスの受け渡しを続けることができますが、必要に応じてWebDriverインスタンスのラップを解除できます。 - -ある時点で、コードベースは主に新しいAPIを使用します。 -この時点で、WebDriverを使用して関係を反転し、オンデマンドでSeleniumインスタンスをインスタンス化できます。 - -```java -Selenium selenium = new WebDriverBackedSelenium(driver, baseUrl); -``` - -## 一般的な問題 - - -幸いなことに、この移行を最初に行ったのはあなたではないので、他の人が経験した一般的な問題とその解決方法を以下に示します。 - -### クリックと入力がより完全に - - -Selenium RCテストの一般的なパターンは、以下のとおりです。 - -```java -selenium.type("name", "exciting tex"); -selenium.keyDown("name", "t"); -selenium.keyPress("name", "t"); -selenium.keyUp("name", "t"); -``` - - -これは、ユーザーがページと対話した場合に通常発生するすべてのイベントも発生せずに、"type"が識別された要素のコンテンツを単に置き換えるという事実に依存しています。 -"key*" の最後の直接呼び出しにより、JSハンドラーが期待どおりに起動します。 - -WebDriverBackedSeleniumを使用する場合、フォームフィールドに入力した結果は "exciting texttt" になります。 -期待したものではありません! -これは、WebDriverがユーザーの動作をより正確にエミュレートするため、ずっとイベントを発火させていたためです。 - -この同じ事実により、Selenium 1テストよりも早くページの読み込みが発生する場合があります。 -"StaleElementException"がWebDriverによってスローされた場合、これが発生したことを確認できます。 - -### WaitForPageToLoadがすぐに戻る - -ページの読み込みが完了したことを発見するのは難しい仕事です。 -"ロードイベントが発生したとき"、"すべてのAJAXリクエストが完了したとき"、"ネットワークトラフィックがないとき"、"document.readyStateが変更されたとき"、または他の全体的な何かを意味しますか? - -WebDriverは元のSeleniumの動作をシミュレートしようとしますが、これはさまざまな理由で常に完全に機能するとは限りません。 -最も一般的な理由は、ページの読み込みがまだ開始されていないことと、ページ呼び出しがメソッド呼び出し間で完了したことの違いを見分けることが難しいことです。 -これは、ページの読み込みが完了する前(または開始される前)に制御がテストに返されることを意味する場合があります。 - -これに対する解決策は、特定の何かを待つことです。 -一般的に、これは次にやり取りしたい要素、または特定の値に設定されるJavascript変数のためのものです。 -例えば、 - -```java -Wait wait = new WebDriverWait(driver, Duration.ofSeconds(30)); -WebElement element= wait.until(visibilityOfElementLocated(By.id("some_id"))); -``` - -"visibilityOfElementLocated" は次のように実装されます。 - -```java -public ExpectedCondition visibilityOfElementLocated(final By locator) { - return new ExpectedCondition() { - public WebElement apply(WebDriver driver) { - WebElement toReturn = driver.findElement(locator); - if (toReturn.isDisplayed()) { - return toReturn; - } - return null; - } - }; -} -``` - -これは複雑に見えるかもしれませんが、ほとんどすべての定型コードです。 -唯一の興味深い点は、 "apply" メソッドが "null" でもBoolean.FALSEでもないものを返すまで、 "ExpectedCondition" が繰り返し評価されることです。 - -もちろん、これらの "wait" 呼び出しをすべて追加すると、コードが混乱する可能性があります。 -その場合で、ニーズが単純な場合は、暗黙的な待機の使用を検討してください。 - -```java -driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); -``` - -これにより、要素が見つかるたびに、要素が存在しない場合は、存在するか、30秒が経過するまで位置が再試行されます。 - -### XPathまたはCSSセレクターによる検索は常に機能するとは限りませんが、Selenium1では機能します - -Selenium 1では、xpathがブラウザ自体の機能ではなく、バンドルされたライブラリを使用するのが一般的でした。 -代替手段がない限り、WebDriverは常にネイティブブラウザーメソッドを使用します。 -つまり、一部のブラウザでは複雑なxpath式が壊れる場合があります。 - -Selenium 1のCSSセレクターは、Sizzleライブラリを使用して実装されました。 -これにより、CSS Selector仕様のスーパーセットが実装され、どこで境界を越えたかが常に明確になるとは限りません。 -WebDriverBackedSeleniumを使用していて、要素の検索にCSSセレクターの代わりにSizzleロケーターを使用している場合、コンソールに警告が記録されます。 -特に要素を見つけることができないためにテストが失敗する場合、これらを探すのに時間をかける価値があります。 - -### Browserbotはありません - -Selenium RCはSelenium Coreに基づいていたため、Javascriptを実行すると、Selenium Coreの一部にアクセスして作業を簡単にすることができました。 -WebDriverはSelenium Coreに基づいていないため、これは不可能です。 -Selenium Coreを使用しているかどうかをどのように確認できますか? -シンプル! "getEval" または同様の呼び出しが、評価されたJavascriptで "selenium" または "browserbot" を使用しているかどうかを確認してください。 - -browserbotを使用して、テストの現在のウィンドウまたはドキュメントへのハンドルを取得している可能性があります。 -幸いなことに、WebDriverは常に現在のウィンドウのコンテキストでJSを評価するため、"ウィンドウ"または"ドキュメント"を直接使用できます。 - -または、Browserbotを使用して要素を見つけることもできます。 -WebDriverでは、これを行うためのイディオムは、最初に要素を見つけ、それを引数としてJavascriptに渡すことです。 -従って、 - -```java -String name = selenium.getEval( - "selenium.browserbot.findElement('id=foo', browserbot.getCurrentWindow()).tagName"); -``` - -このようになります。 - -```java -WebElement element = driver.findElement(By.id("foo")); -String name = (String) ((JavascriptExecutor) driver).executeScript( - "return arguments[0].tagName", element); -``` - -渡された "element" 変数が、JS標準の "arguments" 配列の最初の項目としてどのように表示されるかに注目してください。 - -### Executing Javascript Doesn't Return Anything - - -WebDriverのJavascriptExecutorは、すべてのJSをラップし、匿名式として評価します。 -これは、 "return" キーワードを使用する必要があることを意味します。 - -```java -String title = selenium.getEval("browserbot.getCurrentWindow().document.title"); -``` - -このようになります。 - -```java -((JavascriptExecutor) driver).executeScript("return document.title;"); -``` - diff --git a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.pt-br.md b/website_and_docs/content/documentation/legacy/selenium_2/upgrading.pt-br.md deleted file mode 100644 index 0ab58823ae4d..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.pt-br.md +++ /dev/null @@ -1,250 +0,0 @@ ---- -title: "Migrando do RC para WebDriver" -linkTitle: "Migrando do RC para WebDriver" -weight: 2 -aliases: [ -"/documentation/legacy/migrating_from_rc_to_webdriver/" -] ---- - - -## Como migrar para o Selenium WebDriver - - -Uma pergunta comum ao adotar o Selenium 2 é qual é a coisa certa a fazer -ao adicionar novos testes a um conjunto existente de testes? Usuários que são novos no -framework podem começar usando as novas APIs WebDriver para escrever seus testes. -Mas e os usuários que já possuem suítes de testes existentes? Este guia é -projetado para demonstrar como migrar seus testes existentes para as novas APIs, -permitindo que todos os novos testes sejam escritos usando os novos recursos oferecidos pelo WebDriver. - -O método apresentado aqui descreve uma migração gradativa para as APIs WebDriver sem precisar refazer tudo em um push massivo. Isso significa -que você pode permitir mais tempo para migrar seus testes existentes, que -pode tornar mais fácil para você decidir onde investir seu esforço. - -Este guia foi escrito em Java, porque tem o melhor suporte para -fazer a migração. À medida que fornecemos ferramentas melhores para outras linguagens, -este guia deve ser expandido para incluir essas linguagens. - - -## Porque migrar para o WebDriver - - -Mover um conjunto de testes de uma API para outra requer uma enorme -quantidade de esforço. Por que você e sua equipe considerariam fazer essa mudança? -Aqui estão alguns motivos pelos quais você deve considerar a migração de seus testes Selenium -para usar o WebDriver. - -* API menor e compacta. A API do WebDriver é mais orientada a objetos do que o -Selenium RC API original. Isso pode facilitar o trabalho. -* Melhor emulação das interações do usuário. Sempre que possível, o WebDriver faz -uso de eventos nativos para interagir com uma página da web. Imita melhor a maneira como seus usuários trabalham com seu site e aplicativos. Além do que, o -WebDriver oferece APIs de interações de usuário avançadas que permitem que você -modele interações complexas com seu site. -* Suporte de fornecedores de navegadores. Opera, Mozilla e Google são todos participantes ativos -do desenvolvimento do WebDriver, e cada um tem engenheiros trabalhando -para melhorar a estrutura. Frequentemente, isso significa que o suporte para WebDriver -está embutido no próprio navegador: seus testes são executados tão rápidos e estáveis quanto -possível. - - -## Antes de começar - - -A fim de tornar o processo de migração o mais indolor possível, -certifique-se de que todos os seus testes sejam executados corretamente com a versão mais recente do Selenium. -Isso pode parecer óbvio, mas é melhor que seja dito! - - -## Começando - - -A primeira etapa ao iniciar a migração é mudar a forma como você obtém -sua instância Selenium. Ao usar Selenium RC, isso é feito assim: - -```java -Selenium selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.yoursite.com"); -selenium.start(); -``` - -Isso deve ser substituído assim: - -```java -WebDriver driver = new FirefoxDriver(); -Selenium selenium = new WebDriverBackedSelenium(driver, "http://www.yoursite.com"); -``` - -## Próximos passos - - -Depois que seus testes forem executados sem erros, a próxima etapa é migrar -o código de teste real para usar as APIs WebDriver. Dependendo de quão bem você -abstrair o seu código, pode ser um processo curto ou longo. -Em ambos os casos, a abordagem é a mesma e pode ser resumida simplesmente: -modifique o código para usar a nova API quando for editá-lo. - -Se você precisar extrair a implementação WebDriver subjacente -da instância Selenium, você pode simplesmente fazer um cast para WrapsDriver: - -```java -WebDriver driver = ((WrapsDriver) selenium).getWrappedDriver(); -``` - -Isso permite que você continue passando a instância Selenium como -normal, mas desembrulhar a instância do WebDriver conforme necessário. - -Em algum ponto, sua base de código usará principalmente as APIs mais recentes. -Neste ponto, você pode inverter o relacionamento, usando WebDriver em tudo -e instanciar uma instância do Selenium sob demanda: - -```java -Selenium selenium = new WebDriverBackedSelenium(driver, baseUrl); -``` - -## Problemas comuns - - -Felizmente, você não é a primeira pessoa a passar por essa migração, -então, aqui estão alguns problemas comuns que outras pessoas viram e como resolvê-los. - - -### Clicar e digitar são mais completos - - -Um padrão comum em um teste de Selenium RC é ver algo como: - -```java -selenium.type("name", "exciting tex"); -selenium.keyDown("name", "t"); -selenium.keyPress("name", "t"); -selenium.keyUp("name", "t"); -``` - -Isso se baseia no fato de que o "tipo" simplesmente substitui o conteúdo do -elemento identificado sem também disparar todos os eventos que normalmente -seriam disparados se um usuário interagir com a página. As invocações diretas finais -de "key*" faz com que os manipuladores JS sejam acionados conforme o esperado. - -Ao usar o WebDriverBackedSelenium, o resultado do preenchimento do campo do formulário seria "exciting texttt": não o que você esperaria! -O motivo disso é que o WebDriver emula com mais precisão o comportamento do usuário, e assim terá disparado eventos o tempo todo. - -Esse mesmo fato às vezes pode fazer com que o carregamento da página seja disparado antes do que aconteceria em um teste de Selenium 1. -Você pode dizer que isso aconteceu se uma "StaleElementException" é lançada pelo WebDriver. - - -### WaitForPageToLoad retorna muito cedo - -Descobrir quando o carregamento de uma página está completo é uma tarefa complicada. Queremos dizer -"quando o evento de carregamento dispara", "quando todas as solicitações AJAX são concluídas", "quando -não há tráfego de rede "," quando document.readyState mudou" ou -outra coisa completamente diferente? - -WebDriver tenta simular o comportamento original do Selenium, mas isso não -sempre funciona perfeitamente por vários motivos. O motivo mais comum é que é -difícil dizer a diferença entre um carregamento de página que ainda não começou e um -carregamento da página concluído entre as chamadas de método. Isso às vezes significa que -o controle é devolvido ao seu teste antes que a página termine (ou mesmo comece!) -o carregamento. - -A solução para isso é esperar por algo específico. Normalmente, isso pode ser o elemento com o qual deseja interagir a seguir, ou para alguma variável Javascript -a ser definida com um valor específico. Um exemplo seria: - -```java -Wait wait = new WebDriverWait(driver, Duration.ofSeconds(30)); -WebElement element= wait.until(visibilityOfElementLocated(By.id("some_id"))); -``` - -Onde "visibilityOfElementLocated" é implementado como: - -```java -public ExpectedCondition visibilityOfElementLocated(final By locator) { - return new ExpectedCondition() { - public WebElement apply(WebDriver driver) { - WebElement toReturn = driver.findElement(locator); - if (toReturn.isDisplayed()) { - return toReturn; - } - return null; - } - }; -} -``` - -Isso pode parecer complexo, mas é quase todo um código padrão. O único interessante é que a "condição esperada" será avaliada repetidamente -até que o método "apply" retorne algo que não seja "null" -nem Boolean.FALSE. - -Claro, adicionar todas essas chamadas de "wait" pode confundir seu código. E se -esse é o caso, e suas necessidades são simples, considere usar as esperas implícitas: - -```java -driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); -``` - -Ao fazer isso, toda vez que um elemento é localizado, se o elemento não estiver presente, -o local é tentado novamente até que esteja presente ou até 30 segundos -passados. - -### Encontrar por seletores XPath ou CSS nem sempre funciona, mas funciona no Selenium 1 - -No Selenium 1, era comum para o xpath usar uma biblioteca agrupada em vez de -os recursos do próprio navegador. WebDriver sempre usará -os métodos nativos do navegador, a menos que não haja alternativa. Isso significa que expressões xpath complexas -podem falhar em alguns navegadores. - -Os seletores CSS no Selenium 1 foram implementados usando a biblioteca Sizzle. Esta biblioteca -implementa um superconjunto da CSS Selector Spec, e nem sempre é claro onde -você cruzou a linha. Se você estiver usando o WebDriverBackedSelenium e usar um -Localizador Sizzle em vez de um Seletor CSS para encontrar elementos, um aviso -ser registrado no console. Vale a pena procurar por eles, -particularmente se os testes estão falhando por não ser capaz de encontrar os elementos. - -### Não há nenhum Browserbot - -O Selenium RC era baseado no Selenium Core e, portanto, quando você executava -Javascript, você podia acessar bits do Selenium Core para tornar as coisas mais fáceis. -Como o WebDriver não é baseado no Selenium Core, isso não é mais possível. -Como você pode saber se está usando Selenium Core? Simples! Basta olhar para ver -se o seu "getEval" ou chamadas semelhantes usam "selenium" ou "browserbot" -no Javascript avaliado. - -Você pode estar usando o browserbot para obter um identificador para a janela atual -ou documento do teste. Felizmente, o WebDriver sempre avalia JS no -contexto da janela atual, então você pode usar "window" ou "document" diretamente. - -Como alternativa, você pode usar o browserbot para localizar elementos. -No WebDriver, o idioma para fazer isso é primeiro localizar o elemento, -e então passe isso como um argumento para o Javascript. Portanto: - -```java -String name = selenium.getEval( - "selenium.browserbot.findElement('id=foo', browserbot.getCurrentWindow()).tagName"); -``` - -se torna: - -```java -WebElement element = driver.findElement(By.id("foo")); -String name = (String) ((JavascriptExecutor) driver).executeScript( - "return arguments[0].tagName", element); -``` - -Observe como a variável "element" passada aparece como o primeiro item -na array de "arguments" padrão do JS. - - -### A execução de Javascript não retorna nada - - -O JavascriptExecutor do WebDriver envolverá todo o JS e o avaliará como uma expressão anônima. Isso significa que você precisa usar a palavra-chave "return": - -```java -String title = selenium.getEval("browserbot.getCurrentWindow().document.title"); -``` - -se torna: - -```java -((JavascriptExecutor) driver).executeScript("return document.title;"); -``` - diff --git a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.zh-cn.md b/website_and_docs/content/documentation/legacy/selenium_2/upgrading.zh-cn.md deleted file mode 100644 index f11265e73a9d..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.zh-cn.md +++ /dev/null @@ -1,261 +0,0 @@ ---- -title: "从RC迁移到WebDriver" -linkTitle: "从RC迁移到WebDriver" -weight: 2 -aliases: [ -"/documentation/legacy/migrating_from_rc_to_webdriver/" -] ---- - - -## 如何迁移到Selenium WebDriver - - -在采用Selenium 2时, 一个常见的问题是, -在将新测试添加到现有测试集中时, -正确的做法是什么? -刚接触框架的用户可以通过使用新的WebDriver API编写测试开始. -但是, 已经拥有一套现有测试的用户又该如何呢? -本指南旨在演示如何将现有测试迁移到新的API, -从而允许使用WebDriver提供的新功能编写所有新测试. - -此处介绍的方法描述了向WebDriver API的零星迁移, -而无需一次大刀阔斧地重新进行所有工作. -这意味着您可以留出更多时间来迁移现有测试, -这可以使您更轻松地决定将精力花在哪里. - -本指南使用Java编写, 因为它为迁移提供了最佳支持. -由于我们为其他语言提供了更好的工具, -因此本指南将扩展为包括这些语言. - - -## 为什么要迁移到WebDriver - - -将一组测试从一个API移到另一个API需要大量的工作. -为什么您和您的团队考虑采取此举? -这是您应考虑迁移Selenium测试以使用WebDriver的一些原因. - -* 较小, 紧凑的API. -WebDriver的API比原始的Selenium RC API更面向对象. -这样可以更轻松地使用. -* 更好地模拟用户交互. -WebDriver在可能的情况下利用本机事件与网页进行交互. -这更紧密地模仿了您的用户使用您的网站和应用程序的方式. -此外, WebDriver提供了高级的用户交互API, -使您可以为与网站的复杂交互建模. -* 浏览器供应商的支持. -Opera, Mozilla和Google都是WebDriver开发的积极参与者, -并且各自都有工程师致力于改善框架. -通常, 这意味着对WebDriver的支持已包含在浏览器本身中: -您的测试运行得尽可能快且稳定. - - -## 在开始之前 - - -为了使迁移过程尽可能轻松, -请确保所有测试都在最新的Selenium版本中正常运行. -这听起来似乎显而易见, 但是最好说一下! - - -## 开始上手 - - -开始迁移的第一步是更改获取Selenium实例的方式. -使用Selenium RC时, 就像这样: - -```java -Selenium selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://www.yoursite.com"); -selenium.start(); -``` - -应该这样替换: - -```java -WebDriver driver = new FirefoxDriver(); -Selenium selenium = new WebDriverBackedSelenium(driver, "http://www.yoursite.com"); -``` - -## 下一步 - - -一旦测试成功执行, 下一步就是迁移实际的测试代码以使用WebDriver API. -根据代码的抽象程度, -这可能是一个短暂的过程, 也可能是一个漫长的过程. -在这两种情况下, 方法都是相同的, -可以简单地总结一下:修改代码以在使用新API时进行编辑. - -如果您需要从Selenium实例中提取基础WebDriver实现, -则只需将其强制转换为WrapsDriver: - -```java -WebDriver driver = ((WrapsDriver) selenium).getWrappedDriver(); -``` - -这使您可以继续正常传递Selenium实例, -但可以根据需要解包WebDriver实例. - -有时, 您的代码库将主要使用较新的API. -此时, 您可以翻转关系, -使用WebDriver并按需实例化Selenium实例: - -```java -Selenium selenium = new WebDriverBackedSelenium(driver, baseUrl); -``` - -## 常见问题 - - -幸运的是, 您不是第一个进行此迁移的人, -因此这里有其他人已经看到的一些常见问题以及如何解决它们. - - -### 单击和键入更加完整 - - -Selenium RC测试中的常见模式如下所示: - -```java -selenium.type("name", "exciting tex"); -selenium.keyDown("name", "t"); -selenium.keyPress("name", "t"); -selenium.keyUp("name", "t"); -``` - -这依赖于以下事实: -"类型"仅替换所标识元素的内容, -而不触发用户与页面进行交互时通常会触发的所有事件. -最后的"key*"直接调用导致JS处理程序按预期方式触发. - -使用WebDriverBackedSelenium时, -填写表单字段的结果将是"exciting texttt": -并非您所期望的! -这样做的原因是WebDriver更准确地模拟了用户行为, -因此一直会触发事件. - -相同的事实有时可能会导致页面加载比Selenium 1测试中更早触发. -如果WebDriver抛出"StaleElementException", -您可以说这已经发生. - - -### WaitForPageToLoad很快返回 - -发现何时完成页面加载是一项艰巨的任务. -我们的意思是"何时触发加载事件", -"何时完成所有AJAX请求", -"何时没有网络流量", -"何时document.readyState发生更改" -或其他所有内容? - -WebDriver试图模拟原始的Selenium行为, -但是由于种种原因, 这种方法并不总是能完美发挥作用. -最常见的原因是, 很难区分在尚未开始的页面加载与在方法调用之间完成的页面加载之间的区别. -有时这意味着在页面完成(甚至开始!)加载之前, 控件已返回测试. - -解决方案是等待特定的东西. -通常, 这可能是您想与之交互的元素, -或者是将某些Javascript变量设置为特定值. -一个例子是: - -```java -Wait wait = new WebDriverWait(driver, Duration.ofSeconds(30)); -WebElement element= wait.until(visibilityOfElementLocated(By.id("some_id"))); -``` - -其中"visibilityOfElementLocated"实现为: - -```java -public ExpectedCondition visibilityOfElementLocated(final By locator) { - return new ExpectedCondition() { - public WebElement apply(WebDriver driver) { - WebElement toReturn = driver.findElement(locator); - if (toReturn.isDisplayed()) { - return toReturn; - } - return null; - } - }; -} -``` - -这看起来很复杂, 但这几乎是所有样板代码. -唯一有趣的一点是, 将反复评估"ExpectedCondition", -直到"apply"方法返回的结果既不是"null" -也不是Boolean.FALSE. - -当然, 添加所有这些"等待"调用可能会使您的代码混乱. -如果是这样, 并且您的需求很简单, 请考虑使用隐式等待: - -```java -driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); -``` - -这样, 每次定位某个元素时(如果不存在该元素), -都会重试该位置, 直到该元素存在或经过30秒为止. - -### 通过XPath或CSS选择器查找并不总是可行, 但在Selenium 1中却可以 - -在Selenium 1中, xpath通常使用捆绑的库而不是浏览器本身的功能. -除非没有其他选择, 否则WebDriver将始终使用本机浏览器方法. -这意味着复杂的xpath表达式可能会在某些浏览器上中断. - -Selenium 1中的CSS选择器是使用Sizzle库实现的. -这实现了CSS Selector规范的超集, -而且并不总是清楚您越界的位置. -如果您使用的是WebDriverBackedSelenium, -并且使用Sizzle定位器而不是CSS选择器来查找元素, -则会在控制台上记录一条警告. -值得花时间去寻找这些东西, -尤其是如果由于找不到元素而导致测试失败时. - -### 没有Browserbot - -Selenium RC是基于Selenium Core的, -因此, 当您执行Javascript时, -可以访问Selenium Core的某些部分以使事情变得容易. -由于WebDriver不基于Selenium Core, 因此不再可能. -如何判断您是否正在使用Selenium Core?简单! -只要看看您的"getEval"或类似调用是否在评估的Javascript中使用"Selenium"或"browserbot". - -您可能正在使用browserbot获取测试的当前窗口或文档的句柄. -幸运的是, WebDriver总是在当前窗口的上下文中评估JS, -因此您可以直接使用"window"或"document". - -另外, 您可能正在使用browserbot查找元素. -在WebDriver中, 这样做的习惯是首先找到该元素, -然后将其作为参数传递给Javascript. -从而: - -```java -String name = selenium.getEval( - "selenium.browserbot.findElement('id=foo', browserbot.getCurrentWindow()).tagName"); -``` - -变成: - -```java -WebElement element = driver.findElement(By.id("foo")); -String name = (String) ((JavascriptExecutor) driver).executeScript( - "return arguments[0].tagName", element); -``` - -请注意, 传入的"element"变量如何显示为JS标准"arguments"数组中的第一项. - - -### 执行JavaScript不会返回任何内容 - - -WebDriver的JavascriptExecutor将包装所有JS并将其评估为匿名表达式. -这意味着您需要使用"return"关键字: - -```java -String title = selenium.getEval("browserbot.getCurrentWindow().document.title"); -``` - -变成: - -```java -((JavascriptExecutor) driver).executeScript("return document.title;"); -``` - diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.en.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_3.en.md index ddcb5973bcdf..91e0ac92c6c0 100644 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.en.md +++ b/website_and_docs/content/documentation/legacy/selenium_3/grid_3.en.md @@ -10,7 +10,13 @@ aliases: [ "/documentation/legacy/grid_3", "/documentation/ja/grid/grid_3/", "/documentation/pt-br/grid/grid_3/", -"/documentation/zh-cn/grid/grid_3/" +"/documentation/zh-cn/grid/grid_3/", +"/ja/documentation/legacy/grid_3", +"/ja/documentation/legacy/selenium_3/grid_3/", +"/pt-br/documentation/legacy/grid_3", +"/pt-br/documentation/legacy/selenium_3/grid_3/", +"/zh-cn/documentation/legacy/grid_3", +"/zh-cn/documentation/legacy/selenium_3/grid_3/" ] --- You can read our documentation for more information about [Grid 4]({{< ref "/documentation/grid" >}}) diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.ja.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_3.ja.md deleted file mode 100644 index 4f59d6548068..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.ja.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: "Grid 3" -linkTitle: "Grid 3" -weight: 2 -description: > - Selenium Grid 3 supported WebDriver without Selenium RC code. - Grid 3 was completely rewritten for the new Grid 4. -aliases: [ -"/documentation/legacy/grid_3" -] ---- - -[Grid 4]({{< ref "/documentation/grid" >}}) - -_Selenium Grid_ は、SeleniumテストがコマンドをリモートWebブラウザーインスタンスにルーティングできるようにする賢いプロキシサーバーです。 -その目的は、複数のマシンで並行してテストを実行する簡単な方法を提供することです。 - -Selenium Gridでは、1つのサーバーが、JSON形式のテストコマンドを1つ以上の登録済みのグリッドノードにルーティングするハブとして機能します。 -テストはハブに接続して、リモートブラウザーインスタンスへのアクセスを取得します。 -ハブには、アクセスを提供する登録済みサーバーのリストがあり、これらのインスタンスを制御できます。 - -Selenium Gridを使用すると、複数のマシンで並行してテストを実行し、さまざまなブラウザーバージョンとブラウザー構成を(個々のテストではなく)一元的に管理できます。 - -Selenium Gridは特効薬ではありません。 -一般的な委譲および配布の問題のサブセットを解決しますが、たとえばインフラストラクチャを管理せず、特定のニーズに適さない場合があります。 diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.pt-br.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_3.pt-br.md deleted file mode 100644 index 2042510a4b3a..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.pt-br.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -title: "Grid 3" -linkTitle: "Grid 3" -weight: 2 -description: > - Selenium Grid 3 supported WebDriver without Selenium RC code. - Grid 3 was completely rewritten for the new Grid 4. -aliases: [ -"/documentation/legacy/grid_3" -] ---- - -[Grid 4]({{< ref "/documentation/grid" >}}) - -_Selenium Grid_ é um servidor proxy inteligente -que permite que os testes Selenium encaminhem comandos para instâncias remotas do navegador da web. -Seu objetivo é fornecer uma maneira fácil de executar testes em paralelo em várias máquinas. - -Com Selenium Grid, -um servidor atua como o hub que roteia comandos de teste formatados em JSON -para um ou mais nós registrados. -Os testes entram em contato com o hub para obter acesso a instâncias remotas do navegador. -O hub tem uma lista de servidores registrados aos quais fornece acesso, -e permite o controle dessas instâncias. - -Selenium Grid nos permite executar testes em paralelo em várias máquinas, -e gerenciar diferentes versões e configurações do navegador centralmente -(em vez de em cada teste individual). - -Selenium Grid não é uma bala de prata. -Ele resolve um subconjunto de problemas comuns de delegação e distribuição, -mas não irá, por exemplo, gerenciar sua infraestrutura, -e pode não atender às suas necessidades específicas. - diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.zh-cn.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_3.zh-cn.md deleted file mode 100644 index f4ccaabda42d..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.zh-cn.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: "服务网格 3" -linkTitle: "服务网格 3" -weight: 2 -description: > - Selenium Grid 3 supported WebDriver without Selenium RC code. - Grid 3 was completely rewritten for the new Grid 4. -aliases: [ -"/documentation/legacy/grid_3" -] ---- - -[服务网格 4]({{< ref "/documentation/grid" >}}) - -{{% pageinfo color="warning" %}} -

- - Most of the documentation found in this section is still in English. - Please note we are not accepting pull requests to translate this content - as translating documentation of legacy components does not add value to - the community nor the project. -

-{{% /pageinfo %}} - - -_Selenium服务网格_ 是一个能够让Selenium的测试把命令传送到一个远程浏览器实例的职能代理服务器。 -他的目的是提供一个简便的方法来在多台终端上并行的执行测试任务。 - -在Selenium服务网格, -一台服务器作为转发器(hub)将JSON格式的测试命令转发到1台或多台注册的节点。 -测试任务通过跟转发器(hub)的交互来操作远端浏览器实例。 -转发器(hub)维护了一个可供使用的注册服务器列表,也允许我们通过转发器(hub)来控制这些实例。 - -Selenium服务网格允许我们在多台节点服务器上并行执行测试, -同时也中心化的管理多个浏览器版本,多种浏览器的配置。(以替代传统的基于个人的测试) - -Selenium服务网格并不是万能的(silver bullet)。 -它能够解决一些通用的代理问题和分布式的问题,但是并不能管理你的硬件,也可能不适合你的一些特殊需求。 diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.en.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_components.en.md index 2318cbf97473..87a267ce3732 100644 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.en.md +++ b/website_and_docs/content/documentation/legacy/selenium_3/grid_components.en.md @@ -9,7 +9,10 @@ aliases: [ "/documentation/legacy/grid_3/components_of_a_grid/", "/documentation/ja/grid/grid_3/components_of_a_grid/", "/documentation/pt-br/grid/grid_3/components_of_a_grid/", -"/documentation/zh-cn/grid/grid_3/components_of_a_grid/" +"/documentation/zh-cn/grid/grid_3/components_of_a_grid/", +"/ja/documentation/legacy/selenium_3/grid_components/", +"/pt-br/documentation/legacy/selenium_3/grid_components/", +"/zh-cn/documentation/legacy/selenium_3/grid_components/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.ja.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_components.ja.md deleted file mode 100644 index bcddc67001bd..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.ja.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: "グリッドのコンポーネント" -linkTitle: "グリッドのコンポーネント" -weight: 6 -description: > - Description of Hub and Nodes for Grid 3. ---- - -{{< figure src="/images/documentation/legacy/grid_3/grid.png" class="img-responsive text-center" alt="Grid 3 Components">}} - -## ハブ -* 仲介者およびマネージャー -* テストを実行する要求を受け入れます -* クライアントから命令を受け取り、ノード上でリモートで実行します -* スレッドを管理します - -_ハブ_ は、すべてのテストが送信される中心点です。 -各Selenium Gridは、ちょうど1つのハブで構成されます。 -ハブは、それぞれのクライアント(CIサーバー、開発者マシンなど)から到達可能である必要があります。 -ハブは、テストが委任される1つ以上のノードを接続します。 - -## ノード - -* ブラウザが存在する場所 -* ハブに自分自身を登録し、その機能を伝えます -* ハブからリクエストを受信して実行します - -_ノード_ は、個々のコンピューターシステムでテストを実行するさまざまなSeleniumインスタンスです。 -グリッドには多くのノードが存在する場合があります。 -ノードであるマシンは、ハブまたは他のノードと同じプラットフォームであったり、同じブラウザーを選定する必要はありません。 -Windows上のノードは、Internet Explorerをブラウザーオプションとして提供する機能を備えている場合がありますが、これはLinuxまたはMacでは不可能です。 diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.pt-br.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_components.pt-br.md deleted file mode 100644 index 56063b18e0bd..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.pt-br.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: "Componentes" -linkTitle: "Grid Components" -weight: 6 -description: > - Description of Hub and Nodes for Grid 3. ---- - -{{< figure src="/images/documentation/legacy/grid_3/grid.png" class="img-responsive text-center" alt="Grid 3 Components">}} - -## Hub -* Intermediário e gerente -* Aceita solicitações para executar testes -* Recebe instruções do cliente e as executa remotamente nos nós -* Gerencia tópicos - -Um _Hub_ é um ponto central para onde todos os seus testes são enviados. -Cada Selenium Grid consiste em exatamente um hub. O hub precisa estar acessível -dos respectivos clientes (ou seja, servidor de CI, máquina do desenvolvedor etc.) -O hub irá conectar um ou mais nós -aos quais os testes serão delegados. - -## Nós - -* Onde vivem os navegadores -* Registra-se no hub e comunica seus recursos -* Recebe solicitações do hub e as executa - -_Nodes_ são diferentes instâncias do Selenium -que executarão testes em sistemas de computador individuais. -Pode haver muitos nós em uma grade. -As máquinas que são nós não precisam ser da mesma plataforma -ou ter a mesma seleção de navegador do hub ou de outros nós. -Um nó no Windows pode ter a capacidade de -oferecer o Internet Explorer como uma opção de navegador, -considerando que isso não seria possível no Linux ou Mac. - diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.zh-cn.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_components.zh-cn.md deleted file mode 100644 index 636c8588930f..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.zh-cn.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: "服务网格的组件" -linkTitle: "服务网格的组件" -weight: 6 -description: > - Description of Hub and Nodes for Grid 3. ---- - -{{< figure src="/images/documentation/legacy/grid_3/grid.png" class="img-responsive text-center" alt="Grid 3 Components">}} - -## 转发器(hub) -* 中间人和管理者 -* 接受请求 执行测试任务 -* 接受客户端的指示并在远程节点上执行任务 -* 管理进程 - -_转发器(hub)_ 是一个接受所有所有测试任务的中心节点。 -每个Selenium服务网格包含一个转发器(hub)。转发器(hub)需要能被所有的客户机(比如:持续集成服务器,开发机等等)访问到。 -转发器(hub)会连接1个或者多个节点,这些节点会代理执行测试任务。 - -## 节点 - -* 浏览器会被安装在节点上 -* 节点会把自己注册在转发器(hub)上并申报自己作为测试代理的能力(有些什么浏览器,每个浏览器可以运行几个实例等等) -* 接受转发器(hub)的指示并执行这些指示 - -_节点_ 和不同的Selenium实例,他们能够在特定的计算机系统上执行测试。 -一个服务网格中可以有很多节点。 -这些终端设备并不需要使用统一的平台(或者说操作系统)也不需要选择相同的浏览器。 -一个Windows节点可以提供IE作为一个浏览器选项来执行测试,然而Linux和MAC是不可能提供的。 - diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.en.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.en.md index 5b8e5390cbcc..9295d72ba9bc 100644 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.en.md +++ b/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.en.md @@ -9,7 +9,13 @@ aliases: [ "/documentation/legacy/grid_3/setting_up_your_own_grid/", "/documentation/ja/grid/grid_3/setting_up_your_own_grid/", "/documentation/pt-br/grid/grid_3/setting_up_your_own_grid/", -"/documentation/zh-cn/grid/grid_3/setting_up_your_own_grid/" +"/documentation/zh-cn/grid/grid_3/setting_up_your_own_grid/", +"/ja/documentation/legacy/grid_3/setting_up_your_own_grid/", +"/ja/documentation/legacy/selenium_3/grid_setup/", +"/pt-br/documentation/legacy/grid_3/setting_up_your_own_grid/", +"/pt-br/documentation/legacy/selenium_3/grid_setup/", +"/zh-cn/documentation/legacy/grid_3/setting_up_your_own_grid/", +"/zh-cn/documentation/legacy/selenium_3/grid_setup/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.ja.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.ja.md deleted file mode 100644 index 77f0d0f4b63b..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.ja.md +++ /dev/null @@ -1,203 +0,0 @@ ---- -title: "独自のグリッドを設定する" -linkTitle: "独自のグリッドを設定する" -weight: 4 -description: > - Quick start guide for setting up Grid 3. -aliases: [ -"/documentation/legacy/grid_3/setting_up_your_own_grid/" -] ---- - - -Selenium Gridを使用するには、ノード用の独自のインフラストラクチャを維持する必要があります。 -これは面倒で時間のかかる作業になる可能性があるため、多くの組織はこのインフラストラクチャを提供するためにAmazon EC2やGoogle ComputeなどのIaaSプロバイダーを使用しています。 - -他の選択肢として、クラウドのサービスとしてSelenium Gridを提供するSauce LabsやTesting Botなどのプロバイダーの使うこともできます。 -独自のハードウェアでノードを実行することも確かに可能です。 -この章では、独自のノードインフラストラクチャを備えた独自のグリッドを実行するオプションについて詳しく説明します。 - -## クイックスタート - -この例では、Selenium 2グリッドハブを起動し、WebDriverノードとSelenium 1 RCレガシーノードの両方を登録する方法を示します。 また、Javaからグリッドを呼び出す方法も示します。 -ここでは、ハブとノードが同じマシンで実行されていますが、もちろん、selenium-server-standaloneを複数のマシンにコピーできます。 - -`selenium-server-standalone`パッケージには、グリッドの実行に必要なハブ、WebDriver、およびレガシーRCが含まれています。 _ant_ はもう必要ありません。 -`selenium-server-standalone.jar`は [https://selenium.dev/downloads/](https://selenium.dev/downloads/) からダウンロードできます。 - -### ステップ1:ハブを開始する - -ハブは、テストリクエストを受信し、それらを適切なノードに配布する中心点です。 -配布は機能ベースで行われます。 -つまり、一連の機能を必要とするテストは、その機能セットまたは機能のサブセットを提供するノードにのみ配布されます。 - -テストのDesiredCapabilitiesは、 _任意の_ を意味するため、ハブはDesiredCapabilitiesの設定に完全に一致するノードを見つけることを保証できません。 - -コマンドプロンプトを開き、`selenium-server-standalone.jar`ファイルをコピーしたディレクトリに移動します。 ハブを起動するには、`-role hub`フラグをスタンドアロンサーバーに渡します。 - -```shell -java -jar selenium-server-standalone.jar -role hub -``` - -ハブはデフォルトでポート4444をリッスンします。 ブラウザーウィンドウを開いて [http://localhost:4444/grid/console](http://localhost:4444/grid/console) に移動すると、ハブのステータスを表示できます。 - -デフォルトのポートを変更するには、コマンドを実行するときにリッスンするポートを表す整数を持つオプションの `-port` フラグを追加できます。 -また、JSON構成ファイル(以下を参照)に表示される他のすべてのオプションは、可能なコマンドラインフラグです。 - -確かに上記の簡単なコマンドだけでうまくいくことができますが、より高度な構成が必要な場合は、JSON形式の構成ファイルを指定して、開始時にハブを構成することもできます。 -JSON形式の構成ファイルを指定して開始時にハブを構成する方法は以下のとおりです。 - -```shell -java -jar selenium-server-standalone.jar -role hub -hubConfig hubConfig.json -debug -``` - -以下に、 `hubConfig.json` ファイルの例を示します。 -ステップ2でノード構成ファイルを提供する方法について詳しく説明します。 - -```json -{ - "_comment" : "Configuration for Hub - hubConfig.json", - "host": ip, - "maxSession": 5, - "port": 4444, - "cleanupCycle": 5000, - "timeout": 300000, - "newSessionWaitTimeout": -1, - "servlets": [], - "prioritizer": null, - "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher", - "throwOnCapabilityNotPresent": true, - "nodePolling": 180000, - "platform": "WINDOWS"} -``` - - -### ステップ2:ノードを起動する - -新しいWebDriver機能を備えたグリッドを実行するか、Selenium 1 RC機能を備えたグリッドを実行するか、または両方を同時に実行するかに関係なく、同じ `selenium-server-standalone.jar` ファイルを使用してノードを起動します。 - -```shell -java -jar selenium-server-standalone.jar -role node -hub http://localhost:4444 -``` - -`-port` フラグでポートが指定されていない場合、空いているポートが選択されます。 -1台のマシンで複数のノードを実行できますが、実行する場合は、システムメモリリソースとスクリーンショットの問題をテストで確認する必要があることに注意する必要があります。 - -#### オプションを使用したノード構成 - -前述のように、下位互換性のために、"wd"および"rc"ロールは"node"ロールの有効なサブセットのままです。 -ただし、これらのロールは、対応するAPIへのリモート接続の種類を制限し、"node"はRCとWebDriverの両方のリモート接続を許可します。 - -コマンドラインでもJVMプロパティを( _-jar引数の前に_ `-D`フラグを使用して)渡すと、これらが取得され、ノードに伝播されます。 - -`-Dwebdriver.chrome.driver=chromedriver.exe` - - -#### JSONを使用したノード構成 - -JSON設定ファイルで構成されたグリッドノードを起動することもできます。 - -```shell -java -Dwebdriver.chrome.driver=chromedriver.exe -jar selenium-server-standalone.jar -role node -nodeConfig node1Config.json -``` - -そして、これは `nodeConfig.json` ファイルの例です。 - -```json -{ - "capabilities": [ - { - "browserName": "firefox", - "acceptSslCerts": true, - "javascriptEnabled": true, - "takesScreenshot": false, - "firefox_profile": "", - "browser-version": "27", - "platform": "WINDOWS", - "maxInstances": 5, - "firefox_binary": "", - "cleanSession": true - }, - { - "browserName": "chrome", - "maxInstances": 5, - "platform": "WINDOWS", - "webdriver.chrome.driver": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe" - }, - { - "browserName": "internet explorer", - "maxInstances": 1, - "platform": "WINDOWS", - "webdriver.ie.driver": "C:/Program Files (x86)/Internet Explorer/iexplore.exe" - } - ], - "configuration": { - "_comment" : "Configuration for Node", - "cleanUpCycle": 2000, - "timeout": 30000, - "proxy": "org.openqa.grid.selenium.proxy.WebDriverRemoteProxy", - "port": 5555, - "host": ip, - "register": true, - "hubPort": 4444, - "maxSession": 5 - } -} -``` - -`-host` フラグに関する注意 - -ハブとノードの両方で、`-host`フラグが指定されていない場合、デフォルトで`0.0.0.0`を使用します。 -これにより、マシンのすべてのパブリック(非ループバック)IPv4インターフェイスにバインドされます。 -特別なネットワーク構成または追加のネットワークインターフェイスを作成するコンポーネントがある場合は、`-host`フラグにハブ/ノードが別のマシンから到達できる値を設定することをお勧めします。 - -#### ポートを指定する - -ハブで使用されるデフォルトのTCP / IPポートは4444です。 -ポートを変更する必要がある場合は、上記の構成を使用してください。 - -## トラブルシューティング - -### ログファイルを使用する -高度なトラブルシューティングのために、システムメッセージを記録するログファイルを指定できます。 -log引数を使用してSelenium GRIDハブまたはノードを起動します。 -以下の例をご覧ください。 - -```shell -java -jar selenium-server-standalone.jar -role hub -log log.txt -``` - -お気に入りのテキストエディターを使用してログファイル(上記の例ではlog.txt)を開き、問題が発生した場合に"エラー"ログを見つけます。 - -### `-debug` 引数を使用する - --debug引数を使用して、デバッグログをコンソールに出力することもできます。 -`-debug` 引数を使用してSeleniumグリッドハブまたはノードを起動します。 -以下の例をご覧ください。 - -```shell -java -jar selenium-server-standalone.jar -role hub -debug -``` - -## 警告 - -Selenium Gridは、適切なファイアウォールアクセス許可を使用して外部アクセスから保護する必要があります。 - -グリッドを保護しないと、次の1つ以上が発生する可能性があります。 - -* グリッドインフラストラクチャへのオープンアクセスを提供します。 -* サードパーティが内部Webアプリケーションおよびファイルにアクセスすることを許可します。 -* サードパーティにカスタムバイナリの実行を許可します。 - -[Detectify](//labs.detectify.com) に関するこのブログ投稿をご覧ください。 -これは、公開されたグリッドが悪用される可能性のある概要を示しています。 [Don't Leave your Grid Wide Open](//labs.detectify.com/2017/10/06/guest-blog-dont-leave-your-grid-wide-open/) - -## Docker Selenium -[Docker](//www.docker.com/) は、コンテナと呼ばれる単位でSelenium Gridインフラストラクチャをプロビジョニングおよびスケーリングする便利な方法を提供します。 -コンテナは、さまざまなマシンで信頼性と再現性のある方法で、すべての依存関係を含む目的のアプリケーションを実行するために必要なすべてを含むソフトウェアの標準化されたユニットです。 - -Seleniumプロジェクトは、ダウンロードして実行して作業用グリッドを迅速に起動および実行できる一連のDockerイメージを保持しています。 ノードはFirefoxとChromeの両方で使用できます。 -グリッドのプロビジョニング方法の詳細は、 [Docker Selenium](//github.com/SeleniumHQ/docker-selenium) リポジトリ内にあります。 - -### 前提条件 -グリッドを実行するための唯一の要件は、Dockerをインストールして動作させることです。 -[Dockerのインストール](//www.docker.com/products/docker-desktop). diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.pt-br.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.pt-br.md deleted file mode 100644 index e213ee1462fe..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.pt-br.md +++ /dev/null @@ -1,256 +0,0 @@ ---- -title: "Configurando a sua" -linkTitle: "Configurando a sua" -weight: 4 -description: > - Quick start guide for setting up Grid 3. -aliases: [ -"/documentation/legacy/grid_3/setting_up_your_own_grid/" -] ---- - -Para usar Selenium Grid, -você precisa manter sua própria infraestrutura para os nós. -Como isso pode ser um esforço pesado e intenso, -muitas organizações usam provedores IaaS -como Amazon EC2 e Google Compute -para fornecer essa infraestrutura. - -Outras opções incluem o uso de provedores como Sauce Labs ou Testing Bot -que fornecem uma Selenium Grid como um serviço na nuvem. -Certamente também é possível executar nós em seu próprio hardware. -Este capítulo entrará em detalhes sobre a opção de executar sua própria Grid, -completo com sua própria infraestrutura de nós. - - -## Início - -Este exemplo mostrará como iniciar o Selenium 2 Grid Hub, -e registrar um nó WebDriver e um nó legado Selenium 1 RC. -Também mostraremos como chamar a Grid a partir do Java. -O hub e os nós são mostrados aqui em execução na mesma máquina, -mas é claro que você pode copiar o selenium-server-standalone para várias máquinas. - -O pacote `selenium-server-standalone` inclui o hub, -WebDriver e RC legado necessários para executar o Grid, -_ant_ não é mais necessário. -Você pode baixar o `selenium-server-standalone.jar` de -[https://selenium.dev/downloads/](https://selenium.dev/downloads/). - - -### Passo 1: Inicialize o Hub - -O Hub é o ponto central que receberá solicitações de teste -e os distribuirá para os nós certos. -A distribuição é feita com base em recursos, -significando que um teste que requer um conjunto de recursos -só será distribuído para nós que oferecem esse conjunto ou subconjunto de recursos. - -Porque os recursos desejados de um teste são apenas o que o nome indica, _desired_, -o hub não pode garantir que localizará um nó -corresponder totalmente ao conjunto de recursos desejados solicitados. - -Abra um prompt de comando -e navegue até o diretório onde você copiou -o arquivo `selenium-server-standalone.jar`. -Você inicia o hub passando a sinalização `-role hub` -para o servidor autônomo: - -```shell -java -jar selenium-server-standalone.jar -role hub -``` - -The Hub will listen to port 4444 by default. -You can view the status of the hub by opening a browser window and navigating to -[http://localhost:4444/grid/console](http://localhost:4444/grid/console). - -Para alterar a porta padrão, -você pode adicionar a flag opcional `-port` -com um número inteiro representando a porta a ser ouvida quando você executa o comando. -Além disso, todas as outras opções que você vê no arquivo de configuração JSON (veja abaixo) -são possíveis flags de linha de comando. - -Você certamente pode sobreviver apenas com o comando simples mostrado acima, -mas se você precisar de uma configuração mais avançada, -você também pode especificar um arquivo de configuração de formato JSON, por conveniência, -para configurar o hub ao iniciá-lo. -Você pode fazer assim: - -```shell -java -jar selenium-server-standalone.jar -role hub -hubConfig hubConfig.json -debug -``` - -Abaixo você verá um exemplo de um arquivo `hubConfig.json`. -Entraremos em mais detalhes sobre como fornecer arquivos de configuração de nó no Passo 2. - -```json -{ - "_comment" : "Configuration for Hub - hubConfig.json", - "host": ip, - "maxSession": 5, - "port": 4444, - "cleanupCycle": 5000, - "timeout": 300000, - "newSessionWaitTimeout": -1, - "servlets": [], - "prioritizer": null, - "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher", - "throwOnCapabilityNotPresent": true, - "nodePolling": 180000, - "platform": "WINDOWS"} -``` - - -### Pasos 2: Inicialize os Nós - -Independentemente de você querer executar uma Grid com a nova funcionalidade WebDriver, -ou uma Grid com funcionalidade Selenium 1 RC, -ou os dois ao mesmo tempo, -você usa o mesmo arquivo `selenium-server-standalone.jar` para iniciar os nós: - -```shell -java -jar selenium-server-standalone.jar -role node -hub http://localhost:4444 -``` - -Se uma porta não for especificada por meio do sinalizador `-port`, -uma porta livre será escolhida. Você pode executar vários nós em uma máquina -mas se você fizer isso, você precisa estar ciente dos recursos de memória de seus sistemas -e problemas com capturas de tela se seus testes as fizerem. - - -#### Configuração de um nó com opções - -Como mencionado, para compatibilidade com versões anteriores -as funções “wd” e “rc” ainda são um subconjunto válido da função “node”. -Mas essas funções limitam os tipos de conexões remotas para sua API correspondente, -enquanto “node” permite conexões remotas RC e WebDriver. - -Ao passar propriedades JVM (usando o sinalizador `-D` -_antes do argumento -jar_) -na linha de comando também, -estas serão coletadas e propagadas para os nós: - -`-Dwebdriver.chrome.driver=chromedriver.exe` - - -#### Configuração de um nó com JSON - -Você também pode iniciar nós da Grid que estão configurados -com um arquivo de configuração JSON - -```shell -java -Dwebdriver.chrome.driver=chromedriver.exe -jar selenium-server-standalone.jar -role node -nodeConfig node1Config.json -``` - -E aqui está um exemplo do arquivo `nodeConfig.json`: - -```json -{ - "capabilities": [ - { - "browserName": "firefox", - "acceptSslCerts": true, - "javascriptEnabled": true, - "takesScreenshot": false, - "firefox_profile": "", - "browser-version": "27", - "platform": "WINDOWS", - "maxInstances": 5, - "firefox_binary": "", - "cleanSession": true - }, - { - "browserName": "chrome", - "maxInstances": 5, - "platform": "WINDOWS", - "webdriver.chrome.driver": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe" - }, - { - "browserName": "internet explorer", - "maxInstances": 1, - "platform": "WINDOWS", - "webdriver.ie.driver": "C:/Program Files (x86)/Internet Explorer/iexplore.exe" - } - ], - "configuration": { - "_comment" : "Configuration for Node", - "cleanUpCycle": 2000, - "timeout": 30000, - "proxy": "org.openqa.grid.selenium.proxy.WebDriverRemoteProxy", - "port": 5555, - "host": ip, - "register": true, - "hubPort": 4444, - "maxSession": 5 - } -} -``` - -Uma observação sobre a flag `-host` - -Para hub e nó, se a flag `-host` não for especificada, -`0.0.0.0` será usado por padrão. Isso se ligará a todos as -interfaces IPv4 públicas (sem loopback) da máquina. -Se você tem uma configuração especial de rede ou qualquer -componente que crie interfaces de rede extras, -é aconselhável definir a flag `-host` com um valor que permite o -hub / nó acessível a partir de uma máquina diferente. - -#### Especificando a porta - -A porta TCP / IP padrão usada pelo hub é 4444. Se você precisar alterar a porta -use as configurações mencionadas acima. - -## Solução de problemas - -### Usando um arquivo de log -Para solução de problemas avançada, você pode especificar um arquivo de log para registrar mensagens do sistema. -Inicie o hub ou nó Selenium Grid com o argumento -log. Por favor, veja o exemplo abaixo: - -```shell -java -jar selenium-server-standalone.jar -role hub -log log.txt -``` - -Use o seu editor de texto favorito para abrir o arquivo de log (log.txt no exemplo acima) para encontrar -registros de "ERROR" se você tiver problemas. - -### Usando o argumento `-debug` - -Você também pode usar o argumento `-debug` para imprimir logs de depuração no console. -Inicie o Selenium Grid Hub ou Node com o argumento `-debug`. Por favor, veja -o exemplo abaixo: - -```shell -java -jar selenium-server-standalone.jar -role hub -debug -``` - -## Aviso - -A Selenium Grid deve ser protegida do acesso externo usando -permissões de firewall. - -A falha em proteger sua rede pode resultar em um ou mais dos seguintes eventos: - -* Você fornece acesso aberto à sua infraestrutura de rede -* Você permite que terceiros acessem aplicativos e arquivos internos da web -* Você permite que terceiros executem binários personalizados - -Veja esta postagem do blog em [Detectify](//labs.detectify.com), que dá uma boa -visão geral de como uma rede exposta publicamente pode ser mal utilizada: -[Não deixe sua grade totalmente aberta](//labs.detectify.com/2017/10/06/guest-blog-dont-leave-your-grid-wide-open/). - - -## Docker Selenium -[Docker](//www.docker.com/) fornece uma maneira conveniente de -provisionar e escalar a infraestrutura da Selenium Grid em uma unidade conhecida como contêiner. -Os contêineres são unidades padronizadas de software que contêm tudo o que é necessário -para executar o aplicativo desejado, incluindo todas as dependências, de forma confiável e repetível em máquinas diferentes. - -O projeto Selenium mantém um conjunto de imagens Docker que você pode baixar -e executar para colocar uma Grid em funcionamento rapidamente. Os nós estão disponíveis para -Firefox e Chrome. Detalhes completos de como provisionar uma grade podem ser encontrados -no repositório [Docker Selenium](//github.com/SeleniumHQ/docker-selenium). - -### Pré-requisitos -O único requisito para executar um Grid é ter o Docker instalado e funcionando. -[Instale o Docker] (// www.docker.com/products/docker-desktop). diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.zh-cn.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.zh-cn.md deleted file mode 100644 index 3d4456339623..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.zh-cn.md +++ /dev/null @@ -1,206 +0,0 @@ ---- -title: "配置自己的服务网格" -linkTitle: "配置自己的服务网格" -weight: 4 -description: > - Quick start guide for setting up Grid 3. -aliases: [ -"/documentation/legacy/grid_3/setting_up_your_own_grid/" -] ---- - -使用Selenium网格, -你需要维护你自己的基础设置来作为节点使用, -这将是一个繁重的紧张的工作,很多组织使用IaaS供应商比如Amazon EC2或者Google来提供这些基础设施。 - -使用Sauce Labs或者Testing Bot这类提供了Selenium网格作为云服务的供应商也是一个选择。 -当然,在你自己的硬件群运行节点也是可行的。 -这一章会深入探讨如何用你自己的基础设施来运行你的服务网格, - -## 快速开始 - -这个例子会向你展示如何开始Selenium 2服务网格的转发器(hub), -然后注册WebDriver节点和Selenium 1 RC节点。 -我们也会向你展示如何使用Java来使用Selenium服务网格。 -这个例子里转发器和节点被运行在了同一台终端机上,当然你也可以服务selenium-server-standalone到 -多台终端机。 - -`selenium-server-standalone` 包含了运行网格所需要的转发器(hub),WebDriver和legacy RC needed, _ant_已经不是必须的了. -你可以在[https://selenium.dev/downloads/](https://selenium.dev/downloads/).下载 -`selenium-server-standalone.jar` - -### 第一步: 启动转发器(hub) - -转发器(hub)是接受测试请求并分发到合适的节点的中心点。 -分发是基于节点的能力的,这就意味着一个有特定需求的测试仅会被分发到能提供这个需求的节点上。 - -因为一个测试所期望的能力,就如字面意思,期望,并不代表转发器(hub)能够找到一个真正满足所有期望的节点。 - -打开命令行窗口,来到存放`selenium-server-standalone.jar`文件的地方。 -启动转发器(hub)并传入`-role hub`作为参数来启动一个独立的服务: - -```shell -java -jar selenium-server-standalone.jar -role hub -``` - -转发器(hub)默认会监听4444端口,你也可以通过打开浏览器访问[http://localhost:4444/grid/console](http://localhost:4444/grid/console)来查看转发器(hub)的状态。 - -如果需要改变默认端口,你可以添加`-port`加上一个数字作为参数来代表你期望监听的端口, -同时,所有其他的可选参数都可以在下面这个JSON配置文件里找到。 - -你已经在上面获得了一个简单命令,当然如果你希望一些更高级的配置, -方便起见,你也可以指定一个JSON格式的配置文件来配置并启动你的转发器(hub)。 -你可以这么做: - -```shell -java -jar selenium-server-standalone.jar -role hub -hubConfig hubConfig.json -debug -``` - -下面你可以看到一个配置文件`hubConfig.json`的例子。 -我们会在第二步深入探讨怎么来提供节点配置文件。 - -```json -{ - "_comment" : "Configuration for Hub - hubConfig.json", - "host": ip, - "maxSession": 5, - "port": 4444, - "cleanupCycle": 5000, - "timeout": 300000, - "newSessionWaitTimeout": -1, - "servlets": [], - "prioritizer": null, - "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher", - "throwOnCapabilityNotPresent": true, - "nodePolling": 180000, - "platform": "WINDOWS"} -``` - - -### 第二部: 启动节点 - -无论你期望你的服务网格使用新的WebDriver的功能,还是Selenium 1 RC的功能,或者2者皆有。 -你都只需要使用`selenium-server-standalone.jar`来启动节点。 - -```shell -java -jar selenium-server-standalone.jar -role node -hub http://localhost:4444 -``` - -如果不通过`-port`来指定端口,会选一个可用端口。你也可以在一个终端机上运行多个节点, -但是如果你这么做了,你需要意识到当你的测试使用截屏会引发你的系统内存资源和问题。 - -#### 配置节点的可选参数 - -正如前面提到的,作为一个向下兼容,"wd"和”rc”这两个角色都是节点角色的合法的自己。 -当节点同时允许RC饿WebDriver的远程链接时,这些角色限制了远程连接使用的API。 - -通过在命令行中设置JVM属性(_在-jar参数前_使用`-D`参数),会被传递到节点里: -`-Dwebdriver.chrome.driver=chromedriver.exe` - -#### 使用JSON配置节点 - -你也可以使用JSON配置文件来启动服务网格节点 - -```shell -java -Dwebdriver.chrome.driver=chromedriver.exe -jar selenium-server-standalone.jar -role node -nodeConfig node1Config.json -``` -这里是一个配置文件`nodeConfig.json`的例子: - -```json -{ - "capabilities": [ - { - "browserName": "firefox", - "acceptSslCerts": true, - "javascriptEnabled": true, - "takesScreenshot": false, - "firefox_profile": "", - "browser-version": "27", - "platform": "WINDOWS", - "maxInstances": 5, - "firefox_binary": "", - "cleanSession": true - }, - { - "browserName": "chrome", - "maxInstances": 5, - "platform": "WINDOWS", - "webdriver.chrome.driver": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe" - }, - { - "browserName": "internet explorer", - "maxInstances": 1, - "platform": "WINDOWS", - "webdriver.ie.driver": "C:/Program Files (x86)/Internet Explorer/iexplore.exe" - } - ], - "configuration": { - "_comment" : "Configuration for Node", - "cleanUpCycle": 2000, - "timeout": 30000, - "proxy": "org.openqa.grid.selenium.proxy.WebDriverRemoteProxy", - "port": 5555, - "host": ip, - "register": true, - "hubPort": 4444, - "maxSession": 5 - } -} -``` - -有关于`-host`参数的注解 - -无论是转发器还是节点,如果不指定`-host`参数,会默认使用`0.0.0.0`, -这么做会绑定终端机的所有的公共IPv4接口。如果你有一些特殊网络配置或者一些组件创建的网络接口, -建议设置`-host`参数,来使你的转发器或节点能够被其他终端机访问。 - -#### 指定端口 - -转发器默认使用TCP/IP端口4444.如果你希望改端口,请用上面提到的配置方法。 - -## 故障排查 - -### 使用日志文件 - -如果需要进行高级故障排查你可以指定一个日志文件来记录系统信息。 -启动Selenium服务网格的转发器(hub)或节点的时候使用-log参数。下面是一个例子: - -```shell -java -jar selenium-server-standalone.jar -role hub -log log.txt -``` - -使用你习惯的文本编辑器来打开日志文件(例子里用的log.txt),查找"ERROR"日志来定位你的问题。 - -### 使用 `-debug` 参数 - -同时,你也可以通过使用`-debug`来向控制台打印debug日志。 -启动Selenium服务网格的转发器(hub)或节点的时候使用`-debug`参数。下面是一个例子: - -```shell -java -jar selenium-server-standalone.jar -role hub -debug -``` - -## 提醒 - -Selenium服务网格需要使用合适的防火墙许可来隔离外部访问。 - -如果不能有效的保护你的服务网格,可能会导致以下问题: - -* 提供了一个开发的接口来访问服务网格的基础设施 -* 你将会允许第三方来访问内部web服务和文件 -* 你将会允许第三方来执行定制的二进制文件 - -请参考这篇文章[Detectify](//labs.detectify.com), 这里给了一个很好的概要, -关于暴露一个服务网格后会如何被滥用:[Don't Leave your Grid Wide Open](//labs.detectify.com/2017/10/06/guest-blog-dont-leave-your-grid-wide-open/). - - -## Docker Selenium -[Docker](//www.docker.com/)提供了一个方便的途径来在容器中构建一个可扩张的Selenium服务网格基础设置, -容器是软件的标准单元,包含了所有执行应用程序需要的东西,包括所有的依赖,它以一种可靠的,可以复制的方法来在不同的终端机上运行。 - -Selenium项目维护了一组Docker镜像,你可以下载并运行来快速的获得一个可用的服务网格。 -Firefox和Chrome都提供了可用的镜像。你可以在[Docker Selenium](//github.com/SeleniumHQ/docker-selenium) 找到关于如何启动服务网格的详细信息. - -### 前提 -创建服务网格的唯一的前提是安装了Docker并能正常运行 -[Install Docker](//www.docker.com/products/docker-desktop). diff --git a/website_and_docs/content/documentation/legacy/selenium_ide/_index.en.md b/website_and_docs/content/documentation/legacy/selenium_ide/_index.en.md index aa71c24866ac..afb92291d17f 100644 --- a/website_and_docs/content/documentation/legacy/selenium_ide/_index.en.md +++ b/website_and_docs/content/documentation/legacy/selenium_ide/_index.en.md @@ -4,7 +4,11 @@ linkTitle: "Selenium IDE" weight: 8 description: > Selenium IDE was the original Firefox extension for Record and Playback. -aliases: ["/documentation/en/legacy_docs/selenium_ide/", "/documentation/ja/legacy_docs/selenium_ide/", "/documentation/pt-br/legacy_docs/selenium_ide/", "/documentation/zh-cn/legacy_docs/selenium_ide/"] +aliases: ["/documentation/en/legacy_docs/selenium_ide/", "/documentation/ja/legacy_docs/selenium_ide/", "/documentation/pt-br/legacy_docs/selenium_ide/", "/documentation/zh-cn/legacy_docs/selenium_ide/", +"/ja/documentation/legacy/selenium_ide/", +"/pt-br/documentation/legacy/selenium_ide/", +"/zh-cn/documentation/legacy/selenium_ide/" +] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_ide/_index.ja.md b/website_and_docs/content/documentation/legacy/selenium_ide/_index.ja.md deleted file mode 100644 index 248f0b0a4487..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_ide/_index.ja.md +++ /dev/null @@ -1,1467 +0,0 @@ ---- -title: "レガシー Selenium IDE" -linkTitle: "Selenium IDE" -weight: 8 ---- - -## 紹介 - -Selenium-IDE (統合開発環境) は、Selenium テストケースを開発するためのツールです。 -Selenium-IDE は使いやすい Firefox プラグインで、一般にテストケースを開発するための最も効率的な方法です。 -Selenium-IDE ではコンテキストメニューも使用できます。 -コンテキストメニューを使うと、まず現在ブラウザに表示されているページ上の UI 要素を選択し、次に Selenium コマンドのリストから目的のコマンドを選択できます。 -コマンドのパラメータは、選択された UI 要素のコンテキストに従って、あらかじめ定義されたものが使われます。 -Selenium-IDE を使う方法は、時間の節約になるだけでなく、Selenium スクリプトの構文を学ぶ手段としても優れています。 - -この章では Selenium-IDE について詳しく取り上げ、Selenium-IDE を効果的に使う方法について説明します。 - -## IDEのインストール - -Firefoxを使用して、最初にSeleniumHQ[ダウンロードページ](https://selenium.dev/downloads)からIDEをダウンロードします。 - -Firefoxは、不慣れな場所からアドオンをインストールしないように保護するため、次のスクリーンショットに示すように、インストールを続行するには'許可'をクリックする必要があります。 - -![Selenium IDE Installation 1](/images/documentation/legacy/selenium_ide_installation_1.png) - -Firefoxからダウンロードすると、次のウィンドウが表示されます。 - -![Selenium IDE Installation 2](/images/documentation/legacy/selenium_ide_installation_2.png) - -「今すぐインストール」を選択します。 -Firefoxの「アドオン」ウィンドウがポップアップし、最初にプログレスバーが表示されます。 -ダウンロードが完了すると、次のような画面になります。 - -![Selenium IDE Installation 3](/images/documentation/legacy/selenium_ide_installation_3.png) - -Firefoxを再起動します。 -Firefoxの再起動後、Firefoxの「ツール」メニューには、「Selenium-IDE」が表示されます。 - -![Selenium IDE Installation 4](/images/documentation/legacy/selenium_ide_installation_4.png) - -## IDEを開く - -Selenium-IDEを実行するには、Firefoxの「ツール」メニューから「Selenium-IDE」を選択するだけです。 -空のスクリプト編集ウィンドウと、テストケースを読み込んだり新規作成したりするメニューのある Selenium-IDE のウィンドウが表示されます。 - -![Selenium IDE Open](/images/documentation/legacy/selenium_ide_open.png) - -## IDEの機能 - -### メニューバー - -「ファイル」メニューには、テストケースとテストスイート(テストケースのスイート)のオプションがあります。 -これらを使用して、新しいテストケースを追加し、テストケースを開き、テストケースを保存し、選択した言語でテストケースをエクスポートできます。 -最近のテストケースを開くこともできます。 -これらすべてのオプションは、テストスイートでも使用できます。 - -「編集」メニューでは、テストケースのコマンドを編集するためのすべての操作をコピー、貼り付け、削除、元に戻す、選択できます。 -「オプション」メニューでは、さまざまな設定を変更できます。 -特定のコマンドのタイムアウト値を設定し、Seleniumコマンドの基本セットにユーザー定義のユーザー拡張機能を追加し、テストケースを保存するときに使用する形式(言語)を指定できます。 -「ヘルプ」メニューは Firefox 標準の「ヘルプ」メニューで、この中の 「UI-Element Documentation」 だけが Selenium-IDE に関係のある項目です。 - -### ツールバー - -ツールバーには、テストケースをデバッグするためのステップ実行機能をはじめ、テストケースの実行をコントロールするためのさまざまなボタンが並んでいます。 -右端の赤い丸のボタンは、「Record」(記録) ボタンです。 - -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_1.png) -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_2.png) - -「Speed Control」 (速度調節): テストケースの実行速度を調節します。 - -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_3.png) - -「Run All」 (すべて実行): 複数のテストケースを持つテストスイートが読み込まれているときにテストスイート全体を実行します。 - -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_4.png) - -「Run」 (実行): 現在選択されているテストを実行します。 -テストが1つしか読み込まれていない場合、このボタンと「Run All」ボタンの動作は同じです。 - -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_5.png) -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_6.png) - -「Pause」 / 「Resume」 (一時停止/再開) : 実行中のテストを一時停止または再開します。 - -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_7.png) - -「Step」(ステップ実行): コマンドを1つずつ実行し、テストケースの「1ステップ実行」を行います。 -テストケースをデバッグするときに使います。 - - -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_8.png) - -「TestRunner Mode」 (TestRunner モード): テストケースを Selenium-Core TestRunner で読み込んでブラウザで実行することができます。 -TestRunner は今はあまり使われておらず、いずれ非推奨となるでしょう。 -このボタンは、テストケースを評価して、TestRunner との後方互換性があるかどうかを調べるために用意されています。 -ほとんどのユーザーは、このボタンを使う必要はないでしょう。 - - -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_9.png) - -「Apply Rollup Rules」(ロールアップルールを適用): この高度な機能を利用すると、一連の Selenium コマンドの繰り返しを 1 つのアクションにまとめることができます。 -ロールアップルールの詳細については、「ヘルプ」 メニューの [UI-Element Documentation] を参照してください。 - -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_10.png) - - -### テストケース ペイン - -スクリプトは「テストケース」ペインに表示されます。 -ペインには2つのタブがあります。 -次に示すのは、コマンドとそのパラメータを読みやすい「テーブル」形式で表示するための [「テーブル」タブです。 - -![Selenium IDE Image Pane](/images/documentation/legacy/selenium_ide_image_pane.png) - -もう 1 つの「ソース」タブには、テストケースがネイティブ形式で表示されます。 -ファイルはこのネイティブ形式で保存されます。 -デフォルトでは HTML ですが、Java や C# などのプログラミング言語、あるいは Python などのスクリプト言語に変更することもできます。 -詳細については、「オプション」 メニューを参照してください。 -「ソース」 タブでは、テストケースを生の形式で編集することができ、操作のコピー、切り取り、貼り付けが可能です。 - -「コマンド」、「対象」、および 「値」 入力フィールドには、現在選択されているコマンドとそのパラメータが表示されます。 -これらの入力フィールドでは、現在選択されているコマンドを修正できます。 -一番下のペインの 「リファレンス」 タブで、コマンドに対して指定されている 1 つ目のパラメータは、必ず 「対象」 フィールドに入力します。 -「リファレンス」 タブで 2 つ目のパラメータが指定されている場合、このパラメータは 「値」 フィールドに入力します。 - -![Selenium IDE Entry Fields](/images/documentation/legacy/selenium_ide_entry_fields.png) - -「コマンド」フィールドに文字を入力すると、入力した文字に応じてドロップダウンリストに項目が表示されるので、このリストから目的のコマンドを選択できます。 - -### ログ/参照/UI要素/ロールアップペイン - -一番下のペインは、さまざまな機能で使われます。 -「ログ」、「リファレンス」、「UI-Element」、および 「Rollup」 の4つのタブがあります。 - -#### ログ - -テストケースを実行すると、「ログ」 タブを選択していなくても、エラーメッセージとテストの進行状況を示す情報メッセージが自動的にこのペインに表示されます。 -これらのメッセージは、しばしばテストケースのデバッグに役立ちます。 -ログを消去するには 「消去」 ボタンをクリックします。 -「情報」 ボタンをクリックすると、ドロップダウンリストが表示されます。 -リストで目的の項目を選択すれば、画面に表示する情報のレベルを指定できます。 - -![Selenium IDE Bottom Box](/images/documentation/legacy/selenium_ide_bottom_box.png) - - -#### リファレンス - -「リファレンス」 タブは、「テーブル」 タブで Selenese コマンドとパラメータを入力したり修正したりする場合にデフォルトで選択されるタブです。 -「テーブル」 タブが表示されている場合、「リファレンス」 ペインには現在のコマンドのリファレンスが表示されます。 -「テーブル」 タブの 「ソース」 タブのどちらで作業している場合も、コマンドを入力または修正するときは、「対象」 フィールドと 「値」 フィールドで指定するパラメータが、「リファレンス」 ペインのパラメータリストに指定されているものと一致していることを確認することが非常に重要です。 -指定するパラメータの数は、「リファレンス」 ペインで指定されている数と一致しなければならず、パラメータの順序も 「リファレンス」 ペインのそれと一致しなければなりません。 -さらに、指定するパラメータの型も、「リファレンス」 ペインで指定されている型と一致していなければなりません。 -これら 3つのうち、1つでも一致しないものがあれば、コマンドは正常に実行されません。 - -![Selenium IDE Bottom Box](/images/documentation/legacy/selenium_ide_bottom_box_ref.png) - -「リファレンス」 タブはクイックリファレンスとして大いに役立ちますが、Seleniumリファレンスを参照することもしばしば必要になります。 - -#### UI-ElementとRollup - -これらの2つのペイン (高度な機能を扱うためのペイン) については、Selenium-IDE の 「ヘルプ」 メニューの 「UI-Element Documentation」 を参照してください。 - -## テストケースの作成 - -テストケースを開発するための主な方法は3つあります。 -多くの場合、テスト開発者はこれら 3 つのテクニックをすべて使う必要があります。 - -### 記録 - -Selenium を初めて使うユーザーは、Web サイトでの操作を記録してテストケースを作成することが多いようです。Selenium-IDE を最初に開いたとき、「Record」 ボタンはデフォルトでオンになっています。 - -Selenium-IDEで自動的に記録を開始したくない場合は、Options > Options… に移動し、"Start recording immediately on open."の選択を解除して、これをオフにできます。 - -記録中は、ユーザーの操作に基づいて Selenium-IDE がテストケースにコマンドを自動的に挿入します。 -次に示すのは、典型的なユーザーの操作です。 - -* リンクをクリックする - click または clickAndWait コマンド -* 値を入力する - type コマンド -* ドロップダウンリストボックスからオプションを選択する - select コマンド -* チェックボックスまたはラジオボタンをクリックする - click コマンド - -いくつか注意すべき点を次に示します。 - -* typeコマンドが記録されるようにするには、Web ページ上のどこか別の場所をクリックする操作が必要になる場合があります。 -* リンクをたどる操作は、通常は click コマンドとして記録されます。 - 多くの場合、 click コマンドは clickAndWait に変更して、新しいページが完全に読み込まれるまでテストケースを確実に停止させる必要があります。 - そうしないと、ページに含まれるすべての UI 要素が読み込まれる前にテストケースの実行が先に進み、予期しない形でテストケースが失敗することになります。 - -### コンテキストメニューを使った検証とアサートの追加 - -テストケースでは、Web ページのプロパティをチェックする必要もあるでしょう。 -それには、 assert コマンドと verify コマンドを使う必要があります。 -ここでは、これらのコマンドの細かな点には触れません。 -テストケースに追加する方法だけを説明します。 -コマンドの詳細については、 “Selenese” Selenium コマンド に関する章を参照してください。 - -Selenium-IDE の記録機能がオンの状態で、テスト対象のアプリケーションを表示しているブラウザを選択し、ページ上の任意の場所を右クリックします。 -すると、 verify コマンドや assert コマンドを含むコンテキストメニューが表示されます。 - -初めて Selenium を使う場合には、Selenium コマンドが1つしか表示されないかもしれません。 -しかし、IDE を使っていると、メニューに表示されるコマンドがどんどん増えていきます。 -Selenium-IDE は、現在の Web ページ上で選択されている UI 要素に応じて、必要なコマンドとパラメータの予測を試みます。 - -実際にこの機能をためしてみましょう。 -適当な Web ページを開き、ページ上のテキストを選択します。 -段落1つか、見出しがいいでしょう。 -次に、選択したテキストを右クリックします。 -コンテキストメニューが表示され、 verifyTextPresent コマンドと、このコマンドにふさわしいパラメータとして、選択されたテキスト自体が表示されるはずです。 - -また、「利用可能な全てのコマンド」 という項目があることに注目してください。 -この項目を選択すると、非常に多くのコマンドが、現在選択されている UI 要素のテストに適したパラメータ案とともに表示されます。 - -いくつかほかの UI 要素についても、同じようにためしてみてください。 -たとえば、画像を右クリックしたり、ボタンやチェックボックスなどのユーザーコントロールを右クリックしたりしてみてください。 -verifyTextPresent 以外のオプションを見るには、「利用可能な全てのコマンド」 を使う必要があるかもしれません。 -いったんほかのオプションを選択すると、よく使われるコマンドがトップレベルのコンテキストメニューに表示されるようになります。 -たとえば、画像に対して verifyElementPresent を選択すると、次に画像を選択して右クリックしたときに、トップレベルのコンテキストメニューにこのコマンドが表示されるようになります。 - -繰り返しになりますが、これらのコマンドの詳細については、Selenium のコマンドに関する章で説明します。 -とりあえずここでは、IDE を使ってさまざまなコマンドをテストケースに記録、選択し、テストケースを実行してみてください。IDE を使っていうちに、Selenium のコマンドについても自然に多くのことを学べるはずです。 - -### 編集 - -#### コマンドの挿入 - -##### テーブル タブ - -テストケース内のコマンドを挿入する場所を選択します。 -右クリックして 「コマンドを挿入」 をクリックします。 -コマンド編集用のテキストフィールドを使って、新しいコマンドとそのパラメータを入力します。 - -##### ソース タブ - -テストケース内のコマンドを挿入する場所を選択し、3 列からなる行を 1 つ作成するのに必要な HTML タグを入力します。 -この行の 1 列目にはコマンドを、2 列目には最初のパラメータを (パラメータが必要な場合)、3 列目には 2 つ目のパラメータを (パラメータが必要な場合) 入力します。「テーブル」 タグに戻るときは、その前にテストケースを保存します。 - -```html - - Command - target (locator) - Value - -``` - -#### コメントの挿入 - -テストケースの可読性を高めるためにコメントを入力できます。 -テストケースの実行時にはコメントは無視されます。 - -垂直方向の空白 (1 行以上の空白行) をテストに追加するには、空のコメントを作成する必要があります。 -空のコマンドでは実行時にエラーが発生します。 - -##### テーブル タブ - -テストケース内のコメントを挿入する場所を選択します。 -右クリックして 「コメントを挿入」 をクリックします。 -「コマンド」 フィールドにコメントを入力します。 -入力したコメントは紫色のフォントで表示されます。 - -##### ソース タブ - -テストケース内のコメントを挿入する場所を選択します。 -HTML スタイルのコメント、すなわち `` - -#### Editar um comando ou comentário - -##### Visualização Tabela - -Basta selecionar a linha a ser alterada e editá-la usando os campos de comando, destino, -e valor. - -##### Visualização Código Fonte - -Uma vez que a visualização do Código Fonte fornece o equivalente a um editor WYSIWYG (What You See Is What You Get), simplesmente modifique a linha que você deseja - comando, parâmetro ou comentário. - -### Abrindo e salvando um caso de teste - -Como a maioria dos programas, existem comandos Salvar e Abrir no menu Arquivo. -No entanto, o Selenium distingue entre casos de teste e suítes de teste. Para salvar -seus testes Selenium-IDE para uso posterior, você pode salvar os casos de teste individualmente -ou salvar a suíte de testes. Se os casos de teste de sua suíte de testes não -foram salvos, você será solicitado a salvá-los antes de salvar a suíte. - -Quando você abre um caso de teste ou suíte existente, a Selenium-IDE exibe seu -comandos do Selenium no painel de caso de teste. - -## Executando casos de teste - -A IDE fornece muitas opções para executar seu caso de teste. Você pode executar um caso de teste -inteiro de uma vez, parar e iniciar, executar uma linha de cada vez, executar um único comando -que você está desenvolvendo atualmente e pode fazer uma execução em lote de uma suíte de testes. -A execução de casos de teste é muito flexível na IDE. - -**Executar um caso de teste** - -Clique no botão Executar para executar o caso de teste mostrado. - -**Executar uma suíte de testes** - -Clique no botão Executar Todos para executar todos os testes dentro da suíte de testes - -**Parar e Continuar** - -O botão de Pausa pode ser utilizado para parar o caso de teste no meio da sua execução. -O ícone do botão então muda para indicar que você pode Continuar. Para continuar, clique nele. - -**Parar no meio** - -Você pode definir um ponto de interrupção (breakpoint) no caso de teste para que ele pare em um comando específico. -Isto é útil para depurar seu teste. Para definir um ponto de interrupção, selecione um comando, clique com -o botão direito e a partir do Menu de Contexto selecione Alternar ponto de interrupção. - -**Começar do meio** - -Você pode preferir que a IDE comece a executar a partir de um comando específico -no meio do caso de teste. Isto também pode ser usado para depuração. -Para definir um ponto de começo, selecione o comando, clique com o botão direito -e a partir do Menu de Contexto selecione Set/Clear Start Point. - -**Execute um comando isolado** - -De um duplo-clique em qualquer comando para executá-lo. Isto é útil -quando você está escrevendo um único comando. Permite testar imediatamente -o comando sendo construído, quando não tem certeza se ele está certo. -Você pode dar um duplo-clique para ver se o comando é executado corretamente. -Isto também está disponível no Menu de Contexto. - -## Usando uma URL base para executar casos de teste em diferentes domínios - -O campo URL base na parte superior da janela da Selenium-IDE é muito útil para -permitir que os casos de teste sejam executados em diferentes domínios. -Suponha que um site chamado http://news.portal.com tenha um site beta -interno chamado http://beta.news.portal.com. Quaisquer casos de teste -para esses sites que começam com um comando *open* devem especificar uma -URL relativa como o argumento para abrir, em vez de uma URL absoluta -(começando com um protocolo como http: ou https:). A Selenium-IDE irá -então criar uma URL absoluta anexando o argumento do comando *open* no -final do valor da URL base. Por exemplo, o caso de teste -abaixo seria executado em http://news.portal.com/about.html: - -![Selenium IDE Prod URL](/images/documentation/legacy/selenium_ide_base_url_prod.png) - -Este mesmo caso de teste com uma configuração de URL base modificada seria executado em -http://beta.news.portal.com/about.html: - -![Selenium IDE Beta URL](/images/documentation/legacy/selenium_ide_base_url_beta.png) - -## Comandos Selenium – “Selenese” - -Os comandos do Selenium, muitas vezes chamados de Selenese, -são o conjunto de comandos que executam o seu testes. -Uma sequência desses comandos é um script de teste. -Aqui nós explicamos esses comandos em detalhes, -e apresentamos as diversas opções que você tem ao testar a sua -aplicação web usando o Selenium. - -Selenium fornece um conjunto rico de comandos para testar totalmente sua -aplicação web quase de qualquer maneira que você possa imaginar. -O conjunto de comandos é frequentemente chamado de Selenese. -Esses comandos criam essencialmente uma linguagem de teste. - -Em Selenese, pode-se testar a existência de elementos de UI com base em suas tags HTML, -testar a existência de um conteúdo específico, testar a existência de links quebrados, campos de entrada, -opções de lista de seleção, envio de formulários e dados de tabela, entre outras coisas. Além do mais -os comandos do Selenium suportam testes de tamanho de janela, posição do mouse, alertas, -funcionalidade Ajax, janelas pop-up, tratamento de eventos -e muitas outras características de aplicativos da web. -A Referência de Comandos lista todos os comandos disponíveis. - -Um comando diz ao Selenium o que fazer. Os comandos do Selenium vêm em três "sabores": -**Ações**, **Acessores** e **Asserções**. - -* **Ações** são comandos que geralmente manipulam o estado do aplicativo. -Elas fazem coisas como “clicar neste link” e “selecionar essa opção”. Se uma ação -falhar ou tiver um erro, a execução do teste atual é interrompida. - - Muitas ações podem ser chamadas com o sufixo "AndWait", por ex. “ClickAndWait”. Este - sufixo diz ao Selenium que a ação fará com que o navegador faça uma chamada para - o servidor, e que o Selenium deve aguardar o carregamento de uma nova página. - -* **Acessores** examinam o estado do aplicativo e armazenam os resultados em -variáveis, por exemplo “StoreTitle”. Eles também são usados para gerar Asserções automaticamente. - -* **Asserções** são como Acessores, mas verificam se o estado da -aplicação está em conformidade com o que é esperado. Os exemplos incluem -“certifique-se de que o título da página é X” -e “verifique se esta caixa de seleção está marcada”. - -Todas as asserções do Selenium podem ser usadas em 3 modos: "assert", "verify" -e "wait for". Por exemplo, você pode usar “assertText”, “verifyText” e “waitForText”. -Quando uma asserção falha, o teste é abortado. Quando uma verificação falha, o teste -continuará a execução, registrando a falha. Isso permite uma única asserção para -certificar-se de que o aplicativo está na página correta, seguido por um monte de -verificações para testar os valores dos campos do formulário, rótulos, etc. - -Os comandos "waitFor" aguardam até que alguma condição se torne verdadeira (o que pode ser útil -para testar aplicativos Ajax). Eles terão sucesso imediatamente se a condição -já é verdadeira. No entanto, eles falharão e interromperão o teste se a condição -não se tornar verdadeira dentro da configuração de timeout atual (veja o setTimeout -ação abaixo). - -## Sintaxe do Script - -Os comandos do Selenium são simples, consistem no comando e em dois parâmetros. -Por exemplo: - -| | | | -| -------- | ---------------------------- | ----------- | -| verifyText | //div//a[2] | Login | - -Os parâmetros nem sempre são necessários, depende do comando. Em alguns -casos ambos são necessários, em outros um parâmetro é necessário, e ainda em -outros, o comando pode não ter nenhum parâmetro. Aqui estão mais alguns -exemplos: - -| | | | -| -------- | ---------------------------- | ----------------------------- | -| goBackAndWait | | | -| verifyTextPresent | | Welcome to My Home Page | -| type | id=phone | (555) 666-7066 | -| type | id=address1 | ${myVariableAddress} | - -A referência de comandos descreve os requisitos de parâmetro para cada comando. - -Os parâmetros variam, mas normalmente são: - -* um localizador para identificar um elemento de UI em uma página. -* um padrão de texto para verificar ou fazer uma asserção do conteúdo esperado da página -* um padrão de texto ou uma variável Selenium para inserir texto em um campo de entrada ou -para selecionar uma opção de uma lista de opções. - -Localizadores, padrões de texto, variáveis Selenium e os próprios comandos são -descritos em bastante detalhe na seção sobre Comandos do Selenium. - -Os scripts do Selenium que serão executados a partir da Selenium-IDE serão -armazenados em um arquivo de texto HTML. Isso consiste em uma tabela HTML com três colunas. -A primeira coluna identifica o comando Selenium, a segunda é um alvo e a última -coluna contém um valor. A segunda e terceira colunas podem não exigir valores -dependendo do comando Selenium escolhido, mas elas devem estar presentes. -Cada linha da tabela representa um novo comando Selenium. Aqui está um exemplo de um teste que -abre uma página, faz um asserção no título da página e, em seguida, verifica algum conteúdo na página: - -```html - - - - -
open/download/
assertTitleDownloads
verifyText//h2Downloads
-``` - -Renderizado como uma tabela em um navegador, seria assim: - -| | | | -| -------- | ---------------------------- | ----------------------------- | -| open | /download/ | | -| assertTitle | | Downloads | -| verifyText | //h2 | Downloads | - -A sintaxe HTML Selenese pode ser usada para escrever e executar testes sem exigir -conhecimento de uma linguagem de programação. Com um conhecimento básico de Selenese e -Selenium-IDE você pode produzir e executar casos de teste rapidamente. - -## Suítes de Teste - -Uma suíte de testes é uma coleção de testes. Frequentemente, você executará todos os testes em uma -suite de teste como um trabalho em lote contínuo. - -Ao usar a Selenium-IDE, as suítes de testes também podem ser definidas usando um arquivo HTML simples. -A sintaxe novamente é simples. Uma tabela HTML define uma lista de testes onde -cada linha define o caminho do sistema de arquivos para cada teste. Um exemplo diz tudo. - -```html - - -Test Suite Function Tests - Priority 1 - - - - - - - -
Suite Of Tests
Login
Test Searching for Values
Test Save
- - -``` - -Um arquivo semelhante a este permitiria executar todos os testes de uma vez, um após o -outro, a partir da Selenium-IDE. - -As suítes de testes também podem ser mantidas ao usar o Selenium-RC. Isso é feito via -programação de várias maneiras. Normalmente Junit é usado para -manter um conjunto de testes se estiver usando Selenium-RC com Java. Além disso, se -C# é a linguagem escolhida, o Nunit pode ser utilizado. Se estiver usando uma linguagem interpretada -como Python com Selenium-RC, então alguma programação simples seria -envolvida na configuração de uma suíte. Uma vez que o motivo de usar -Selenium-RC é se aproveitar da lógica de programação para o seu teste, geralmente -não é um problema. - -## Comandos Selenium usados com frequencia - -Para concluir nossa introdução ao Selenium, mostraremos alguns -comandos típicos. Estes são provavelmente os comandos mais comumente usados para construir -testes. - -**open** - -abre uma página usando a URL. - -**click/clickAndWait** - -realiza um clique e opcionalmente aguarda o carregamento de uma nova página. - -**verifyTitle/assertTitle** - -verifica se o título da página é o esperado. - -**verifyTextPresent** - -verifica se o texto esperado está em algum lugar da página. - -**verifyElementPresent** - -verifica se o elemento de UI esperado, definido pela tag HTML, está em algum lugar da página. - -**verifyText** - -verficia se o texto esperado e a tag HTML correspondente estão presentes na página. - -**verifyTable** - -verifica se o conteúdo da tabela é o esperado. - -**waitForPageToLoad** - -pausa a execução até que a nova página carregue. Chamado automaticamente quando -clickAndWait é utilizado. - -**waitForElementPresent** - -pausa a execução até que um elemento HTML, definido por sua tag HTML, esteja -presenta na página. - -## Verificando elementos da página - -Verificar os elementos de UI em uma página da web é provavelmente o recurso mais comum dos seus -testes automatizados. Selenese permite várias maneiras de verificar os elementos de UI. -É importante que você entenda esses métodos diferentes porque eles -definem o que você está realmente testando. - -Por exemplo, você vai testar se... - -1. um elemento está presente em algum lugar da página? -1. um texto específico está em algum lugar da página? -1. um texto específico está em um local específico na página? - -Por exemplo, se você estiver testando um título de texto, o texto -e sua posição na parte superior da página provavelmente são relevantes para o seu teste. -Se, no entanto, você está testando a existência de uma imagem na página inicial, -e os web designers frequentemente alteram o arquivo de imagem específico -junto com sua posição na página, -então você só quer testar se uma imagem (em oposição à um arquivo de imagem específico) -existe em algum lugar. - -## Asserção ou Verificação? - -Escolher entre "assert" e "verify" se resume à conveniência e gerenciamento -de falhas. Não vale a pena verificar se o primeiro parágrafo da -página é correto se o seu teste já falhou ao verificar se o -navegador está exibindo a página esperada. Se você não estiver na página correta, -você provavelmente vai querer abortar seu caso de teste para poder investigar a -causa e corrigir o(s) problema(s) imediatamente. Por outro lado, você pode querer verificar -muitos atributos de uma página sem abortar o caso de teste na primeira falha -pois isso permitirá que você analise todas as falhas na página e tome a -ação apropriada. Efetivamente, um "assert" irá falhar no teste e abortar o -caso de teste atual, enquanto um "verify" irá falhar no teste e continuar a executar -o caso de teste. - -O melhor uso desse recurso é agrupar logicamente seus comandos de teste e -iniciar cada grupo com um "assert" seguido por um ou mais comandos de "verify". -Segue um exemplo: - -| Command | Target | Value | -| -------- | ---------------------------- | ----------------------------- | -| open | /download/ | | -| assertTitle | | Downloads | -| verifyText | //h2 | Downloads | -| assertTable | 1.2.1 | Selenium IDE | -| verifyTable | 1.2.2 | June 3, 2008 | -| verifyTable | 1.2.3 | 1.0 beta 2 | - -O exemplo acima primeiro abre uma página e, em seguida, faz uma asserção para saber se a página correta -é carregada comparando o título com o valor esperado. Só se passar, -o seguinte comando será executado e verificará se o texto está presente na -localização esperada. O caso de teste, então, faz uma asserção para saber se a primeira coluna na segunda -linha da primeira tabela contém o valor esperado, e somente se este for aprovado -as células restantes nessa linha serão “verificadas”. - -### **verifyTextPresent** - -O comando `verifyTextPresent` é usado para verificar se existe um texto específico em algum lugar -na página. Leva um único argumento - o texto a ser verificado. Por -exemplo: - -| Command | Target | Value | -| -------- | ---------------------------- | ----------------------------- | -| verifyTextPresent | Marketing Analysis | | - -Isso faria com que o Selenium procurasse e verificasse que a string de texto -“Marketing Analysis” aparece em algum lugar na página que está sendo testada. Use -verifyTextPresent quando você está interessado apenas no próprio texto estar presente -na página. Não use isso quando você também precisa testar onde o texto está -na página. - -### **verifyElementPresent** - -Use este comando quando precisar testar a presença de um elemento de UI específico, -em vez de seu conteúdo. Esta verificação não verifica o texto, apenas a -tag HTML. Um uso comum é verificar a presença de uma imagem. - -| Command | Target | Value | -| -------- | ---------------------------- | ----------------------------- | -| verifyElementPresent | //div/p/img | | - -Este comando verifica se uma imagem, especificada pela existência de uma tag HTML ``, -está presente na página e aparece após uma tag `
` e uma tag `

`. -O primeiro (e único) parâmetro é um localizador para informar o -comando Selenese de como encontrar o elemento. -Os localizadores são explicados na próxima seção. - -`verifyElementPresent` pode ser usado para verificar a existência de qualquer tag HTML dentro -da página. Você pode verificar a existência de links, parágrafos, divisões `

`, -etc. Aqui estão mais alguns exemplos. - -| Command | Target | Value | -| -------- | ---------------------------- | ----------------------------- | -| verifyElementPresent | //div/p | | -| verifyElementPresent | //div/a | | -| verifyElementPresent | id=Login | | -| verifyElementPresent | link=Go to Marketing Research | | -| verifyElementPresent | //a[2] | | -| verifyElementPresent | //head/title | | - -Esses exemplos ilustram a variedade de maneiras pelas quais um elemento de UI pode ser testado. Novamente, -os localizadores são explicados na próxima seção. - -### **verifyText** - -Use `verifyText` quando o texto e seu elemento de UI devem ser testados. verifyText -deve usar um localizador. Se você escolher um localizador _XPath_ ou _DOM_, você pode verificar se um -texto específico aparece em um local específico na página em relação a outro componente na página. - -| Command | Target | Value | -| -------- | ---------------------------- | ------------------------------------------------------------------- | -| verifyText | //table/tr/td/div/p | This is my text and it occurs right after the div inside the table. | - - -## Localizando elementos - -Para muitos comandos do Selenium, um alvo é necessário. Este alvo identifica um -elemento no conteúdo do aplicativo da web, e consiste na estratégia de localização seguida pela localização no formato `locatorType = location`. -O tipo de localizador pode ser omitido em muitos casos. Os vários tipos de localizadores são -explicados abaixo com exemplos para cada um. - -### Localizando pelo Identificador - -Este é provavelmente o método mais comum de localização de elementos e é o -padrão quando nenhum tipo de localizador reconhecido é usado. Com esta estratégia, -o primeiro elemento com o valor do atributo id correspondente ao local será usado. E se -nenhum elemento tem um atributo *id* correspondente, então o primeiro elemento com um -atributo *name* correspondente ao local será usado. - -Por exemplo, o código fonte da sua página pode ter atributos id e name -do seguinte modo: - -```html - - -
- - - -
- - -``` - -As seguintes estratégias de localização retornariam os elementos do HTML acima indicado pelo número da linha: - -- ``identifier=loginForm`` (3) -- ``identifier=password`` (5) -- ``identifier=continue`` (6) -- ``continue`` (6) - -Como o tipo de localizador ``identifier`` é o padrão, o ``identifier =`` -nos primeiros três exemplos acima não é necessário. - -### Localizando pelo id - -Este tipo de localizador é mais limitado do que o tipo Localizador por Identificador, mas -também mais explícito. Use isto quando você souber o atributo *id* de um elemento. - -```html - - -
- - - - -
- - -``` - -- ``id=loginForm`` (3) - -### Localizando pelo *name* - -O tipo Localizador de Nome irá localizar o primeiro elemento com um atributo *name* correspondente. -Se vários elementos tiverem o mesmo valor para um atributo *name*, então -você pode usar filtros para refinar ainda mais sua estratégia de localização. -O tipo de filtro padrão é *value* (correspondendo ao atributo *value*). - -```html - - -
- - - - -
- - -``` - -- ``name=username`` (4) -- ``name=continue value=Clear`` (7) -- ``name=continue Clear`` (7) -- ``name=continue type=button`` (7) - -Nota: Ao contrário de alguns tipos de localizadores XPath e DOM, os três - tipos de localizadores acima permitem que o Selenium teste um elemento de UI independente - de sua localização em - a página. Portanto, se a estrutura e a organização da página forem alteradas, o teste - ainda vai passar. Você pode ou não querer também testar se a página - tem mudanças de estrutura. No caso em que os web designers frequentemente alteram a - página, mas sua funcionalidade deve ser testada por regressão, testando via *id* e - atributos de nome, ou realmente através de qualquer propriedade HTML, torna-se muito importante. - -### Localizando pelo XPath - -XPath é a linguagem usada para localizar nós em um documento XML. Como o HTML pode -ser uma implementação de XML (XHTML), os usuários do Selenium podem aproveitar esta poderosa -linguagem para encontrar elementos em seus aplicativos da web. XPath vai além (bem como apoia) -os métodos simples de localização por atributos *id* ou *name* -e abre todos os tipos de novas possibilidades, como localizar a -terceira caixa de seleção na página. - -Uma das principais razões para usar XPath é quando você não tem um *id* adequado -ou atributo de nome para o elemento que você deseja localizar. Você pode usar XPath para -localizar o elemento em termos absolutos (não recomendado) ou em relação a um -elemento que possui um atributo *id* ou name. Localizadores XPath também podem ser -usados para especificar elementos por meio de atributos diferentes de *id* e *name*. - -Os XPaths absolutos contêm a localização de todos os elementos da raiz (html) e -como resultado, é provável que falhe com apenas o menor ajuste na -aplicação. Ao encontrar um elemento próximo com um atributo *id* ou *name* (de preferência -um elemento pai), você pode localizar seu elemento de destino com base no relacionamento. -É muito menos provável que isso mude e pode tornar seus testes mais robustos. - -Uma vez que apenas os localizadores ``xpath`` começam com "//", não é necessário incluir -o rótulo ``xpath=`` ao especificar um localizador XPath. - -```html - - -
- - - - -
- - -``` - -- ``xpath=/html/body/form[1]`` (3) - *Caminho absoluto (seria quebrado se o HTML sofresse - qualquer pequena mudança)* -- ``//form[1]`` (3) - *Primeiro elemento `
` no HTML* -- ``xpath=//form[@id='loginForm']`` (3) - *O elemento `` com o atributo 'id' e o valor 'loginForm'* -- ``xpath=//form[input/@name='username']`` (3) - *Primeiro elemento `` com um elemento filho `` - com o atributo 'name' e o valor 'username'* -- ``//input[@name='username']`` (4) - *Primeiro elemento `` com o atributo 'name' e o valor - 'username'* -- ``//form[@id='loginForm']/input[1]`` (4) - *Primeiro elemento filho `` do - elemento `` com o atributo 'id' e o valor 'loginForm'* -- ``//input[@name='continue'][@type='button']`` (7) - *`` com o atributo 'name' e o valor 'continue' - e o atributo 'type' e o valor 'button'* -- ``//form[@id='loginForm']/input[4]`` (7) - *Quarto elemento filho `` do - elemento `` com atributo 'id' e valor 'loginForm'* - -Esses exemplos cobrem alguns princípios básicos, mas para aprender mais, -as seguintes referências são recomendadas: - -* [W3Schools XPath Tutorial](http://www.w3schools.com/xml/xpath_intro.asp>) -* [W3C XPath Recommendation](http://www.w3.org/TR/xpath) - -Existem também alguns complementos do Firefox muito úteis que podem ajudar a -descobrir o XPath de um elemento: - -* [XPath Checker](https://addons.mozilla.org/en-US/firefox/addon/1095?id=1095) - Pode - ser usado para testar os resultados do XPath. -* [Firebug](https://addons.mozilla.org/en-US/firefox/addon/1843) - Sugestões de XPath - é apenas um dos muitos recursos poderosos deste complemento muito útil. - -### Localizando hyperlinks pelo texto do link - -Este é um método simples de localizar um hiperlink em sua página da web usando o -texto do link. Se dois links com o mesmo texto estiverem presentes, então a primeira -correspondência será usada. - -```html - - -

Are you sure you want to do this?

-
Continue - Cancel - - -``` - -- ``link=Continue`` (4) -- ``link=Cancel`` (5) - -### Localizando pelo DOM - -O Document Object Model representa um documento HTML e pode ser acessado -usando JavaScript. Esta estratégia de localização usa um JavaScript que representa -um elemento na página, que pode ser simplesmente a localização do elemento usando a -notação hierárquica. - -Uma vez que apenas os localizadores ``dom`` começam com "document", não é necessário incluir -o rótulo ``dom=`` ao especificar um localizador DOM. - -```html - - - - - - - -
- - -``` - -- ``dom=document.getElementById('loginForm')`` (3) -- ``dom=document.forms['loginForm']`` (3) -- ``dom=document.forms[0]`` (3) -- ``document.forms[0].username`` (4) -- ``document.forms[0].elements['username']`` (4) -- ``document.forms[0].elements[0]`` (4) -- ``document.forms[0].elements[3]`` (7) - -Você pode usar o próprio Selenium, bem como outros sites e extensões para explorar -o DOM do seu aplicativo da web. Uma boa referência é a [W3Schools](http://www.w3schools.com/js/js_htmldom.asp). - -### Localizando pelo CSS - -CSS (Cascading Style Sheets) é uma linguagem para descrever a renderização de HTML -e documentos XML. CSS usa seletores para vincular propriedades de estilo a elementos -no documento. Esses seletores podem ser usados pelo Selenium como outra estratégia de localização. - -```html - - -
- - - - -
- - -``` - -- ``css=form#loginForm`` (3) -- ``css=input[name="username"]`` (4) -- ``css=input.required[type="text"]`` (4) -- ``css=input.passfield`` (5) -- ``css=#loginForm input[type="button"]`` (7) -- ``css=#loginForm input:nth-child(2)`` (5) - -Para obter mais informações sobre seletores CSS, o melhor lugar para ir é [a -publicação do W3C](http://www.w3.org/TR/css3-selectors/). Você encontrará todas as -referências lá. - -### Localizadores implícitos - -Você pode optar por omitir o tipo de localizador nas seguintes situações: - - - Localizadores sem uma estratégia de localização explicitamente definida utilizará a estratégia de localização padrão. Veja _`Localizando pelo Identificador`_. - - - Localizadores começando com "//" usarão a estratégia de localização XPath. - Veja _`Localizando pelo XPath`_. - - - Os localizadores que começam com "document" usarão a estratégia do localização DOM. - Veja _`Localizando pelo DOM`_ - - -## Padrões de texto - -Como os localizadores, *padrões* são um tipo de parâmetro frequentemente exigido pelos comandos Selenese. Exemplos de comandos que exigem padrões são **verifyTextPresent**, -**verifyTitle**, **verifyAlert**, **assertConfirmation**, **verifyText**, e -**verifyPrompt**. E como foi mencionado acima, os localizadores de link podem utilizar -um padrão. Os padrões permitem que você *descreva*, por meio do uso de caracteres especiais, -qual texto é esperado em vez de precisar especificar esse texto exatamente. - -Existem três tipos de padrões: *globbing*, *expressões regulares* e *exato*. - -### Padrão de Globbing - -A maioria das pessoas está familiarizada com o uso de globbing em -expansão de nome de arquivo em uma linha de comando DOS ou Unix / Linux como ``ls * .c``. -Neste caso, globbing é usado para exibir todos os arquivos no diretório atual -que terminam com uma extensão ``.c``. Globbing é bastante limitado. -Apenas dois caracteres especiais são suportados na implementação do Selenium: - -`*` que é traduzido como "corresponder a qualquer coisa", ou seja, nada, um único caractere ou muitos caracteres. - -`[ ]` (*classe de caracteres*) que é traduzido como "corresponder a qualquer caractere dentro dos colchetes." -Um travessão (hífen) pode ser usado como uma abreviação para especificar um intervalo de caracteres -(que são contíguos no conjunto ASCII). -Alguns exemplos tornarão clara a funcionalidade de uma classe de caracteres: - -``[aeiou]`` corresponde a qualquer vogal minúscula - -``[0-9]`` corresponde a qualquer dígito - -``[a-zA-Z0-9]`` corresponde a qualquer caractere alfanumérico - -Na maioria dos outros contextos, globbing inclui um terceiro caractere especial, o **?**. -No entanto, os padrões de globbing do Selenium suportam apenas o asterisco e a classe de caracteres. - -Para especificar um parâmetro de padrão globbing para um comando Selenese, você pode -prefixar o padrão com um rótulo **glob:**. No entanto, já que o padrão globbing é o padrão, -você também pode omitir o rótulo e especificar apenas o padrão em si. - -Abaixo está um exemplo de dois comandos que usam padrões globbing. O -texto real do link na página que está sendo testada -foi "Film/Television Department"; usando um padrão -em vez do texto exato, o comando **click** funcionará mesmo se o -o texto do link for alterado para "Film & Television Department" ou "Film and Television -Department". O asterisco do padrão glob corresponderá a "qualquer coisa ou nada" -entre a palavra "Film" e a palavra "Television". - -| Command | Target | Value | -| -------- | -------------------------------------- | ------------------------------------------------------------------ | -| click | link=glob:Film*Television Department | | -| verifyTitle | glob:\*Film\*Television\* | | - - -O título real da página acessada clicando no link era "De Anza Film And -Television Department - Menu". Usando um padrão em vez do texto exato, -o ``verifyTitle`` vai passar enquanto as duas palavras "Film" e "Television" aparecerem -(nessa ordem) em qualquer lugar no título da página. Por exemplo, se -o proprietário da página encurtar -o título apenas para "Film & Television Department", o teste ainda seria aprovado. -Usar um padrão para um link e um teste simples de que o link funcionou (como -o ``verifyTitle`` acima faz) pode reduzir bastante a manutenção de tais -casos de teste. - -#### Padrão de Expressões Regulares - -Os padrões de *expressão regular* são os mais poderosos dos três tipos -de padrões que o Selenese suporta. Expressões regulares -também são suportados pela maioria das linguagens de programação de alto nível, muitos editores de texto -e uma série de ferramentas, incluindo utilitários **grep**, **sed** e **awk** da linha de comando Linux / Unix. Em Selenese, -padrões de expressão regular permitem que um usuário execute muitas tarefas que iriam -ser muito difíceis de outra forma. Por exemplo, suponha que seu teste precise garantir que uma determinada célula da tabela contivesse nada além de um número. -``regexp:[0-9]+`` é um padrão simples que corresponderá a um número decimal de qualquer comprimento. - -Enquanto os padrões de Globbing do Selenese suportam apenas o **\*** -e **[ ]** (classe de caracteres), os padrões de expressão regular Selenese oferecem a mesma -ampla gama de caracteres especiais que existem em JavaScript. Abaixo -está um subconjunto desses caracteres especiais: - -| PATTERN | MATCH | -| ------------- | --------------------------------------------------------------------------- | -| . | qualquer caractere isolado | -| [ ] | classe de caracteres: qualquer caractere definido dentros dos colchetes | -| \* | quantificação: 0 ou mais do caractere anterior (ou grupo) | -| \+ | quantificação: 1 ou mais do caractere anterior (ou grupo) | -| ? | quantificação: 0 ou 1 do caractere anterior (ou grupo) | -| {1,5} | quantificação: 1 até 5 repetições do caractere anterior (ou grupo) | -| \| | alternação: o caractere/grupo na esquerda OU o caractere/grupo na direita | -| ( ) | agrupamento: normalmente usado com alternação e/ou quantificação | - -Os padrões de expressão regular em Selenese precisam ser prefixados com ``regexp:`` ou ``regexpi:``. -O primeiro é sensível a maiúsculas e minúsculas; -o último não faz distinção entre maiúsculas e minúsculas. - -Alguns exemplos ajudarão a esclarecer como os padrões de expressão regular podem -ser usados com comandos Selenese. O primeiro usa o que é provavelmente -o padrão de expressão regular mais comumente usado - **.\*** ("ponto estrela"). Esta -sequência de dois caracteres pode ser traduzida como "0 ou mais ocorrências de -qualquer caractere" ou, mais simplesmente, "qualquer coisa ou nada." É o -equivalente do padrão globbing de um caractere **\*** (um único asterisco). - -| Command | Target | Value | -| -------- | -------------------------------------- | ------------------------------------------------------------------ | -| click | link=glob:Film*Television Department | | -| verifyTitle | regexp:.\*Film.\*Television.\* | | - - -O exemplo acima é funcionalmente equivalente ao exemplo anterior -que usou padrões de globbing para este mesmo teste. As únicas diferenças -são o prefixo (**regexp:** em vez de **glob:**) e o padrão "qualquer coisa -ou nada" (**.\*** em vez de apenas **\***). - -O exemplo mais complexo abaixo testa que a página de clima do Yahoo! -para Anchorage, Alasca, contém informações sobre o horário do nascer do sol: - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ------------------------------------------------- | -| open | http://weather.yahoo.com/forecast/USAK0012.html | | -| verifyTextPresent | regexp:Sunrise: \*[0-9]{1,2}:[0-9]{2} [ap]m | | - - -Vamos examinar a expressão regular acima em partes: - -| | | -| -------------------------- | --------------------------------------------------------------------------------- | -| ``Sunrise: *`` | A string **Sunrise:** seguida por 0 ou mais espaços | -| ``[0-9]{1,2}`` | 1 ou 2 dígitos (para a hora do dia) | -| ``:`` | O caractere **:** (sem caracteres especiais envolvidos) | -| ``[0-9]{2}`` | 2 dígitos (para os minutos) seguidos de um espaço | -| ``[ap]m`` | "a" ou "p" seguido por "m" (am ou pm) | - - -#### Padrão Exato - -O tipo de padrão **exato** do Selenium é de utilidade marginal. -Ele não usa nenhum caractere especial. Então, se você precisasse procurar -um caractere de asterisco real (que é especial para globbing e -padrões de expressão regular), o padrão **exato** seria uma maneira -fazer isso. Por exemplo, se você quiser selecionar um item rotulado -"Real\*" em uma lista suspensa, o código a seguir pode funcionar ou não. -O asterisco no padrão ``glob:Real*`` irá corresponder a qualquer coisa ou a nada. -Portanto, se houvesse uma opção de seleção anterior rotulada "Números reais", -ser a opção selecionada em vez da opção "Real\*". - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ------------------------------------------------- | -| select | //select | glob:Real \* | - -A fim de garantir que o item "Real\*" seja selecionado, o prefixo ``exact:`` pode ser usado para criar um padrão **exato** conforme mostrado abaixo: - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ------------------------------------------------- | -| select | //select | exact:Real \* | - -Mas o mesmo efeito pode ser alcançado escapando o asterisco em um -padrão de expressão regular: - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ------------------------------------------------- | -| select | //select | regexp:Real \\\* | - -É bastante improvável que a maioria dos testadores precise procurar -um asterisco ou um conjunto de colchetes com caracteres dentro deles (a -classe de caracteres para padrões globbing). Assim, os padrões de globbing e -os padrões de expressão regular são suficientes para a grande maioria de nós. - - -## Os comandos "AndWait" - -A diferença entre um comando e sua alternativa *AndWait* é que o comando -regular (por exemplo, *click*) fará a ação e -continuará com o seguinte comando o mais rápido possível, -enquanto a alternativa *AndWait* (por exemplo, *clickAndWait*) -diz ao Selenium para **esperar** que a página -carregue após a ação ter sido realizada. - -A alternativa *AndWait* é sempre usada quando a ação faz com que o navegador -navegue para outra página ou recarregue a atual. - -Esteja ciente, se você usar um comando *AndWait* para uma ação que -não aciona uma navegação/atualização, seu teste falhará. Isto acontece -porque o Selenium alcançará o timeout de *AndWait* sem ver nenhuma -navegação ou atualização sendo feita, fazendo com que o Selenium lance uma exceção de timeout. - -## Os comandos waitFor em aplicações Ajax - -Em aplicações web orientadas a AJAX, os dados são recuperados do servidor sem -atualização da página. Usar os comandos *AndWait* não funcionará porque a página não é -realmente atualizada. Pausar a execução do teste por um determinado período de tempo -também não é uma boa abordagem, pois o elemento da web pode aparecer mais tarde ou antes do -período estipulado dependendo da capacidade de resposta do sistema, carga ou outros -fatores descontrolados do momento, levando a falhas de teste. A melhor abordagem -seria esperar pelo elemento necessário em um período dinâmico e então continuar -a execução assim que o elemento for encontrado. - -Isso é feito usando comandos *waitFor*, como *waitForElementPresent* ou -*waitForVisible*, que espera dinamicamente, verificando a condição desejada -a cada segundo e continuando para o próximo comando no script assim que a -condição for atendida. - -## Sequências de avaliação e controle de fluxo - -Quando um script é executado, ele simplesmente é executado em sequência, um comando após o outro. - -Selenese, por si só, não suporta declarações de condição (if-else, etc.) ou -iteração (for, while, etc.). Muitos testes úteis podem ser realizados sem fluxo -de controle. No entanto, para um teste funcional de conteúdo dinâmico, possivelmente envolvendo -múltiplas páginas, a lógica de programação é frequentemente necessária. - -Quando o controle de fluxo é necessário, existem três opções: - -a) Execute o script usando Selenium-RC e uma biblioteca cliente, como Java ou - PHP para utilizar os recursos de controle de fluxo da linguagem de programação. - -b) Execute um pequeno fragmento de JavaScript de dentro do script usando o comando storeEval. - -c) Instale a extensão `goto_sel_ide.js`. - -A maioria dos testadores exportará o script de teste para um arquivo de linguagem de programação que usa a -API Selenium-RC (consulte o capítulo Selenium-IDE). No entanto, algumas organizações preferem executar seus scripts a partir do Selenium-IDE sempre que possível (por exemplo, quando eles têm -muitas pessoas de nível júnior executando testes para eles, ou quando as habilidades de programação estão -em falta). Se este for o seu caso, considere um snippet de JavaScript ou a extensão goto_sel_ide.js. - - -## Comandos de armazenamento e variáveis Selenium - -Você pode usar variáveis Selenium para armazenar constantes no -início de um script. Além disso, quando combinado com um design de teste baseado em dados -(discutido em uma seção posterior), as variáveis Selenium podem ser usadas para armazenar valores -passados para o seu programa de teste da linha de comando, de outro programa ou de -um arquivo. - -O comando *store* é o mais básico dos muitos comandos de armazenamento e pode ser usado -para simplesmente armazenar um valor constante em uma variável Selenium. Leva dois -parâmetros, o valor do texto a ser armazenado e uma variável Selenium. Use as -convenções de nomenclatura de variável padrão de apenas caracteres alfanuméricos quando -escolher um nome para sua variável. - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ---------------------------------- | -| store | paul@mysite.org | | - - -Posteriormente em seu script, você desejará usar o valor armazenado de sua -variável. Para acessar o valor de uma variável, coloque a variável em -colchetes ({}) e preceda-a com um cifrão como a seguir. - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ---------------------------------- | -| verifyText | //div/p | \\${userName} | - -Um uso comum de variáveis é armazenar a entrada para um campo input. - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ---------------------------------- | -| type | id=login | \\${userName} | - - -Variáveis Selenium podem ser usadas no primeiro ou segundo parâmetro e -são interpretadas pelo Selenium antes de quaisquer outras operações realizadas pelo -comando. Uma variável Selenium também pode ser usada em uma expressão de localização. - -Existe um comando de armazenamento equivalente para cada comando de verificação e asserção. Aqui -são alguns comandos de armazenamento mais comumente usados. - -### storeElementPresent - -Isso corresponde a verifyElementPresent. Ele simplesmente armazena um valor booleano - "true" -ou "false" - dependendo se o elemento de UI for encontrado. - -### storeText - -StoreText corresponde a verifyText. Ele usa um localizador para identificar um texto específico -na página. O texto, se encontrado, é armazenado na variável. StoreText pode ser -usado para extrair texto da página que está sendo testada. - -### storeEval - -Este comando leva um script como seu -primeiro parâmetro. A incorporação de JavaScript no Selenese é abordada na próxima seção. -StoreEval permite que o teste armazene o resultado da execução do script em uma variável. - - -## JavaScript e parâmetros Selenese - -JavaScript pode ser usado com dois tipos de parâmetros Selenese: script -e não-script (geralmente expressões). Na maioria dos casos, você deseja acessar -e/ou manipular uma variável de caso de teste dentro do snippet JavaScript usado como -um parâmetro Selenese. Todas as variáveis criadas em seu caso de teste são armazenadas em -um *array associativo* JavaScript. Uma matriz associativa tem índices de string -em vez de índices numéricos sequenciais. A matriz associativa contendo -as variáveis do seu caso de teste é chamada **storedVars**. Sempre que você quiser -acessar ou manipular uma variável em um snippet de JavaScript, você deve consultá-la como **storedVars['yourVariableName']**. - -### Usando JavaScript com parâmetros de script - -Vários comandos Selenese especificam um parâmetro **script** incluindo -**assertEval**, **verifyEval**, **storeEval** e **waitForEval**. -Esses parâmetros não requerem sintaxe especial. -Um usuário da Selenium-IDE simplesmente colocaria um snippet de código JavaScript -no campo apropriado, normalmente o campo **Target** (porque -um parâmetro **script** é normalmente o primeiro ou único parâmetro). - -O exemplo abaixo ilustra como um snippet de JavaScript -pode ser usado para realizar um cálculo numérico simples: - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ---------------------------------- | -| store | 10 | hits | -| storeXpathCount | //blockquote | blockquotes | -| storeEval | storedVars['hits'].storedVars['blockquotes'] | paragraphs | - -Este próximo exemplo ilustra como um snippet de JavaScript pode incluir chamadas para -métodos, neste caso, os métodos ``toUpperCase`` e ``toLowerCase``do objeto JavaScript String. - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ---------------------------------- | -| store | Edith Wharton | name | -| storeEval | storedVars['name'].toUpperCase() | uc | -| storeEval | storedVars['name'].toUpperCase() | lc | - - -#### Usando JavaScript com parâmetros não-script - -JavaScript também pode ser usado para ajudar a gerar valores para parâmetros, mesmo -quando o parâmetro não é especificado para ser do tipo **script**. -No entanto, neste caso, uma sintaxe especial é necessária - o parâmetro *inteiro* -deve ser prefixado por ``javascript{`` com um ``}`` final, que envolve o snippet JavaScript, -como em ``javascript{*yourCodeHere*}``. -Abaixo está um exemplo em que o segundo parâmetro do comando ``type`` -- ``value`` - é gerado através do código JavaScript usando esta sintaxe especial: - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ---------------------------------------------------- | -| store | league of nations | searchString | -| type | q | javascript{storedVars['searchString'].toUpperCase()} | - - -## *echo* - O comando de print do Selenese - -Selenese tem um comando simples que permite imprimir texto para a saída do seu teste. -Isso é útil para fornecer notas de progresso informativas em seu -teste que são exibidas no console durante a execução. Essas notas também podem ser -usadas para fornecer contexto em seus relatórios de resultados de teste, o que pode ser útil -para descobrir onde existe um defeito em uma página, caso seu teste encontre um -problema. Finalmente, declarações echo podem ser usadas para imprimir o conteúdo de -variáveis Selenium. - - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ---------------------------------------------------- | -| echo | Testing page footer now. | | -| echo | Username is \\${userName} | | - - -## Alertas, Popups e Múltiplas Janelas - -Suponha que você esteja testando uma página semelhante a esta. - -```html - - - - - - - - - - - New Window Link - - - -
- - - - -``` - -O usuário deve responder às caixas de alerta / confirmação, bem como mover o foco para as novas -janelas pop-up abertas. Felizmente, o Selenium pode cobrir pop-ups de JavaScript. - -Mas antes de começarmos a abordar alertas / confirmações / solicitações em detalhes individuais, é -útil compreender a semelhança entre eles. Alertas, caixas de confirmação -e todos os prompts têm variações do seguinte - -|Command|Description| -|--- |--- | -|assertFoo(pattern)|gera erro se o padrão não corresponder ao texto do pop-up| -|assertFooPresent|gera erro se o pop-up estiver presente| -|assertFooNotPresent|gera um erro se algum pop-up não estiver presente| -|storeFoo(variable)|armazena o texto do pop-up em uma variável| -|storeFooPresent(variable)|armazena o texto do pop-up em uma variável e retorna verdadeiro ou falso| - - -Ao executar no Selenium, pop-ups de JavaScript não aparecerão. Isto é porque -as chamadas de função são realmente substituídas em tempo de execução pelo próprio JavaScript do Selenium. -No entanto, só porque você não pode ver o pop-up, não significa que você não -tem que lidar com isso. Para lidar com um pop-up, você deve chamar sua função ``assertFoo(padrão)``. -Se você falhar em fazer a asserção da presença de um pop-up, seu próximo comando será -bloqueado e você obterá um erro semelhante ao seguinte ``[error] Error: There -was an unexpected Confirmation! [Chose an option.]`` - -### Alertas - -Vamos começar com alertas porque eles são os pop-ups mais simples de lidar. Para começar, -abra o exemplo de HTML acima em um navegador e clique no botão "Show alert". Você vai -observar que, depois de fechar o alerta, o texto "Alert is gone." é exibido na -página. Agora execute as mesmas etapas com a gravação da Selenium IDE e verifique que -o texto é adicionado após fechar o alerta. Seu teste será parecido com -este: - -|Command|Target|Value| -|--- |--- |--- | -|open|/|| -|click|btnAlert|| -|assertAlert|I’m blocking!|| -|verifyTextPresent|Alert is gone.|| - -Você pode estar pensando: "Isso é estranho, nunca tentei fazer uma asserção nesse alerta." Mas isso é a -Selenium-IDE manipulando e fechando o alerta para você. Se você remover essa etapa e repetir -o teste você obterá o seguinte erro ``[error] Error: There was an unexpected -Alert! [I'm blocking!]``. Você deve incluir uma asserção do alerta para reconhecer -sua presença. - -Se você apenas deseja verificar que um alerta está presente, mas não sabe ou não se importa -o texto que ele contém, você pode usar ``assertAlertPresent``. Isso retornará verdadeiro ou falso, -sendo que falso faz o teste parar. - -### Confirmações - -As confirmações se comportam da mesma forma que os alertas, com ``assertConfirmation`` e -``assertConfirmationPresent`` oferecendo as mesmas características de suas contrapartes de alerta. -No entanto, por padrão, o Selenium selecionará OK quando uma confirmação for exibida. Tente gravar -clicando no botão "Show confirm box" na página de amostra, mas clique no botão "Cancel" -no pop-up e, em seguida, confirme o texto de saída. Seu teste pode ser semelhante a este: - -|Command|Target|Value| -|--- |--- |--- | -|open|/|| -|click|btnConfirm|| -|chooseCancelOnNextConfirmation||| -|assertConfirmation|Choose an option.|| -|verifyTextPresent|Rejected|| - -A função ``chooseCancelOnNextConfirmation`` diz ao Selenium que todas as seguintes -confirmações devem retornar falso. Ela pode ser redefinido chamando chooseOkOnNextConfirmation. - -Você vai notar que não pode repetir este teste, porque o Selenium reclama que há -uma confirmação não tratada. Isso ocorre porque a ordem dos registros de eventos do Selenium-IDE -faz com que o clique e chooseCancelOnNextConfirmation sejam colocados na ordem errada (faz sentido -se você pensar sobre isso, o Selenium não pode saber que você está cancelando antes de abrir uma confirmação). -Simplesmente troque esses dois comandos e seu teste funcionará bem. - -### Prompts - -Os prompts se comportam da mesma forma que os alertas, com ``assertPrompt`` e ``assertPromptPresent`` -oferecendo as mesmas características que suas contrapartes de alerta. Por padrão, o Selenium irá esperar -você inserir dados quando o prompt for exibido. Tente gravar clicando no botão "Show prompt" -na página de amostra e digite "Selenium" no prompt. Seu teste pode ser semelhante a este: - -|Command|Target|Value| -|--- |--- |--- | -|open|/|| -|answerOnNextPrompt|Selenium!|| -|click|id=btnPrompt|| -|assertPrompt|What’s the best web QA tool?|| -|verifyTextPresent|Selenium!|| - -Se você escolher "Cancel" no prompt, poderá observar que answerOnNextPrompt simplesmente mostrará um -alvo em branco. Selenium trata o cancelamento e uma entrada em branco no prompt basicamente como a mesma coisa. - -## Depuração - -Depurar significa encontrar e corrigir erros em seu caso de teste. Isso é normal - e parte do desenvolvimento. - -Não vamos ensinar depuração aqui, pois a maioria dos novos usuários do Selenium já terá -alguma experiência básica com depuração. Se isso for novo para você, recomendamos -que você pergunte a um dos desenvolvedores em sua organização. - -### Pontos de interrupção e pontos de começo - -O Sel-IDE suporta a configuração de pontos de interrupção e a capacidade de iniciar e -interromper a execução de um caso de teste, de qualquer ponto dele. Ou seja, você -pode executar até um comando específico no meio do caso de teste e inspecionar como -o caso de teste se comporta nesse ponto. Para fazer isso, defina um ponto de interrupção no -comando imediatamente antes daquele a ser examinado. - -Para definir um ponto de interrupção, selecione um comando, clique com o botão direito e no menu de contexto -selecione *Alternar ponto de interrupção (Toggle Breakpoint, em inglês)*. -Em seguida, clique no botão Executar para executar seu caso de teste -do início ao ponto de interrupção. - -Às vezes também é útil executar um caso de teste de algum lugar no meio para -o final ou até um ponto de interrupção após o ponto de partida. -Por exemplo, suponha que seu caso de teste primeiro faz login no site e depois -executa uma série de testes e você está tentando depurar um desses testes. -No entanto, você só precisa fazer o login uma vez, mas precisa continuar executando novamente o seu -teste conforme você o desenvolve. Você pode fazer o login uma vez e, em seguida, executar seu caso de teste -de um ponto de início colocado após a parte de login do seu caso de teste. Isso vai -evitar que você tenha que fazer logout manualmente sempre que executar novamente. - -Para definir um ponto de partida, selecione um comando, clique com o botão direito e do contexto -no menu selecione *Definir / Limpar Ponto Inicial (Set/Clear Start Point, em inglês)*. -Em seguida, clique no botão Executar para executar o -caso de teste começando naquele ponto inicial. - -### Avançando por etapas em um caso de teste - -Para executar um caso de teste, um comando de cada vez ("percorrê-lo"), siga estes -passos: - -1. Inicie o caso de teste em executando com o botão Executar na barra de ferramentas. - -2. Pare imediatamente o caso de teste em execução com o botão Pausar. - -3. Selecione repetidamente o botão Etapa. - -### Botão Localizar - -O botão Localizar é usado para ver qual elemento da interface do usuário atualmente exibido -página da web (no navegador) é usado no comando Selenium atualmente selecionado. -Isso é útil ao construir um localizador para o primeiro parâmetro de um comando (consulte a -seção sobre: ref:`locators ` no capítulo Comandos do Selenium). -Ele pode ser usado com qualquer comando que identifica um elemento de UI em uma página da web, -ou seja, *click*, *clickAndWait*, *type* e certos comandos *assert* e *verify*, -entre outros. - -Na visualização de Tabela, selecione qualquer comando que tenha um parâmetro localizador. -Clique no botão Localizar. -Agora olhe na página da web: deve haver um retângulo verde brilhante -envolvendo o elemento especificado pelo parâmetro localizador. - -### Código Fonte da página para depuração - -Muitas vezes, ao depurar um caso de teste, você simplesmente deve olhar para o código fonte da página (o -HTML da página da web que você está tentando testar) para determinar um problema. O Firefox -torna isso mais fácil. Simplesmente clique com o botão direito na página da web e selecione 'Exibir-> Código-fonte da página. -O HTML é aberto em uma janela separada. Use seu recurso de pesquisa (Editar => Encontrar) -para procurar uma palavra-chave para encontrar o HTML do elemento de UI que você está tentando -testar. - -Como alternativa, selecione apenas a parte da página da web para a qual deseja -ver o código fonte. Em seguida, clique com o botão direito na página da web e -selecione Exibir Código Fonte da Seleção. Neste caso, a janela HTML separada conterá apenas uma pequena -quantidade de código fonte, com destaque na parte que representa a sua -seleção. - -### Assistência de localizador - -Sempre que a Selenium-IDE registra um argumento do tipo localizador, ela armazena -informações adicionais que permitem ao usuário visualizar outros possíveis -argumentos do tipo localizador que podem ser usados em seu lugar. Este recurso pode ser -muito útil para aprender mais sobre localizadores e muitas vezes é necessário para ajudar -a construir um tipo de localizador diferente do tipo que foi registrado. - -Esta assistência do localizador é apresentada na janela Selenium-IDE -como um menu suspenso acessível na extremidade direita do campo Destino (Target, em inglês) -(somente quando o campo Destino contém um argumento do tipo localizador registrado). -Abaixo está uma captura de tela mostrando o conteúdo desse menu suspenso para um comando. -Observe que a primeira coluna do menu suspenso fornece localizadores alternativos, -enquanto a segunda coluna indica o tipo de cada alternativa. - -![Selenium Locator Assistance](/images/documentation/legacy/selenium_ide_locator_assistance.png) - - -## Programando uma suíte de testes - -Uma suíte de testes é uma coleção de casos de teste que é exibida no -painel mais à esquerda na IDE. -O painel da suíte de testes pode ser aberto ou fechado manualmente selecionando um pequeno ponto -no meio da borda direita do painel (que é a borda esquerda da -janela inteira da Selenium-IDE se o painel estiver fechado). - -O painel da suíte de testes será aberto automaticamente quando uma suíte de testes existente -é aberta *ou* quando o usuário seleciona o item Novo Caso de Teste (New Test Case, em inglês) no -menu Arquivo. Neste último caso, o novo caso de teste aparecerá imediatamente -abaixo do caso de teste anterior. - -A Selenium-IDE também suporta o carregamento de casos de teste pré-existentes usando Arquivo --> Adicionar Caso de Teste. Isso permite que você adicione casos de teste existentes a -um novo conjunto de testes. - -Um arquivo de suíte de testes é um arquivo HTML que contém uma tabela de uma coluna. Cada -célula de cada linha na seção contém um link para um caso de teste. -O exemplo abaixo é de um conjunto de testes contendo quatro casos de teste: - -```html - - - - Sample Selenium Test Suite - - - - - - - - - - - - -
Test Cases for De Anza A-Z Directory Links
A Links
B Links
C Links
D Links
- - -``` - -Observação: os arquivos do caso de teste não devem ser colocados no mesmo local do arquivo do conjunto de testes - que os invoca. E em sistemas Mac OS e Linux, esse é realmente o - caso. No entanto, no momento em que este livro foi escrito, um bug impedia os usuários do Windows - de ser capaz de colocar os casos de teste em outro lugar que não com o conjunto de testes - que os invoca. - -## Extensões de usuário - -As extensões de usuário são arquivos JavaScript que permitem criar as suas próprias -personalizações e recursos para adicionar funcionalidade adicional. Frequentemente, isso está -na forma de comandos personalizados, embora esta extensibilidade não se limite a -comandos adicionais. - -Existem várias extensões úteis criadas por usuários. - -*IMPORTANTE: ESTA SEÇÃO ESTÁ DESATUALIZADA - REVISAREMOS EM BREVE.* - -* extensões: http://wiki.openqa.org/display/SEL/Contributed+User-Extensions - -[Extensão goto_sel_ide.js](http://wiki.openqa.org/download/attachments/379/goto_sel_ide.js): - -Talvez a mais popular de todas as extensões da Selenium-IDE -é aquela que fornece controle de fluxo na forma de loops while e -condicionais primitivas. Esta extensão é a goto_sel_ide.js_. Para um exemplo -de como usar a funcionalidade fornecida por esta extensão, veja a -página criada pelo autor. - -Para instalar esta extensão, coloque o nome do caminho da extensão em seu -computador no campo **Selenium Core extensions** da Selenium-IDE -Opções => Opções => Geral. - -![Selenium IDE Extensions Install](/images/documentation/legacy/selenium_ide_extensions_install.png) - -Depois de selecionar o botão **OK**, você deve fechar e reabrir a Selenium-IDE -para que o arquivo de extensões seja lido. Qualquer mudança que você fizer em uma -extensão também exigirá que você feche e reabra a Selenium-IDE. - -Informações sobre como escrever suas próprias extensões podem ser encontradas perto da -parte inferior do documento Selenium Reference. - -Às vezes, pode ser muito útil depurar passo a passo a Selenium IDE e sua -Extensão do usuário. O único depurador que parece capaz de depurar -as extensões baseadas em XUL / Chrome é o Venkman, que é suportada no Firefox até a versão 32 (incluída). -A depuração passo a passo foi verificada para funcionar com Firefox 32 e Selenium IDE 2.9.0. - -## Formato - -Formato, no menu Opções, permite que você selecione uma linguagem para salvar -e exibir o caso de teste. O padrão é HTML. - -Se você for usar Selenium-RC para executar seus casos de teste, este recurso é usado -para traduzir seu caso de teste em uma linguagem de programação. Selecione a -linguagem, por exemplo Java ou PHP, que você usará com Selenium-RC para o desenvolvimento -dos seus programas de teste. Em seguida, simplesmente salve o caso de teste usando Arquivo => Exportar Caso de Teste Como. -Seu caso de teste será traduzido para uma série de funções na linguagem que você -escolher. Essencialmente, o código do programa que suporta o seu teste é gerado para você -por Selenium-IDE. - -Além disso, observe que se o código gerado não atender às suas necessidades, você pode alterar -editando um arquivo de configuração que define o processo de geração. -Cada linguagem com suporte possui definições de configuração que podem ser editadas. Isto -está em Opções => Opções => Formatos. - -## Executando testes da Selenium-IDE em diferentes navegadores - -Embora o Selenium-IDE só possa executar testes no Firefox, os testes -desenvolvidos com Selenium-IDE podem ser executados em outros navegadores, usando uma -interface de linha de comando simples que invoca o servidor Selenium-RC. Este tópico -é abordado na seção: ref: `Executar testes Selenese ` no capítulo -Selenium-RC. A opção de linha de comando *-htmlSuite* é o recurso específico de interesse. - -## Solução de problemas - -Abaixo está uma lista de pares de imagem / explicação que descrevem -fontes de problemas com Selenium-IDE: - -*Table view is not available with this format.* - -Esta mensagem pode ser exibida ocasionalmente na guia Tabela quando a Selenium IDE é -lançada. A solução alternativa é fechar e reabrir a Selenium IDE. Veja -a [issue 1008](http://code.google.com/p/selenium/issues/detail?id=1008). -Para maiores informações. Se você é capaz de reproduzir isso de forma confiável, por favor -forneça detalhes para que possamos trabalhar em uma correção. - ------------------- - -*error loading test case: no command found* - -Você usou **File => Open** para tentar abrir um arquivo de suíte de testes. Use **File => Open -Test Suite** em vez disso. - -Uma solicitação de aprimoramento foi levantada para melhorar esta mensagem de erro. Veja -a [issue 1010](http://code.google.com/p/selenium/issues/detail?id=1010). - ------------------- - -![Selenium IDE Trouble Timing](/images/documentation/legacy/selenium_ide_trouble_timing.png) - -Este tipo de **erro** pode indicar um problema de tempo, ou seja, o elemento -especificado por um localizador em seu comando não foi totalmente carregado quando o comando -foi executado. Tente colocar um **pause 5000** antes do comando para determinar -se o problema está realmente relacionado ao tempo. Em caso afirmativo, investigue usando um -comando **waitFor\*** ou **\*AndWait** apropriado antes do comando com falha. - ------------------- - -![Selenium IDE Trouble Param](/images/documentation/legacy/selenium_ide_trouble_param.png) - -Sempre que sua tentativa de usar a substituição de variável falha, como é o -caso para o comando **open** acima, isso indica -que você não criou realmente a variável cujo valor você está -tentando acessar. Isto é -às vezes devido a colocar a variável no campo **Valor** quando -deve estar no campo **Destino** ou vice-versa. No exemplo acima, -os dois parâmetros para o comando **store** foram erroneamente -colocados na ordem inversa do que é necessário. -Para qualquer comando Selenese, o primeiro parâmetro obrigatório deve ir -no campo **Destino** e o segundo parâmetro obrigatório (se houver) -deve ir no campo **Valor**. - ----------- - -*error loading test case: [Exception... "Component returned failure code: -0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIFileInputStream.init]" nresult: -"0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: -chrome://selenium-ide/content/file-utils.js :: anonymous :: line 48" data: no]* - -Um dos casos de teste em seu conjunto de testes não pode ser encontrado. Certifique-se de que -o caso de teste está realmente localizado onde o conjunto de testes indica que ele está localizado. Além disso, -certifique-se de que seus arquivos de caso de teste tenham a extensão .html em -seus nomes de arquivo e no arquivo de suíte de testes onde são referenciados. - -Uma solicitação de aprimoramento foi levantada para melhorar esta mensagem de erro. Veja -a [issue 1011](http://code.google.com/p/selenium/issues/detail?id=1011). - ----------- - -![Selenium IDE Trouble Extension](/images/documentation/legacy/selenium_ide_trouble_extension.png) - -O conteúdo do seu arquivo de extensão não foi lido pela Selenium-IDE. -Certifique-se de ter especificado o nome do caminho adequado para o arquivo de extensões via -**Options => Options => General** no campo **Selenium Core extensions**. -Além disso, a Selenium-IDE deve ser reiniciada após qualquer alteração em um -arquivo de extensões *ou* no conteúdo do campo **Selenium Core extensions**. diff --git a/website_and_docs/content/documentation/legacy/selenium_ide/_index.zh-cn.md b/website_and_docs/content/documentation/legacy/selenium_ide/_index.zh-cn.md deleted file mode 100644 index 28ad7f67e884..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_ide/_index.zh-cn.md +++ /dev/null @@ -1,1749 +0,0 @@ ---- -title: "Legacy Selenium IDE" -linkTitle: "Selenium IDE" -weight: 8 ---- - -{{% pageinfo color="warning" %}} -

- - Most of the documentation found in this section is still in English. - Please note we are not accepting pull requests to translate this content - as translating documentation of legacy components does not add value to - the community nor the project. -

-{{% /pageinfo %}} - -## Introduction - -The Selenium-IDE (Integrated Development Environment) is the tool you use to -develop your Selenium test cases. It’s an easy-to-use Firefox plug-in and is -generally the most efficient way to develop test cases. It also contains a -context menu that allows you to first select a UI element from the browser’s -currently displayed page and then select from a list of Selenium commands with -parameters pre-defined according to the context of the selected UI element. -This is not only a time-saver, but also an excellent way of learning Selenium -script syntax. - -This chapter is all about the Selenium IDE and how to use it effectively. - -## Installing the IDE - -Using Firefox, first, download the IDE from the SeleniumHQ [downloads page](https://selenium.dev/downloads) - -Firefox will protect you from installing addons from unfamiliar locations, so -you will need to click ‘Allow’ to proceed with the installation, as shown in -the following screenshot. - -![Selenium IDE Installation 1](/images/documentation/legacy/selenium_ide_installation_1.png) - -When downloading from Firefox, you’ll be presented with the following window. - -![Selenium IDE Installation 2](/images/documentation/legacy/selenium_ide_installation_2.png) - -Select Install Now. The Firefox Add-ons window pops up, first showing a progress bar, -and when the download is complete, displays the following. - -![Selenium IDE Installation 3](/images/documentation/legacy/selenium_ide_installation_3.png) - -Restart Firefox. After Firefox reboots you will find the Selenium-IDE listed under -the Firefox Tools menu. - -![Selenium IDE Installation 4](/images/documentation/legacy/selenium_ide_installation_4.png) - -## Opening the IDE - -To run the Selenium-IDE, simply select it from the Firefox Tools menu. It opens -as follows with an empty script-editing window and a menu for loading, or -creating new test cases. - -![Selenium IDE Open](/images/documentation/legacy/selenium_ide_open.png) - -## IDE Features - -### Menu Bar - -The File menu has options for Test Case and Test Suite (suite of Test Cases). -Using these you can add a new Test Case, open a Test Case, save a Test Case, -export Test Case in a language of your choice. You can also open the recent -Test Case. All these options are also available for Test Suite. - -The Edit menu allows copy, paste, delete, undo, and select all operations for -editing the commands in your test case. The Options menu allows the changing of -settings. You can set the timeout value for certain commands, add user-defined -user extensions to the base set of Selenium commands, and specify the format -(language) used when saving your test cases. The Help menu is the standard -Firefox Help menu; only one item on this menu–UI-Element Documentation–pertains -to Selenium-IDE. - -### Toolbar - -The toolbar contains buttons for controlling the execution of your test cases, -including a step feature for debugging your test cases. The right-most button, -the one with the red-dot, is the record button. - -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_1.png) -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_2.png) - -Speed Control: controls how fast your test case runs. - -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_3.png) - -Run All: Runs the entire test suite when a test suite with multiple test cases is loaded. - -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_4.png) - -Run: Runs the currently selected test. When only a single test is loaded -this button and the Run All button have the same effect. - -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_5.png) -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_6.png) - -Pause/Resume: Allows stopping and re-starting of a running test case. - -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_7.png) - -Step: Allows you to “step” through a test case by running it one command at a time. -Use for debugging test cases. - -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_8.png) - -TestRunner Mode: Allows you to run the test case in a browser loaded with the -Selenium-Core TestRunner. The TestRunner is not commonly used now and is likely -to be deprecated. This button is for evaluating test cases for backwards -compatibility with the TestRunner. Most users will probably not need this -button. - -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_9.png) - -Apply Rollup Rules: This advanced feature allows repetitive sequences of -Selenium commands to be grouped into a single action. Detailed documentation on -rollup rules can be found in the UI-Element Documentation on the Help menu. - -![Selenium IDE Features](/images/documentation/legacy/selenium_ide_features_10.png) - - -### Test Case Pane - -Your script is displayed in the test case pane. It has two tabs, one for -displaying the command and their parameters in a readable “table” format. - -![Selenium IDE Image Pane](/images/documentation/legacy/selenium_ide_image_pane.png) - -The other tab - Source displays the test case in the native format in which the -file will be stored. By default, this is HTML although it can be changed to a -programming language such as Java or C#, or a scripting language like Python. -See the Options menu for details. The Source view also allows one to edit the -test case in its raw form, including copy, cut and paste operations. - -The Command, Target, and Value entry fields display the currently selected -command along with its parameters. These are entry fields where you can modify -the currently selected command. The first parameter specified for a command in -the Reference tab of the bottom pane always goes in the Target field. If a -second parameter is specified by the Reference tab, it always goes in the Value -field. - -![Selenium IDE Entry Fields](/images/documentation/legacy/selenium_ide_entry_fields.png) - -If you start typing in the Command field, a drop-down list will be populated -based on the first characters you type; you can then select your desired -command from the drop-down. - -### Log/Reference/UI-Element/Rollup Pane - -The bottom pane is used for four different functions–Log, Reference, -UI-Element, and Rollup–depending on which tab is selected. - -#### Log - -When you run your test case, error messages and information messages showing -the progress are displayed in this pane automatically, even if you do not first -select the Log tab. These messages are often useful for test case debugging. -Notice the Clear button for clearing the Log. Also notice the Info button is a -drop-down allowing selection of different levels of information to log. - -![Selenium IDE Bottom Box](/images/documentation/legacy/selenium_ide_bottom_box.png) - - -#### Reference - -The Reference tab is the default selection whenever you are entering or -modifying Selenese commands and parameters in Table mode. In Table mode, the -Reference pane will display documentation on the current command. When entering -or modifying commands, whether from Table or Source mode, it is critically -important to ensure that the parameters specified in the Target and Value -fields match those specified in the parameter list in the Reference pane. The -number of parameters provided must match the number specified, the order of -parameters provided must match the order specified, and the type of parameters -provided must match the type specified. If there is a mismatch in any of these -three areas, the command will not run correctly. - -![Selenium IDE Bottom Box](/images/documentation/legacy/selenium_ide_bottom_box_ref.png) - -While the Reference tab is invaluable as a quick reference, it is still often -necessary to consult the Selenium Reference document. - -#### UI-Element and Rollup - -Detailed information on these two panes (which cover advanced features) can be -found in the UI-Element Documentation on the Help menu of Selenium-IDE. - -## Building Test Cases - -There are three primary methods for developing test cases. Frequently, a test -developer will require all three techniques. - -### Recording - -Many first-time users begin by recording a test case from their interactions -with a website. When Selenium-IDE is first opened, the record button is ON by -default. If you do not want Selenium-IDE to begin recording automatically you -can turn this off by going under Options > Options… and deselecting “Start -recording immediately on open.” - -During recording, Selenium-IDE will automatically insert commands into your -test case based on your actions. Typically, this will include: - -* clicking a link - click or clickAndWait commands -* entering values - type command -* selecting options from a drop-down listbox - select command -* clicking checkboxes or radio buttons - click command - -Here are some “gotchas” to be aware of: - -* The type command may require clicking on some other area of the web page for it -to record. -* Following a link usually records a click command. You will often need to change -this to clickAndWait to ensure your test case pauses until the new page is -completely loaded. Otherwise, your test case will continue running commands -before the page has loaded all its UI elements. This will cause unexpected test -case failures. - -### Adding Verifications and Asserts With the Context Menu - -Your test cases will also need to check the properties of a web-page. This -requires assert and verify commands. We won’t describe the specifics of these -commands here; that is in the chapter on Selenium Commands – “Selenese”. Here -we’ll simply describe how to add them to your test case. - -With Selenium-IDE recording, go to the browser displaying your test application -and right click anywhere on the page. You will see a context menu showing -verify and/or assert commands. - -The first time you use Selenium, there may only be one Selenium command listed. -As you use the IDE however, you will find additional commands will quickly be -added to this menu. Selenium-IDE will attempt to predict what command, along -with the parameters, you will need for a selected UI element on the current -web-page. - -Let’s see how this works. Open a web-page of your choosing and select a block -of text on the page. A paragraph or a heading will work fine. Now, right-click -the selected text. The context menu should give you a verifyTextPresent command -and the suggested parameter should be the text itself. - -Also, notice the Show All Available Commands menu option. This shows many, many -more commands, again, along with suggested parameters, for testing your -currently selected UI element. - -Try a few more UI elements. Try right-clicking an image, or a user control like -a button or a checkbox. You may need to use Show All Available Commands to see -options other than verifyTextPresent. Once you select these other options, the -more commonly used ones will show up on the primary context menu. For example, -selecting verifyElementPresent for an image should later cause that command to -be available on the primary context menu the next time you select an image and -right-click. - -Again, these commands will be explained in detail in the chapter on Selenium -commands. For now though, feel free to use the IDE to record and select -commands into a test case and then run it. You can learn a lot about the -Selenium commands simply by experimenting with the IDE. - -### Editing - -#### Insert Command - -##### Table View - -Select the point in your test case where you want to insert the command. To do -this, in the Test Case Pane, left-click on the line where you want to insert a -new command. Right-click and select Insert Command; the IDE will add a blank -line just ahead of the line you selected. Now use the command editing text -fields to enter your new command and its parameters. - -##### Source View - -Select the point in your test case where you want to insert the command. To do -this, in the Test Case Pane, left-click between the commands where you want to -insert a new command, and enter the HTML tags needed to create a 3-column row -containing the Command, first parameter (if one is required by the Command), -and second parameter (again, if one is required to locate an element) and third -parameter(again, if one is required to have a value). Example: - -```html - - Command - target (locator) - Value - -``` - -#### Insert Comment - -Comments may be added to make your test case more readable. These comments are -ignored when the test case is run. - -Comments may also be used to add vertical white space (one or more blank lines) -in your tests; just create empty comments. An empty command will cause an error -during execution; an empty comment won’t. - -##### Table View - -Select the line in your test case where you want to insert the comment. -Right-click and select Insert Comment. Now use the Command field to enter the -comment. Your comment will appear in purple text. - -##### Source View - -Select the point in your test case where you want to insert the comment. Add an -HTML-style comment, i.e., ``. - -#### Edit a Command or Comment - -##### Table View - -Simply select the line to be changed and edit it using the Command, Target, -and Value fields. - -##### Source View - -Since Source view provides the equivalent of a WYSIWYG (What You See is What -You Get) editor, simply modify which line you wish–command, parameter, or comment. - -### Opening and Saving a Test Case - -Like most programs, there are Save and Open commands under the File menu. -However, Selenium distinguishes between test cases and test suites. To save -your Selenium-IDE tests for later use you can either save the individual test -cases, or save the test suite. If the test cases of your test suite have not -been saved, you’ll be prompted to save them before saving the test suite. - -When you open an existing test case or suite, Selenium-IDE displays its -Selenium commands in the Test Case Pane. - -## Running Test Cases - -The IDE allows many options for running your test case. You can run a test case -all at once, stop and start it, run it one line at a time, run a single command -you are currently developing, and you can do a batch run of an entire test -suite. Execution of test cases is very flexible in the IDE. - -**Run a Test Case** - -Click the Run button to run the currently displayed test case. - -**Run a Test Suite** - -Click the Run All button to run all the test cases in the currently loaded test -suite. - -**Stop and Start** - -The Pause button can be used to stop the test case while it is running. The -icon of this button then changes to indicate the Resume button. To continue -click Resume. - -**Stop in the Middle** - -You can set a breakpoint in the test case to cause it to stop on a particular -command. This is useful for debugging your test case. To set a breakpoint, -select a command, right-click, and from the context menu select Toggle -Breakpoint. - -**Start from the Middle** - -You can tell the IDE to begin running from a specific command in the middle of -the test case. This also is used for debugging. To set a startpoint, select a -command, right-click, and from the context menu select Set/Clear Start Point. - -**Run Any Single Command** - -Double-click any single command to run it by itself. This is useful when -writing a single command. It lets you immediately test a command you are -constructing, when you are not sure if it is correct. You can double-click it -to see if it runs correctly. This is also available from the context menu. - -## Using Base URL to Run Test Cases in Different Domains - -The Base URL field at the top of the Selenium-IDE window is very useful for -allowing test cases to be run across different domains. Suppose that a site -named http://news.portal.com had an in-house beta site named -http://beta.news.portal.com. Any test cases for these sites that begin with an -open statement should specify a relative URL as the argument to open rather -than an absolute URL (one starting with a protocol such as http: or https:). -Selenium-IDE will then create an absolute URL by appending the open command’s -argument onto the end of the value of Base URL. For example, the test case -below would be run against http://news.portal.com/about.html: - -![Selenium IDE Prod URL](/images/documentation/legacy/selenium_ide_base_url_prod.png) - -This same test case with a modified Base URL setting would be run against -http://beta.news.portal.com/about.html: - -![Selenium IDE Beta URL](/images/documentation/legacy/selenium_ide_base_url_beta.png) - -## Selenium Commands – “Selenese” - -Selenium commands, often called selenese, are the set of commands that run your -tests. A sequence of these commands is a test script. Here we explain those -commands in detail, and we present the many choices you have in testing your -web application when using Selenium. - -Selenium provides a rich set of commands for fully testing your web-app in -virtually any way you can imagine. The command set is often called selenese. -These commands essentially create a testing language. - -In selenese, one can test the existence of UI elements based on their HTML -tags, test for specific content, test for broken links, input fields, selection -list options, submitting forms, and table data among other things. In addition -Selenium commands support testing of window size, mouse position, alerts, Ajax -functionality, pop up windows, event handling, and many other web-application -features. The Command Reference lists all the available commands. - -A command tells Selenium what to do. Selenium commands come in three “flavors”: -**Actions**, **Accessors**, and **Assertions**. - -* **Actions** are commands that generally manipulate the state of the application. -They do things like “click this link” and “select that option”. If an Action -fails, or has an error, the execution of the current test is stopped. - - Many Actions can be called with the “AndWait” suffix, e.g. “clickAndWait”. This - suffix tells Selenium that the action will cause the browser to make a call to - the server, and that Selenium should wait for a new page to load. - -* **Accessors** examine the state of the application and store the results in -variables, e.g. “storeTitle”. They are also used to automatically generate -Assertions. - -* **Assertions** are like Accessors, but they verify that the state of the -application conforms to what is expected. Examples include “make sure the page -title is X” and “verify that this checkbox is checked”. - -All Selenium Assertions can be used in 3 modes: “assert”, “verify”, and ” -waitFor”. For example, you can “assertText”, “verifyText” and “waitForText”. -When an “assert” fails, the test is aborted. When a “verify” fails, the test -will continue execution, logging the failure. This allows a single “assert” to -ensure that the application is on the correct page, followed by a bunch of -“verify” assertions to test form field values, labels, etc. - -“waitFor” commands wait for some condition to become true (which can be useful -for testing Ajax applications). They will succeed immediately if the condition -is already true. However, they will fail and halt the test if the condition -does not become true within the current timeout setting (see the setTimeout -action below). - -## Script Syntax - -Selenium commands are simple, they consist of the command and two parameters. -For example: - -| | | | -| -------- | ---------------------------- | ----------- | -| verifyText | //div//a[2] | Login | - -The parameters are not always required; it depends on the command. In some -cases both are required, in others one parameter is required, and in still -others the command may take no parameters at all. Here are a couple more -examples: - -| | | | -| -------- | ---------------------------- | ----------------------------- | -| goBackAndWait | | | -| verifyTextPresent | | Welcome to My Home Page | -| type | id=phone | (555) 666-7066 | -| type | id=address1 | ${myVariableAddress} | - -The command reference describes the parameter requirements for each command. - -Parameters vary, however they are typically: - -* a locator for identifying a UI element within a page. -* a text pattern for verifying or asserting expected page content -* a text pattern or a Selenium variable for entering text in an input field or -for selecting an option from an option list. - -Locators, text patterns, Selenium variables, and the commands themselves are -described in considerable detail in the section on Selenium Commands. - -Selenium scripts that will be run from Selenium-IDE will be stored in an HTML -text file format. This consists of an HTML table with three columns. The first -column identifies the Selenium command, the second is a target, and the final -column contains a value. The second and third columns may not require values -depending on the chosen Selenium command, but they should be present. Each -table row represents a new Selenium command. Here is an example of a test that -opens a page, asserts the page title and then verifies some content on the page: - -```html - - - - -
open/download/
assertTitleDownloads
verifyText//h2Downloads
-``` - -Rendered as a table in a browser this would look like the following: - -| | | | -| -------- | ---------------------------- | ----------------------------- | -| open | /download/ | | -| assertTitle | | Downloads | -| verifyText | //h2 | Downloads | - -The Selenese HTML syntax can be used to write and run tests without requiring -knowledge of a programming language. With a basic knowledge of selenese and -Selenium-IDE you can quickly produce and run testcases. - -## Test Suites - -A test suite is a collection of tests. Often one will run all the tests in a -test suite as one continuous batch-job. - -When using Selenium-IDE, test suites also can be defined using a simple HTML -file. The syntax again is simple. An HTML table defines a list of tests where -each row defines the filesystem path to each test. An example tells it all. - -```html - - -Test Suite Function Tests - Priority 1 - - - - - - - -
Suite Of Tests
Login
Test Searching for Values
Test Save
- - -``` - -A file similar to this would allow running the tests all at once, one after -another, from the Selenium-IDE. - -Test suites can also be maintained when using Selenium-RC. This is done via -programming and can be done a number of ways. Commonly Junit is used to -maintain a test suite if one is using Selenium-RC with Java. Additionally, if -C# is the chosen language, Nunit could be employed. If using an interpreted -language like Python with Selenium-RC then some simple programming would be -involved in setting up a test suite. Since the whole reason for using -Selenium-RC is to make use of programming logic for your testing this usually -isn’t a problem. - -## Commonly Used Selenium Commands - -To conclude our introduction of Selenium, we’ll show you a few typical Selenium -commands. These are probably the most commonly used commands for building -tests. - -**open** - -opens a page using a URL. - -**click/clickAndWait** - -performs a click operation, and optionally waits for a new page to load. - -**verifyTitle/assertTitle** - -verifies an expected page title. - -**verifyTextPresent** - -verifies expected text is somewhere on the page. - -**verifyElementPresent** - -verifies an expected UI element, as defined by its HTML tag, is present on the -page. - -**verifyText** - -verifies expected text and its corresponding HTML tag are present on the page. - -**verifyTable** - -verifies a table’s expected contents. - -**waitForPageToLoad** - -pauses execution until an expected new page loads. Called automatically when -clickAndWait is used. - -**waitForElementPresent** - -pauses execution until an expected UI element, as defined by its HTML tag, is -present on the page. - -## Verifying Page Elements - -Verifying UI elements on a web page is probably the most common feature of your -automated tests. Selenese allows multiple ways of checking for UI elements. It -is important that you understand these different methods because these methods -define what you are actually testing. - -For example, will you test that… - -1. an element is present somewhere on the page? -1. specific text is somewhere on the page? -1. specific text is at a specific location on the page? - -For example, if you are testing a text heading, the text and its position at -the top of the page are probably relevant for your test. If, however, you are -testing for the existence of an image on the home page, and the web designers -frequently change the specific image file along with its position on the page, -then you only want to test that an image (as opposed to the specific image -file) exists somewhere on the page. - -## Assertion or Verification? - -Choosing between “assert” and “verify” comes down to convenience and management -of failures. There’s very little point checking that the first paragraph on the -page is the correct one if your test has already failed when checking that the -browser is displaying the expected page. If you’re not on the correct page, -you’ll probably want to abort your test case so that you can investigate the -cause and fix the issue(s) promptly. On the other hand, you may want to check -many attributes of a page without aborting the test case on the first failure -as this will allow you to review all failures on the page and take the -appropriate action. Effectively an “assert” will fail the test and abort the -current test case, whereas a “verify” will fail the test and continue to run -the test case. - -The best use of this feature is to logically group your test commands, and -start each group with an “assert” followed by one or more “verify” test -commands. An example follows: - -| Command | Target | Value | -| -------- | ---------------------------- | ----------------------------- | -| open | /download/ | | -| assertTitle | | Downloads | -| verifyText | //h2 | Downloads | -| assertTable | 1.2.1 | Selenium IDE | -| verifyTable | 1.2.2 | June 3, 2008 | -| verifyTable | 1.2.3 | 1.0 beta 2 | - -The above example first opens a page and then “asserts” that the correct page -is loaded by comparing the title with the expected value. Only if this passes -will the following command run and “verify” that the text is present in the -expected location. The test case then “asserts” the first column in the second -row of the first table contains the expected value, and only if this passed -will the remaining cells in that row be “verified”. - -### **verifyTextPresent** - -The command `verifyTextPresent` is used to verify specific text exists somewhere -on the page. It takes a single argument–the text pattern to be verified. For -example: - -| Command | Target | Value | -| -------- | ---------------------------- | ----------------------------- | -| verifyTextPresent | Marketing Analysis | | - -This would cause Selenium to search for, and verify, that the text string -“Marketing Analysis” appears somewhere on the page currently being tested. Use -verifyTextPresent when you are interested in only the text itself being present -on the page. Do not use this when you also need to test where the text occurs -on the page. - -### **verifyElementPresent** - -Use this command when you must test for the presence of a specific UI element, -rather than its content. This verification does not check the text, only the -HTML tag. One common use is to check for the presence of an image. - -| Command | Target | Value | -| -------- | ---------------------------- | ----------------------------- | -| verifyElementPresent | //div/p/img | | - -This command verifies that an image, specified by the existence of an -HTML tag, is present on the page, and that it follows a
tag and a

-tag. The first (and only) parameter is a locator for telling the Selenese -command how to find the element. Locators are explained in the next section. - -`verifyElementPresent` can be used to check the existence of any HTML tag within -the page. You can check the existence of links, paragraphs, divisions

, -etc. Here are a few more examples. - -| Command | Target | Value | -| -------- | ---------------------------- | ----------------------------- | -| verifyElementPresent | //div/p | | -| verifyElementPresent | //div/a | | -| verifyElementPresent | id=Login | | -| verifyElementPresent | link=Go to Marketing Research | | -| verifyElementPresent | //a[2] | | -| verifyElementPresent | //head/title | | - -These examples illustrate the variety of ways a UI element may be tested. Again, -locators are explained in the next section. - -### **verifyText** - -Use `verifyText` when both the text and its UI element must be tested. verifyText -must use a locator. If you choose an _XPath_ or _DOM_ locator, you can verify that -specific text appears at a specific location on the page relative to other UI -components on the page. - -| Command | Target | Value | -| -------- | ---------------------------- | ------------------------------------------------------------------- | -| verifyText | //table/tr/td/div/p | This is my text and it occurs right after the div inside the table. | - - -## Locating Elements - -For many Selenium commands, a target is required. This target identifies an -element in the content of the web application, and consists of the location -strategy followed by the location in the format `locatorType=location`. The -locator type can be omitted in many cases. The various locator types are -explained below with examples for each. - -### Locating by Identifier - -This is probably the most common method of locating elements and is the -catch-all default when no recognized locator type is used. With this strategy, -the first element with the id attribute value matching the location will be used. If -no element has a matching id attribute, then the first element with a name -attribute matching the location will be used. - -For instance, your page source could have id and name attributes -as follows: - -```html - - -
- - - -
- - -``` - -The following locator strategies would return the elements from the HTML -snippet above indicated by line number: - -- ``identifier=loginForm`` (3) -- ``identifier=password`` (5) -- ``identifier=continue`` (6) -- ``continue`` (6) - -Since the ``identifier`` type of locator is the default, the ``identifier=`` -in the first three examples above is not necessary. - -### Locating by Id - -This type of locator is more limited than the identifier locator type, but -also more explicit. Use this when you know an element's id attribute. - -```html - - -
- - - - -
- - -``` - -- ``id=loginForm`` (3) - -### Locating by Name - -The name locator type will locate the first element with a matching name -attribute. If multiple elements have the same value for a name attribute, then -you can use filters to further refine your location strategy. The default -filter type is value (matching the value attribute). - -```html - - -
- - - - -
- - -``` - -- ``name=username`` (4) -- ``name=continue value=Clear`` (7) -- ``name=continue Clear`` (7) -- ``name=continue type=button`` (7) - -Note: Unlike some types of XPath and DOM locators, the three - types of locators above allow Selenium to test a UI element independent - of its location on - the page. So if the page structure and organization is altered, the test - will still pass. You may or may not want to also test whether the page - structure changes. In the case where web designers frequently alter the - page, but its functionality must be regression tested, testing via id and - name attributes, or really via any HTML property, becomes very important. - -### Locating by XPath - -XPath is the language used for locating nodes in an XML document. As HTML can -be an implementation of XML (XHTML), Selenium users can leverage this powerful -language to target elements in their web applications. XPath extends beyond (as -well as supporting) the simple methods of locating by id or name -attributes, and opens up all sorts of new possibilities such as locating the -third checkbox on the page. - -One of the main reasons for using XPath is when you don't have a suitable id -or name attribute for the element you wish to locate. You can use XPath to -either locate the element in absolute terms (not advised), or relative to an -element that does have an id or name attribute. XPath locators can also be -used to specify elements via attributes other than id and name. - -Absolute XPaths contain the location of all elements from the root (html) and -as a result are likely to fail with only the slightest adjustment to the -application. By finding a nearby element with an id or name attribute (ideally -a parent element) you can locate your target element based on the relationship. -This is much less likely to change and can make your tests more robust. - -Since only ``xpath`` locators start with "//", it is not necessary to include -the ``xpath=`` label when specifying an XPath locator. - -```html - - -
- - - - -
- - -``` - -- ``xpath=/html/body/form[1]`` (3) - *Absolute path (would break if the HTML was - changed only slightly)* -- ``//form[1]`` (3) - *First form element in the HTML* -- ``xpath=//form[@id='loginForm']`` (3) - *The form element with attribute named 'id' and the value 'loginForm'* -- ``xpath=//form[input/@name='username']`` (3) - *First form element with an input child - element with attribute named 'name' and the value 'username'* -- ``//input[@name='username']`` (4) - *First input element with attribute named 'name' and the value - 'username'* -- ``//form[@id='loginForm']/input[1]`` (4) - *First input child element of the - form element with attribute named 'id' and the value 'loginForm'* -- ``//input[@name='continue'][@type='button']`` (7) - *Input with attribute named 'name' and the value 'continue' - and attribute named 'type' and the value 'button'* -- ``//form[@id='loginForm']/input[4]`` (7) - *Fourth input child element of the - form element with attribute named 'id' and value 'loginForm'* - -These examples cover some basics, but in order to learn more, the -following references are recommended: - -* [W3Schools XPath Tutorial](http://www.w3schools.com/xml/xpath_intro.asp>) -* [W3C XPath Recommendation](http://www.w3.org/TR/xpath) - -There are also a couple of very useful Firefox Add-ons that can assist in -discovering the XPath of an element: - -* [XPath Checker](https://addons.mozilla.org/en-US/firefox/addon/1095?id=1095) - XPath and can be used to test XPath results. -* [Firebug](https://addons.mozilla.org/en-US/firefox/addon/1843 - XPath - suggestions are just one of the many powerful features of this very useful add-on. - -### Locating Hyperlinks by Link Text - -This is a simple method of locating a hyperlink in your web page by using the -text of the link. If two links with the same text are present, then the first -match will be used. - -```html - - -

Are you sure you want to do this?

- Continue - Cancel - - -``` - -- ``link=Continue`` (4) -- ``link=Cancel`` (5) - - -### Locating by DOM - -The Document Object Model represents an HTML document and can be accessed -using JavaScript. This location strategy takes JavaScript that evaluates to -an element on the page, which can be simply the element's location using the -hierarchical dotted notation. - -Since only ``dom`` locators start with "document", it is not necessary to include -the ``dom=`` label when specifying a DOM locator. - -```html - - -
- - - - -
- - -``` - -- ``dom=document.getElementById('loginForm')`` (3) -- ``dom=document.forms['loginForm']`` (3) -- ``dom=document.forms[0]`` (3) -- ``document.forms[0].username`` (4) -- ``document.forms[0].elements['username']`` (4) -- ``document.forms[0].elements[0]`` (4) -- ``document.forms[0].elements[3]`` (7) - -You can use Selenium itself as well as other sites and extensions to explore -the DOM of your web application. A good reference exists on [W3Schools](http://www.w3schools.com/js/js_htmldom.asp). - -### Locating by CSS - -CSS (Cascading Style Sheets) is a language for describing the rendering of HTML -and XML documents. CSS uses Selectors for binding style properties to elements -in the document. These Selectors can be used by Selenium as another locating -strategy. - -```html - - -
- - - - -
- - -``` - -- ``css=form#loginForm`` (3) -- ``css=input[name="username"]`` (4) -- ``css=input.required[type="text"]`` (4) -- ``css=input.passfield`` (5) -- ``css=#loginForm input[type="button"]`` (7) -- ``css=#loginForm input:nth-child(2)`` (5) - -For more information about CSS Selectors, the best place to go is [the W3C -publication](http://www.w3.org/TR/css3-selectors/). You'll find additional -references there. - -### Implicit Locators - -You can choose to omit the locator type in the following situations: - - - Locators without an explicitly defined locator strategy will default - to using the identifier locator strategy. See `Locating by Identifier`_. - - - Locators starting with "//" will use the XPath locator strategy. - See `Locating by XPath`_. - - - Locators starting with "document" will use the DOM locator strategy. - See `Locating by DOM`_ - - -## Matching Text Patterns - -Like locators, *patterns* are a type of parameter frequently required by Selenese -commands. Examples of commands which require patterns are **verifyTextPresent**, -**verifyTitle**, **verifyAlert**, **assertConfirmation**, **verifyText**, and -**verifyPrompt**. And as has been mentioned above, link locators can utilize -a pattern. Patterns allow you to *describe*, via the use of special characters, -what text is expected rather than having to specify that text exactly. - -There are three types of patterns: *globbing*, *regular expressions*, and *exact*. - -### Globbing Patterns - -Most people are familiar with globbing as it is utilized in -filename expansion at a DOS or Unix/Linux command line such as ``ls *.c``. -In this case, globbing is used to display all the files ending with a ``.c`` -extension that exist in the current directory. Globbing is fairly limited. -Only two special characters are supported in the Selenium implementation: - -`*` which translates to "match anything," i.e., nothing, a single character, or many characters. - -`[ ]` (*character class*) which translates to "match any single character -found inside the square brackets." A dash (hyphen) can be used as a shorthand -to specify a range of characters (which are contiguous in the ASCII character -set). A few examples will make the functionality of a character class clear: - -``[aeiou]`` matches any lowercase vowel - -``[0-9]`` matches any digit - -``[a-zA-Z0-9]`` matches any alphanumeric character - -In most other contexts, globbing includes a third special character, the **?**. -However, Selenium globbing patterns only support the asterisk and character -class. - -To specify a globbing pattern parameter for a Selenese command, you can -prefix the pattern with a **glob:** label. However, because globbing -patterns are the default, you can also omit the label and specify just the -pattern itself. - -Below is an example of two commands that use globbing patterns. The -actual link text on the page being tested -was "Film/Television Department"; by using a pattern -rather than the exact text, the **click** command will work even if the -link text is changed to "Film & Television Department" or "Film and Television -Department". The glob pattern's asterisk will match "anything or nothing" -between the word "Film" and the word "Television". - -| Command | Target | Value | -| -------- | -------------------------------------- | ------------------------------------------------------------------ | -| click | link=glob:Film*Television Department | | -| verifyTitle | glob:\*Film\*Television\* | | - - -The actual title of the page reached by clicking on the link was "De Anza Film And -Television Department - Menu". By using a pattern rather than the exact -text, the ``verifyTitle`` will pass as long as the two words "Film" and "Television" appear -(in that order) anywhere in the page's title. For example, if -the page's owner should shorten -the title to just "Film & Television Department," the test would still pass. -Using a pattern for both a link and a simple test that the link worked (such as -the ``verifyTitle`` above does) can greatly reduce the maintenance for such -test cases. - -#### Regular Expression Patterns - -*Regular expression* patterns are the most powerful of the three types -of patterns that Selenese supports. Regular expressions -are also supported by most high-level programming languages, many text -editors, and a host of tools, including the Linux/Unix command-line -utilities **grep**, **sed**, and **awk**. In Selenese, regular -expression patterns allow a user to perform many tasks that would -be very difficult otherwise. For example, suppose your test needed -to ensure that a particular table cell contained nothing but a number. -``regexp: [0-9]+`` is a simple pattern that will match a decimal number of any length. - -Whereas Selenese globbing patterns support only the **\*** -and **[ ]** (character -class) features, Selenese regular expression patterns offer the same -wide array of special characters that exist in JavaScript. Below -are a subset of those special characters: - -| PATTERN | MATCH | -| ------------- | --------------------------------------------------------------------------------- | -| . | any single character | -| [ ] | character class: any single character that appears inside the brackets | -| \* | quantifier: 0 or more of the preceding character (or group) | -| \+ | quantifier: 1 or more of the preceding character (or group) | -| ? | quantifier: 0 or 1 of the preceding character (or group) | -| {1,5} | quantifier: 1 through 5 of the preceding character (or group) | -| \| | alternation: the character/group on the left or the character/group on the right | -| ( ) | grouping: often used with alternation and/or quantifier | - -Regular expression patterns in Selenese need to be prefixed with -either ``regexp:`` or ``regexpi:``. The former is case-sensitive; the -latter is case-insensitive. - -A few examples will help clarify how regular expression patterns can -be used with Selenese commands. The first one uses what is probably -the most commonly used regular expression pattern--**.\*** ("dot star"). This -two-character sequence can be translated as "0 or more occurrences of -any character" or more simply, "anything or nothing." It is the -equivalent of the one-character globbing pattern **\*** (a single asterisk). - -| Command | Target | Value | -| -------- | -------------------------------------- | ------------------------------------------------------------------ | -| click | link=glob:Film*Television Department | | -| verifyTitle | regexp:.\*Film.\*Television.\* | | - - -The example above is functionally equivalent to the earlier example -that used globbing patterns for this same test. The only differences -are the prefix (**regexp:** instead of **glob:**) and the "anything -or nothing" pattern (**.\*** instead of just **\***). - -The more complex example below tests that the Yahoo! -Weather page for Anchorage, Alaska contains info on the sunrise time: - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ------------------------------------------------- | -| open | http://weather.yahoo.com/forecast/USAK0012.html | | -| verifyTextPresent | regexp:Sunrise: \*[0-9]{1,2}:[0-9]{2} [ap]m | | - - -Let's examine the regular expression above one part at a time: - -| | | -| -------------------------- | --------------------------------------------------------------------------------- | -| ``Sunrise: *`` | The string **Sunrise:** followed by 0 or more spaces | -| ``[0-9]{1,2}`` | 1 or 2 digits (for the hour of the day) | -| ``:`` | The character **:** (no special characters involved) | -| ``[0-9]{2}`` | 2 digits (for the minutes) followed by a space | -| ``[ap]m`` | "a" or "p" followed by "m" (am or pm) | - - -#### Exact Patterns - -The **exact** type of Selenium pattern is of marginal usefulness. -It uses no special characters at all. So, if you needed to look for -an actual asterisk character (which is special for both globbing and -regular expression patterns), the **exact** pattern would be one way -to do that. For example, if you wanted to select an item labeled -"Real \*" from a dropdown, the following code might work or it might not. -The asterisk in the ``glob:Real *`` pattern will match anything or nothing. -So, if there was an earlier select option labeled "Real Numbers," it would -be the option selected rather than the "Real \*" option. - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ------------------------------------------------- | -| select | //select | glob:Real \* | - -In order to ensure that the "Real \*" item would be selected, the ``exact:`` -prefix could be used to create an **exact** pattern as shown below: - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ------------------------------------------------- | -| select | //select | exact:Real \* | - -But the same effect could be achieved via escaping the asterisk in a -regular expression pattern: - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ------------------------------------------------- | -| select | //select | regexp:Real \\\* | - -It's rather unlikely that most testers will ever need to look for -an asterisk or a set of square brackets with characters inside them (the -character class for globbing patterns). Thus, globbing patterns and -regular expression patterns are sufficient for the vast majority of us. - - -## The "AndWait" Commands - -The difference between a command and its *AndWait* -alternative is that the regular command (e.g. *click*) will do the action and -continue with the following command as fast as it can, while the *AndWait* -alternative (e.g. *clickAndWait*) tells Selenium to **wait** for the page to -load after the action has been done. - -The *AndWait* alternative is always used when the action causes the browser to -navigate to another page or reload the present one. - -Be aware, if you use an *AndWait* command for an action that -does not trigger a navigation/refresh, your test will fail. This happens -because Selenium will reach the *AndWait*'s timeout without seeing any -navigation or refresh being made, causing Selenium to raise a timeout -exception. - -## The waitFor Commands in AJAX applications - -In AJAX driven web applications, data is retrieved from server without -refreshing the page. Using *andWait* commands will not work as the page is not -actually refreshed. Pausing the test execution for a certain period of time is -also not a good approach as web element might appear later or earlier than the -stipulated period depending on the system's responsiveness, load or other -uncontrolled factors of the moment, leading to test failures. The best approach -would be to wait for the needed element in a dynamic period and then continue -the execution as soon as the element is found. - -This is done using *waitFor* commands, as *waitForElementPresent* or -*waitForVisible*, which wait dynamically, checking for the desired condition -every second and continuing to the next command in the script as soon as the -condition is met. - -## Sequence of Evaluation and Flow Control - -When a script runs, it simply runs in sequence, one command after another. - -Selenese, by itself, does not support condition statements (if-else, etc.) or -iteration (for, while, etc.). Many useful tests can be conducted without flow -control. However, for a functional test of dynamic content, possibly involving -multiple pages, programming logic is often needed. - -When flow control is needed, there are three options: - -a) Run the script using Selenium-RC and a client library such as Java or - PHP to utilize the programming language's flow control features. -b) Run a small JavaScript snippet from within the script using the storeEval command. -c) Install the `goto_sel_ide.js extension`. - -Most testers will export the test script into a programming language file that uses the -Selenium-RC API (see the Selenium-IDE chapter). However, some organizations prefer -to run their scripts from Selenium-IDE whenever possible (for instance, when they have -many junior-level people running tests for them, or when programming skills are -lacking). If this is your case, consider a JavaScript snippet or the goto_sel_ide.js extension. - - -## Store Commands and Selenium Variables - -You can use Selenium variables to store constants at the -beginning of a script. Also, when combined with a data-driven test design -(discussed in a later section), Selenium variables can be used to store values -passed to your test program from the command-line, from another program, or from -a file. - -The plain *store* command is the most basic of the many store commands and can be used -to simply store a constant value in a Selenium variable. It takes two -parameters, the text value to be stored and a Selenium variable. Use the -standard variable naming conventions of only alphanumeric characters when -choosing a name for your variable. - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ---------------------------------- | -| store | paul@mysite.org | | - - -Later in your script, you'll want to use the stored value of your -variable. To access the value of a variable, enclose the variable in -curly brackets ({}) and precede it with a dollar sign like this. - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ---------------------------------- | -| verifyText | //div/p | \\${userName} | - -A common use of variables is for storing input for an input field. - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ---------------------------------- | -| type | id=login | \\${userName} | - - -Selenium variables can be used in either the first or second parameter and -are interpreted by Selenium prior to any other operations performed by the -command. A Selenium variable may also be used within a locator expression. - -An equivalent store command exists for each verify and assert command. Here -are a couple more commonly used store commands. - -### storeElementPresent - -This corresponds to verifyElementPresent. It simply stores a boolean value--"true" -or "false"--depending on whether the UI element is found. - -### storeText - -StoreText corresponds to verifyText. It uses a locator to identify specific -page text. The text, if found, is stored in the variable. StoreText can be -used to extract text from the page being tested. - -### storeEval - -This command takes a script as its -first parameter. Embedding JavaScript within Selenese is covered in the next section. -StoreEval allows the test to store the result of running the script in a variable. - - -## JavaScript and Selenese Parameters - -JavaScript can be used with two types of Selenese parameters: script -and non-script (usually expressions). In most cases, you'll want to access -and/or manipulate a test case variable inside the JavaScript snippet used as -a Selenese parameter. All variables created in your test case are stored in -a JavaScript *associative array*. An associative array has string indexes -rather than sequential numeric indexes. The associative array containing -your test case's variables is named **storedVars**. Whenever you wish to -access or manipulate a variable within a JavaScript snippet, you must refer -to it as **storedVars['yourVariableName']**. - -### JavaScript Usage with Script Parameters - -Several Selenese commands specify a **script** parameter including -**assertEval**, **verifyEval**, **storeEval**, and **waitForEval**. -These parameters require no special syntax. A Selenium-IDE -user would simply place a snippet of JavaScript code into -the appropriate field, normally the **Target** field (because -a **script** parameter is normally the first or only parameter). - -The example below illustrates how a JavaScript snippet -can be used to perform a simple numerical calculation: - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ---------------------------------- | -| store | 10 | hits | -| storeXpathCount | //blockquote | blockquotes | -| storeEval | storedVars['hits'].storedVars['blockquotes'] | paragraphs | - -This next example illustrates how a JavaScript snippet can include calls to -methods, in this case the JavaScript String object's ``toUpperCase`` method -and ``toLowerCase`` method. - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ---------------------------------- | -| store | Edith Wharton | name | -| storeEval | storedVars['name'].toUpperCase() | uc | -| storeEval | storedVars['name'].toUpperCase() | lc | - - -#### JavaScript Usage with Non-Script Parameters - -JavaScript can also be used to help generate values for parameters, even -when the parameter is not specified to be of type **script**. -However, in this case, special syntax is required--the *entire* parameter -value must be prefixed by ``javascript{`` with a trailing ``}``, which encloses the JavaScript -snippet, as in ``javascript{*yourCodeHere*}``. -Below is an example in which the ``type`` command's second parameter -``value`` is generated via JavaScript code using this special syntax: - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ---------------------------------------------------- | -| store | league of nations | searchString | -| type | q | javascript{storedVars['searchString'].toUpperCase()} | - - -## *echo* - The Selenese Print Command - -Selenese has a simple command that allows you to print text to your test's -output. This is useful for providing informational progress notes in your -test which display on the console as your test is running. These notes also can be -used to provide context within your test result reports, which can be useful -for finding where a defect exists on a page in the event your test finds a -problem. Finally, echo statements can be used to print the contents of -Selenium variables. - - -| Command | Target | Value | -| -------- | ------------------------------------------------- | ---------------------------------------------------- | -| echo | Testing page footer now. | | -| echo | Username is \\${userName} | | - - -## Alerts, Popups, and Multiple Windows - -Suppose that you are testing a page that looks like this. - -```html - - - - - - - - - - - New Window Link - - - -
- - - - -``` - -The user must respond to alert/confirm boxes, as well as moving focus to newly -opened popup windows. Fortunately, Selenium can cover JavaScript pop-ups. - -But before we begin covering alerts/confirms/prompts in individual detail, it is -helpful to understand the commonality between them. Alerts, confirmation boxes -and prompts all have variations of the following - -|Command|Description| -|--- |--- | -|assertFoo(pattern)|throws error if pattern doesn’t match the text of the pop-up| -|assertFooPresent|throws error if pop-up is not available| -|assertFooNotPresent|throws error if any pop-up is present| -|storeFoo(variable)|stores the text of the pop-up in a variable| -|storeFooPresent(variable)|stores the text of the pop-up in a variable and returns true or false| - - -When running under Selenium, JavaScript pop-ups will not appear. This is because -the function calls are actually being overridden at runtime by Selenium's own -JavaScript. However, just because you cannot see the pop-up doesn't mean you don't -have to deal with it. To handle a pop-up, you must call its ``assertFoo(pattern)`` -function. If you fail to assert the presence of a pop-up your next command will be -blocked and you will get an error similar to the following ``[error] Error: There -was an unexpected Confirmation! [Chose an option.]`` - -### Alerts - -Let's start with alerts because they are the simplest pop-up to handle. To begin, -open the HTML sample above in a browser and click on the "Show alert" button. You'll -notice that after you close the alert the text "Alert is gone." is displayed on the -page. Now run through the same steps with Selenium IDE recording, and verify -the text is added after you close the alert. Your test will look something like -this: - -|Command|Target|Value| -|--- |--- |--- | -|open|/|| -|click|btnAlert|| -|assertAlert|I’m blocking!|| -|verifyTextPresent|Alert is gone.|| - -You may be thinking "That's odd, I never tried to assert that alert." But this is -Selenium-IDE handling and closing the alert for you. If you remove that step and replay -the test you will get the following error ``[error] Error: There was an unexpected -Alert! [I'm blocking!]``. You must include an assertion of the alert to acknowledge -its presence. - -If you just want to assert that an alert is present but either don't know or don't care -what text it contains, you can use ``assertAlertPresent``. This will return true or false, -with false halting the test. - -### Confirmations - -Confirmations behave in much the same way as alerts, with ``assertConfirmation`` and -``assertConfirmationPresent`` offering the same characteristics as their alert counterparts. -However, by default Selenium will select OK when a confirmation pops up. Try recording -clicking on the "Show confirm box" button in the sample page, but click on the "Cancel" button -in the popup, then assert the output text. Your test may look something like this: - -|Command|Target|Value| -|--- |--- |--- | -|open|/|| -|click|btnConfirm|| -|chooseCancelOnNextConfirmation||| -|assertConfirmation|Choose an option.|| -|verifyTextPresent|Rejected|| - -The ``chooseCancelOnNextConfirmation`` function tells Selenium that all following -confirmation should return false. It can be reset by calling chooseOkOnNextConfirmation. - -You may notice that you cannot replay this test, because Selenium complains that there -is an unhandled confirmation. This is because the order of events Selenium-IDE records -causes the click and chooseCancelOnNextConfirmation to be put in the wrong order (it makes sense -if you think about it, Selenium can't know that you're cancelling before you open a confirmation) -Simply switch these two commands and your test will run fine. - -### Prompts - -Prompts behave in much the same way as alerts, with ``assertPrompt`` and ``assertPromptPresent`` -offering the same characteristics as their alert counterparts. By default, Selenium will wait for -you to input data when the prompt pops up. Try recording clicking on the "Show prompt" button in -the sample page and enter "Selenium" into the prompt. Your test may look something like this: - -|Command|Target|Value| -|--- |--- |--- | -|open|/|| -|answerOnNextPrompt|Selenium!|| -|click|id=btnPrompt|| -|assertPrompt|What’s the best web QA tool?|| -|verifyTextPresent|Selenium!|| - -If you choose cancel on the prompt, you may notice that answerOnNextPrompt will simply show a -target of blank. Selenium treats cancel and a blank entry on the prompt basically as the same thing. - -## Debugging - -Debugging means finding and fixing errors in your test case. This is a normal -part of test case development. - -We won't teach debugging here as most new users to Selenium will already have -some basic experience with debugging. If this is new to you, we recommend -you ask one of the developers in your organization. - -### Breakpoints and Startpoints - -The Sel-IDE supports the setting of breakpoints and the ability to start and -stop the running of a test case, from any point within the test case. That is, one -can run up to a specific command in the middle of the test case and inspect how -the test case behaves at that point. To do this, set a breakpoint on the -command just before the one to be examined. - -To set a breakpoint, select a command, right-click, and from the context menu -select *Toggle Breakpoint*. Then click the Run button to run your test case from -the beginning up to the breakpoint. - -It is also sometimes useful to run a test case from somewhere in the middle to -the end of the test case or up to a breakpoint that follows the starting point. -For example, suppose your test case first logs into the website and then -performs a series of tests and you are trying to debug one of those tests. -However, you only need to login once, but you need to keep rerunning your -tests as you are developing them. You can login once, then run your test case -from a startpoint placed after the login portion of your test case. That will -prevent you from having to manually logout each time you rerun your test case. - -To set a startpoint, select a command, right-click, and from the context -menu select *Set/Clear Start Point*. Then click the Run button to execute the -test case beginning at that startpoint. - -### Stepping Through a Testcase - -To execute a test case one command at a time ("step through" it), follow these -steps: - -1. Start the test case running with the Run button from the toolbar. - -2. Immediately pause the executing test case with the Pause button. - -3. Repeatedly select the Step button. - -### Find Button - -The Find button is used to see which UI element on the currently displayed -webpage (in the browser) is used in the currently selected Selenium command. -This is useful when building a locator for a command's first parameter (see the -section on :ref:`locators ` in the Selenium Commands chapter). -It can be used with any command that identifies a UI element on a webpage, -i.e. *click*, *clickAndWait*, *type*, and certain *assert* and *verify* commands, -among others. - -From Table view, select any command that has a locator parameter. -Click the Find button. -Now look on the webpage: There should be a bright green rectangle -enclosing the element specified by the locator parameter. - -### Page Source for Debugging - -Often, when debugging a test case, you simply must look at the page source (the -HTML for the webpage you're trying to test) to determine a problem. Firefox -makes this easy. Simply right-click the webpage and select 'View->Page Source. -The HTML opens in a separate window. Use its Search feature (Edit=>Find) -to search for a keyword to find the HTML for the UI element you're trying -to test. - -Alternatively, select just that portion of the webpage for which you want to -see the source. Then right-click the webpage and select View Selection -Source. In this case, the separate HTML window will contain just a small -amount of source, with highlighting on the portion representing your -selection. - -### Locator Assistance - -Whenever Selenium-IDE records a locator-type argument, it stores -additional information which allows the user to view other possible -locator-type arguments that could be used instead. This feature can be -very useful for learning more about locators, and is often needed to help -one build a different type of locator than the type that was recorded. - -This locator assistance is presented on the Selenium-IDE window as a drop-down -list accessible at the right end of the Target field -(only when the Target field contains a recorded locator-type argument). -Below is a snapshot showing the -contents of this drop-down for one command. Note that the first column of -the drop-down provides alternative locators, whereas the second column -indicates the type of each alternative. - -![Selenium Locator Assistance](/images/documentation/legacy/selenium_ide_locator_assistance.png) - - -## Writing a Test Suite - -A test suite is a collection of test cases which is displayed in the leftmost -pane in the IDE. -The test suite pane can be manually opened or closed via selecting a small dot -halfway down the right edge of the pane (which is the left edge of the -entire Selenium-IDE window if the pane is closed). - -The test suite pane will be automatically opened when an existing test suite -is opened *or* when the user selects the New Test Case item from the -File menu. In the latter case, the new test case will appear immediately -below the previous test case. - -Selenium-IDE also supports loading pre-existing test cases by using the File --> Add Test Case menu option. This allows you to add existing test cases to -a new test suite. - -A test suite file is an HTML file containing a one-column table. Each -cell of each row in the section contains a link to a test case. -The example below is of a test suite containing four test cases: - -```html - - - - Sample Selenium Test Suite - - - - - - - - - - - - -
Test Cases for De Anza A-Z Directory Links
A Links
B Links
C Links
D Links
- - -``` - -Note: Test case files should not have to be co-located with the test suite file - that invokes them. And on Mac OS and Linux systems, that is indeed the - case. However, at the time of this writing, a bug prevents Windows users - from being able to place the test cases elsewhere than with the test suite - that invokes them. - -## User Extensions - -User extensions are JavaScript files that allow one to create his or her own -customizations and features to add additional functionality. Often this is in -the form of customized commands although this extensibility is not limited to -additional commands. - -There are a number of useful extensions_ created by users. - -*IMPORTANT: THIS SECTION IS OUT OF DATE--WE WILL BE REVISING THIS SOON.* - -* _extensions: http://wiki.openqa.org/display/SEL/Contributed+User-Extensions - -.. _[`goto_sel_ide.js extension`](http://wiki.openqa.org/download/attachments/379/goto_sel_ide.js): - -Perhaps the most popular of all Selenium-IDE extensions -is one which provides flow control in the form of while loops and primitive -conditionals. This extension is the goto_sel_ide.js_. For an example -of how to use the functionality provided by this extension, look at the -page_ created by its author. - -To install this extension, put the pathname to its location on your -computer in the **Selenium Core extensions** field of Selenium-IDE's -Options=>Options=>General tab. - -![Selenium IDE Extensions Install](/images/documentation/legacy/selenium_ide_extensions_install.png) - -After selecting the **OK** button, you must close and reopen Selenium-IDE -in order for the extensions file to be read. Any change you make to an -extension will also require you to close and reopen Selenium-IDE. - -Information on writing your own extensions can be found near the -bottom of the Selenium Reference_ document. - -Sometimes it can prove very useful to debug step by step Selenium IDE and your -User Extension. The only debugger that appears able to debug -XUL/Chrome based extensions is Venkman which is supported in Firefox until version 32 included. -The step by step debug has been verified to work with Firefox 32 and Selenium IDE 2.9.0. - -## Format - -Format, under the Options menu, allows you to select a language for saving -and displaying the test case. The default is HTML. - -If you will be using Selenium-RC to run your test cases, this feature is used -to translate your test case into a programming language. Select the -language, e.g. Java, PHP, you will be using with Selenium-RC for developing -your test programs. Then simply save the test case using File=>Export Test Case As. -Your test case will be translated into a series of functions in the language you -choose. Essentially, program code supporting your test is generated for you -by Selenium-IDE. - -Also, note that if the generated code does not suit your needs, you can alter -it by editing a configuration file which defines the generation process. -Each supported language has configuration settings which are editable. This -is under the Options=>Options=>Formats tab. - -## Executing Selenium-IDE Tests on Different Browsers - -While Selenium-IDE can only run tests against Firefox, tests -developed with Selenium-IDE can be run against other browsers, using a -simple command-line interface that invokes the Selenium-RC server. This topic -is covered in the :ref:`Run Selenese tests ` section on Selenium-RC -chapter. The *-htmlSuite* command-line option is the particular feature of interest. - -## Troubleshooting - -Below is a list of image/explanation pairs which describe frequent -sources of problems with Selenium-IDE: - -*Table view is not available with this format.* - -This message can be occasionally displayed in the Table tab when Selenium IDE is -launched. The workaround is to close and reopen Selenium IDE. See -[issue 1008](http://code.google.com/p/selenium/issues/detail?id=1008). -for more information. If you are able to reproduce this reliably then please -provide details so that we can work on a fix. - ------------------- - -*error loading test case: no command found* - -You've used **File=>Open** to try to open a test suite file. Use **File=>Open -Test Suite** instead. - -An enhancement request has been raised to improve this error message. See -[issue 1010](http://code.google.com/p/selenium/issues/detail?id=1010). - ------------------- - -![Selenium IDE Trouble Timing](/images/documentation/legacy/selenium_ide_trouble_timing.png) - -This type of **error** may indicate a timing problem, i.e., the element -specified by a locator in your command wasn't fully loaded when the command -was executed. Try putting a **pause 5000** before the command to determine -whether the problem is indeed related to timing. If so, investigate using an -appropriate **waitFor\*** or **\*AndWait** command before the failing command. - ------------------- - -![Selenium IDE Trouble Param](/images/documentation/legacy/selenium_ide_trouble_param.png) - -Whenever your attempt to use variable substitution fails as is the -case for the **open** command above, it indicates -that you haven't actually created the variable whose value you're -trying to access. This is -sometimes due to putting the variable in the **Value** field when it -should be in the **Target** field or vice versa. In the example above, -the two parameters for the **store** command have been erroneously -placed in the reverse order of what is required. -For any Selenese command, the first required parameter must go -in the **Target** field, and the second required parameter (if one exists) -must go in the **Value** field. - ----------- - -*error loading test case: [Exception... "Component returned failure code: -0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIFileInputStream.init]" nresult: -"0x80520012 (NS_ERROR_FILE_NOT_FOUND)" location: "JS frame :: -chrome://selenium-ide/content/file-utils.js :: anonymous :: line 48" data: no]* - -One of the test cases in your test suite cannot be found. Make sure that the -test case is indeed located where the test suite indicates it is located. Also, -make sure that your actual test case files have the .html extension both in -their filenames, and in the test suite file where they are referenced. - -An enhancement request has been raised to improve this error message. See -[issue 1011](http://code.google.com/p/selenium/issues/detail?id=1011). - ----------- - -![Selenium IDE Trouble Extension](/images/documentation/legacy/selenium_ide_trouble_extension.png) - -Your extension file's contents have not been read by Selenium-IDE. Be -sure you have specified the proper pathname to the extensions file via -**Options=>Options=>General** in the **Selenium Core extensions** field. -Also, Selenium-IDE must be restarted after any change to either an -extensions file *or* to the contents of the **Selenium Core extensions** -field. - diff --git a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.en.md b/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.en.md index 194160b83c72..8c55b029843e 100644 --- a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.en.md +++ b/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.en.md @@ -9,7 +9,13 @@ aliases: [ "/documentation/legacy/html_runner/", "/documentation/ja/legacy_docs/html-runner/", "/documentation/pt-br/legacy_docs/html-runner/", -"/documentation/zh-cn/legacy_docs/html-runner/" +"/documentation/zh-cn/legacy_docs/html-runner/", +"/ja/documentation/legacy/html_runner/", +"/ja/documentation/legacy/selenium_ide/html_runner/", +"/pt-br/documentation/legacy/html_runner/", +"/pt-br/documentation/legacy/selenium_ide/html_runner/", +"/zh-cn/documentation/legacy/html_runner/", +"/zh-cn/documentation/legacy/selenium_ide/html_runner/" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.ja.md b/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.ja.md deleted file mode 100644 index 8e4f17ed0654..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.ja.md +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: "HTMLランナー" -linkTitle: "HTMLランナー" -weight: 2 -description: > - Execute HTML Selenium IDE exports from command line -aliases: [ -"/documentation/legacy/html_runner/" -] ---- - - -_Selenium HTMLランナー_ を使用すると、コマンドラインからテストスイートを実行できます。 -テストスイートは、Selenium IDEまたは互換性ツールからのHTMLエクスポートです。 - -## 共通情報 - -* geckodriver / firefox / selenium-html-runnerのリリースの組み合わせが重要です。 -どこかにソフトウェア互換性マトリックスがあるかもしれません。 -* selenium-html-runnerはテストスイートのみを実行します(テストケースではなく、Monitis Transaction Monitorからのエクスポートなど)。 -必ずこれを順守してください。 -* DISPLAYのないLinuxユーザーの場合-仮想ディスプレイでhtml-runnerを起動する必要があります(xvfbを検索)。 - -## Linux環境の例 -次のソフトウェアパッケージをインストール/ダウンロードします。 - -```shell -[user@localhost ~]$ cat /etc/redhat-release -CentOS Linux release 7.4.1708 (Core) - -[user@localhost ~]$ rpm -qa | egrep -i "xvfb|java-1.8|firefox" -xorg-x11-server-Xvfb-1.19.3-11.el7.x86_64 -firefox-52.4.0-1.el7.centos.x86_64 -java-1.8.0-openjdk-1.8.0.151-1.b12.el7_4.x86_64 -java-1.8.0-openjdk-headless-1.8.0.151-1.b12.el7_4.x86_64 -``` - -テストスイートの例 - -```html -[user@localhost ~]$ cat testsuite.html - - - - - - Test Suite - - - - - -
Test Suite
YOUR-TEST-SCENARIO
- - -``` - - -## selenium-html-runnerをヘッドレスで実行する方法 - -さて、最も重要な部分、selenium-html-runnerの実行方法の例! -経験によってソフトウェアの組み合わせ、- geckodriver / FF / html-runnerリリースによって異なる場合があります。 - -```shell -xvfb-run java -Dwebdriver.gecko.driver=/home/mmasek/geckodriver.0.18.0 -jar selenium-html-runner-3.7.1.jar -htmlSuite "firefox" "https://YOUR-BASE-URL" "$(pwd)/testsuite.html" "results.html" ; grep result: -A1 results.html/firefox.results.html -``` - -```shell -[user@localhost ~]$ xvfb-run java -Dwebdriver.gecko.driver=/home/mmasek/geckodriver.0.18.0 -jar selenium-html-runner-3.7.1.jar -htmlSuite "*firefox" "https://YOUR-BASE-URL" "$(pwd)/testsuite.html" "results.html" ; grep result: -A1 results.html/firefox.results.html -Multi-window mode is longer used as an option and will be ignored. -1510061109691 geckodriver INFO geckodriver 0.18.0 -1510061109708 geckodriver INFO Listening on 127.0.0.1:2885 -1510061110162 geckodriver::marionette INFO Starting browser /usr/bin/firefox with args ["-marionette"] -1510061111084 Marionette INFO Listening on port 43229 -1510061111187 Marionette WARN TLS certificate errors will be ignored for this session -Nov 07, 2017 1:25:12 PM org.openqa.selenium.remote.ProtocolHandshake createSession -INFO: Detected dialect: W3C -2017-11-07 13:25:12.714:INFO::main: Logging initialized @3915ms to org.seleniumhq.jetty9.util.log.StdErrLog -2017-11-07 13:25:12.804:INFO:osjs.Server:main: jetty-9.4.z-SNAPSHOT -2017-11-07 13:25:12.822:INFO:osjsh.ContextHandler:main: Started o.s.j.s.h.ContextHandler@87a85e1{/tests,null,AVAILABLE} -2017-11-07 13:25:12.843:INFO:osjs.AbstractConnector:main: Started ServerConnector@52102734{HTTP/1.1,[http/1.1]}{0.0.0.0:31892} -2017-11-07 13:25:12.843:INFO:osjs.Server:main: Started @4045ms -Nov 07, 2017 1:25:13 PM org.openqa.selenium.server.htmlrunner.CoreTestCase run -INFO: |open | /auth_mellon.php | | -Nov 07, 2017 1:25:14 PM org.openqa.selenium.server.htmlrunner.CoreTestCase run -INFO: |waitForPageToLoad | 3000 | | -. -. -.etc - -result: -PASS - - -``` diff --git a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.pt-br.md b/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.pt-br.md deleted file mode 100644 index 2cd667de7b89..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.pt-br.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: "HTML runner" -linkTitle: "HTML runner" -weight: 2 -description: > - Execute HTML Selenium IDE exports from command line -aliases: [ -"/documentation/legacy/html_runner/" -] ---- - -_Selenium HTML-runner_ permite que você execute suítes de teste da -linha de comando. Suítes de teste são exportações de HTML do Selenium IDE ou -ferramentas compatíveis. - - -## Informação comum - -* Combinação de lançamentos de geckodriver / firefox / -selenium-html-runner são importantes. Pode haver um software -matriz de compatibilidade em algum lugar. -* selenium-html-runner executa apenas suítes de teste (não casos de teste - -por exemplo, uma exportação do Monitis Transaction Monitor). Certifique-se de cumprir isso. -* Para usuários Linux sem DISPLAY - você precisa iniciar o html-runner -com display virtual (procure por xvfb) - -## Exemplo de ambiente Linux -Instale / baixe os seguintes pacotes: - -```shell -[user@localhost ~]$ cat /etc/redhat-release -CentOS Linux release 7.4.1708 (Core) - -[user@localhost ~]$ rpm -qa | egrep -i "xvfb|java-1.8|firefox" -xorg-x11-server-Xvfb-1.19.3-11.el7.x86_64 -firefox-52.4.0-1.el7.centos.x86_64 -java-1.8.0-openjdk-1.8.0.151-1.b12.el7_4.x86_64 -java-1.8.0-openjdk-headless-1.8.0.151-1.b12.el7_4.x86_64 -``` - -Exemplo de suíte de testes: - -```html -[user@localhost ~]$ cat testsuite.html - - - - - - Test Suite - - - - - -
Test Suite
YOUR-TEST-SCENARIO
- - -``` - - -## Como rodar o selenium-html-runner headless - -Agora, a parte mais importante, um exemplo de como executar o -selenium-html-runner! Sua experiência pode variar dependendo das combinações -de software - versões geckodriver / FF / html-runner. - -```shell -xvfb-run java -Dwebdriver.gecko.driver=/home/mmasek/geckodriver.0.18.0 -jar selenium-html-runner-3.7.1.jar -htmlSuite "firefox" "https://YOUR-BASE-URL" "$(pwd)/testsuite.html" "results.html" ; grep result: -A1 results.html/firefox.results.html -``` - -```shell -[user@localhost ~]$ xvfb-run java -Dwebdriver.gecko.driver=/home/mmasek/geckodriver.0.18.0 -jar selenium-html-runner-3.7.1.jar -htmlSuite "*firefox" "https://YOUR-BASE-URL" "$(pwd)/testsuite.html" "results.html" ; grep result: -A1 results.html/firefox.results.html -Multi-window mode is longer used as an option and will be ignored. -1510061109691 geckodriver INFO geckodriver 0.18.0 -1510061109708 geckodriver INFO Listening on 127.0.0.1:2885 -1510061110162 geckodriver::marionette INFO Starting browser /usr/bin/firefox with args ["-marionette"] -1510061111084 Marionette INFO Listening on port 43229 -1510061111187 Marionette WARN TLS certificate errors will be ignored for this session -Nov 07, 2017 1:25:12 PM org.openqa.selenium.remote.ProtocolHandshake createSession -INFO: Detected dialect: W3C -2017-11-07 13:25:12.714:INFO::main: Logging initialized @3915ms to org.seleniumhq.jetty9.util.log.StdErrLog -2017-11-07 13:25:12.804:INFO:osjs.Server:main: jetty-9.4.z-SNAPSHOT -2017-11-07 13:25:12.822:INFO:osjsh.ContextHandler:main: Started o.s.j.s.h.ContextHandler@87a85e1{/tests,null,AVAILABLE} -2017-11-07 13:25:12.843:INFO:osjs.AbstractConnector:main: Started ServerConnector@52102734{HTTP/1.1,[http/1.1]}{0.0.0.0:31892} -2017-11-07 13:25:12.843:INFO:osjs.Server:main: Started @4045ms -Nov 07, 2017 1:25:13 PM org.openqa.selenium.server.htmlrunner.CoreTestCase run -INFO: |open | /auth_mellon.php | | -Nov 07, 2017 1:25:14 PM org.openqa.selenium.server.htmlrunner.CoreTestCase run -INFO: |waitForPageToLoad | 3000 | | -. -. -.etc - -result: -PASS - - -``` diff --git a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.zh-cn.md b/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.zh-cn.md deleted file mode 100644 index a0946e30586a..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.zh-cn.md +++ /dev/null @@ -1,94 +0,0 @@ ---- -title: "HTML runner" -linkTitle: "HTML runner" -weight: 2 -description: > - Execute HTML Selenium IDE exports from command line -aliases: [ -"/documentation/legacy/html_runner/" -] ---- - -_Selenium HTML-runner_ 允许您从命令行运行 Test Suites。 -Test Suites 是从 Selenium IDE 或兼容工具导出的 HTML。 - -## 公共信息 - -* geckodriver / firefox / selenium-html-runner 版本的组合很重要。 -可能在某个地方有一个软件兼容性矩阵。 -* selenium-html-runner 只运行 Test Suite(而不是 Test Case —— 例如从 Monitis Transaction Monitor 导出的东西)。一定要遵守这个规定。 - -* 对于没有 DISPLAY 的 Linux 用户,您需要启动具有 Virtual DISPLAY 的 html-runner (搜索 xvfb) - -## 示例 Linux 环境 - -安装 / 下载以下软件包: - -```shell -[user@localhost ~]$ cat /etc/redhat-release -CentOS Linux release 7.4.1708 (Core) - -[user@localhost ~]$ rpm -qa | egrep -i "xvfb|java-1.8|firefox" -xorg-x11-server-Xvfb-1.19.3-11.el7.x86_64 -firefox-52.4.0-1.el7.centos.x86_64 -java-1.8.0-openjdk-1.8.0.151-1.b12.el7_4.x86_64 -java-1.8.0-openjdk-headless-1.8.0.151-1.b12.el7_4.x86_64 -``` - -Test Suite 示例: - -```html -[user@localhost ~]$ cat testsuite.html - - - - - - Test Suite - - - - - -
Test Suite
YOUR-TEST-SCENARIO
- - -``` - -## 如何运行 selenium-html-runner headless - -现在,最重要的部分,一个如何运行 selenium-html-runner 的例子! -您的体验可能因软件组合而异 - geckodriver / FF / html-runner 版本。 - -```shell -xvfb-run java -Dwebdriver.gecko.driver=/home/mmasek/geckodriver.0.18.0 -jar selenium-html-runner-3.7.1.jar -htmlSuite "firefox" "https://YOUR-BASE-URL" "$(pwd)/testsuite.html" "results.html" ; grep result: -A1 results.html/firefox.results.html -``` - -```shell -[user@localhost ~]$ xvfb-run java -Dwebdriver.gecko.driver=/home/mmasek/geckodriver.0.18.0 -jar selenium-html-runner-3.7.1.jar -htmlSuite "*firefox" "https://YOUR-BASE-URL" "$(pwd)/testsuite.html" "results.html" ; grep result: -A1 results.html/firefox.results.html -Multi-window mode is longer used as an option and will be ignored. -1510061109691 geckodriver INFO geckodriver 0.18.0 -1510061109708 geckodriver INFO Listening on 127.0.0.1:2885 -1510061110162 geckodriver::marionette INFO Starting browser /usr/bin/firefox with args ["-marionette"] -1510061111084 Marionette INFO Listening on port 43229 -1510061111187 Marionette WARN TLS certificate errors will be ignored for this session -Nov 07, 2017 1:25:12 PM org.openqa.selenium.remote.ProtocolHandshake createSession -INFO: Detected dialect: W3C -2017-11-07 13:25:12.714:INFO::main: Logging initialized @3915ms to org.seleniumhq.jetty9.util.log.StdErrLog -2017-11-07 13:25:12.804:INFO:osjs.Server:main: jetty-9.4.z-SNAPSHOT -2017-11-07 13:25:12.822:INFO:osjsh.ContextHandler:main: Started o.s.j.s.h.ContextHandler@87a85e1{/tests,null,AVAILABLE} -2017-11-07 13:25:12.843:INFO:osjs.AbstractConnector:main: Started ServerConnector@52102734{HTTP/1.1,[http/1.1]}{0.0.0.0:31892} -2017-11-07 13:25:12.843:INFO:osjs.Server:main: Started @4045ms -Nov 07, 2017 1:25:13 PM org.openqa.selenium.server.htmlrunner.CoreTestCase run -INFO: |open | /auth_mellon.php | | -Nov 07, 2017 1:25:14 PM org.openqa.selenium.server.htmlrunner.CoreTestCase run -INFO: |waitForPageToLoad | 3000 | | -. -. -.etc - -result: -PASS - - -``` diff --git a/website_and_docs/content/documentation/overview/_index.en.md b/website_and_docs/content/documentation/overview/_index.en.md index f3cb1d9a0c64..4f91a1c3f8fc 100644 --- a/website_and_docs/content/documentation/overview/_index.en.md +++ b/website_and_docs/content/documentation/overview/_index.en.md @@ -4,7 +4,11 @@ linkTitle: "Overview" weight: 1 description: > Is Selenium for you? See an overview of the different project components. -aliases: ["/documentation/en/introduction/", "/documentation/ja/introduction/", "/documentation/pt-br/introduction/", "/documentation/zh-cn/introduction/"] +aliases: ["/documentation/en/introduction/", "/documentation/ja/introduction/", "/documentation/pt-br/introduction/", "/documentation/zh-cn/introduction/", +"/ja/documentation/overview/", +"/pt-br/documentation/overview/", +"/zh-cn/documentation/overview/" +] --- diff --git a/website_and_docs/content/documentation/overview/_index.ja.md b/website_and_docs/content/documentation/overview/_index.ja.md deleted file mode 100644 index 7de205c59726..000000000000 --- a/website_and_docs/content/documentation/overview/_index.ja.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: "概要" -linkTitle: "概要" -weight: 1 -description: > - Seleniumはあなたに適していますか?さまざまなプロジェクトのコンポーネントの概要を参照してください。 ---- - -Seleniumは単一のツールやAPIではなく、多くのツールから構成されています。 - -## WebDriver - -デスクトップまたはモバイルのウェブサイトのテスト自動化を始める場合は、WebDriver APIを使用します。 -[WebDriver]({{< ref "webdriver.md" >}})は、ブラウザーベンダーが提供するブラウザー自動化APIを使用して、ブラウザーを操作し、テストを実行します。これは、実際のユーザーがブラウザーを操作するのと同じように動作します。 -WebDriverのAPIをアプリケーションコードとともにコンパイルする必要はないため、アプリケーションに変更を加えることなくテストできます。 -したがって、本番環境にリリースするものと同じアプリケーションをテストできます。 - -## IDE - -[IDE](https://selenium.dev/selenium-ide)(統合開発環境、Integrated Development Environment)は、Seleniumのテストケースを開発するためのツールです。 -ChromeとFirefox向けの使いやすい拡張機能であり、一般にテストケースを開発する最も効率的な方法です。 -IDEは、既存のSeleniumコマンドと、対象要素のコンテキストによって定義されるパラメーターを使用して、ブラウザー上のユーザー操作を記録します。 -これは時間を節約できるだけでなく、Seleniumスクリプトの構文を学ぶ優れた方法でもあります。 - - -## Grid - -Selenium Gridを使用すると、さまざまなプラットフォームのさまざまなマシンでテストケースを実行できます。 -テストケースの起動はローカル側で制御され、起動されたテストケースはリモート側で自動的に実行されます。 - -WebDriverテストを開発した後、複数のブラウザーとオペレーティングシステムの組み合わせでテストを実行する必要が生じる場合があります。 -そのときに役立つのが[Grid]({{< ref "grid.md" >}})です。 diff --git a/website_and_docs/content/documentation/overview/_index.pt-br.md b/website_and_docs/content/documentation/overview/_index.pt-br.md deleted file mode 100644 index 845080e9ab0f..000000000000 --- a/website_and_docs/content/documentation/overview/_index.pt-br.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: "Resumo" -linkTitle: "Resumo" -weight: 1 -description: > - Será Selenium a ferramenta para você? Veja um resumo dos componentes do projecto. ---- - -Selenium não é só uma ferramenta ou API, -mas sim uma composição de várias ferramentas. - -## WebDriver - -Se você está começando com automação de testes de um site de desktop ou site para celular, então -vai usar as APIs WebDriver. O [WebDriver]({{< ref "webdriver.md" >}}) -usa APIs de automação de navegador disponibilizadas por fornecedores de navegador para o controlar e -executar testes. É como se um usuário real o estivesse operando. Como o -WebDriver não exige que sua API seja compilada com o código do aplicativo, -não é intrusivo. Portanto, você está testando o -mesmo aplicativo que você envia aos ambientes de produção. - - -## IDE - -[IDE](//selenium.dev/selenium-ide) (Ambiente de Desenvolvimento Integrado, em português) -é a ferramenta que você usa para desenvolver seus casos de teste Selenium. É uma extensão para Chrome -e Firefox fácil de usar e geralmente é a maneira mais eficiente de desenvolver -casos de teste. Ela registra as ações dos usuários no navegador para você, usando -comandos Selenium existentes, com parâmetros definidos pelo contexto daquele -elemento. Isso não é apenas uma economia de tempo, mas também uma maneira excelente -de aprender a sintaxe de script do Selenium. - -## Grid - -Selenium Grid permite que você execute casos de teste em diferentes -máquinas em diferentes plataformas. O controle para -acionar os casos de teste está na extremidade local, e -quando os casos de teste são acionados, eles são automaticamente -executados pela extremidade remota. - -Após o desenvolvimento dos testes WebDriver, você pode enfrentar -a necessidade de executar seus testes em vários navegadores e -combinações de sistemas operacionais. -É aqui que o [Grid]({{< ref "grid.md" >}}) entra em cena. diff --git a/website_and_docs/content/documentation/overview/_index.zh-cn.md b/website_and_docs/content/documentation/overview/_index.zh-cn.md deleted file mode 100644 index 1ac133b9f9a3..000000000000 --- a/website_and_docs/content/documentation/overview/_index.zh-cn.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: "概述" -linkTitle: "概述" -weight: 1 -description: > - Selenium适合你吗? 请参见不同项目组件的概述. ---- - - -Selenium 不仅仅是一个工具或 API, 它还包含许多工具. - -## WebDriver - -如果您开始使用桌面网站测试自动化, 那么您将使用 WebDriver APIs. -[WebDriver]({{< ref "webdriver.md" >}}) 使用浏览器供应商提供的浏览器自动化 API 来控制浏览器和运行测试. -这就像真正的用户正在操作浏览器一样. -由于 WebDriver 不要求使用应用程序代码编译其 API, 因此它本质上不具有侵入性. -因此, 您测试的应用程序与实时推送的应用程序相同. - -## Selenium IDE - -[Selenium IDE](https://selenium.dev/selenium-ide) (Integrated Development Environment 集成开发环境) -是用来开发 Selenium 测试用例的工具. 这是一个易于使用的 Chrome 和 Firefox -浏览器扩展, 通常是开发测试用例最有效率的方式. 它使用现有的 Selenium 命令记录用户在浏览器中的操作, -参数由元素的上下文确定. 这不仅节省了开发时间, 而且是学习 Selenium 脚本语法的一种很好的方法. - - -## Grid - -Selenium Grid允许您在不同平台的不同机器上运行测试用例. -可以本地控制测试用例的操作, -当测试用例被触发时, -它们由远端自动执行. - -当开发完WebDriver测试之后, -您可能需要在多个浏览器和操作系统的组合上运行测试. -这就是 [Grid]({{< ref "grid.md" >}}) 的用途所在. diff --git a/website_and_docs/content/documentation/overview/components.en.md b/website_and_docs/content/documentation/overview/components.en.md index 64e991c086bd..dc4f4d59189d 100644 --- a/website_and_docs/content/documentation/overview/components.en.md +++ b/website_and_docs/content/documentation/overview/components.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/webdriver/understanding_the_components", "/documentation/ja/webdriver/understanding_the_components/", "/documentation/pt-br/webdriver/understanding_the_components/", -"/documentation/zh-cn/webdriver/understanding_the_components/" +"/documentation/zh-cn/webdriver/understanding_the_components/", +"/ja/documentation/overview/components/", +"/ja/documentation/webdriver/understanding_the_components", +"/pt-br/documentation/overview/components/", +"/pt-br/documentation/webdriver/understanding_the_components", +"/zh-cn/documentation/overview/components/", +"/zh-cn/documentation/webdriver/understanding_the_components" ] --- diff --git a/website_and_docs/content/documentation/overview/components.ja.md b/website_and_docs/content/documentation/overview/components.ja.md deleted file mode 100644 index ffed7bad26b0..000000000000 --- a/website_and_docs/content/documentation/overview/components.ja.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: "コンポーネントを理解する" -linkTitle: "コンポーネントを理解する" -weight: 1 -aliases: [ -"/documentation/webdriver/understanding_the_components" -] ---- - -WebDriverを使ってテストスイートを構築するには、多くのコンポーネントを理解し、効率的に使用する必要があります。 -ソフトウェア全般と同様に、人によっては同じ概念に異なる用語を使用します。 -ここでは、用語を以下の意味で使用します。 - -### 用語 - -* **API:** アプリケーションプログラミングインターフェイス。WebDriverを操作するために使用する「コマンド」の集合です。 -* **ライブラリ:** APIと、それらを実装するために必要なコードを含むコードモジュール。 -ライブラリは言語バインディングごとに用意されています。たとえば、Java用の .jar ファイルや .NET用の .dll ファイルなどです。 -* **ドライバー:** 実際のブラウザを制御する役割を担います。 -ほとんどのドライバーはブラウザベンダー自身によって作成されます。ドライバーは通常、ブラウザが稼働するシステム上で実行される実行可能モジュールであり、テストスイートを実行するシステムとは別のものです。(ただし、両者が同じシステムの場合もあります。)_注: ドライバーをプロキシと呼ぶ人もいます。_ -* **フレームワーク:** WebDriverスイートを補助するために使用する追加ライブラリ。これらのフレームワークは、JUnitやNUnitなどのテストフレームワークである場合があります。また、CucumberやRobot Frameworkといった自然言語の機能をサポートするフレームワークである場合もあります。テスト対象システムの操作や構成、データ作成、テストオラクルなどのために、フレームワークを作成して使用することもあります。 - -### 構成要素 -WebDriverは最小構成では、ドライバーを介してブラウザと通信します。 -通信は双方向です。WebDriverはドライバーを介してブラウザにコマンドを渡し、同じ経路で情報を受け取ります。 - -{{< figure src="/images/documentation/webdriver/basic_comms.png" class="img-responsive text-center" alt="基本通信">}} - -ドライバーは、GoogleのChrome/Chromium用のChromeDriverや、MozillaのFirefox用のGeckoDriverなど、ブラウザ固有のものです。 -ドライバーはブラウザと同じシステム上で実行されます。これは、テスト自体を実行するシステムと同一の場合も、異なる場合もあります。 - -この単純な例では、_直接_ 通信を行います。ブラウザとの通信は、Selenium ServerまたはRemoteWebDriverを介した _リモート_ 通信にすることもできます。RemoteWebDriverは、ドライバーおよびブラウザと同じシステム上で実行されます。 - -{{< figure src="/images/documentation/webdriver/remote_comms.png" class="img-responsive text-center" alt="リモート通信">}} - -リモート通信は、Selenium ServerまたはSelenium Gridを使用して行うこともできます。どちらもホストシステム上のドライバーと通信します。 - -{{< figure src="/images/documentation/webdriver/remote_comms_server.png" class="img-responsive text-center" alt="Selenium Gridを用いたリモート通信">}} - -## フレームワークの位置づけ - -WebDriverには、上記のいずれかの方法でブラウザと通信するという、ただ1つの役割があります。WebDriverはテストについて何も知りません。値を比較する方法も、成否をアサートする方法も、レポートや Given/When/Then の文法も知りません。 - -ここで、さまざまなフレームワークが登場します。 -最低限、使用する言語バインディングに対応したテストフレームワークが必要です。たとえば、.NET用のNUnit、Java用のJUnit、Ruby用のRSpecなどです。 - -テストフレームワークは、WebDriverとテストに関連する手順の実行を担当します。 -したがって、次の図のような構成だと考えることができます。 - -{{< figure src="/images/documentation/webdriver/test_framework.png" class="img-responsive text-center" alt="テストフレームワーク">}} - -上図では、Cucumberなどの自然言語を扱うフレームワーク/ツールが、テストフレームワークのボックスの一部として存在する場合があります。または、独自の実装の中でテストフレームワーク全体をラップする場合もあります。 diff --git a/website_and_docs/content/documentation/overview/components.pt-br.md b/website_and_docs/content/documentation/overview/components.pt-br.md deleted file mode 100644 index e8cf13f8959d..000000000000 --- a/website_and_docs/content/documentation/overview/components.pt-br.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: "Entendendo os componentes" -linkTitle: "Entendendo os componentes" -weight: 1 -aliases: [ -"/documentation/webdriver/understanding_the_components" -] ---- - -Construir um conjunto de testes usando WebDriver exigirá que você entenda e -use efetivamente uma série de componentes diferentes. Como com tudo em -software, pessoas diferentes usam termos diferentes para a mesma ideia. Abaixo está -uma análise de como os termos são usados nesta descrição. - -### Terminologia - -* **API:** interface de programação de aplicativo. Este é o conjunto de "comandos" que -você usa para manipular o WebDriver. -* **Biblioteca:** um módulo de código que contém as APIs e o código necessário -para implementá-los. As bibliotecas são específicas para cada linguagem, por exemplo arquivos -.jar para Java, arquivos .dll para .NET, etc. -* **Driver:** responsável por controlar o navegador atual. A maioria dos drivers -são criados pelos próprios fornecedores de navegadores. Os drivers são geralmente -módulos executáveis ​​que são executados no sistema com o próprio navegador, -não no sistema que está executando o conjunto de testes. (Embora esses possam ser -mesmo sistema.) NOTA: _Algumas pessoas se referem aos drivers como proxies._ -* **Framework:** uma biblioteca adicional usada como suporte para suítes do WebDriver. -* Essas estruturas podem ser estruturas de teste, como JUnit ou NUnit. -Eles também podem ser estruturas que suportam recursos de linguagem natural, como -como Cucumber ou Robot Framework. Frameworks também podem ser escritos e usados ​​para -coisas como manipulação ou configuração do sistema em teste, -criação de dados, oráculos de teste, etc. - - -### As partes e peças -No mínimo, o WebDriver se comunica com um navegador por meio de um driver. Comunicação -é bidirecional: o WebDriver passa comandos para o navegador por meio do driver e -recebe informações de volta pela mesma rota. - -{{< figure src="/images/documentation/webdriver/basic_comms.png" class="img-responsive text-center" alt="Basic Communication">}} - -O driver é específico para o navegador, como ChromeDriver para Google -Chrome / Chromium, GeckoDriver para Mozilla Firefox, etc. O driver é -executado no mesmo sistema do navegador. Este pode, ou não ser, o mesmo sistema onde -os próprios testes estão sendo executados. - -Este exemplo simples acima é comunicação _direta_. Comunicação para o -navegador também pode ser comunicação _remota_ através do servidor Selenium ou -RemoteWebDriver. RemoteWebDriver roda no mesmo sistema que o driver -e o navegador. - -{{< figure src="/images/documentation/webdriver/remote_comms.png" class="img-responsive text-center" alt="Remote Communication">}} - -A comunicação remota também pode ocorrer usando Selenium Server ou Selenium -Grid, que, por sua vez, fala com o driver no sistema host - -{{< figure src="/images/documentation/webdriver/remote_comms_server.png" class="img-responsive text-center" alt="Remote Communication with Grid">}} - -## Onde frameworks se encaixam - -O WebDriver tem um trabalho e apenas um trabalho: comunicar-se com o navegador por meio de qualquer um -dos métodos acima. O WebDriver não sabe nada sobre testes: ele não -sabe como comparar coisas, afirmar passa ou falha, e certamente não sabe -uma coisa sobre relatórios ou gramática Dado / Quando / Então. - -É aqui que vários frameworks entram em cena. No mínimo, você precisará de um framework de -teste que corresponde às linguagens, por exemplo, NUnit para .NET, JUnit -para Java, RSpec para Ruby, etc. - -O framework de teste é responsável por rodar e executar seu WebDriver -e etapas relacionadas em seus testes. Como tal, você pode pensar nele parecendo a imagem seguinte. - -{{< figure src="/images/documentation/webdriver/test_framework.png" class="img-responsive text-center" alt="Estrutura de Teste">}} - -Frameworks/ferramentas de linguagem natural, como Cucumber, podem existir como parte desse -framework de teste na figura acima, ou eles podem envolver o framework de teste -inteiramente em sua própria implementação. diff --git a/website_and_docs/content/documentation/overview/components.zh-cn.md b/website_and_docs/content/documentation/overview/components.zh-cn.md deleted file mode 100644 index 7852754dceae..000000000000 --- a/website_and_docs/content/documentation/overview/components.zh-cn.md +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: "了解组件" -linkTitle: "了解组件" -weight: 1 -aliases: [ -"/documentation/webdriver/understanding_the_components" -] ---- - -使用 WebDriver 构建测试套件需要您理解并有效地使用许多不同的组件。就像软件中的一切一样, -不同的人对同一个想法使用不同的术语。下面是在这个描述中如何使用术语的细分。 - -### 专业术语 - -* **API:** 应用程序编程接口。这是一组用来操作 WebDriver 的 “命令”。 -* **库:** 一个代码模块,它包含 api 和实现这些 api 所需的代码。库是对应于具体的语言的,例如 Java 的 .jar 文件,.NET 的 .dll 文件,等等。 -* **驱动程序:** 负责控制实际的浏览器。大多数驱动程序是由浏览器厂商自己创建的。 -驱动程序通常是与浏览器一起在系统上运行的可执行模块,而不是在执行测试套件的系统上。 -(尽管它们可能是同一个系统。) _注意: 有些人把驱动称为代理。_ -* **框架:** 用于支持 WebDriver 套件的附加库。这些框架可能是测试框架,如 JUnit 或 NUnit。 -它们也可能是支持自然语言特性的框架,如 Cucumber 或 Robot Framework。还可以编写和使用框架来操作或配置被测试的系统、 -数据创建、测试预言等等。 - -### 组成部分 -至少,WebDriver 通过一个驱动程序与浏览器对话。通信有两种方式: WebDriver 通过驱动程序向浏览器传递命令, -然后通过相同的路径接收信息。 - -{{< figure src="/images/documentation/webdriver/basic_comms.png" class="img-responsive text-center" alt="基本通信">}} - -驱动程序是特定于浏览器的,例如 ChromeDriver 对应于谷歌的 Chrome/Chromium, -GeckoDriver 对应于 Mozilla 的 Firefox 的,等等。驱动程序在与浏览器相同的系统上运行。 -这可能与执行测试本身的系统相同,也可能不同。 - -上面这个简单的例子就是 _直接_通信。与浏览器的通信也可以是通过 Selenium 服务器或 RemoteWebDriver -进行的 _远程_通信。RemoteWebDriver 与驱动程序和浏览器运行在同一个系统上。 - -{{< figure src="/images/documentation/webdriver/remote_comms.png" class="img-responsive text-center" alt="远程通信">}} - -远程通信也可以使用 Selenium Server 或 Selenium Grid 进行,这两者依次与主机系统上的驱动程序进行通信 - -{{< figure src="/images/documentation/webdriver/remote_comms_server.png" class="img-responsive text-center" alt="通过 Grid 远程通信">}} - -## 应用框架 - -WebDriver 有且只有一个任务: 通过上面的任何方法与浏览器通信。WebDriver 对测试一窍不通:它不知道如何比较事物、 -断言通过或失败,当然它也不知道报告或 Given/When/Then 语法。 - -这就是各种框架发挥作用的地方。至少你需要一个与绑定语言相匹配的测试框架,比如. NET 的 NUnit, Java 的 JUnit, -Ruby 的 RSpec 等等。 - -测试框架负责运行和执行 WebDriver 以及测试中相关步骤。因此,您可以认为它看起来类似于下图。 - -{{< figure src="/images/documentation/webdriver/test_framework.png" class="img-responsive text-center" alt="测试框架">}} - -像 Cucumber 这样的自然语言框架/工具可能作为上图中测试框架框的一部分存在, -或者它们可能将测试框架完全封装在它们自己的实现中。 diff --git a/website_and_docs/content/documentation/overview/details.en.md b/website_and_docs/content/documentation/overview/details.en.md index 5bb04f416e7d..114fd5926df4 100644 --- a/website_and_docs/content/documentation/overview/details.en.md +++ b/website_and_docs/content/documentation/overview/details.en.md @@ -10,7 +10,13 @@ aliases: [ "/documentation/overview/a_deeper_look", "/documentation/ja/introduction/the_selenium_project_and_tools/", "/documentation/pt-br/introduction/the_selenium_project_and_tools/", -"/documentation/zh-cn/introduction/the_selenium_project_and_tools/" +"/documentation/zh-cn/introduction/the_selenium_project_and_tools/", +"/ja/documentation/overview/a_deeper_look", +"/ja/documentation/overview/details/", +"/pt-br/documentation/overview/a_deeper_look", +"/pt-br/documentation/overview/details/", +"/zh-cn/documentation/overview/a_deeper_look", +"/zh-cn/documentation/overview/details/" ] --- diff --git a/website_and_docs/content/documentation/overview/details.ja.md b/website_and_docs/content/documentation/overview/details.ja.md deleted file mode 100644 index 3a30898f3086..000000000000 --- a/website_and_docs/content/documentation/overview/details.ja.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: "Seleniumを詳しく見る" -linkTitle: "詳細" -weight: 2 -description: > - Seleniumは、Webブラウザの自動化を可能にし、その自動化を支援する - 多様なツールとライブラリを包含するプロジェクトです。 -aliases: [ -"/documentation/overview/a_deeper_look" -] ---- - -### SeleniumはWebブラウザを制御します - -_Selenium_ にはさまざまな側面がありますが、その中核は、ブラウザインスタンスをリモートで制御し、 -ユーザーとブラウザのやりとりをエミュレートするために利用可能な最良の技術を用いる、 -Webブラウザ自動化のためのツールセットです。 - -Seleniumを使用すると、エンドユーザーが行う一般的な操作を -シミュレートできます。フィールドへのテキスト入力、ドロップダウンの値やチェックボックスの選択、 -ドキュメント内のリンクのクリックなどです。また、マウス移動や任意のJavaScriptの実行など、 -ほかにも多数の機能を提供します。 - -Seleniumは主にWebサイトのフロントエンドテストに使用されますが、その中核は、 -ブラウザのユーザーエージェントとして機能する _ライブラリ_ です。 -そのインターフェースは幅広い用途で利用でき、目的に合わせてほかのライブラリと -組み合わせることができます。 - -### すべてを支配する1つのインターフェース - -プロジェクトの指針となる原則の1つは、すべての(主要な)ブラウザ技術に共通のインターフェースを -サポートすることです。Webブラウザは非常に複雑で、高度に設計されたアプリケーションであり、 -まったく異なる方法で操作を実行しますが、実行中は同じように見えることがよくあります。 -テキストは同じフォントで表示され、画像は同じ場所に表示され、リンク先も同じです。 -水面下で起こっていることは、昼と夜と同じくらい異なります。 -Seleniumはこれらの違いを「抽象化」し、コードを書く人からその詳細や複雑さを隠蔽します。 -これにより、数行のコードを記述して複雑なワークフローを実行できますが、同じコード行は、 -Firefox、Internet Explorer、Chrome、およびその他のサポートされているすべてのブラウザで -実行されます。 - -### ツールとサポート - -Seleniumの最小限の設計アプローチにより、より大規模なアプリケーションのコンポーネントとして -組み込める汎用性が得られます。Seleniumの傘下で提供される周辺インフラストラクチャは、 -[ブラウザのGrid]({{< ref "grid.md" >}})を構築するためのツールを提供し、 -さまざまなマシン上の複数のオペレーティングシステムとブラウザでテストを実行できるようにします。 - -サーバールームやデータセンター内の多数のコンピュータがすべて同時にブラウザを起動して、 -サイトのリンク、フォーム、テーブルにアクセスし、1日24時間アプリケーションをテストしていると -想像してください。最も一般的なプログラミング言語向けに提供されるシンプルな -プログラミングインターフェースを介して、これらのテストは並列で休むことなく実行され、 -エラーが発生するとユーザーに報告します。 - -ブラウザを制御するだけでなく、そのようなGridを簡単に拡張・展開できるようにするツールと -ドキュメントをユーザーに提供することで、これを現実のものとするお手伝いをすることが目的です。 - -### 誰がSeleniumを利用するのか - -世界で最も重要な企業の多くが、ブラウザベースのテストにSeleniumを採用しており、多くの場合、 -他の独自ツールを使用した長年にわたる取り組みに取って代わっています。 -人気が高まるにつれて、その要件と課題も増えてきました。 - -Webがより複雑になり、新しいテクノロジーがWebサイトに追加されるにつれて、可能な限りそれらに -遅れずについていくことがこのプロジェクトの使命です。オープンソースプロジェクトであるため、 -このサポートは多くのボランティアからの惜しみない時間の寄付によって提供されます。 -こうしたボランティアには全員、本業があります。 - -このプロジェクトのもう1つの使命は、より多くのボランティアがこの取り組みに参加することを奨励し、 -強力なコミュニティを構築して、プロジェクトが新たに登場するテクノロジに対応し続け、 -機能テスト自動化の主要なプラットフォームであり続けることができるようにすることです。 diff --git a/website_and_docs/content/documentation/overview/details.pt-br.md b/website_and_docs/content/documentation/overview/details.pt-br.md deleted file mode 100644 index 3abfd61610c4..000000000000 --- a/website_and_docs/content/documentation/overview/details.pt-br.md +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: "Detalhes" -linkTitle: "Detalhes" -weight: 2 -description: > - Selenium é um projeto abrangente para uma gama de ferramentas e bibliotecas que permitem - e suportam a automação de navegadores da web. -aliases: [ -"/documentation/overview/a_deeper_look" -] ---- - -### Selenium controla navegadores - -_Selenium_ é muitas coisas -mas, em sua essência, é um conjunto de ferramentas para automação de navegador da web -que usa as melhores técnicas disponíveis -para controlar remotamente as instâncias do navegador -e emular a interação do usuário com o navegador. - -Ele permite que os usuários simulem atividades comuns realizadas por usuários finais; -inserir texto em campos, -selecionando valores suspensos e caixas de seleção, -e clicar em links em documentos. -Ele também fornece muitos outros controles, como o movimento do mouse, -execução arbitrária de JavaScript e muito mais. - -Embora seja usado principalmente para testes de front-end de sites, -Selenium é basicamente uma biblioteca de agente de usuário de navegador. -As interfaces são onipresentes em seus aplicativos, -o que incentiva a composição com outras bibliotecas para atender a sua finalidade. - - -### Uma interface para tudo - -Um dos princípios norteadores do projeto -é oferecer suporte a uma interface comum para todas as tecnologias de navegador (principais). -Os navegadores da web são aplicativos incrivelmente complexos e altamente projetados, -realizando suas operações de maneiras completamente diferentes -mas que frequentemente têm a mesma aparência ao fazê-lo. -Mesmo que o texto seja renderizado com as mesmas fontes, -as imagens sejam exibidas no mesmo lugar -e os links levem você ao mesmo destino. -O que está acontecendo por baixo é tão diferente quanto noite e dia. -Selenium "abstrai" essas diferenças, -esconde seus detalhes e complexidades da pessoa que está escrevendo o código. -Isso permite que você escreva várias linhas de código para realizar um fluxo de trabalho complicado, -mas essas mesmas linhas serão executadas no Firefox, -Internet Explorer, Chrome e todos os outros navegadores compatíveis. - - -### Ferramentas e suporte - -A abordagem de design minimalista do Selenium lhe dá a -versatilidade para ser incluído como um componente em aplicações maiores. -A infraestrutura circundante fornecida sob o Selenium -dá a você as ferramentas para montar -sua [Grid de navegadores]({{< ref "grid.md" >}}) -para que os testes possam ser executados em diferentes navegadores e sistemas operacionais -em uma variedade de máquinas. - -Imagine um banco de computadores em sua sala de servidores ou data center -todos abrindo navegadores ao mesmo tempo -acessando links, formulários, -e tabelas — testando seu aplicativo 24 horas por dia. -Por meio da interface de programação simples -fornecido para os idiomas mais comuns, -esses testes serão executados incansavelmente em paralelo, -reportando de volta para você quando ocorrerem erros. - -É o objetivo de ajudar a tornar isso uma realidade para você, -fornecendo aos usuários ferramentas e documentação não apenas para controlar os navegadores -mas para tornar mais fácil dimensionar e implantar essas grades. - - -### Quem usa Selenium - -Muitas das empresas mais importantes do mundo -adotaram o Selenium para seus testes baseados em navegador, -frequentemente substituindo esforços de anos envolvendo outras ferramentas proprietárias. -À medida que sua popularidade cresceu, seus requisitos e desafios se multiplicaram. - -Conforme a web se torna mais complicada -e novas tecnologias são adicionadas aos sites, -é a missão deste projeto acompanhá-los sempre que possível. -Sendo um projeto de código aberto, -este apoio é fornecido por meio da generosa doação de tempo de muitos voluntários, -cada um deles tem um “trabalho diurno”. - -Outra missão do projeto é incentivar -mais voluntários para participar deste esforço, -e construir uma comunidade forte -para que o projeto possa continuar a acompanhar as tecnologias emergentes -e permanecer uma plataforma dominante para automação de teste funcional. - diff --git a/website_and_docs/content/documentation/overview/details.zh-cn.md b/website_and_docs/content/documentation/overview/details.zh-cn.md deleted file mode 100644 index c6fcc790e33c..000000000000 --- a/website_and_docs/content/documentation/overview/details.zh-cn.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: "深度介绍" -linkTitle: "深度介绍" -weight: 2 -description: > - Selenium 是一系列工具和库的综合项目,这些工具和库支持 web 浏览器的自动化。 -aliases: [ -"/documentation/overview/a_deeper_look" -] ---- - - -### Selenium 控制网页浏览器 - -_Selenium_ 有很多功能, -但其核心是 web 浏览器自动化的一个工具集, -它使用最好的技术来远程控制浏览器实例, -并模拟用户与浏览器的交互。 - -它允许用户模拟终端用户执行的常见活动;将文本输入到字段中,选择下拉值和复选框,并单击文档中的链接。 -它还提供许多其他控件,比如鼠标移动、任意 JavaScript 执行等等。 - -虽然 Selenium 主要用于网站的前端测试,但其核心是浏览器用户代理库。 -这些接口在应用程序中无处不在,它们鼓励与其他库进行组合,以满足您的目的。 - -### 一个接口来统治它们 - -该项目的指导原则之一是支持所有(主要)浏览器技术的通用接口。 -Web 浏览器是非常复杂的,高度工程化的应用程序, -以完全不同的方式执行它们的操作,但是在执行这些操作时,它们通常看起来是一样的 -即使文本以相同的字体呈现,图像也会显示在相同的位置,并且链接会将您带到相同的目的地。 -下面发生的事情就像白天和黑夜一样不同。 -Selenium “抽象”了这些差异,向编写代码的人隐藏了它们的细节和复杂性。 -这允许您编写几行代码来执行一个复杂的工作流程, -但是这几行代码将在 Firefox、 Internet Explorer、 Chrome 和所有其他支持的浏览器上执行。 - -### 工具和支持 - -Selenium 的极简设计方法使其具有通用性,可以作为更大应用程序中的组件。 -Selenium 保护伞下提供的周边基础设施为您提供了组合自己的 -[浏览器 grid]({{< ref "grid.md" >}}) 的工具, -因此测试就可以跨一系列机器在不同的浏览器和多个操作系统上运行。 - -想象一下, -服务器机房或数据中心的一组计算机同时启动浏览器,访问站点的链接、表单和表格 — -全天 24 小时测试应用程序。 -通过为最常见的语言提供的简单编程接口, -这些测试将不知疲倦地并行运行, -当错误发生时向您报告。 - -通过为用户提供工具和文档, -不仅可以控制浏览器, -还可以方便地扩展和部署这些grid, -从而帮助您实现这一目标。 - -### 谁在使用 Selenium - -世界上许多最重要的公司都在基于浏览器的测试中采用了 Selenium, -这常常取代了多年来涉及其他专有工具的工作。 -随着它越来越受欢迎, -它的需求和挑战也成倍增加。 - -随着网络变得越来越复杂,新的技术被添加到网站上, -这个项目的任务就是尽可能地跟上它们。 -作为一个开源项目,这种支持是通过许多志愿者的慷慨捐赠来提供的, -每个志愿者都有一份“日常工作”。 - -该项目的另一个任务是鼓励更多的志愿者参与到这项工作中来, -并建立一个强大的社区,以便项目能够继续跟上新兴的技术, -并继续成为功能测试自动化的主导平台。 diff --git a/website_and_docs/content/documentation/test_practices/design_strategies.ja.md b/website_and_docs/content/documentation/test_practices/design_strategies.ja.md index 8e7375e3867f..ca8553b26977 100644 --- a/website_and_docs/content/documentation/test_practices/design_strategies.ja.md +++ b/website_and_docs/content/documentation/test_practices/design_strategies.ja.md @@ -13,8 +13,8 @@ weight: 1 次のデザインパターンと戦略は、テストの作成と保守を容易にするためにWebDriverで以前に使用されています。 それらもあなたにとって役に立つかもしれません。 -[DomainDrivenDesign]({{< ref "encouraged/domain_specific_language.md" >}}):アプリのエンドユーザーの言語でテストを表現します。 -[PageObjects]({{< ref "encouraged/page_object_models.md" >}}):WebアプリのUIの単純な抽象化 +[DomainDrivenDesign]({{< ref path="encouraged/domain_specific_language.md" lang="en" >}}):アプリのエンドユーザーの言語でテストを表現します。 +[PageObjects]({{< ref path="encouraged/page_object_models.md" lang="en" >}}):WebアプリのUIの単純な抽象化 LoadableComponent:PageObjectsをコンポーネントとしてモデリングします。 BotStyleTests:PageObjectsが推奨するオブジェクトベースのアプローチではなく、コマンドベースのアプローチを使用してテストを自動化します。 diff --git a/website_and_docs/content/documentation/test_practices/design_strategies.pt-br.md b/website_and_docs/content/documentation/test_practices/design_strategies.pt-br.md index 7d555f28e816..4e55bda77308 100644 --- a/website_and_docs/content/documentation/test_practices/design_strategies.pt-br.md +++ b/website_and_docs/content/documentation/test_practices/design_strategies.pt-br.md @@ -15,8 +15,8 @@ occur you want to be up and running again as quickly as possible. The following design patterns and strategies have been used before with WebDriver to help make tests easier to write and maintain. They may help you too. -[DomainDrivenDesign]({{< ref "encouraged/domain_specific_language.md" >}}): Express your tests in the language of the end-user of the app. -[PageObjects]({{< ref "encouraged/page_object_models.md" >}}): A simple abstraction of the UI of your web app. +[DomainDrivenDesign]({{< ref path="encouraged/domain_specific_language.md" lang="en" >}}): Express your tests in the language of the end-user of the app. +[PageObjects]({{< ref path="encouraged/page_object_models.md" lang="en" >}}): A simple abstraction of the UI of your web app. LoadableComponent: Modeling PageObjects as components. BotStyleTests: Using a command-based approach to automating tests, rather than the object-based approach that PageObjects encourage diff --git a/website_and_docs/content/documentation/test_practices/design_strategies.zh-cn.md b/website_and_docs/content/documentation/test_practices/design_strategies.zh-cn.md index 7b8c37681302..9dd5de876db6 100644 --- a/website_and_docs/content/documentation/test_practices/design_strategies.zh-cn.md +++ b/website_and_docs/content/documentation/test_practices/design_strategies.zh-cn.md @@ -16,9 +16,9 @@ weight: 1 下面介绍的一些设计模式与策略在 WebDriver 场景下被证明可以简化测试编写与维护, 可能也对你有帮助. -[领域驱动设计]({{< ref "encouraged/domain_specific_language.md" >}}): 以最终用户的语言来表达测试. +[领域驱动设计]({{< ref path="encouraged/domain_specific_language.md" lang="en" >}}): 以最终用户的语言来表达测试. -[页面对象]({{< ref "encouraged/page_object_models.md" >}}): 对 Web 应用 UI 的一种简单抽象. +[页面对象]({{< ref path="encouraged/page_object_models.md" lang="en" >}}): 对 Web 应用 UI 的一种简单抽象. LoadableComponent: 把页面对象建模为可加载的组件. diff --git a/website_and_docs/content/documentation/test_practices/discouraged/_index.en.md b/website_and_docs/content/documentation/test_practices/discouraged/_index.en.md index 1c4fc28db545..627f20a8d042 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/_index.en.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/_index.en.md @@ -9,7 +9,13 @@ aliases: [ "/documentation/worst_practices/", "/documentation/ja/worst_practices/", "/documentation/pt-br/worst_practices/", -"/documentation/zh-cn/worst_practices/" +"/documentation/zh-cn/worst_practices/", +"/ja/documentation/test_practices/discouraged/", +"/ja/documentation/worst_practices/", +"/pt-br/documentation/test_practices/discouraged/", +"/pt-br/documentation/worst_practices/", +"/zh-cn/documentation/test_practices/discouraged/", +"/zh-cn/documentation/worst_practices/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/_index.ja.md b/website_and_docs/content/documentation/test_practices/discouraged/_index.ja.md deleted file mode 100644 index fe8fb4546c0e..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/_index.ja.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "推奨されない行動" -linkTitle: "非推奨" -weight: 8 -description: > - Seleniumでブラウザを自動化するときに避けるべきこと。 -aliases: [ -"/documentation/worst_practices/" -] ---- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/_index.pt-br.md b/website_and_docs/content/documentation/test_practices/discouraged/_index.pt-br.md deleted file mode 100644 index 3fcfcb1c3f8d..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/_index.pt-br.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "Piores práticas" -linkTitle: "Piores práticas" -weight: 8 -description: > - Temas a evitar quando automatizar navegadores com Selenium. -aliases: [ -"/documentation/worst_practices/" -] ---- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/_index.zh-cn.md b/website_and_docs/content/documentation/test_practices/discouraged/_index.zh-cn.md deleted file mode 100644 index 7b27322e785d..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/_index.zh-cn.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "不鼓励的行为" -linkTitle: "反模式" -weight: 8 -description: > - 使用Selenium自动化浏览器时应避免的事项. -aliases: [ -"/documentation/worst_practices/" -] ---- - - diff --git a/website_and_docs/content/documentation/test_practices/discouraged/captchas.en.md b/website_and_docs/content/documentation/test_practices/discouraged/captchas.en.md index 67489e34a311..4a7609d82585 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/captchas.en.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/captchas.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/worst_practices/captchas/", "/documentation/ja/worst_practices/captchas/", "/documentation/pt-br/worst_practices/captchas/", -"/documentation/zh-cn/worst_practices/captchas/" +"/documentation/zh-cn/worst_practices/captchas/", +"/ja/documentation/test_practices/discouraged/captchas/", +"/ja/documentation/worst_practices/captchas/", +"/pt-br/documentation/test_practices/discouraged/captchas/", +"/pt-br/documentation/worst_practices/captchas/", +"/zh-cn/documentation/test_practices/discouraged/captchas/", +"/zh-cn/documentation/worst_practices/captchas/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/captchas.ja.md b/website_and_docs/content/documentation/test_practices/discouraged/captchas.ja.md deleted file mode 100644 index 6484ae16a62d..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/captchas.ja.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "CAPTCHA(キャプチャ)" -linkTitle: "CAPTCHA(キャプチャ)" -weight: 1 -aliases: [ -"/documentation/worst_practices/captchas/" -] ---- - -CAPTCHA(キャプチャ)は、 _Completely Automated Public Turing test -to tell Computers and Humans Apart_ (コンピューターと人間を区別するための完全に自動化された公開チューリングテスト)の略で、自動化を防ぐように明示的に設計されているため、試さないでください! -CAPTCHAチェックを回避するための2つの主要な戦略があります。 - -* テスト環境でCAPTCHAを無効にします -* テストがCAPTCHAをバイパスできるようにするフックを追加します diff --git a/website_and_docs/content/documentation/test_practices/discouraged/captchas.pt-br.md b/website_and_docs/content/documentation/test_practices/discouraged/captchas.pt-br.md deleted file mode 100644 index 516a903ae558..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/captchas.pt-br.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: "Captchas" -linkTitle: "Captchas" -weight: 1 -aliases: [ -"/documentation/worst_practices/captchas/" -] ---- - -CAPTCHA, abreviação de _Completely Automated Public Turing test -to tell Computers and Humans Apart_, -foi projetado explicitamente para impedir a automação, portanto, não tente! -Existem duas estratégias principais para contornar as verificações CAPTCHA: - -* Desative CAPTCHAs em seu ambiente de teste -* Adicione um hook para permitir que os testes ignorem o CAPTCHA diff --git a/website_and_docs/content/documentation/test_practices/discouraged/captchas.zh-cn.md b/website_and_docs/content/documentation/test_practices/discouraged/captchas.zh-cn.md deleted file mode 100644 index e2e7a14f7118..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/captchas.zh-cn.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: "验证码" -linkTitle: "验证码" -weight: 1 -aliases: [ -"/documentation/worst_practices/captchas/" -] ---- -验证码 (CAPTCHA), 是 _全自动区分计算机和人类的图灵测试_ *(Completely Automated Public Turing test to tell Computers and Humans Apart)* 的简称, -是被明确地设计用于阻止自动化的, 所以不要尝试! -规避验证码的检查, 主要有两个策略: - -* 在测试环境中禁用验证码 -* 添加钩子以允许测试绕过验证码 diff --git a/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.en.md b/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.en.md index fde9ac91bfcf..1dadfad1ff6c 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.en.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/worst_practices/file_downloads/", "/documentation/ja/worst_practices/file_downloads/", "/documentation/pt-br/worst_practices/file_downloads/", -"/documentation/zh-cn/worst_practices/file_downloads/" +"/documentation/zh-cn/worst_practices/file_downloads/", +"/ja/documentation/test_practices/discouraged/file_downloads/", +"/ja/documentation/worst_practices/file_downloads/", +"/pt-br/documentation/test_practices/discouraged/file_downloads/", +"/pt-br/documentation/worst_practices/file_downloads/", +"/zh-cn/documentation/test_practices/discouraged/file_downloads/", +"/zh-cn/documentation/worst_practices/file_downloads/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.ja.md b/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.ja.md deleted file mode 100644 index ab9c0b8fedba..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.ja.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: "ファイルダウンロード" -linkTitle: "ファイルダウンロード" -weight: 2 -aliases: [ -"/documentation/worst_practices/file_downloads/" -] ---- - - -Seleniumの管理下にあるブラウザーでリンクをクリックしてダウンロードを開始することは可能ですが、APIはダウンロードの進行状況を公開しないため、ダウンロードしたファイルのテストには理想的ではありません。 -これは、ファイルのダウンロードは、Webプラットフォームとのユーザーインタラクションをエミュレートする重要な側面とは見なされないためです。 -代わりに、Selenium(および必要なCookie)を使用してリンクを見つけ、 [curl](https://curl.se/) などのHTTPリクエストライブラリに渡します。 - -[HtmlUnitドライバー](https://github.com/SeleniumHQ/htmlunit-driver)は、 -[AttachmentHandler](https://htmlunit.sourceforge.io/apidocs/com/gargoylesoftware/htmlunit/attachment/AttachmentHandler.html) インターフェイスを実装することで、 -入力ストリームとして添付ファイルにアクセスすることによって、添付ファイルをダウンロードできます。 -AttachmentHandlerは、[HtmlUnit](https://htmlunit.sourceforge.io/) に追加できます。 diff --git a/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.pt-br.md b/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.pt-br.md deleted file mode 100644 index 2a335267672c..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.pt-br.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "Downloads de arquivo" -linkTitle: "Downloads de arquivo" -weight: 2 -aliases: [ -"/documentation/worst_practices/file_downloads/" -] ---- - -Embora seja possível iniciar um download -clicando em um link com um navegador sob o controle do Selenium, -a API não expõe o progresso do download, -tornando-o menos do que ideal para testar arquivos baixados. -Isso ocorre porque o download de arquivos não é considerado um aspecto importante -de emular a interação do usuário com a plataforma da web. -Em vez disso, encontre o link usando Selenium -(e todos os cookies necessários) -e passe este cookie para uma biblioteca de solicitação HTTP como -[curl](https://curl.se/). - -O [driver HtmlUnit](https://github.com/SeleniumHQ/htmlunit-driver) pode baixar -anexos acessando-os como fluxos de entrada, implementando o -[AttachmentHandler](https://htmlunit.sourceforge.io/apidocs/com/gargoylesoftware/htmlunit/attachment/AttachmentHandler.html). -O AttachmentHandler pode ser adicionado ao WebClient [HtmlUnit](https://htmlunit.sourceforge.io/). diff --git a/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.zh-cn.md b/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.zh-cn.md deleted file mode 100644 index c58231464412..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/file_downloads.zh-cn.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "文件下载" -linkTitle: "文件下载" -weight: 2 -aliases: [ -"/documentation/worst_practices/file_downloads/" -] ---- - - -虽然可以通过在Selenium的控制下单击浏览器的链接来开始下载, 但是API并不会暴露下载进度, 因此这是一种不理想的测试下载文件的方式. -因为下载文件并非模拟用户与Web平台交互的重要方面. 取而代之的是, 应使用Selenium(以及任何必要的cookie)查找链接, 并将其传递给例如[curl](//curl.se/)这样的HTTP请求库. - - -[HtmlUnit driver](https://github.com/SeleniumHQ/htmlunit-driver) -可以通过实现[AttachmentHandler](https://htmlunit.sourceforge.io/apidocs/com/gargoylesoftware/htmlunit/attachment/AttachmentHandler.html) -接口将附件作为输入流进行访问来下载附件. -可以将AttachmentHandler添加到 -[HtmlUnit](https://htmlunit.sourceforge.io/) WebClient. diff --git a/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.en.md b/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.en.md index 6f305f542746..0d1dc8311574 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.en.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/worst_practices/gmail_email_and_facebook_logins/", "/documentation/ja/worst_practices/gmail_email_and_facebook_logins/", "/documentation/pt-br/worst_practices/gmail_email_and_facebook_logins/", -"/documentation/zh-cn/worst_practices/gmail_email_and_facebook_logins/" +"/documentation/zh-cn/worst_practices/gmail_email_and_facebook_logins/", +"/ja/documentation/test_practices/discouraged/gmail_email_and_facebook_logins/", +"/ja/documentation/worst_practices/gmail_email_and_facebook_logins/", +"/pt-br/documentation/test_practices/discouraged/gmail_email_and_facebook_logins/", +"/pt-br/documentation/worst_practices/gmail_email_and_facebook_logins/", +"/zh-cn/documentation/test_practices/discouraged/gmail_email_and_facebook_logins/", +"/zh-cn/documentation/worst_practices/gmail_email_and_facebook_logins/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.ja.md b/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.ja.md deleted file mode 100644 index 70eba9ee0d28..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.ja.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "Gmail、Eメール、Facebookログイン" -linkTitle: "Gmail、Eメール、Facebook" -weight: 4 -aliases: [ -"/documentation/worst_practices/gmail_email_and_facebook_logins/" -] ---- - - -複数の理由から、WebDriverを使用してGmailやFacebookなどのサイトにログインすることはお勧めしません。 -これらのサイトの使用条件(アカウントがシャットダウンされるリスクがある)に違反することは別として、それは遅く、信頼性がありません。 - -理想的なプラクティスは、メールプロバイダーが提供するAPIを使用すること、またはFacebookの場合、テストアカウントや友人などを作成するためのAPIを公開する開発者ツールサービスを使用することです。 -APIの使用は少し大変な作業のように思えるかもしれませんが、速度、信頼性、および安定性に見返りがあります。 -また、APIが変更されることはほとんどありませんが、WebページとHTMLロケーターは頻繁に変更され、テストフレームワークを更新する必要があります。 - -テストの任意の時点でWebDriverを使用してサードパーティのサイトにログインすると、テストが長くなるため、テストが失敗するリスクが高くなります。 -一般的な経験則として、テストが長くなるほど脆弱で信頼性が低くなります。 - -[W3C準拠](//w3c.github.io/webdriver/webdriver-spec.html) のWebDriver実装は、サービス拒否攻撃を軽減できるように、`navigator`オブジェクトに`WebDriver`プロパティで注釈を付けます。 diff --git a/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.pt-br.md b/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.pt-br.md deleted file mode 100644 index 202f1221675a..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.pt-br.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: "Login via Gmail, email e Facebook" -linkTitle: "Login via Gmail, email e Facebook" -weight: 4 -aliases: [ -"/documentation/worst_practices/gmail_email_and_facebook_logins/" -] ---- - -Por vários motivos, fazer login em sites como Gmail e Facebook -usando do WebDriver não é recomendado. -Além de ser contra os termos de uso desses sites -(onde você corre o risco de ter a conta encerrada), -é lento e não confiável. - -A prática ideal é usar as APIs que os provedores de e-mail oferecem, -ou no caso do Facebook, o serviço de ferramentas para desenvolvedores -que expõe uma API para criar contas de teste, amigos e assim por diante. -Embora usar uma API possa parecer um pouco trabalhoso, -você será recompensado em velocidade, confiabilidade e estabilidade. -A API também não deve mudar, -enquanto as páginas da web e os localizadores de HTML mudam frequentemente -e exigem que você atualize sua estrutura de teste. - -Login em sites de terceiros usando WebDriver -em qualquer ponto do seu teste aumenta o risco -de seu teste falhar porque torna o teste mais longo. -Uma regra geral é que testes mais longos -são mais frágeis e não confiáveis. - -Implementações WebDriver que estão -[em conformidade com W3C](//w3c.github.io/webdriver/webdriver-spec.html) -também anotam o objeto `navigator` -com uma propriedade `WebDriver` -para que os ataques de negação de serviço possam ser mitigados. diff --git a/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.zh-cn.md b/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.zh-cn.md deleted file mode 100644 index 738d7d33647f..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/gmail_email_and_facebook_logins.zh-cn.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: "Gmail, email 和 Facebook 登录" -linkTitle: "Gmail, email and Facebook" -weight: 4 -aliases: [ -"/documentation/worst_practices/gmail_email_and_facebook_logins/" -] ---- - - -由于多种原因, 不建议使用WebDriver登录Gmail和Facebook等网站. -除了违反这些网站的使用条款之外 (您可能会面临帐户被关闭的风险) , -还有其运行速度缓慢且不可靠的因素. - - -理想的做法是使用电子邮件供应商提供的API, -或者对于Facebook, 使用开发者工具的服务, -该服务是被用于创建测试帐户、朋友等内容的API. -尽管使用API可能看起来有些额外的工作量, -但是您将获得基于速度、可靠性和稳定性的回报. -API不会频繁更改, 但是网页和HTML定位符经常变化, -并且需要您更新测试框架的代码. - -在任何时候测试使用WebDriver登录第三方站点, -都会增加测试失败的风险, -因为这会使您的测试时间更长. -通常的经验是, 执行时间较长的测试会更加脆弱和不可靠. - -符合[W3C conformant](//w3c.github.io/webdriver/webdriver-spec.html) -的WebDriver实现, -也会使用 `WebDriver` 的属性对 `navigator` 对象进行注释, -用于缓解拒绝服务的攻击. diff --git a/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.en.md b/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.en.md index 67e9120d0548..da128ea50248 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.en.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/worst_practices/http_response_codes/", "/documentation/ja/worst_practices/http_response_codes/", "/documentation/pt-br/worst_practices/http_response_codes/", -"/documentation/zh-cn/worst_practices/http_response_codes/" +"/documentation/zh-cn/worst_practices/http_response_codes/", +"/ja/documentation/test_practices/discouraged/http_response_codes/", +"/ja/documentation/worst_practices/http_response_codes/", +"/pt-br/documentation/test_practices/discouraged/http_response_codes/", +"/pt-br/documentation/worst_practices/http_response_codes/", +"/zh-cn/documentation/test_practices/discouraged/http_response_codes/", +"/zh-cn/documentation/worst_practices/http_response_codes/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.ja.md b/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.ja.md deleted file mode 100644 index 767f607dca3d..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.ja.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -title: "HTTPレスポンスコード" -linkTitle: "HTTPレスポンスコード" -weight: 3 -aliases: [ -"/documentation/worst_practices/http_response_codes/" -] ---- - - -Selenium RCの一部のブラウザー構成では、Seleniumはブラウザーと自動化されているサイトの間のプロキシとして機能しました。 -これは、Seleniumを通過したすべてのブラウザートラフィックをキャプチャまたは操作できることを意味していました。 -`captureNetworkTraffic()` メソッドは、HTTPレスポンスコードを含むブラウザーと自動化されているサイト間のすべてのネットワークトラフィックをキャプチャすることを目的としています。 - -Selenium WebDriverは、ブラウザーの自動化に対するまったく異なるアプローチであり、ユーザーのように振る舞うことを好むため、WebDriverを使用してテストを記述する方法で表現します。 -自動化された機能テストでは、ステータスコードの確認はテストの失敗の特に重要な詳細ではありません。 -それに先行する手順がより重要です。 - -ブラウザーは常にHTTPステータスコードを表します。たとえば、404または500エラーページを想像してください。 -これらのエラーページの1つに遭遇したときに"早く失敗"する簡単な方法は、ページが読み込まれるたびにページタイトルまたは信頼できるポイント(たとえば `

` タグ)のコンテンツをチェックすることです。 -ページオブジェクトモデルを使用している場合、このチェックをクラスコンストラクターまたはページの読み込みが予想される同様のポイントに含めることができます。 -場合によっては、HTTPコードがブラウザーのエラーページに表示されることもあります。 -WebDriverを使用してこれを読み取り、デバッグ出力を改善できます。 - -Webページ自体を確認することは、WebDriverの理想的なプラクティスに沿っており、WebDriverのユーザーのWebサイトの見え方を表現し、主張します。 - -HTTPステータスコードをキャプチャするための高度なソリューションは、プロキシを使用してSelenium RCの動作を複製することです。 -WebDriver APIは、ブラウザーのプロキシを設定する機能を提供します。 -Webサーバーとの間で送受信されるリクエストのコンテンツをプログラムで操作できるプロキシがいくつかあります。 -プロキシを使用すると、リダイレクトレスポンスコードへの応答方法を決めることができます。 -さらに、すべてのブラウザーがWebDriverでレスポンスコードを利用できるようにするわけではないため、プロキシを使用することを選択すると、すべてのブラウザーで機能するソリューションが得られます。 diff --git a/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.pt-br.md b/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.pt-br.md deleted file mode 100644 index ea78f028370e..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.pt-br.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: "Códigos de respostas HTTP" -linkTitle: "Códigos de respostas HTTP" -weight: 3 -aliases: [ -"/documentation/worst_practices/http_response_codes/" -] ---- - -Para algumas configurações de navegador no Selenium RC, -Selenium atuou como um proxy entre o navegador -e o site sendo automatizado. -Isso significa que todo o tráfego do navegador que passou pelo Selenium -poderia ser capturado ou manipulado. -O método `captureNetworkTraffic()` -pretendia capturar todo o tráfego de rede entre o navegador -e o site sendo automatizado, -incluindo códigos de resposta HTTP. - -Selenium WebDriver é uma abordagem completamente diferente -para a automação do navegador, -preferindo agir mais como um usuário. -Isso é representado na maneira como você escreve testes com o WebDriver. -Em testes funcionais automatizados, -verificar o código de status -não é um detalhe particularmente importante da falha de um teste; -as etapas que o precederam são mais importantes. - -O navegador sempre representará o código de status HTTP, -imagine, por exemplo, uma página de erro 404 ou 500. -Uma maneira simples de “falhar rapidamente” quando você encontrar uma dessas páginas de erro -é verificar o título da página ou o conteúdo de um ponto confiável -(por exemplo, a tag `

`) após cada carregamento de página. -Se você estiver usando o modelo de objeto de página, -você pode incluir esta verificação em seu construtor de classe -ou ponto semelhante onde o carregamento da página é esperado. -Ocasionalmente, o código HTTP pode até ser representado -na página de erro do navegador -e você pode usar o WebDriver para ler isso -e melhorar sua saída de depuração. - -Verificar se a própria página da web está alinhada -com a prática ideal do WebDriver -de representar a visão do usuário do site. - -Se você insiste, uma solução avançada para capturar códigos de status HTTP -é replicar o comportamento do Selenium RC usando um proxy. -A API WebDriver fornece a capacidade de definir um proxy para o navegador, -e há uma série de proxies que irão -permitir que você manipule de forma programática -o conteúdo das solicitações enviadas e recebidas do servidor da web. -Usar um proxy permite que você decida como deseja responder -para códigos de resposta de redirecionamento. -Além disso, nem todo navegador -torna os códigos de resposta disponíveis para WebDriver, -então optar por usar um proxy -permite que você tenha uma solução que funciona para todos os navegadores. diff --git a/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.zh-cn.md b/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.zh-cn.md deleted file mode 100644 index df51f272d5f1..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/http_response_codes.zh-cn.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: "HTTP响应码" -linkTitle: "HTTP响应码" -weight: 3 -aliases: [ -"/documentation/worst_practices/http_response_codes/" -] ---- - -对于Selenium RC中的某些浏览器配置, -Selenium充当了浏览器和自动化站点之间的代理. -这意味着可以捕获或操纵通过Selenium传递的所有浏览器流量. - `captureNetworkTraffic()` 方法旨在捕获浏览器和自动化站点之间的所有网络流量,包括HTTP响应码. - -Selenium WebDriver是一种完全不同的浏览器自动化实现, -它更喜欢表现得像用户一样,这种方式来自于基于WebDriver编写测试的方式. -在自动化功能测试中,检查状态码并不是测试失败的特别重要的细节, 之前的步骤更重要. - -浏览器将始终呈现HTTP状态代码,例如404或500错误页面. -遇到这些错误页面时,一种“快速失败”的简单方法是 -在每次加载页面后检查页面标题或可信赖点的内容(例如 `

` 标签). -如果使用的是页面对象模型,则可以将此检查置于类构造函数中或类似于期望的页面加载的位置. -有时,HTTP代码甚至可能出现在浏览器的错误页面中, -您可以使用WebDriver读取此信息并改善调试输出. - -检查网页本身的一种理想实践是符合WebDriver的呈现以及用户的视角. - -如果您坚持,捕获HTTP状态代码的高级解决方案是复刻Selenium RC的行为去使用代理. -WebDriver API提供了为浏览器设置代理的功能, -并且有许多代理可以通过编程方式来操纵发送到Web服务器和从Web服务器接收的请求的内容. -使用代理可以决定如何响应重定向响应代码. -此外,并非每个浏览器都将响应代码提供给WebDriver, -因此选择使用代理可以使您拥有适用于每个浏览器的解决方案. diff --git a/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.en.md b/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.en.md index d28e7c7f5617..ee0f968779f8 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.en.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/worst_practices/link_spidering/", "/documentation/ja/worst_practices/link_spidering/", "/documentation/pt-br/worst_practices/link_spidering/", -"/documentation/zh-cn/worst_practices/link_spidering/" +"/documentation/zh-cn/worst_practices/link_spidering/", +"/ja/documentation/test_practices/discouraged/link_spidering/", +"/ja/documentation/worst_practices/link_spidering/", +"/pt-br/documentation/test_practices/discouraged/link_spidering/", +"/pt-br/documentation/worst_practices/link_spidering/", +"/zh-cn/documentation/test_practices/discouraged/link_spidering/", +"/zh-cn/documentation/worst_practices/link_spidering/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.ja.md b/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.ja.md deleted file mode 100644 index 88f52733ffeb..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.ja.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "リンクスパイダー" -linkTitle: "リンクスパイダー" -weight: 7 -aliases: [ -"/documentation/worst_practices/link_spidering/" -] ---- - - -WebDriverを使用してリンクをスパイダーすることは、実行できないためではなく、最も理想的なツールではないため明らかに推奨される方法ではありません。 -WebDriverの起動には時間が必要であり、テストの記述方法によっては、ページに到達してDOMを通過するために数秒から1分かかる場合があります。 - -このためにWebDriverを使用する代わりに、[curl](https://curl.se/) コマンドを実行するか、BeautifulSoupなどのライブラリを使用することにより、これらの方法はブラウザーの作成やページへの移動に依存しないため、時間を大幅に節約できます。 -このタスクにWebDriverを使用しないことで、時間を大幅に節約できます。 diff --git a/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.pt-br.md b/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.pt-br.md deleted file mode 100644 index c00bd834f4e5..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.pt-br.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: "Navegação por links" -linkTitle: "Navegação por links" -weight: 7 -aliases: [ -"/documentation/worst_practices/link_spidering/" -] ---- - -Usar o WebDriver para navegar por links -não é uma prática recomendada. Não porque não pode ser feito, -mas porque WebDriver definitivamente não é a ferramenta ideal para isso. -O WebDriver precisa de tempo para inicializar, -e pode levar vários segundos, até um minuto -dependendo de como seu teste é escrito, -apenas para chegar à página e atravessar o DOM. - -Em vez de usar o WebDriver para isso, -você poderia economizar muito tempo -executando um comando [curl](https://curl.se/), -ou usando uma biblioteca como BeautifulSoup -uma vez que esses métodos não dependem -em criar um navegador e navegar para uma página. -Você está economizando muito tempo por não usar o WebDriver para essa tarefa. - diff --git a/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.zh-cn.md b/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.zh-cn.md deleted file mode 100644 index 255b69824d26..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/link_spidering.zh-cn.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "爬取链接" -linkTitle: "爬取链接" -weight: 7 -aliases: [ -"/documentation/worst_practices/link_spidering/" -] ---- - -建议您不要使用WebDriver来通过链接进行爬网, -并非因为无法完成,而是因为它绝对不是最理想的工具。 -WebDriver需要一些时间来启动,并且可能要花几秒钟到一分钟的时间, -具体取决于测试的编写方式,仅仅是为了获取页面并遍历DOM. - -除了使用WebDriver之外, -您还可以通过执行 [curl](https://curl.se/) 命令或 -使用诸如BeautifulSoup之类的库来节省大量时间, -因为这些方法不依赖于创建浏览器和导航至页面. -通过不使用WebDriver可以节省大量时间. - diff --git a/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.en.md b/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.en.md index c8271a2ceed1..630197534b9a 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.en.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/worst_practices/performance_testing/", "/documentation/ja/worst_practices/performance_testing/", "/documentation/pt-br/worst_practices/performance_testing/", -"/documentation/zh-cn/worst_practices/performance_testing/" +"/documentation/zh-cn/worst_practices/performance_testing/", +"/ja/documentation/test_practices/discouraged/performance_testing/", +"/ja/documentation/worst_practices/performance_testing/", +"/pt-br/documentation/test_practices/discouraged/performance_testing/", +"/pt-br/documentation/worst_practices/performance_testing/", +"/zh-cn/documentation/test_practices/discouraged/performance_testing/", +"/zh-cn/documentation/worst_practices/performance_testing/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.ja.md b/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.ja.md deleted file mode 100644 index 1da5838964b2..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.ja.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: "パフォーマンステスト" -linkTitle: "パフォーマンステスト" -weight: 6 -aliases: [ -"/documentation/worst_practices/performance_testing/" -] ---- - - -通常、SeleniumとWebDriverを使用したパフォーマンステストはお勧めしません。 -それができないからではなく、ジョブに最適化されておらず、良い結果が得られないからです。 - -ユーザーのコンテキストでパフォーマンステストを行うのが理想的なように思えるかもしれませんが、WebDriverテストスイートは、外部および内部の脆弱性の多くのポイントにさらされます。 -たとえば、ブラウザの起動速度、HTTPサーバーの速度、JavaScriptまたはCSSをホストするサードパーティサーバーの応答、およびWebDriver実装自体の計測ペナルティ。 これらのポイントが変わることで、結果が変わります。 Webサイトのパフォーマンスと外部リソースのパフォーマンスの違いを区別することは困難です。また、ブラウザでWebDriverを使用すること、特にスクリプトを挿入する場合のパフォーマンスの低下を把握することも困難です。 - -他の潜在的な魅力は "時間の節約" です。 -機能テストとパフォーマンステストを同時に実行します。 -ただし、機能テストとパフォーマンステストには反対の目的があります。 -機能をテストするために、テスターは忍耐強くロードを待つ必要があるかもしれませんが、これはパフォーマンステスト結果を曖昧にし、その逆もまた同様です。 - -Webサイトのパフォーマンスを改善するには、改善すべき点を知るために、環境の違いに関係なく全体的なパフォーマンスを分析し、貧弱なコードプラクティス、個々のリソース(例えば、CSSまたはJavaScript)のパフォーマンスの内訳を特定できる必要があります。 -このジョブを実行できるパフォーマンステストツールが既にあり、それらは改善を提案できるレポートと分析を提供します。 - -使用する(オープンソース)パッケージの例は次のとおりです。: [JMeter](//jmeter.apache.org/) diff --git a/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.pt-br.md b/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.pt-br.md deleted file mode 100644 index c3614675f6ce..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.pt-br.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: "Teste de performance/desempenho" -linkTitle: "Teste de performance/desempenho" -weight: 6 -aliases: [ -"/documentation/worst_practices/performance_testing/" -] ---- - -Teste de desempenho usando Selenium e WebDriver -geralmente não é recomendado. -Não porque é incapaz, -mas porque não é otimizado para o trabalho -e é improvável que você obtenha bons resultados. - -Pode parecer ideal para teste de desempenho -no contexto do usuário, mas um conjunto de testes WebDriver -estão sujeitos a muitos pontos de fragilidade externa e interna -que estão além do seu controle; -por exemplo, velocidade de inicialização do navegador, -velocidade dos servidores HTTP, -resposta de servidores de terceiros que hospedam JavaScript ou CSS, -e a penalidade de instrumentação -da própria implementação do WebDriver. -A variação nesses pontos causará variação em seus resultados. -É difícil separar a diferença -entre o desempenho do seu site -e o desempenho de recursos externos, -e também é difícil dizer qual é a penalidade de desempenho -para usar WebDriver no navegador, -especialmente se você estiver injetando scripts. - -A outra atração potencial é "economizar tempo" - -execução de testes funcionais e de desempenho ao mesmo tempo. -No entanto, os testes funcionais e de desempenho têm objetivos opostos. -Para testar a funcionalidade, um testador pode precisar ser paciente -e aguarde o carregamento, -mas isso irá turvar os resultados do teste de desempenho e vice-versa. - -Para melhorar o desempenho do seu site, -você precisará ser capaz de analisar o desempenho geral -independente das diferenças de ambiente, -identificar práticas de código ruins, -repartição do desempenho de recursos individuais -(ou seja, CSS ou JavaScript), -para saber o que melhorar. -Existem ferramentas de teste de desempenho disponíveis -que podem fazer este trabalho, -que fornecem relatórios e análises, -e podem até fazer sugestões de melhorias. - -Pacotes de exemplo (código aberto) a serem usados ​​são: [JMeter](//jmeter.apache.org/) diff --git a/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.zh-cn.md b/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.zh-cn.md deleted file mode 100644 index a01f024b618e..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/performance_testing.zh-cn.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: "性能测试" -linkTitle: "性能测试" -weight: 6 -aliases: [ -"/documentation/worst_practices/performance_testing/" -] ---- - -通常不建议使用Selenium和WebDriver进行性能测试. -并非因为不能做, 只是缺乏针对此类工作的优化, -因而难以得到乐观的结果. - -对于用户而言, 在用户上下文中执行性能测试似乎是自然而然的选择, -但是WebDriver的测试会受到许多外部和内部的影响而变得脆弱, -这是您无法控制的. 例如, -浏览器的启动速度, HTTP服务器的速度, -托管JavaScript或CSS的第三方服务器的响应 -以及WebDriver实现本身检测的损失. -这些因素的变化会影响结果. -很难区分网站自身与外部资源之间的性能差异, -并且也很难明确浏览器中使用WebDriver对性能的影响, -尤其是在注入脚本时. - -另一个潜在的吸引点是"节省时间"-同时执行功能和性能测试. -但是, 功能和性能测试分别具有截然不同的目标. -要测试功能, 测试人员可能需要耐心等待加载, -但这会使性能测试结果蒙上阴影, 反之亦然. - -为了提高网站的性能, 您需要不依赖于环境的差异来分析整体性能, -识别不良代码的实践, -对单个资源 (即CSS或JavaScript) 的性能进行细分 -以了解需要改进的地方. -有很多性能测试工具已经可以完成这项工作, -并且提供了报告和分析结果, 甚至可以提出改进建议. - -例如一种易于使用的 (开源) 软件包是: [JMeter](//jmeter.apache.org/) diff --git a/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.en.md b/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.en.md index 934b1a6e0224..0250b2b30b72 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.en.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/worst_practices/test_dependency/", "/documentation/ja/worst_practices/test_dependency/", "/documentation/pt-br/worst_practices/test_dependency/", -"/documentation/zh-cn/worst_practices/test_dependency/" +"/documentation/zh-cn/worst_practices/test_dependency/", +"/ja/documentation/test_practices/discouraged/test_dependency/", +"/ja/documentation/worst_practices/test_dependency/", +"/pt-br/documentation/test_practices/discouraged/test_dependency/", +"/pt-br/documentation/worst_practices/test_dependency/", +"/zh-cn/documentation/test_practices/discouraged/test_dependency/", +"/zh-cn/documentation/worst_practices/test_dependency/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.ja.md b/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.ja.md deleted file mode 100644 index 7bfbf7a84619..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.ja.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "テストの依存関係" -linkTitle: "テストの依存関係" -weight: 5 -aliases: [ -"/documentation/worst_practices/test_dependency/" -] ---- - - -自動テストに関する一般的な考え方と誤解は、特定のテスト順序に関するものです。 -テストは **任意** の順序で実行でき、成功するために完了するために他のテストに依存してはなりません。 diff --git a/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.pt-br.md b/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.pt-br.md deleted file mode 100644 index b86d28a8b7cf..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.pt-br.md +++ /dev/null @@ -1,13 +0,0 @@ ---- -title: "Dependência entre testes" -linkTitle: "Dependência entre testes" -weight: 5 -aliases: [ -"/documentation/worst_practices/test_dependency/" -] ---- - -Uma ideia comum e um equívoco sobre o teste automatizado é sobre uma -ordem de testes específica. Seus testes devem ser executados em **qualquer** ordem, -e não depender da conclusão de outros testes para ter sucesso. - diff --git a/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.zh-cn.md b/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.zh-cn.md deleted file mode 100644 index 45b471a85f1c..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/test_dependency.zh-cn.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "测试依赖" -linkTitle: "测试依赖" -weight: 5 -aliases: [ -"/documentation/worst_practices/test_dependency/" -] ---- - -关于自动化测试的一个常见想法和误解是关于特定的测试顺序. 您的测试应该能够以**任何**顺序运行,而不是依赖于完成其他测试才能成功. diff --git a/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.en.md b/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.en.md index dbed65a51502..43f48219e743 100644 --- a/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.en.md +++ b/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/worst_practices/two_factor_authentication/", "/documentation/ja/worst_practices/two_factor_authentication/", "/documentation/pt-br/worst_practices/two_factor_authentication/", -"/documentation/zh-cn/worst_practices/two_factor_authentication/" +"/documentation/zh-cn/worst_practices/two_factor_authentication/", +"/ja/documentation/test_practices/discouraged/two_factor_authentication/", +"/ja/documentation/worst_practices/two_factor_authentication/", +"/pt-br/documentation/test_practices/discouraged/two_factor_authentication/", +"/pt-br/documentation/worst_practices/two_factor_authentication/", +"/zh-cn/documentation/test_practices/discouraged/two_factor_authentication/", +"/zh-cn/documentation/worst_practices/two_factor_authentication/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.ja.md b/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.ja.md deleted file mode 100644 index f3a16a88aaa2..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.ja.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: "二要素認証" -linkTitle: "二要素認証" -weight: 8 -aliases: [ -"/documentation/worst_practices/two_factor_authentication/" -] ---- - -_2FA_ として知られている2要素認証は、"Google Authenticator" 、 -"Microsoft Authenticator" などの"Authenticator" モバイルアプリを使用して、 -またはSMS、電子メールで認証することにより、 -ワンタイムパスワード(OTP)を生成する認証メカニズムです。 -これをシームレスかつ一貫して自動化することは、Seleniumの大きな課題です。 -このプロセスを自動化する方法はいくつかあります。 -しかし、これはSeleniumテストの上にある別のレイヤーであり、また安全でもありません。 -したがって、2FAの自動化を回避したほうがいいです。 - -2FAチェックを回避するいくつかの選択肢があります。 - -* テスト環境で特定のユーザーの2FAを無効にして、 -それらのユーザー資格情報を自動化で使用できるようにします。 -* テスト環境で2FAを無効にします。 -* 特定のIPからログインする場合は、2FAを無効にします。 -そうすれば、テストマシンのIPを設定してこれを回避できます。 diff --git a/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.pt-br.md b/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.pt-br.md deleted file mode 100644 index 94bcb9b6fb4b..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.pt-br.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "Autenticação de Dois Fatores (2FA)" -linkTitle: "Autenticação de Dois Fatores (2FA)" -weight: 8 -aliases: [ -"/documentation/worst_practices/two_factor_authentication/" -] ---- - -A autenticação de dois fatores, conhecida como _2FA_, é um mecanismo de autorização -onde a senha de uso único (OTP) é gerada usando aplicativos móveis "Autenticadores", -como "Google Authenticator", "Microsoft Authenticator" -etc., ou por SMS, e-mail para autenticação. Automatizar isso perfeitamente -e consistentemente é um grande desafio no Selenium. Existem algumas maneiras -para automatizar este processo. Mas essa será outra camada em cima de nossos -testes Selenium e não protegidos também. Portanto, você pode evitar a automação do 2FA. - -Existem algumas opções para contornar as verificações 2FA: - -* Desative 2FA para determinados usuários no ambiente de teste, para que você possa -usar essas credenciais de usuário na automação. -* Desative 2FA em seu ambiente de teste. -* Desative 2FA se você fizer o login de determinados IPs. Dessa forma, podemos configurar nosso -teste os IPs da máquina para evitar isso. diff --git a/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.zh-cn.md b/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.zh-cn.md deleted file mode 100644 index 9cc4a5f5bb07..000000000000 --- a/website_and_docs/content/documentation/test_practices/discouraged/two_factor_authentication.zh-cn.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "双因素认证" -linkTitle: "双因素认证" -weight: 8 -aliases: [ -"/documentation/worst_practices/two_factor_authentication/" -] ---- - -双因素认证通常简写成 _2FA_ 是一种一次性密码(OTP)通常用在移动应用上例如“谷歌认证器”, -“微软认证器”等等,或者通过短信或者邮件来认证。在Selenium自动化中这些都是影响有效自动化 -的极大挑战。虽然也有一些方法可以自动化这些过程,但是同样对于Selenium自动化也引入了很多不安全因素。 -所以你应该要避免对2FA自动化。 - -这里有一些对于如何绕过2FA校验的建议: - -* 在测试环境中对特定用户禁止2FA校验,这样对于这些特定用户可以直接进行自动化测试。 -* 禁止2FA校验在测试环境中。 -* 对于特定IP区域禁止2FA校验,这样我们可以配置测试机器的IP在这些白名单区域中。 diff --git a/website_and_docs/content/documentation/test_practices/encouraged/_index.en.md b/website_and_docs/content/documentation/test_practices/encouraged/_index.en.md index e0f5d4ef6963..f9ca846f5f14 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/_index.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/_index.en.md @@ -9,7 +9,13 @@ aliases: [ "/documentation/guidelines/", "/documentation/ja/guidelines_and_recommendations/", "/documentation/pt-br/guidelines_and_recommendations/", -"/documentation/zh-cn/guidelines_and_recommendations/" +"/documentation/zh-cn/guidelines_and_recommendations/", +"/ja/documentation/guidelines/", +"/ja/documentation/test_practices/encouraged/", +"/pt-br/documentation/guidelines/", +"/pt-br/documentation/test_practices/encouraged/", +"/zh-cn/documentation/guidelines/", +"/zh-cn/documentation/test_practices/encouraged/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/_index.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/_index.ja.md deleted file mode 100644 index eb005b28f55e..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/_index.ja.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "推奨された行動" -linkTitle: "推奨" -weight: 3 -description: > - Seleniumプロジェクトからのテストに関するいくつかのガイドラインと推奨事項 -aliases: [ -"/documentation/guidelines/" -] ---- - -「ベストプラクティス」に関するメモ:このドキュメントでは、"ベストプラクティス"というフレーズを意図的に避けています。 -すべての状況に有効なアプローチはありません。 -"ガイドラインとレコメンデーション"というアイデアを好みます。 -これらを一通り読み、特定の環境でどのアプローチが効果的かを慎重に決定することをお勧めします。 - -機能テストは、多くの理由で適切に行うのが困難です。 -まるでアプリケーションの状態、複雑さ、および依存関係が、テストを十分に難しくしないと思えるほど、ブラウザ(特にクロスブラウザの非互換性)を扱うのは、良いテストの作成を難しくします。 - -Seleniumは、機能的なユーザーインタラクションを簡単にするツールを提供しますが、適切に設計されたテストスイートの作成には役立ちません。 -この章では、機能的なWebページの自動化に取り組む方法に関するアドバイス、ガイドライン、および推奨事項を提供します。 - -この章では、長年にわたって成功を収めてきたSeleniumの多くのユーザーの間で人気のあるソフトウェア設計パターンを記録します。 diff --git a/website_and_docs/content/documentation/test_practices/encouraged/_index.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/_index.pt-br.md deleted file mode 100644 index 7bf0f0ea8365..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/_index.pt-br.md +++ /dev/null @@ -1,30 +0,0 @@ ---- -title: "Diretrizes e recomendações" -linkTitle: "Diretrizes" -weight: 7 -description: > - Guias e recomendações ao preparar soluções de testes com o projecto Selenium. -aliases: [ -"/documentation/guidelines/" -] ---- - -Uma nota sobre "Melhores práticas": evitamos intencionalmente a frase "Melhores -Práticas" nesta documentação. Nenhuma abordagem funciona para todas as situações. -Preferimos a ideia de "Diretrizes e Recomendações". Nós encorajamos -que você leia e decida cuidadosamente quais abordagens -funcionarão para você em seu ambiente específico. - -O teste funcional é difícil de acertar por muitos motivos. -Como se o estado, a complexidade e as dependências do aplicativo não tornassem o teste suficientemente difícil, -lidar com navegadores (especialmente com incompatibilidades entre navegadores) -torna a escrita de bons testes um desafio. - -Selenium fornece ferramentas para facilitar a interação funcional do usuário, -mas não o ajuda a escrever suítes de teste bem arquitetadas. -Neste capítulo, oferecemos conselhos, diretrizes e recomendações -sobre como abordar a automação funcional de páginas da web. - -Este capítulo registra os padrões de design de software populares -entre muitos dos usuários do Selenium -que tiveram sucesso ao longo dos anos. diff --git a/website_and_docs/content/documentation/test_practices/encouraged/_index.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/_index.zh-cn.md deleted file mode 100644 index 46785d6c8cff..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/_index.zh-cn.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "指南和建议" -linkTitle: "指南" -weight: 7 -description: > - Selenium项目的一些测试指南和建议. -aliases: [ -"/documentation/guidelines/" -] ---- - - -关于"最佳实践"的注解:我们有意在本文档中避免使用"最佳实践"的说辞. -没有一种方法可以适用于所有情况. -我们更喜欢"指南和建议"的想法. -我们鼓励您通读这些内容, 并仔细地确定哪种方法适用于您的特定环境. - -由于许多原因, 功能测试很难正确完成. 即便应用程序的状态, 复杂性, 依赖还不够让测试变得 -足够复杂, 操作浏览器(特别是跨浏览器的兼容性测试)就已经使得写一个好的测试变成一种挑战. - -Selenium提供了一些工具使得功能测试用户更简单的操作浏览器, 但是这些工具并不能帮助你来写一个好的 -架构的测试套件. 这章我们会针对怎么来做web页面的功能测试的自动化给出一些忠告, 指南和建议. - -这章记录了很多历年来成功的使用Selenium的用户的常用的软件设计模式. diff --git a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.en.md b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.en.md index 0a126998ee06..d3707895602a 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/guidelines/avoid_sharing_state/", "/documentation/ja/guidelines_and_recommendations/avoid_sharing_state/", "/documentation/pt-br/guidelines_and_recommendations/avoid_sharing_state/", -"/documentation/zh-cn/guidelines_and_recommendations/avoid_sharing_state/" +"/documentation/zh-cn/guidelines_and_recommendations/avoid_sharing_state/", +"/ja/documentation/guidelines/avoid_sharing_state/", +"/ja/documentation/test_practices/encouraged/avoid_sharing_state/", +"/pt-br/documentation/guidelines/avoid_sharing_state/", +"/pt-br/documentation/test_practices/encouraged/avoid_sharing_state/", +"/zh-cn/documentation/guidelines/avoid_sharing_state/", +"/zh-cn/documentation/test_practices/encouraged/avoid_sharing_state/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.ja.md deleted file mode 100644 index ae23dd2267a8..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.ja.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: "状態を共有しない" -linkTitle: "状態を共有しない" -weight: 8 -aliases: [ -"/documentation/guidelines/avoid_sharing_state/" -] ---- - -いくつかの場所で言及されていますが、再度言及する価値があります。 -テストが互いに分離されていることを確認してください。 - -* テストデータを共有しないでください。 -アクションを実行する1つを選択する前に、それぞれが有効な注文をデータベースに照会するいくつかのテストを想像してください。 -2つのテストで同じ順序を選択すると、予期しない動作が発生する可能性があります。 - -* 別のテストで取得される可能性のあるアプリケーション内の古いデータを削除します。 例: 無効な注文レコード - -* テストごとに新しいWebDriverインスタンスを作成します。 -これにより、テストの分離が保証され、並列化がより簡単になります。 - - * テストランナーとして [pytest](https://pytest.org/) を選択した場合、グローバルフィクスチャで - ドライバーを yield することで、これを簡単に実現できます。これにより、各テストは独自の - ドライバーインスタンスを取得でき、テストの成功・失敗を問わず、テスト完了後に常に - ドライバーを終了させることができます。 diff --git a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.pt-br.md deleted file mode 100644 index 00cb270ebe56..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.pt-br.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "Evite compartilhamento de estado" -linkTitle: "Evite compartilhamento de estado" -weight: 8 -aliases: [ -"/documentation/guidelines/avoid_sharing_state/" -] ---- - - -Embora mencionado em vários lugares, vale a pena mencionar novamente. Garanta que -os testes são isolados uns dos outros. - -* Não compartilhe dados de teste. Imagine vários testes em que cada um consulta o banco de dados -para pedidos válidos antes de escolher um para executar uma ação. Caso dois testes -peguem a mesma ordem, provavelmente você obterá um comportamento inesperado. - -* Limpe dados desatualizados no aplicativo que podem ser obtidos por outro -teste, por exemplo registros de pedidos inválidos. - -* Crie uma nova instância do WebDriver por teste. Isso ajuda a garantir o isolamento do teste -e torna a paralelização mais simples. - - * If you choose [pytest](https://pytest.org/) as your test runner, this can be - easily done by yielding your driver in a global fixture. This way each test gets its own - driver instance, and you can ensure that drivers always quit after a test is finished - (pass or fail). diff --git a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.zh-cn.md deleted file mode 100644 index 65b618a11d28..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/avoid_sharing_state.zh-cn.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: "避免共享状态" -linkTitle: "避免共享状态" -weight: 8 -aliases: [ -"/documentation/guidelines/avoid_sharing_state/" -] ---- - -尽管在多个地方都提到过, 但这点仍值得被再次提及. 确保测试相互隔离. - -* 不要共享测试数据. -想象一下有几个测试, 每个测试都会在选择操作执行之前查询数据库中的有效订单. -如果两个测试采用相同的顺序, 则很可能会出现意外行为. - -* 清理应用程序中过时的数据, 这些数据可能会被其他测试. -例如无效的订单记录. - -* 每次测试都创建一个新的WebDriver实例. -这在确保测试隔离的同时可以保障并行化更为简单. - - * If you choose [pytest](https://pytest.org/) as your test runner, this can be - easily done by yielding your driver in a global fixture. This way each test gets its own - driver instance, and you can ensure that drivers always quit after a test is finished - (pass or fail). diff --git a/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.en.md b/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.en.md index 66d437545b92..1055953a242b 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/guidelines/consider_using_a_fluent_api/", "/documentation/ja/guidelines_and_recommendations/consider_using_a_fluent_api/", "/documentation/pt-br/guidelines_and_recommendations/consider_using_a_fluent_api/", -"/documentation/zh-cn/guidelines_and_recommendations/consider_using_a_fluent_api/" +"/documentation/zh-cn/guidelines_and_recommendations/consider_using_a_fluent_api/", +"/ja/documentation/guidelines/consider_using_a_fluent_api/", +"/ja/documentation/test_practices/encouraged/consider_using_a_fluent_api/", +"/pt-br/documentation/guidelines/consider_using_a_fluent_api/", +"/pt-br/documentation/test_practices/encouraged/consider_using_a_fluent_api/", +"/zh-cn/documentation/guidelines/consider_using_a_fluent_api/", +"/zh-cn/documentation/test_practices/encouraged/consider_using_a_fluent_api/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.ja.md deleted file mode 100644 index c24ec9fbb9ea..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.ja.md +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: "Fluent APIの使用を検討する" -linkTitle: "Fluent APIの使用を検討する" -weight: 10 -aliases: [ -"/documentation/guidelines/consider_using_a_fluent_api/" -] ---- - - -マーチン・ファウラーは["Fluent API"](//www.martinfowler.com/bliki/FluentInterface.html)という用語を作り出しました。 -Seleniumは既に、`FluentWait`クラスでこのようなものを実装しています。 -これは、標準のWaitクラスの代替としてのものです。 -ページオブジェクトでFluent APIデザインパターンを有効にしてから、次のようなコードスニペットを使用してGoogle検索ページを照会できます。 - -```java -driver.get( "http://www.google.com/webhp?hl=en&tab=ww" ); -GoogleSearchPage gsp = new GoogleSearchPage(driver); -gsp.setSearchString().clickSearchButton(); -``` - -この流暢な動作を持つGoogleページオブジェクトクラスは次のようになります。 - -```java -public abstract class BasePage { - protected WebDriver driver; - - public BasePage(WebDriver driver) { - this.driver = driver; - } -} - -public class GoogleSearchPage extends BasePage { - public GoogleSearchPage(WebDriver driver) { - super(driver); - // Generally do not assert within pages or components. - // Effectively throws an exception if the lambda condition is not met. - new WebDriverWait(driver, Duration.ofSeconds(3)).until(d -> d.findElement(By.id("logo"))); - } - - public GoogleSearchPage setSearchString(String sstr) { - driver.findElement(By.id("gbqfq")).sendKeys(sstr); - return this; - } - - public void clickSearchButton() { - driver.findElement(By.id("gbqfb")).click(); - } -} -``` diff --git a/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.pt-br.md deleted file mode 100644 index d8105a71dc18..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.pt-br.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -title: "Considere usar uma API fluente" -LinkTitle: "Considere usar uma API fluente" -weight: 10 -aliases: [ -"/documentation/guidelines/consider_using_a_fluent_api/" -] ---- - - -Martin Fowler cunhou o termo ["API Fluent"](//www.martinfowler.com/bliki/FluentInterface.html). Selenium já -implementa algo assim em sua classe `FluentWait`, que é -pretende ser uma alternativa à classe padrão Wait. -Você pode habilitar o padrão de design de API fluente em seu objeto de página -e, em seguida, consulte a página de pesquisa do Google com um snippet de código como este: - -```java -driver.get( "http://www.google.com/webhp?hl=en&tab=ww" ); -GoogleSearchPage gsp = new GoogleSearchPage(driver); -gsp.setSearchString().clickSearchButton(); -``` - -A classe de objeto da página do Google com este comportamento fluente -pode ser assim: - -```java -public abstract class BasePage { - protected WebDriver driver; - - public BasePage(WebDriver driver) { - this.driver = driver; - } -} - -public class GoogleSearchPage extends BasePage { - public GoogleSearchPage(WebDriver driver) { - super(driver); - // Generally do not assert within pages or components. - // Effectively throws an exception if the lambda condition is not met. - new WebDriverWait(driver, Duration.ofSeconds(3)).until(d -> d.findElement(By.id("logo"))); - } - - public GoogleSearchPage setSearchString(String sstr) { - driver.findElement(By.id("gbqfq")).sendKeys(sstr); - return this; - } - - public void clickSearchButton() { - driver.findElement(By.id("gbqfb")).click(); - } -} -``` diff --git a/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.zh-cn.md deleted file mode 100644 index 5e6fb26d1eab..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/consider_using_a_fluent_api.zh-cn.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: "考虑使用Fluent API" -linkTitle: "考虑使用Fluent API" -weight: 10 -aliases: [ -"/documentation/guidelines/consider_using_a_fluent_api/" -] ---- - -Martin Fowler创造了术语 ["Fluent API"](//www.martinfowler.com/bliki/FluentInterface.html). -Selenium已经在其 `FluentWait` 类中实现了类似的东西, 这是对标准 Wait 类的替代. -您可以在页面对象中启用Fluent API设计模式, 然后使用如下代码段查询Google搜索页面: - -```java -driver.get( "http://www.google.com/webhp?hl=en&tab=ww" ); -GoogleSearchPage gsp = new GoogleSearchPage(driver); -gsp.setSearchString().clickSearchButton(); -``` - -Google页面对象类具有这种流畅行为后可能看起来像这样: - -```java -public abstract class BasePage { - protected WebDriver driver; - - public BasePage(WebDriver driver) { - this.driver = driver; - } -} - -public class GoogleSearchPage extends BasePage { - public GoogleSearchPage(WebDriver driver) { - super(driver); - // Generally do not assert within pages or components. - // Effectively throws an exception if the lambda condition is not met. - new WebDriverWait(driver, Duration.ofSeconds(3)).until(d -> d.findElement(By.id("logo"))); - } - - public GoogleSearchPage setSearchString(String sstr) { - driver.findElement(By.id("gbqfq")).sendKeys(sstr); - return this; - } - - public void clickSearchButton() { - driver.findElement(By.id("gbqfb")).click(); - } -} -``` diff --git a/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.en.md b/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.en.md index 8b212e3ecaa4..50308a59b0d4 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/guidelines/domain_specific_language/", "/documentation/ja/guidelines_and_recommendations/domain_specific_language/", "/documentation/pt-br/guidelines_and_recommendations/domain_specific_language/", -"/documentation/zh-cn/guidelines_and_recommendations/domain_specific_language/" +"/documentation/zh-cn/guidelines_and_recommendations/domain_specific_language/", +"/ja/documentation/guidelines/domain_specific_language/", +"/ja/documentation/test_practices/encouraged/domain_specific_language/", +"/pt-br/documentation/guidelines/domain_specific_language/", +"/pt-br/documentation/test_practices/encouraged/domain_specific_language/", +"/zh-cn/documentation/guidelines/domain_specific_language/", +"/zh-cn/documentation/test_practices/encouraged/domain_specific_language/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.ja.md deleted file mode 100644 index 40ae76a2b640..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.ja.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -title: "ドメイン固有言語(DSL)" -linkTitle: "ドメイン固有言語(DSL)" -weight: 4 -aliases: [ -"/documentation/guidelines/domain_specific_language/" -] ---- - -ドメイン固有言語(DSL)は、問題を解決するための表現手段をユーザーに提供するシステムです。 -それによって、ユーザーは、プログラマーの言葉でなく、自分の言葉でシステムとやりとりすることができます。 - -通常、ユーザーはサイトの外観を気にしません。 -装飾、アニメーション、グラフィックスは気にしません。 -彼らはあなたのシステムを使用して、新しい従業員を最小限の難しさでプロセスに押し込みたいと考えています。 -彼らはアラスカへの旅行を予約したい。 -ユニコーンを設定して割引価格で購入したいのです。 -テスターとしてのあなたの仕事は、この考え方を"とらえる"ことにできるだけ近づくことです。 -それを念頭に置いて、テストスクリプト(ユーザーの唯一のプレリリースの代理人)がユーザーを"代弁し"、表現するように、作業中のアプリケーションの"モデリング"に取り掛かります。 - -Seleniumでは、DSLは通常、APIをシンプルで読みやすいように記述したメソッドで表されます。 -開発者と利害関係者(ユーザー、製品所有者、ビジネスインテリジェンススペシャリストなど)との伝達が可能になります。 - -## 利点 - -* **Readable:** ビジネス関係者はそれを理解できます。 -* **Writable:** 書きやすく、不要な重複を避けます。 -* **Extensible:** 機能は(合理的に)契約と既存の機能を壊すことなく追加できます。 -* **Maintainable:** 実装の詳細をテストケースから除外することにより、AUT* の変更に対して十分に隔離されます。 - -## Java - -Javaの妥当なDSLメソッドの例を次に示します。 -簡潔にするために、`driver`オブジェクトが事前に定義されており、メソッドで使用可能であることを前提としています。 - -```java -/** - * Takes a username and password, fills out the fields, and clicks "login". - * @return An instance of the AccountPage - */ -public AccountPage loginAsUser(String username, String password) { - WebElement loginField = driver.findElement(By.id("loginField")); - loginField.clear(); - loginField.sendKeys(username); - - // Fill out the password field. The locator we're using is "By.id", and we should - // have it defined elsewhere in the class. - WebElement passwordField = driver.findElement(By.id("password")); - passwordField.clear(); - passwordField.sendKeys(password); - - // Click the login button, which happens to have the id "submit". - driver.findElement(By.id("submit")).click(); - - // Create and return a new instance of the AccountPage (via the built-in Selenium - // PageFactory). - return PageFactory.newInstance(AccountPage.class); -} -``` - -このメソッドは、テストコードから入力フィールド、ボタン、クリック、さらにはページの概念を完全に抽象化します。 -このアプローチを使用すると、テスターはこのメソッドを呼び出すだけで済みます。 -これにより、メンテナンスの利点が得られます。 -ログインフィールドが変更された場合、テストではなく、このメソッドを変更するだけで済みます。 - -```java -public void loginTest() { - loginAsUser("cbrown", "cl0wn3"); - - // Now that we're logged in, do some other stuff--since we used a DSL to support - // our testers, it's as easy as choosing from available methods. - do.something(); - do.somethingElse(); - Assert.assertTrue("Something should have been done!", something.wasDone()); - - // Note that we still haven't referred to a button or web control anywhere in this - // script... -} -``` - -繰り返しになります。 -主な目標の1つは、 テストが **UIの問題ではなく、手元の問題** に対処できるAPIを作成することです。 -UIはユーザーにとって二次的な関心事です。ユーザーはUIを気にせず、ただ仕事をやりたいだけです。 -テストスクリプトは、ユーザーがやりたいことと知りたいことの長々としたリストのように読む必要があります。 -テストでは、UIがどのようにそれを実行するように要求するかについて、気にするべきではありません。 - -***AUT**: Application under test(テスト対象アプリケーション) - diff --git a/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.pt-br.md deleted file mode 100644 index 7452ec82435a..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.pt-br.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: "Linguagem específica de domínio (DSL)" -linkTitle: "Linguagem específica de domínio (DSL)" -weight: 4 -aliases: [ -"/documentation/guidelines/domain_specific_language/" -] ---- - -Uma linguagem específica de domínio (DSL) é um sistema que fornece ao usuário -um meio expressivo de resolver um problema. Ele permite a um usuário -interagir com o sistema em seus termos - não apenas na linguagem do programador. - -Seus usuários, em geral, não se importam com a aparência do seu site. Eles não -preocupam-se com a decoração, animações ou gráficos. Eles -deseja usar seu sistema para empurrar seus novos funcionários através do -processo com dificuldade mínima; eles querem reservar uma viagem para o Alasca; -eles querem configurar e comprar unicórnios com desconto. Seu trabalho como -testador deve chegar o mais perto possível de “capturar” essa mentalidade. -Com isso em mente, começamos a "modelar" o aplicativo que você está -trabalhando, de modo que os scripts de teste (o único proxy de pré-lançamento do usuário) “fala a linguagem” e representa o usuário. - -Com Selenium, DSL é geralmente representado por métodos, escritos para fazer -a API simples e legível - eles permitem um relatório entre o -desenvolvedores e as partes interessadas (usuários, proprietários de produtos, negócios -especialistas em inteligência, etc.). - -## Benefícios - -* **Legível:** As partes interessadas da empresa podem entendê-lo. -* **Gravável:** Fácil de escrever, evita duplicações desnecessárias. -* **Extensível:** Funcionalidade pode (razoavelmente) ser adicionada - sem quebrar contratos e funcionalidades existentes. -* **Manutenção:** Deixando os detalhes de implementação fora do teste - casos, você está bem isolado contra alterações no AUT *. - - -## Java - -Aqui está um exemplo de um método DSL razoável em Java. -Por questão de brevidade, ele assume que o objeto `driver` é pré-definido -e está disponível para o método. - -```java -/** - * Recebe um username e password, prrenche os campos, e clica em "login". - * @return Uma instância de AccountPage - */ -public AccountPage loginAsUser(String username, String password) { - WebElement loginField = driver.findElement(By.id("loginField")); - loginField.clear(); - loginField.sendKeys(username); - - // Preenche o campo password. O localizador que estamos usando é "By.id", e devemos - // definí-lo em algum outro lugar dentro da Classe. - WebElement passwordField = driver.findElement(By.id("password")); - passwordField.clear(); - passwordField.sendKeys(password); - - // Clica o botão de login, que possui o id "submit". - driver.findElement(By.id("submit")).click(); - - // Cria e retorna uma nova instância de AccountPage (via o Selenium - // PageFactory embutido). - return PageFactory.newInstance(AccountPage.class); -} -``` - -Este método abstrai completamente os conceitos de campos de entrada, -botões, cliques e até páginas do seu código de teste. Usando este -abordagem, tudo o que o testador precisa fazer é chamar esse método. Isto dá -uma vantagem de manutenção: se os campos de login mudaram, você -teria apenas que alterar esse método - não seus testes. - -```java -public void loginTest() { - loginAsUser("cbrown", "cl0wn3"); - - // Agora que estamos logados, fazemos alguma outra coisa--como usamos uma DSL para suportar - // nossos testadores, é apenas escolher um dos métodos disponíveis. - do.something(); - do.somethingElse(); - Assert.assertTrue("Algo deveria ter sido feito!", something.wasDone()); - - // Note que ainda não nos referimos a nenhum botão ou web control nesse - // script... -} -``` - -Vale a pena repetir: um de seus principais objetivos deve ser escrever um -API que permite que seus testes resolvam **o problema em questão, e NÃO -o problema da IU**. A IU é uma preocupação secundária para o seu -usuários - eles não se importam com a interface do usuário, eles apenas querem fazer seu trabalho -feito. Seus scripts de teste devem ser lidos como uma lista de itens sujos que o usuário deseja FAZER e as coisas que deseja SABER. Os testes -não devem se preocupar com COMO a interface do usuário exige que você vá -sobre isso. - -***AUT**: Application under test - diff --git a/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.zh-cn.md deleted file mode 100644 index 55257e49af6a..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/domain_specific_language.zh-cn.md +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: "领域特定语言" -linkTitle: "领域特定语言" -weight: 4 -aliases: [ -"/documentation/guidelines/domain_specific_language/" -] ---- - - -领域特定语言 (DSL) 是一种为用户提供解决问题的表达方式的系统. -它使用户可以按照自己的术语与系统进行交互, 而不仅仅是通过程序员的语言. - -您的用户通常并不关心您网站的外观. -他们不在乎装饰, 动画或图形. -他们希望借助于您的系统, 以最小的难度使新员工融入整个流程; -他们想预订去阿拉斯加的旅行; -他们想以折扣价配置和购买独角兽. -您作为测试人员的工作应尽可能接近"捕捉”这种思维定势. -考虑到这一点, 我们开始着手"建模”您正在工作的应用程序, -以使测试脚本 (发布前用户仅有的代理) "说话”并代表用户. - - -在Selenium中, DSL通常由方法表示, -其编写方式使API简单易读-它们使开发人员和干系人 - (用户, 产品负责人, 商业智能专家等) 之间能够产生汇报. - - -## 好处 - -* **可读:** 业务关系人可以理解. -* **可写:** 易于编写, 避免不必要的重复. -* **可扩展:** 可以 (合理地) 添加功能而无需打破约定以及现有功能. -* **可维护:** 通过将实现细节排除在测试用例之外, 您可以很好地隔离 AUT* 的修改. - - -## Java - -以下是Java中合理的DSL方法的示例. -为简便起见, 假定 `driver` 对象是预定义的并且可用于该方法. - -```java -/** - * Takes a username and password, fills out the fields, and clicks "login". - * @return An instance of the AccountPage - */ -public AccountPage loginAsUser(String username, String password) { - WebElement loginField = driver.findElement(By.id("loginField")); - loginField.clear(); - loginField.sendKeys(username); - - // Fill out the password field. The locator we're using is "By.id", and we should - // have it defined elsewhere in the class. - WebElement passwordField = driver.findElement(By.id("password")); - passwordField.clear(); - passwordField.sendKeys(password); - - // Click the login button, which happens to have the id "submit". - driver.findElement(By.id("submit")).click(); - - // Create and return a new instance of the AccountPage (via the built-in Selenium - // PageFactory). - return PageFactory.newInstance(AccountPage.class); -} -``` - -此方法完全从测试代码中抽象出输入字段, 按钮, 单击甚至页面的概念. -使用这种方法, 测试人员要做的就是调用此方法. -这给您带来了维护方面的优势: 如果登录字段曾经更改过, -则只需更改此方法-而非您的测试. - -```java -public void loginTest() { - loginAsUser("cbrown", "cl0wn3"); - - // Now that we're logged in, do some other stuff--since we used a DSL to support - // our testers, it's as easy as choosing from available methods. - do.something(); - do.somethingElse(); - Assert.assertTrue("Something should have been done!", something.wasDone()); - - // Note that we still haven't referred to a button or web control anywhere in this - // script... -} -``` - - -郑重强调: 您的主要目标之一应该是编写一个API, -该API允许您的测试解决 **当前的问题, 而不是UI的问题**. -用户界面是用户的次要问题–用户并不关心用户界面, 他们只是想完成工作. -您的测试脚本应该像用户希望做的事情以及他们想知道的事情的完整清单那样易于阅读. -测试不应该考虑UI如何要求您去做. - -***AUT**: 待测系统 - diff --git a/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.en.md b/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.en.md index bd73b4aecbf6..f724898ba7ca 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/guidelines/fresh_browser_per_test/", "/documentation/ja/guidelines_and_recommendations/fresh_browser_per_test/", "/documentation/pt-br/guidelines_and_recommendations/fresh_browser_per_test/", -"/documentation/zh-cn/guidelines_and_recommendations/fresh_browser_per_test/" +"/documentation/zh-cn/guidelines_and_recommendations/fresh_browser_per_test/", +"/ja/documentation/guidelines/fresh_browser_per_test/", +"/ja/documentation/test_practices/encouraged/fresh_browser_per_test/", +"/pt-br/documentation/guidelines/fresh_browser_per_test/", +"/pt-br/documentation/test_practices/encouraged/fresh_browser_per_test/", +"/zh-cn/documentation/guidelines/fresh_browser_per_test/", +"/zh-cn/documentation/test_practices/encouraged/fresh_browser_per_test/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.ja.md deleted file mode 100644 index af87f9e2187f..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.ja.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -title: "テストごとに新しいブラウザを起動する" -linkTitle: "テストごとに新しいブラウザを起動する" -weight: 11 -aliases: [ -"/documentation/guidelines/fresh_browser_per_test/" -] ---- - - -各テストは、クリーンで既知の状態から開始します。 -理想的には、テストごとに新しい仮想マシンを起動してください。 -新しい仮想マシンを起動することが現実的でない場合は、少なくともテストごとに新しい WebDriver を起動してください。 -GeckoDriver や ChromeDriver など、ほとんどのブラウザドライバーはデフォルトで、新しいユーザープロファイルを使用したクリーンで既知の状態で起動します。 -```java -WebDriver driver = new FirefoxDriver(); -``` diff --git a/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.pt-br.md deleted file mode 100644 index f722db34b4fa..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.pt-br.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: "Navegador novo por teste" -linkTitle: "Navegador novo por teste" -weight: 11 -aliases: [ -"/documentation/guidelines/fresh_browser_per_test/" -] ---- - -Comece cada teste a partir de um estado limpo conhecido. -Idealmente, ligue uma nova máquina virtual para cada teste. -Se ligar uma nova máquina virtual não for prático, -pelo menos inicie um novo WebDriver para cada teste. -Most browser drivers like GeckoDriver and ChromeDriver will start with a clean -known state with a new user profile, by default. -```java -WebDriver driver = new FirefoxDriver(); -``` diff --git a/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.zh-cn.md deleted file mode 100644 index 04cebe967041..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/fresh_browser_per_test.zh-cn.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: "每次测试都刷新浏览器" -linkTitle: "每次测试都刷新浏览器" -weight: 11 -aliases: [ -"/documentation/guidelines/fresh_browser_per_test/" -] ---- - - -每次测试都从一个干净的已知状态开始. -理想情况下, 为每次测试打开一个新的虚拟机. -如果打开新虚拟机不切实际, 则至少应为每次测试启动一个新的WebDriver. -对于Firefox, 请使用您已知的配置文件去启动WebDriver. -大多数浏览器驱动器,像GeckoDriver和ChromeDriver那样,默认都会以干净的已知状态和一个新的用户配置文件开始。 -```java -WebDriver driver = new FirefoxDriver(); -``` diff --git a/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.en.md b/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.en.md index 4e2b6ab6f015..55477be91232 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/guidelines/generating_application_state/", "/documentation/ja/guidelines_and_recommendations/generating_application_state/", "/documentation/pt-br/guidelines_and_recommendations/generating_application_state/", -"/documentation/zh-cn/guidelines_and_recommendations/generating_application_state/" +"/documentation/zh-cn/guidelines_and_recommendations/generating_application_state/", +"/ja/documentation/guidelines/generating_application_state/", +"/ja/documentation/test_practices/encouraged/generating_application_state/", +"/pt-br/documentation/guidelines/generating_application_state/", +"/pt-br/documentation/test_practices/encouraged/generating_application_state/", +"/zh-cn/documentation/guidelines/generating_application_state/", +"/zh-cn/documentation/test_practices/encouraged/generating_application_state/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.ja.md deleted file mode 100644 index 2aea4670bde5..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.ja.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: "アプリケーション状態の生成" -linkTitle: "アプリケーション状態の生成" -weight: 5 -aliases: [ -"/documentation/guidelines/generating_application_state/" -] ---- - -Seleniumはテストケースの準備に使用しないでください。 -テストケースのすべての反復アクションと準備は、他の方法で行う必要があります。 -たとえば、ほとんどのWeb UIには認証があります(ログインフォームなど)。 -すべてのテストの前にWebブラウザーからのログインをなくすことで、テストの速度と安定性の両方が向上します。 -AUT* にアクセスするためのメソッドを作成する必要があります(APIを使用してログインし、Cookieを設定するなど)。 -また、テスト用にデータをプリロードするメソッドの作成は、Seleniumを使用して実行しないほうがいいです。 -前述のように、AUT* のデータを作成するには、既存のAPIを活用する必要があります。 - -***AUT**: Application under test(テスト対象アプリケーション) diff --git a/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.pt-br.md deleted file mode 100644 index 5283ded806f3..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.pt-br.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "Gerando estado da aplicação" -linkTitle: "Gerando estado da aplicação" -weight: 5 -aliases: [ -"/documentation/guidelines/generating_application_state/" -] ---- - -Selenium não deve ser usado para preparar um caso de teste. Tudo as -ações repetitivas e preparações para um caso de teste devem ser feitas por meio de outros -métodos. Por exemplo, a maioria das IUs da web tem autenticação (por exemplo, um formulário de login). Eliminar o login via navegador da web antes de cada teste irá -melhorar a velocidade e estabilidade do teste. Um método deve ser -criado para obter acesso à AUT* (por exemplo, usando uma API para fazer login e definir um -cookie). Além disso, a criação de métodos para pré-carregar dados para -o teste não deve ser feito usando Selenium. Como dito anteriormente, -APIs existentes devem ser aproveitadas para criar dados para a AUT *. - -***AUT**: Application under test diff --git a/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.zh-cn.md deleted file mode 100644 index 1f71a670a411..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/generating_application_state.zh-cn.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: "生成应用程序状态" -linkTitle: "生成应用程序状态" -weight: 5 -aliases: [ -"/documentation/guidelines/generating_application_state/" -] ---- - - -Selenium不应用于准备测试用例. -测试用例中所有重复性动作和准备工作, 都应通过其他方法来完成. -例如, 大多数Web UI都具有身份验证 (诸如一个登录表单) . -在每次测试之前通过Web浏览器进行登录的消除, 将提高测试的速度和稳定性. -应该创建一种方法来获取对 AUT* 的访问权限 (例如, 使用API登录并设置Cookie) . -此外, 不应使用Selenium创建预加载数据来进行测试的方法. -如前所述, 应利用现有的API为 AUT* 创建数据. -***AUT**: 待测系统 diff --git a/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.en.md b/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.en.md index 475e37e8fcc6..5bbd59fcfff1 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/guidelines/improved_reporting/", "/documentation/ja/guidelines_and_recommendations/improved_reporting/", "/documentation/pt-br/guidelines_and_recommendations/improved_reporting/", -"/documentation/zh-cn/guidelines_and_recommendations/improved_reporting/" +"/documentation/zh-cn/guidelines_and_recommendations/improved_reporting/", +"/ja/documentation/guidelines/improved_reporting/", +"/ja/documentation/test_practices/encouraged/improved_reporting/", +"/pt-br/documentation/guidelines/improved_reporting/", +"/pt-br/documentation/test_practices/encouraged/improved_reporting/", +"/zh-cn/documentation/guidelines/improved_reporting/", +"/zh-cn/documentation/test_practices/encouraged/improved_reporting/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.ja.md deleted file mode 100644 index 1662cf4e33b3..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.ja.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: "改善されたレポート" -linkTitle: "改善されたレポート" -weight: 7 -aliases: [ -"/documentation/guidelines/improved_reporting/" -] ---- - - -Seleniumは、実行されたテストケースのステータスをレポートするようには設計されていません。 -単体テストフレームワークの組み込みのレポート機能を利用することは、良いスタートです。 -ほとんどの単体テストフレームワークには、xUnitまたはHTML形式のレポートを生成できるレポートがあります。 -xUnitレポートは、Jenkins、Travis、Bambooなどの継続的インテグレーション(CI)サーバーに結果をインポートするのに人気があります。 -いくつかの言語のレポート出力に関する詳細情報へのリンクがあります。 - -[Allure Report: fancy reports (language and framework agnostic)](https://allurereport.org/) - -[NUnit 3 Console Runner](//github.com/nunit/docs/wiki/Console-Runner) - -[NUnit 3 Console Command Line](//github.com/nunit/docs/wiki/Console-Command-Line) - -[xUnit getting test results in TeamCity](//xunit.net/docs/getting-test-results-in-teamcity) - -[xUnit getting test results in CruiseControl.NET](//xunit.net/docs/getting-test-results-in-ccnet) - -[xUnit getting test results in Azure DevOps](//xunit.net/docs/getting-test-results-in-azure-devops) diff --git a/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.pt-br.md deleted file mode 100644 index 28020bc97cfb..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.pt-br.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: "Relatórios melhorados" -linkTitle: "Relatórios melhorados" -weight: 7 -aliases: [ -"/documentation/guidelines/improved_reporting/" -] ---- - -O Selenium não foi projetado para relatar sobre o status de casos de teste. Aproveitar -os recursos de relatórios integrados de frameworks de teste unitários é um bom começo. -A maioria dos frameworks de teste unitários podem gerar relatórios formatados em xUnit ou HTML. -Relatórios xUnit são populares para importar resultados para um servidor de integração contínua -(CI) como Jenkins, Travis, Bamboo, etc. Aqui estão alguns links -para obter mais informações sobre resultados de relatórios em vários idiomas. - - -[Allure Report: fancy reports (language and framework agnostic)](https://allurereport.org/) - -[NUnit 3 Console Runner](//github.com/nunit/docs/wiki/Console-Runner) - -[NUnit 3 Console Command Line](//github.com/nunit/docs/wiki/Console-Command-Line) - -[xUnit getting test results in TeamCity](//xunit.net/docs/getting-test-results-in-teamcity) - -[xUnit getting test results in CruiseControl.NET](//xunit.net/docs/getting-test-results-in-ccnet) - -[xUnit getting test results in Azure DevOps](//xunit.net/docs/getting-test-results-in-azure-devops) diff --git a/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.zh-cn.md deleted file mode 100644 index 121a35fd3069..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/improved_reporting.zh-cn.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -title: "改善报告" -linkTitle: "改善报告" -weight: 7 -aliases: [ -"/documentation/guidelines/improved_reporting/" -] ---- - -Selenium并非旨在报告测试用例的运行状态. -利用单元测试框架的内置报告功能是一个好的开始. -大多数单元测试框架都有可以生成xUnit或HTML格式的报告. -xUnit报表很受欢迎, 可以将其结果导入到持续集成(CI)服务器, -例如Jenkins、Travis、Bamboo等. -以下是一些链接, 可获取关于几种语言报表输出的更多信息. - - -[Allure Report: fancy reports (language and framework agnostic)](https://allurereport.org/) - -[NUnit 3 Console Runner](//github.com/nunit/docs/wiki/Console-Runner) - -[NUnit 3 Console Command Line](//github.com/nunit/docs/wiki/Console-Command-Line) - -[xUnit getting test results in TeamCity](//xunit.net/docs/getting-test-results-in-teamcity) - -[xUnit getting test results in CruiseControl.NET](//xunit.net/docs/getting-test-results-in-ccnet) - -[xUnit getting test results in Azure DevOps](//xunit.net/docs/getting-test-results-in-azure-devops) diff --git a/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.en.md b/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.en.md index a8f7e14beaf1..69110dc44b2b 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/guidelines/mock_external_services/", "/documentation/ja/guidelines_and_recommendations/mock_external_services/", "/documentation/pt-br/guidelines_and_recommendations/mock_external_services/", -"/documentation/zh-cn/guidelines_and_recommendations/mock_external_services/" +"/documentation/zh-cn/guidelines_and_recommendations/mock_external_services/", +"/ja/documentation/guidelines/mock_external_services/", +"/ja/documentation/test_practices/encouraged/mock_external_services/", +"/pt-br/documentation/guidelines/mock_external_services/", +"/pt-br/documentation/test_practices/encouraged/mock_external_services/", +"/zh-cn/documentation/guidelines/mock_external_services/", +"/zh-cn/documentation/test_practices/encouraged/mock_external_services/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.ja.md deleted file mode 100644 index 65fa5545741c..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.ja.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -title: "モック外部サービス" -linkTitle: "モック外部サービス" -weight: 6 -aliases: [ -"/documentation/guidelines/mock_external_services/" -] ---- - -外部サービスへの依存を排除すると、テストの速度と安定性が大幅に向上します。 diff --git a/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.pt-br.md deleted file mode 100644 index 5b521d425ba9..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.pt-br.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "Simulação de serviços externos" -linkTitle: "Simulação de serviços externos" -weight: 6 -aliases: [ -"/documentation/guidelines/mock_external_services/" -] ---- - -Eliminar as dependências de serviços externos melhorará muito -a velocidade e estabilidade de seus testes. diff --git a/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.zh-cn.md deleted file mode 100644 index f2458717787d..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/mock_external_services.zh-cn.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "模拟外部服务" -linkTitle: "模拟外部服务" -weight: 6 -aliases: [ -"/documentation/guidelines/mock_external_services/" -] ---- - - -消除对外部服务的依赖性将大大提高测试的速度和稳定性. diff --git a/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.en.md b/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.en.md index 00d7a75b7ff6..c7e5380886fe 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/guidelines/page_object_models/", "/documentation/ja/guidelines_and_recommendations/page_object_models/", "/documentation/pt-br/guidelines_and_recommendations/page_object_models/", -"/documentation/zh-cn/guidelines_and_recommendations/page_object_models/" +"/documentation/zh-cn/guidelines_and_recommendations/page_object_models/", +"/ja/documentation/guidelines/page_object_models/", +"/ja/documentation/test_practices/encouraged/page_object_models/", +"/pt-br/documentation/guidelines/page_object_models/", +"/pt-br/documentation/test_practices/encouraged/page_object_models/", +"/zh-cn/documentation/guidelines/page_object_models/", +"/zh-cn/documentation/test_practices/encouraged/page_object_models/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.ja.md deleted file mode 100644 index 2f9304b5fe52..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.ja.md +++ /dev/null @@ -1,497 +0,0 @@ ---- -title: "ページオブジェクトモデル" -linkTitle: "ページオブジェクトモデル" -weight: 3 -needsTranslation: true -aliases: [ -"/documentation/guidelines/page_object_models/" -] ---- - -Note: this page has merged contents from multiple sources, including -the [Selenium wiki](https://github.com/SeleniumHQ/selenium/wiki/PageObjects) - -## Overview - -Within your web app's UI, there are areas where your tests interact with. -A Page Object only models these as objects within the test code. -This reduces the amount of duplicated code and means that if the UI changes, -the fix needs only to be applied in one place. - -Page Object Model is a Design Pattern that has become popular in test automation for -enhancing test maintenance and reducing code duplication. A page object is an -object-oriented class that serves as an interface to a page of your AUT. The -tests then use the methods of this page object class whenever they need to -interact with the UI of that page. The benefit is that if the UI changes for -the page, the tests themselves don’t need to change, only the code within the -page object needs to change. Subsequently, all changes to support that new UI -are located in one place. - -### Advantages - -* There is a clean separation between the test code and page-specific code, such as - locators (or their use if you’re using a UI Map) and layout. -* There is a single repository for the services or operations the page offers - rather than having these services scattered throughout the tests. - -In both cases, this allows any modifications required due to UI changes to all -be made in one place. Helpful information on this technique can be found on -numerous blogs as this ‘test design pattern’ is becoming widely used. We -encourage readers who wish to know more to search the internet for blogs -on this subject. Many have written on this design pattern and can provide -helpful tips beyond the scope of this user guide. To get you started, -we’ll illustrate page objects with a simple example. - -### Examples - -First, consider an example, typical of test automation, that does not use a -page object: - -```java -/*** - * Tests login feature - */ -public class Login { - - public void testLogin() { - // fill login data on sign-in page - driver.findElement(By.name("user_name")).sendKeys("userName"); - driver.findElement(By.name("password")).sendKeys("my supersecret password"); - driver.findElement(By.name("sign-in")).click(); - - // verify h1 tag is "Hello userName" after login - driver.findElement(By.tagName("h1")).isDisplayed(); - assertThat(driver.findElement(By.tagName("h1")).getText(), is("Hello userName")); - } -} -``` - -There are two problems with this approach. - -* There is no separation between the test method and the AUT’s locators (IDs in -this example); both are intertwined in a single method. If the AUT’s UI changes -its identifiers, layout, or how a login is input and processed, the test itself -must change. -* The ID-locators would be spread in multiple tests, in all tests that had to -use this login page. - -Applying the page object model, this example could be rewritten like this -in the following example of a page object for a Sign-in page. - -```java -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; - -/** - * Page Object encapsulates the Sign-in page. - */ -public class SignInPage { - protected WebDriver driver; - - // - private By usernameBy = By.name("user_name"); - // - private By passwordBy = By.name("password"); - // - private By signinBy = By.name("sign_in"); - - public SignInPage(WebDriver driver){ - this.driver = driver; - if (!driver.getTitle().equals("Sign In Page")) { - throw new IllegalStateException("This is not Sign In Page," + - " current page is: " + driver.getCurrentUrl()); - } - } - - /** - * Login as valid user - * - * @param userName - * @param password - * @return HomePage object - */ - public HomePage loginValidUser(String userName, String password) { - driver.findElement(usernameBy).sendKeys(userName); - driver.findElement(passwordBy).sendKeys(password); - driver.findElement(signinBy).click(); - return new HomePage(driver); - } -} -``` - -and page object for a Home page could look like this. - -```java -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; - -/** - * Page Object encapsulates the Home Page - */ -public class HomePage { - protected WebDriver driver; - - //

Hello userName

- private By messageBy = By.tagName("h1"); - - public HomePage(WebDriver driver){ - this.driver = driver; - if (!driver.getTitle().equals("Home Page of logged in user")) { - throw new IllegalStateException("This is not Home Page of logged in user," + - " current page is: " + driver.getCurrentUrl()); - } - } - - /** - * Get message (h1 tag) - * - * @return String message text - */ - public String getMessageText() { - return driver.findElement(messageBy).getText(); - } - - public HomePage manageProfile() { - // Page encapsulation to manage profile functionality - return new HomePage(driver); - } - /* More methods offering the services represented by Home Page - of Logged User. These methods in turn might return more Page Objects - for example click on Compose mail button could return ComposeMail class object */ -} -``` - -So now, the login test would use these two page objects as follows. - -```java -/*** - * Tests login feature - */ -public class TestLogin { - - @Test - public void testLogin() { - SignInPage signInPage = new SignInPage(driver); - HomePage homePage = signInPage.loginValidUser("userName", "password"); - assertThat(homePage.getMessageText(), is("Hello userName")); - } - -} -``` - -There is a lot of flexibility in how the page objects may be designed, but -there are a few basic rules for getting the desired maintainability of your -test code. - -## Assertions in Page Objects - -Page objects themselves should never make verifications or assertions. This is -part of your test and should always be within the test’s code, never in a page -object. The page object will contain the representation of the page, and the -services the page provides via methods but no code related to what is being -tested should be within the page object. - -There is one, single, verification which can, and should, be within the page -object and that is to verify that the page, and possibly critical elements on -the page, were loaded correctly. This verification should be done while -instantiating the page object. In the examples above, both the SignInPage and -HomePage constructors check that the expected page is available and ready for -requests from the test. - -## Page Component Objects - -A page object does not necessarily need to represent all the parts of a -page itself. This was [noted by Martin Fowler](https://martinfowler.com/bliki/PageObject.html#footnote-panel-object) in the early days, while first coining the term "panel objects". - -The same principles used for page objects can be used to -create "Page _Component_ Objects", as it was later called, that represent discrete chunks of the -page and **can be included in page objects**. These component objects can -provide references to the elements inside those discrete chunks, and -methods to leverage the functionality or behavior provided by them. - -For example, a Products page has multiple products. - -```html - -
- Products -
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-``` - -Each product is a component of the Products page. - - -```html - -
-
Backpack
-
-
$29.99
- -
-
-``` - -The Products page HAS-A list of products. This object relationship is called Composition. In simpler terms, something is _composed of_ another thing. - -```java -public abstract class BasePage { - protected WebDriver driver; - - public BasePage(WebDriver driver) { - this.driver = driver; - } -} - -// Page Object -public class ProductsPage extends BasePage { - public ProductsPage(WebDriver driver) { - super(driver); - // No assertions, throws an exception if the element is not loaded - new WebDriverWait(driver, Duration.ofSeconds(3)) - .until(d -> d.findElement(By.className​("header_container"))); - } - - // Returning a list of products is a service of the page - public List getProducts() { - return driver.findElements(By.className​("inventory_item")) - .stream() - .map(e -> new Product(e)) // Map WebElement to a product component - .toList(); - } - - // Return a specific product using a boolean-valued function (predicate) - // This is the behavioral Strategy Pattern from GoF - public Product getProduct(Predicate condition) { - return getProducts() - .stream() - .filter(condition) // Filter by product name or price - .findFirst() - .orElseThrow(() -> new RuntimeException("Product not found")); // Error thrown during actual test run - } -} -``` - -The Product component object is used inside the Products page object. - -```java -public abstract class BaseComponent { - protected WebElement root; - - public BaseComponent(WebElement root) { - this.root = root; - } -} - -// Page Component Object -public class Product extends BaseComponent { - // The root element contains the entire component - public Product(WebElement root) { - super(root); // inventory_item - } - - public String getName() { - // Locating an element begins at the root of the component - return root.findElement(By.className("inventory_item_name")).getText(); - } - - public BigDecimal getPrice() { - return new BigDecimal( - root.findElement(By.className("inventory_item_price")) - .getText() - .replace("$", "") - ).setScale(2, RoundingMode.UNNECESSARY); // Sanitation and formatting - } - - public void addToCart() { - root.findElement(By.id("add-to-cart-backpack")).click(); - } -} -``` - -So now, the products test would use the page object and the page component object as follows. - -```java -public class ProductsTest { - @Test - public void testProductInventory() { - var productsPage = new ProductsPage(driver); // page object - var products = productsPage.getProducts(); - assertEquals(6, products.size()); // expected, actual - } - - @Test - public void testProductPrices() { - var productsPage = new ProductsPage(driver); - - // Pass a lambda expression (predicate) to filter the list of products - // The predicate or "strategy" is the behavior passed as parameter - var backpack = productsPage.getProduct(p -> p.getName().equals("Backpack")); // page component object - var bikeLight = productsPage.getProduct(p -> p.getName().equals("Bike Light")); - - assertEquals(new BigDecimal("29.99"), backpack.getPrice()); - assertEquals(new BigDecimal("9.99"), bikeLight.getPrice()); - } -} -``` - -The page and component are represented by their own objects. Both objects only have methods for the **services** they offer, which matches the real-world application as is the core principle of object-oriented programming. When applications are built, they are not made of a massive page entity. They are built with components contained in a page. Page Component Objects implement the same approach. - -You can even -nest component objects inside other component objects for more complex -pages. If a page in the AUT has multiple components, or common -components used throughout the site (e.g. a navigation bar), then it -may improve maintainability and reduce code duplication. - -## Other Design Patterns Used in Testing - -There are other design patterns that also may be used in testing. Discussing all of these is -beyond the scope of this user guide. Here, we merely want to introduce the -concepts to make the reader aware of some of the things that can be done. As -was mentioned earlier, many have blogged on this topic and we encourage the -reader to search for blogs on these topics. - -## Implementation Notes - -Page Objects can be thought of as facing in two directions simultaneously. Facing toward the developer of a test, they represent the **services** offered by a particular page. Facing away from the developer, they should be the only thing that has a deep knowledge of the structure of the HTML of a page (or part of a page) It's simplest to think of the methods on a Page Object as offering the "services" that a page offers rather than exposing the details and mechanics of the page. As an example, think of the inbox of any web-based email system. Amongst the services it offers are the ability to compose a new email, choose to read a single email, and list the subject lines of the emails in the inbox. How these are implemented shouldn't matter to the test. - -Because we're encouraging the developer of a test to try and think about the services they're interacting with rather than the implementation, Page Objects should seldom expose the underlying WebDriver instance. To facilitate this, **methods on the Page Object may return another Page Object, another Page Component Object, or even itself (this)**. This means we can effectively model the user's journey through our application. It also means that should the way that pages relate to one another change (like when the login page asks the user to change their password the first time they log into a service when it previously didn't do that), simply changing the appropriate method's signature will cause the tests to fail to compile. Put another way; we can tell which tests would fail without needing to run them when we change the relationship between pages and reflect this in the Page Objects. - -One consequence of this approach is that it may be necessary to model (for example) both a successful and unsuccessful login; or a click could have a different result depending on the app's state. When this happens, it is common to have multiple methods on the Page Object: - -```java -public class LoginPage { - public HomePage loginAs(String username, String password) { - // ... clever magic happens here - } - - public LoginPage loginAsExpectingError(String username, String password) { - // ... failed login here, maybe because one or both of the username and password are wrong - } - - public String getErrorMessage() { - // So we can verify that the correct error is shown - } -} -``` - -The code presented above shows an important point: the tests, not the Page Objects, should be responsible for making assertions about the state of a page. For example: - -```java -public void testMessagesAreReadOrUnread() { - Inbox inbox = new Inbox(driver); - inbox.assertMessageWithSubjectIsUnread("I like cheese"); - inbox.assertMessageWithSubjectIsNotUnread("I'm not fond of tofu"); -} -``` - -could be re-written as: - -```java -public void testMessagesAreReadOrUnread() { - Inbox inbox = new Inbox(driver); - assertTrue(inbox.isMessageWithSubjectIsUnread("I like cheese")); - assertFalse(inbox.isMessageWithSubjectIsUnread("I'm not fond of tofu")); -} -``` - -Of course, as with every guideline, there are exceptions, and one that is commonly seen with Page Objects is to check that the WebDriver is on the correct page when we instantiate the Page Object. This is done in the example below. - -Finally, a Page Object need not represent an entire page and can be composed of Page Object Components. These components may represent a section that appears frequently within a site or page, such as site navigation. The essential principle is that there is only one place in your test suite with knowledge of the structure of the HTML of a particular (part of a) page. - -## Summary - -* The public methods represent the services that the page or component offers -* Try not to expose the internals of the page or component -* Generally don't make assertions -* Methods return other Page Objects, Page Component Objects, or optionally themselves (for fluent syntax) -* Need not represent an entire page all the time -* Different results for the same action are modelled as different methods - -## Example - -```java -public class LoginPage { - private final WebDriver driver; - - public LoginPage(WebDriver driver) { - this.driver = driver; - - // Check that we're on the right page. - if (!"Login".equals(driver.getTitle())) { - // Alternatively, we could navigate to the login page, perhaps logging out first - throw new IllegalStateException("This is not the login page"); - } - } - - // The login page contains several HTML elements that will be represented as WebElements. - // The locators for these elements should only be defined once. - By usernameLocator = By.id("username"); - By passwordLocator = By.id("passwd"); - By loginButtonLocator = By.id("login"); - - // The login page allows the user to type their username into the username field - public LoginPage typeUsername(String username) { - // This is the only place that "knows" how to enter a username - driver.findElement(usernameLocator).sendKeys(username); - - // Return the current page object as this action doesn't navigate to a page represented by another PageObject - return this; - } - - // The login page allows the user to type their password into the password field - public LoginPage typePassword(String password) { - // This is the only place that "knows" how to enter a password - driver.findElement(passwordLocator).sendKeys(password); - - // Return the current page object as this action doesn't navigate to a page represented by another PageObject - return this; - } - - // The login page allows the user to submit the login form - public HomePage submitLogin() { - // This is the only place that submits the login form and expects the destination to be the home page. - // A separate method should be created for the instance of clicking login whilst expecting a login failure. - driver.findElement(loginButtonLocator).submit(); - - // Return a new page object representing the destination. Should the login page ever - // go somewhere else (for example, a legal disclaimer) then changing the method signature - // for this method will mean that all tests that rely on this behaviour won't compile. - return new HomePage(driver); - } - - // The login page allows the user to submit the login form knowing that an invalid username and / or password were entered - public LoginPage submitLoginExpectingFailure() { - // This is the only place that submits the login form and expects the destination to be the login page due to login failure. - driver.findElement(loginButtonLocator).submit(); - - // Return a new page object representing the destination. Should the user ever be navigated to the home page after submitting a login with credentials - // expected to fail login, the script will fail when it attempts to instantiate the LoginPage PageObject. - return new LoginPage(driver); - } - - // Conceptually, the login page offers the user the service of being able to "log into" - // the application using a user name and password. - public HomePage loginAs(String username, String password) { - // The PageObject methods that enter username, password & submit login have already defined and should not be repeated here. - typeUsername(username); - typePassword(password); - return submitLogin(); - } -} -``` diff --git a/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.pt-br.md deleted file mode 100644 index 289ceb35b2c4..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.pt-br.md +++ /dev/null @@ -1,497 +0,0 @@ ---- -title: "Modelos de objetos de página" -linkTitle: "Modelos de objetos de página" -weight: 3 -needsTranslation: false -aliases: [ -"/documentation/guidelines/page_object_models/" -] ---- - -Note: this page has merged contents from multiple sources, including -the [Selenium wiki](https://github.com/SeleniumHQ/selenium/wiki/PageObjects) - -## Overview - -Within your web app's UI, there are areas where your tests interact with. -A Page Object only models these as objects within the test code. -This reduces the amount of duplicated code and means that if the UI changes, -the fix needs only to be applied in one place. - -Page Object Model is a Design Pattern that has become popular in test automation for -enhancing test maintenance and reducing code duplication. A page object is an -object-oriented class that serves as an interface to a page of your AUT. The -tests then use the methods of this page object class whenever they need to -interact with the UI of that page. The benefit is that if the UI changes for -the page, the tests themselves don’t need to change, only the code within the -page object needs to change. Subsequently, all changes to support that new UI -are located in one place. - -### Advantages - -* There is a clean separation between the test code and page-specific code, such as - locators (or their use if you’re using a UI Map) and layout. -* There is a single repository for the services or operations the page offers - rather than having these services scattered throughout the tests. - -In both cases, this allows any modifications required due to UI changes to all -be made in one place. Helpful information on this technique can be found on -numerous blogs as this ‘test design pattern’ is becoming widely used. We -encourage readers who wish to know more to search the internet for blogs -on this subject. Many have written on this design pattern and can provide -helpful tips beyond the scope of this user guide. To get you started, -we’ll illustrate page objects with a simple example. - -### Examples - -First, consider an example, typical of test automation, that does not use a -page object: - -```java -/*** - * Tests login feature - */ -public class Login { - - public void testLogin() { - // fill login data on sign-in page - driver.findElement(By.name("user_name")).sendKeys("userName"); - driver.findElement(By.name("password")).sendKeys("my supersecret password"); - driver.findElement(By.name("sign-in")).click(); - - // verify h1 tag is "Hello userName" after login - driver.findElement(By.tagName("h1")).isDisplayed(); - assertThat(driver.findElement(By.tagName("h1")).getText(), is("Hello userName")); - } -} -``` - -There are two problems with this approach. - -* There is no separation between the test method and the AUT’s locators (IDs in -this example); both are intertwined in a single method. If the AUT’s UI changes -its identifiers, layout, or how a login is input and processed, the test itself -must change. -* The ID-locators would be spread in multiple tests, in all tests that had to -use this login page. - -Applying the page object model, this example could be rewritten like this -in the following example of a page object for a Sign-in page. - -```java -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; - -/** - * Page Object encapsulates the Sign-in page. - */ -public class SignInPage { - protected WebDriver driver; - - // - private By usernameBy = By.name("user_name"); - // - private By passwordBy = By.name("password"); - // - private By signinBy = By.name("sign_in"); - - public SignInPage(WebDriver driver){ - this.driver = driver; - if (!driver.getTitle().equals("Sign In Page")) { - throw new IllegalStateException("This is not Sign In Page," + - " current page is: " + driver.getCurrentUrl()); - } - } - - /** - * Login as valid user - * - * @param userName - * @param password - * @return HomePage object - */ - public HomePage loginValidUser(String userName, String password) { - driver.findElement(usernameBy).sendKeys(userName); - driver.findElement(passwordBy).sendKeys(password); - driver.findElement(signinBy).click(); - return new HomePage(driver); - } -} -``` - -and page object for a Home page could look like this. - -```java -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; - -/** - * Page Object encapsulates the Home Page - */ -public class HomePage { - protected WebDriver driver; - - //

Hello userName

- private By messageBy = By.tagName("h1"); - - public HomePage(WebDriver driver){ - this.driver = driver; - if (!driver.getTitle().equals("Home Page of logged in user")) { - throw new IllegalStateException("This is not Home Page of logged in user," + - " current page is: " + driver.getCurrentUrl()); - } - } - - /** - * Get message (h1 tag) - * - * @return String message text - */ - public String getMessageText() { - return driver.findElement(messageBy).getText(); - } - - public HomePage manageProfile() { - // Page encapsulation to manage profile functionality - return new HomePage(driver); - } - /* More methods offering the services represented by Home Page - of Logged User. These methods in turn might return more Page Objects - for example click on Compose mail button could return ComposeMail class object */ -} -``` - -So now, the login test would use these two page objects as follows. - -```java -/*** - * Tests login feature - */ -public class TestLogin { - - @Test - public void testLogin() { - SignInPage signInPage = new SignInPage(driver); - HomePage homePage = signInPage.loginValidUser("userName", "password"); - assertThat(homePage.getMessageText(), is("Hello userName")); - } - -} -``` - -There is a lot of flexibility in how the page objects may be designed, but -there are a few basic rules for getting the desired maintainability of your -test code. - -## Assertions in Page Objects - -Page objects themselves should never make verifications or assertions. This is -part of your test and should always be within the test’s code, never in a page -object. The page object will contain the representation of the page, and the -services the page provides via methods but no code related to what is being -tested should be within the page object. - -There is one, single, verification which can, and should, be within the page -object and that is to verify that the page, and possibly critical elements on -the page, were loaded correctly. This verification should be done while -instantiating the page object. In the examples above, both the SignInPage and -HomePage constructors check that the expected page is available and ready for -requests from the test. - -## Page Component Objects - -A page object does not necessarily need to represent all the parts of a -page itself. This was [noted by Martin Fowler](https://martinfowler.com/bliki/PageObject.html#footnote-panel-object) in the early days, while first coining the term "panel objects". - -The same principles used for page objects can be used to -create "Page _Component_ Objects", as it was later called, that represent discrete chunks of the -page and **can be included in page objects**. These component objects can -provide references to the elements inside those discrete chunks, and -methods to leverage the functionality or behavior provided by them. - -For example, a Products page has multiple products. - -```html - -
- Products -
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-``` - -Each product is a component of the Products page. - - -```html - -
-
Backpack
-
-
$29.99
- -
-
-``` - -The Products page HAS-A list of products. This object relationship is called Composition. In simpler terms, something is _composed of_ another thing. - -```java -public abstract class BasePage { - protected WebDriver driver; - - public BasePage(WebDriver driver) { - this.driver = driver; - } -} - -// Page Object -public class ProductsPage extends BasePage { - public ProductsPage(WebDriver driver) { - super(driver); - // No assertions, throws an exception if the element is not loaded - new WebDriverWait(driver, Duration.ofSeconds(3)) - .until(d -> d.findElement(By.className​("header_container"))); - } - - // Returning a list of products is a service of the page - public List getProducts() { - return driver.findElements(By.className​("inventory_item")) - .stream() - .map(e -> new Product(e)) // Map WebElement to a product component - .toList(); - } - - // Return a specific product using a boolean-valued function (predicate) - // This is the behavioral Strategy Pattern from GoF - public Product getProduct(Predicate condition) { - return getProducts() - .stream() - .filter(condition) // Filter by product name or price - .findFirst() - .orElseThrow(() -> new RuntimeException("Product not found")); // Error thrown during actual test run - } -} -``` - -The Product component object is used inside the Products page object. - -```java -public abstract class BaseComponent { - protected WebElement root; - - public BaseComponent(WebElement root) { - this.root = root; - } -} - -// Page Component Object -public class Product extends BaseComponent { - // The root element contains the entire component - public Product(WebElement root) { - super(root); // inventory_item - } - - public String getName() { - // Locating an element begins at the root of the component - return root.findElement(By.className("inventory_item_name")).getText(); - } - - public BigDecimal getPrice() { - return new BigDecimal( - root.findElement(By.className("inventory_item_price")) - .getText() - .replace("$", "") - ).setScale(2, RoundingMode.UNNECESSARY); // Sanitation and formatting - } - - public void addToCart() { - root.findElement(By.id("add-to-cart-backpack")).click(); - } -} -``` - -So now, the products test would use the page object and the page component object as follows. - -```java -public class ProductsTest { - @Test - public void testProductInventory() { - var productsPage = new ProductsPage(driver); // page object - var products = productsPage.getProducts(); - assertEquals(6, products.size()); // expected, actual - } - - @Test - public void testProductPrices() { - var productsPage = new ProductsPage(driver); - - // Pass a lambda expression (predicate) to filter the list of products - // The predicate or "strategy" is the behavior passed as parameter - var backpack = productsPage.getProduct(p -> p.getName().equals("Backpack")); // page component object - var bikeLight = productsPage.getProduct(p -> p.getName().equals("Bike Light")); - - assertEquals(new BigDecimal("29.99"), backpack.getPrice()); - assertEquals(new BigDecimal("9.99"), bikeLight.getPrice()); - } -} -``` - -The page and component are represented by their own objects. Both objects only have methods for the **services** they offer, which matches the real-world application as is the core principle of object-oriented programming. When applications are built, they are not made of a massive page entity. They are built with components contained in a page. Page Component Objects implement the same approach. - -You can even -nest component objects inside other component objects for more complex -pages. If a page in the AUT has multiple components, or common -components used throughout the site (e.g. a navigation bar), then it -may improve maintainability and reduce code duplication. - -## Other Design Patterns Used in Testing - -There are other design patterns that also may be used in testing. Discussing all of these is -beyond the scope of this user guide. Here, we merely want to introduce the -concepts to make the reader aware of some of the things that can be done. As -was mentioned earlier, many have blogged on this topic and we encourage the -reader to search for blogs on these topics. - -## Implementation Notes - -Page Objects can be thought of as facing in two directions simultaneously. Facing toward the developer of a test, they represent the **services** offered by a particular page. Facing away from the developer, they should be the only thing that has a deep knowledge of the structure of the HTML of a page (or part of a page) It's simplest to think of the methods on a Page Object as offering the "services" that a page offers rather than exposing the details and mechanics of the page. As an example, think of the inbox of any web-based email system. Amongst the services it offers are the ability to compose a new email, choose to read a single email, and list the subject lines of the emails in the inbox. How these are implemented shouldn't matter to the test. - -Because we're encouraging the developer of a test to try and think about the services they're interacting with rather than the implementation, Page Objects should seldom expose the underlying WebDriver instance. To facilitate this, **methods on the Page Object may return another Page Object, another Page Component Object, or even itself (this)**. This means we can effectively model the user's journey through our application. It also means that should the way that pages relate to one another change (like when the login page asks the user to change their password the first time they log into a service when it previously didn't do that), simply changing the appropriate method's signature will cause the tests to fail to compile. Put another way; we can tell which tests would fail without needing to run them when we change the relationship between pages and reflect this in the Page Objects. - -One consequence of this approach is that it may be necessary to model (for example) both a successful and unsuccessful login; or a click could have a different result depending on the app's state. When this happens, it is common to have multiple methods on the Page Object: - -```java -public class LoginPage { - public HomePage loginAs(String username, String password) { - // ... clever magic happens here - } - - public LoginPage loginAsExpectingError(String username, String password) { - // ... failed login here, maybe because one or both of the username and password are wrong - } - - public String getErrorMessage() { - // So we can verify that the correct error is shown - } -} -``` - -The code presented above shows an important point: the tests, not the Page Objects, should be responsible for making assertions about the state of a page. For example: - -```java -public void testMessagesAreReadOrUnread() { - Inbox inbox = new Inbox(driver); - inbox.assertMessageWithSubjectIsUnread("I like cheese"); - inbox.assertMessageWithSubjectIsNotUnread("I'm not fond of tofu"); -} -``` - -could be re-written as: - -```java -public void testMessagesAreReadOrUnread() { - Inbox inbox = new Inbox(driver); - assertTrue(inbox.isMessageWithSubjectIsUnread("I like cheese")); - assertFalse(inbox.isMessageWithSubjectIsUnread("I'm not fond of tofu")); -} -``` - -Of course, as with every guideline, there are exceptions, and one that is commonly seen with Page Objects is to check that the WebDriver is on the correct page when we instantiate the Page Object. This is done in the example below. - -Finally, a Page Object need not represent an entire page and can be composed of Page Object Components. These components may represent a section that appears frequently within a site or page, such as site navigation. The essential principle is that there is only one place in your test suite with knowledge of the structure of the HTML of a particular (part of a) page. - -## Summary - -* The public methods represent the services that the page or component offers -* Try not to expose the internals of the page or component -* Generally don't make assertions -* Methods return other Page Objects, Page Component Objects, or optionally themselves (for fluent syntax) -* Need not represent an entire page all the time -* Different results for the same action are modelled as different methods - -## Example - -```java -public class LoginPage { - private final WebDriver driver; - - public LoginPage(WebDriver driver) { - this.driver = driver; - - // Check that we're on the right page. - if (!"Login".equals(driver.getTitle())) { - // Alternatively, we could navigate to the login page, perhaps logging out first - throw new IllegalStateException("This is not the login page"); - } - } - - // The login page contains several HTML elements that will be represented as WebElements. - // The locators for these elements should only be defined once. - By usernameLocator = By.id("username"); - By passwordLocator = By.id("passwd"); - By loginButtonLocator = By.id("login"); - - // The login page allows the user to type their username into the username field - public LoginPage typeUsername(String username) { - // This is the only place that "knows" how to enter a username - driver.findElement(usernameLocator).sendKeys(username); - - // Return the current page object as this action doesn't navigate to a page represented by another PageObject - return this; - } - - // The login page allows the user to type their password into the password field - public LoginPage typePassword(String password) { - // This is the only place that "knows" how to enter a password - driver.findElement(passwordLocator).sendKeys(password); - - // Return the current page object as this action doesn't navigate to a page represented by another PageObject - return this; - } - - // The login page allows the user to submit the login form - public HomePage submitLogin() { - // This is the only place that submits the login form and expects the destination to be the home page. - // A separate method should be created for the instance of clicking login whilst expecting a login failure. - driver.findElement(loginButtonLocator).submit(); - - // Return a new page object representing the destination. Should the login page ever - // go somewhere else (for example, a legal disclaimer) then changing the method signature - // for this method will mean that all tests that rely on this behaviour won't compile. - return new HomePage(driver); - } - - // The login page allows the user to submit the login form knowing that an invalid username and / or password were entered - public LoginPage submitLoginExpectingFailure() { - // This is the only place that submits the login form and expects the destination to be the login page due to login failure. - driver.findElement(loginButtonLocator).submit(); - - // Return a new page object representing the destination. Should the user ever be navigated to the home page after submitting a login with credentials - // expected to fail login, the script will fail when it attempts to instantiate the LoginPage PageObject. - return new LoginPage(driver); - } - - // Conceptually, the login page offers the user the service of being able to "log into" - // the application using a user name and password. - public HomePage loginAs(String username, String password) { - // The PageObject methods that enter username, password & submit login have already defined and should not be repeated here. - typeUsername(username); - typePassword(password); - return submitLogin(); - } -} -``` diff --git a/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md deleted file mode 100644 index 2b77e7875fa1..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/page_object_models.zh-cn.md +++ /dev/null @@ -1,517 +0,0 @@ ---- -title: "页面对象模型" -linkTitle: "页面对象模型" -weight: 3 -aliases: [ -"/documentation/guidelines/page_object_models/" -] ---- - -注意:本页内容合并自多个来源,包括 -[Selenium wiki](https://github.com/SeleniumHQ/selenium/wiki/PageObjects) - -## 概述 - -在 Web 应用的 UI 中,总有一些区域是测试需要与之交互的。 -页面对象仅将这些区域建模为测试代码中的对象。 -这减少了重复代码的数量,意味着如果 UI 发生变化, -只需在一处进行修复。 - -页面对象模型是一种设计模式,它在测试自动化领域日益流行, -旨在增强测试的可维护性并减少代码重复。页面对象是一个 -面向对象的类,它作为被测应用 (AUT) 某个页面的接口。 -测试在需要与该页面的 UI 交互时,会使用此页面对象类的 -方法。好处在于,如果该页面的 UI 发生变化,测试本身 -不需要更改,只需更改页面对象中的代码即可。随后, -所有支持新 UI 的更改都集中在一个地方。 - -### 优势 - -* 测试代码与页面特定代码(如定位器,或使用 UI 映射时的定位器使用方式)和布局之间有清晰的分离。 -* 页面所提供的服务或操作有单一的存储库, - 而不是将这些服务分散在各处测试中。 - -在以上两种情况下,这使得因 UI 变更而需要进行的所有修改 -都可以在一处完成。关于此技术的有用信息可以在众多博客中找到, -因为这种"测试设计模式"正被广泛使用。 -我们鼓励希望了解更多信息的读者在互联网上搜索关于此主题的博客。 -许多人已经就这一设计模式撰写了文章, -并能提供超出本用户指南范围的有用提示。 -为了帮助您入门,我们将用一个简单的示例来说明页面对象。 - -### 示例 - -首先,考虑一个不使用页面对象的典型测试自动化示例: - -```java -/*** - * Tests login feature - */ -public class Login { - - public void testLogin() { - // fill login data on sign-in page - driver.findElement(By.name("user_name")).sendKeys("userName"); - driver.findElement(By.name("password")).sendKeys("my supersecret password"); - driver.findElement(By.name("sign-in")).click(); - - // verify h1 tag is "Hello userName" after login - driver.findElement(By.tagName("h1")).isDisplayed(); - assertThat(driver.findElement(By.tagName("h1")).getText(), is("Hello userName")); - } -} -``` - -这种方式存在两个问题。 - -* 测试方法与 AUT 的定位器(在本例中为 ID)之间没有分离;两者 - 交织在同一个方法中。如果 AUT 的 UI 更改了其标识符、布局, - 或登录的输入和处理方式,测试本身必须随之更改。 -* ID 定位器会分散在多个测试中,散布在所有需要 - 使用此登录页面的测试里。 - -应用页面对象模型后,此示例可以重写为 -以下登录页面的页面对象示例。 - -```java -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; - -/** - * Page Object encapsulates the Sign-in page. - */ -public class SignInPage { - protected WebDriver driver; - - // - private By usernameBy = By.name("user_name"); - // - private By passwordBy = By.name("password"); - // - private By signinBy = By.name("sign_in"); - - public SignInPage(WebDriver driver){ - this.driver = driver; - if (!driver.getTitle().equals("Sign In Page")) { - throw new IllegalStateException("This is not Sign In Page," + - " current page is: " + driver.getCurrentUrl()); - } - } - - /** - * Login as valid user - * - * @param userName - * @param password - * @return HomePage object - */ - public HomePage loginValidUser(String userName, String password) { - driver.findElement(usernameBy).sendKeys(userName); - driver.findElement(passwordBy).sendKeys(password); - driver.findElement(signinBy).click(); - return new HomePage(driver); - } -} -``` - -而首页的页面对象可能如下所示。 - -```java -import org.openqa.selenium.By; -import org.openqa.selenium.WebDriver; - -/** - * Page Object encapsulates the Home Page - */ -public class HomePage { - protected WebDriver driver; - - //

Hello userName

- private By messageBy = By.tagName("h1"); - - public HomePage(WebDriver driver){ - this.driver = driver; - if (!driver.getTitle().equals("Home Page of logged in user")) { - throw new IllegalStateException("This is not Home Page of logged in user," + - " current page is: " + driver.getCurrentUrl()); - } - } - - /** - * Get message (h1 tag) - * - * @return String message text - */ - public String getMessageText() { - return driver.findElement(messageBy).getText(); - } - - public HomePage manageProfile() { - // Page encapsulation to manage profile functionality - return new HomePage(driver); - } - /* More methods offering the services represented by Home Page - of Logged User. These methods in turn might return more Page Objects - for example click on Compose mail button could return ComposeMail class object */ -} -``` - -现在,登录测试将按如下方式使用这两个页面对象。 - -```java -/*** - * Tests login feature - */ -public class TestLogin { - - @Test - public void testLogin() { - SignInPage signInPage = new SignInPage(driver); - HomePage homePage = signInPage.loginValidUser("userName", "password"); - assertThat(homePage.getMessageText(), is("Hello userName")); - } - -} -``` - -页面对象的设计方式有很大的灵活性, -但要获得所需的测试代码可维护性,有一些基本规则需要遵循。 - -## 页面对象中的断言 - -页面对象本身不应进行验证或断言。 -这是测试的一部分,应始终在测试代码中, -而非页面对象中。 -页面对象将包含页面的表示, -以及页面通过方法提供的服务, -但不应包含与被测内容相关的代码。 - -有一个唯一的验证可以、也应当在页面对象中进行, -那就是验证页面以及页面上的关键元素是否已正确加载。 -此验证应在实例化页面对象时完成。 -在上面的示例中,SignInPage 和 -HomePage 的构造函数都会检查预期页面是否可用并准备好 -接收测试的请求。 - -## 页面组件对象 - -页面对象不一定需要自身表示页面的所有部分。 -这在早期就已被[Martin Fowler](https://martinfowler.com/bliki/PageObject.html#footnote-panel-object) 指出, -他当时首次提出了"面板对象"这一术语。 - -用于页面对象的相同原则可以用来 -创建"页面 _组件_ 对象"(后来的称呼),它表示页面的离散区块, -并 **可以包含在页面对象中**。 -这些组件对象可以提供对这些离散区块内部元素的引用, -以及利用它们所提供的功能或行为的方法。 - -例如,一个产品页面有多个产品。 - -```html - -
- Products -
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-``` - -每个产品都是产品页面的一个组件。 - - -```html - -
-
Backpack
-
-
$29.99
- -
-
-``` - -产品页面拥有(HAS-A)一个产品列表。这种对象关系称为组合。 -简单来说,某个事物 _由_ 另一个事物 _组成_。 - -```java -public abstract class BasePage { - protected WebDriver driver; - - public BasePage(WebDriver driver) { - this.driver = driver; - } -} - -// Page Object -public class ProductsPage extends BasePage { - public ProductsPage(WebDriver driver) { - super(driver); - // No assertions, throws an exception if the element is not loaded - new WebDriverWait(driver, Duration.ofSeconds(3)) - .until(d -> d.findElement(By.className​("header_container"))); - } - - // Returning a list of products is a service of the page - public List getProducts() { - return driver.findElements(By.className​("inventory_item")) - .stream() - .map(e -> new Product(e)) // Map WebElement to a product component - .toList(); - } - - // Return a specific product using a boolean-valued function (predicate) - // This is the behavioral Strategy Pattern from GoF - public Product getProduct(Predicate condition) { - return getProducts() - .stream() - .filter(condition) // Filter by product name or price - .findFirst() - .orElseThrow(() -> new RuntimeException("Product not found")); // Error thrown during actual test run - } -} -``` - -Product 组件对象在产品页面对象内部使用。 - -```java -public abstract class BaseComponent { - protected WebElement root; - - public BaseComponent(WebElement root) { - this.root = root; - } -} - -// Page Component Object -public class Product extends BaseComponent { - // The root element contains the entire component - public Product(WebElement root) { - super(root); // inventory_item - } - - public String getName() { - // Locating an element begins at the root of the component - return root.findElement(By.className("inventory_item_name")).getText(); - } - - public BigDecimal getPrice() { - return new BigDecimal( - root.findElement(By.className("inventory_item_price")) - .getText() - .replace("$", "") - ).setScale(2, RoundingMode.UNNECESSARY); // Sanitation and formatting - } - - public void addToCart() { - root.findElement(By.id("add-to-cart-backpack")).click(); - } -} -``` - -现在,产品测试将按如下方式使用页面对象和页面组件对象。 - -```java -public class ProductsTest { - @Test - public void testProductInventory() { - var productsPage = new ProductsPage(driver); // page object - var products = productsPage.getProducts(); - assertEquals(6, products.size()); // expected, actual - } - - @Test - public void testProductPrices() { - var productsPage = new ProductsPage(driver); - - // Pass a lambda expression (predicate) to filter the list of products - // The predicate or "strategy" is the behavior passed as parameter - var backpack = productsPage.getProduct(p -> p.getName().equals("Backpack")); // page component object - var bikeLight = productsPage.getProduct(p -> p.getName().equals("Bike Light")); - - assertEquals(new BigDecimal("29.99"), backpack.getPrice()); - assertEquals(new BigDecimal("9.99"), bikeLight.getPrice()); - } -} -``` - -页面和组件由各自的对象表示。这两个对象只有提供其**服务**的方法, -这与实际应用相匹配,也是面向对象编程的核心原则。 -当构建应用程序时,它们并不是由一个庞大的页面实体构成的。 -它们是由包含在页面中的组件构建的。页面组件对象实现了相同的方法。 - -您甚至可以 -将组件对象嵌套在其他组件对象中,用于更复杂的 -页面。如果 AUT 中的某个页面有多个组件,或 -整个站点中使用的公共组件(例如导航栏),那么这 -可能会提高可维护性并减少代码重复。 - -## 测试中使用的其他设计模式 - -还有其他一些设计模式也可用于测试。讨论所有这些模式 -超出了本用户指南的范围。在这里,我们只是想介绍 -这些概念,让读者了解可以做的一些事情。正如 -前面提到的,许多人已经在这一主题上撰写了博客,我们鼓励 -读者搜索关于这些主题的博客。 - -## 实现说明 - -页面对象可以被看作同时面向两个方向。面向测试开发者的一面, -它们表示特定页面提供的**服务**。 -背对开发者的一面,它们应该是唯一对页面(或页面的一部分)的 HTML 结构有深入了解的东西。 -最简单的理解方式是将页面对象上的方法视为提供页面所提供的"服务",而不是暴露页面的细节和机制。 -举例来说,想想任何基于 Web 的电子邮件系统的收件箱。 -它提供的服务包括撰写新邮件、选择阅读单封邮件,以及列出收件箱中邮件的主题行。 -这些功能如何实现对测试而言不应重要。 - -因为我们鼓励测试开发者尝试思考他们正在交互的服务而非实现, -所以页面对象应尽量少地暴露底层的 WebDriver 实例。 -为此,**页面对象上的方法可以返回另一个页面对象、另一个页面组件对象, -甚至自身**。这意味着我们可以有效地对用户在应用程序中的旅程进行建模。 -这也意味着,如果页面之间的关联方式发生变化 -(例如,登录页面在用户首次登录某服务时要求其更改密码,而以前并不这样做), -只需更改相应方法的签名就会导致测试无法编译。 -换言之,当我们更改页面之间的关系并在页面对象中反映这一变化时, -无需运行测试就能知道哪些测试会失败。 - -这种方法的一个后果是,可能需要对(例如)成功和失败的登录分别建模; -或者一次点击可能根据应用程序的状态产生不同的结果。 -当发生这种情况时,通常在页面对象上有多个方法: - -```java -public class LoginPage { - public HomePage loginAs(String username, String password) { - // ... clever magic happens here - } - - public LoginPage loginAsExpectingError(String username, String password) { - // ... failed login here, maybe because one or both of the username and password are wrong - } - - public String getErrorMessage() { - // So we can verify that the correct error is shown - } -} -``` - -上面的代码展示了一个要点:测试而非页面对象应负责对页面状态进行断言。例如: - -```java -public void testMessagesAreReadOrUnread() { - Inbox inbox = new Inbox(driver); - inbox.assertMessageWithSubjectIsUnread("I like cheese"); - inbox.assertMessageWithSubjectIsNotUnread("I'm not fond of tofu"); -} -``` - -可以重写为: - -```java -public void testMessagesAreReadOrUnread() { - Inbox inbox = new Inbox(driver); - assertTrue(inbox.isMessageWithSubjectIsUnread("I like cheese")); - assertFalse(inbox.isMessageWithSubjectIsUnread("I'm not fond of tofu")); -} -``` - -当然,与每条指南一样,也有例外情况, -页面对象中常见的一个例外是在实例化页面对象时检查 WebDriver 是否在正确的页面上。 -这在下面的示例中有所体现。 - -最后,页面对象不必表示整个页面,可以由页面对象组件组成。 -这些组件可以表示在站点或页面中频繁出现的部分,例如站点导航。 -核心原则是,在你的测试套件中只有一个地方了解特定页面(或页面的一部分)的 HTML 结构。 - -## 总结 - -* 公共方法表示页面或组件提供的服务 -* 尽量不要暴露页面或组件的内部细节 -* 通常不要进行断言 -* 方法返回其他页面对象、页面组件对象,或可选地返回自身(用于流畅语法) -* 不必始终表示整个页面 -* 同一操作的不同结果建模为不同的方法 - -## 示例 - -```java -public class LoginPage { - private final WebDriver driver; - - public LoginPage(WebDriver driver) { - this.driver = driver; - - // Check that we're on the right page. - if (!"Login".equals(driver.getTitle())) { - // Alternatively, we could navigate to the login page, perhaps logging out first - throw new IllegalStateException("This is not the login page"); - } - } - - // The login page contains several HTML elements that will be represented as WebElements. - // The locators for these elements should only be defined once. - By usernameLocator = By.id("username"); - By passwordLocator = By.id("passwd"); - By loginButtonLocator = By.id("login"); - - // The login page allows the user to type their username into the username field - public LoginPage typeUsername(String username) { - // This is the only place that "knows" how to enter a username - driver.findElement(usernameLocator).sendKeys(username); - - // Return the current page object as this action doesn't navigate to a page represented by another PageObject - return this; - } - - // The login page allows the user to type their password into the password field - public LoginPage typePassword(String password) { - // This is the only place that "knows" how to enter a password - driver.findElement(passwordLocator).sendKeys(password); - - // Return the current page object as this action doesn't navigate to a page represented by another PageObject - return this; - } - - // The login page allows the user to submit the login form - public HomePage submitLogin() { - // This is the only place that submits the login form and expects the destination to be the home page. - // A separate method should be created for the instance of clicking login whilst expecting a login failure. - driver.findElement(loginButtonLocator).submit(); - - // Return a new page object representing the destination. Should the login page ever - // go somewhere else (for example, a legal disclaimer) then changing the method signature - // for this method will mean that all tests that rely on this behaviour won't compile. - return new HomePage(driver); - } - - // The login page allows the user to submit the login form knowing that an invalid username and / or password were entered - public LoginPage submitLoginExpectingFailure() { - // This is the only place that submits the login form and expects the destination to be the login page due to login failure. - driver.findElement(loginButtonLocator).submit(); - - // Return a new page object representing the destination. Should the user ever be navigated to the home page after submitting a login with credentials - // expected to fail login, the script will fail when it attempts to instantiate the LoginPage PageObject. - return new LoginPage(driver); - } - - // Conceptually, the login page offers the user the service of being able to "log into" - // the application using a user name and password. - public HomePage loginAs(String username, String password) { - // The PageObject methods that enter username, password & submit login have already defined and should not be repeated here. - typeUsername(username); - typePassword(password); - return submitLogin(); - } -} -``` diff --git a/website_and_docs/content/documentation/test_practices/encouraged/test_independency.en.md b/website_and_docs/content/documentation/test_practices/encouraged/test_independency.en.md index 4a37e1bfc2f8..937db3ccc072 100644 --- a/website_and_docs/content/documentation/test_practices/encouraged/test_independency.en.md +++ b/website_and_docs/content/documentation/test_practices/encouraged/test_independency.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/guidelines/test_independency/", "/documentation/ja/guidelines_and_recommendations/test_independency/", "/documentation/pt-br/guidelines_and_recommendations/test_independency/", -"/documentation/zh-cn/guidelines_and_recommendations/test_independency/" +"/documentation/zh-cn/guidelines_and_recommendations/test_independency/", +"/ja/documentation/guidelines/test_independency/", +"/ja/documentation/test_practices/encouraged/test_independency/", +"/pt-br/documentation/guidelines/test_independency/", +"/pt-br/documentation/test_practices/encouraged/test_independency/", +"/zh-cn/documentation/guidelines/test_independency/", +"/zh-cn/documentation/test_practices/encouraged/test_independency/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/encouraged/test_independency.ja.md b/website_and_docs/content/documentation/test_practices/encouraged/test_independency.ja.md deleted file mode 100644 index cb114dddff29..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/test_independency.ja.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -title: "テストの独立性" -linkTitle: "テストの独立性" -weight: 9 -aliases: [ -"/documentation/guidelines/test_independency/" -] ---- - -各テストを独自のユニットとして記述します。 -他のテストに依存しない方法でテストを記述してください。 - -公開後にモジュールとしてWebサイトに表示されるカスタムコンテンツを作成できるコンテンツ管理システム(CMS)があり、CMSとアプリケーション間の同期に時間がかかる場合があるとします。 - -モジュールをテストする間違った方法は、1つのテストでコンテンツが作成および公開され、別のテストでモジュールをチェックすることです。 -コンテンツは公開後、他のテストですぐに利用できない可能性があるため、この方法はふさわしくありません。 - -代わりに、影響を受けるテスト内でオン/オフできるスタブコンテンツを作成し、それをモジュールの検証に使用できます。 -ただし、コンテンツの作成については、別のテストを行うことができます。 diff --git a/website_and_docs/content/documentation/test_practices/encouraged/test_independency.pt-br.md b/website_and_docs/content/documentation/test_practices/encouraged/test_independency.pt-br.md deleted file mode 100644 index 44fb5ae212eb..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/test_independency.pt-br.md +++ /dev/null @@ -1,25 +0,0 @@ ---- -title: "Independência de Testes" -linkTitle: "Independência de Testes" -weight: 9 -aliases: [ -"/documentation/guidelines/test_independency/" -] ---- - - -Escreva cada teste como sua própria unidade. Escreva os testes de uma forma que não seja -dependente de outros testes para concluir: - -Digamos que existe um sistema de gerenciamento de conteúdo com o qual você pode criar -algum conteúdo personalizado que então aparece em seu site como um módulo após -publicação, e pode levar algum tempo para sincronizar entre o CMS e a aplicação. - -Uma maneira errada de testar seu módulo é que o conteúdo seja criado e -publicado em um teste e, em seguida, verificar o módulo em outro teste. Este teste -não é viável, pois o conteúdo pode não estar disponível imediatamente para o -outro teste após a publicação. - -Em vez disso, você pode criar um conteúdo stub que pode ser ligado e desligado -dentro do teste e use-o para validar o módulo. Contudo, -para a criação de conteúdo, você ainda pode ter um teste separado. diff --git a/website_and_docs/content/documentation/test_practices/encouraged/test_independency.zh-cn.md b/website_and_docs/content/documentation/test_practices/encouraged/test_independency.zh-cn.md deleted file mode 100644 index c57f1f0efd08..000000000000 --- a/website_and_docs/content/documentation/test_practices/encouraged/test_independency.zh-cn.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -title: "测试的独立性" -linkTitle: "测试的独立性" -weight: 9 -aliases: [ -"/documentation/guidelines/test_independency/" -] ---- - -将每个测试编写为独立的单元. -以不依赖于其他测试完成的方式编写测试: - -例如有一个内容管理系统, -您可以借助其创建一些自定义内容, -这些内容在发布后作为模块显示在您的网站上, -并且CMS和应用程序之间的同步可能需要一些时间. - -测试模块的一种错误方法是在测试中创建并发布内容, -然后在另一测试中检查该模块. -这是不可取的, 因为发布后内容可能无法立即用于其他测试. - -与之相反的事, 您可以创建在受影响的测试中打开和关闭的打桩内容, 并将其用于验证模块. -而且, 对于内容的创建, 您仍然可以进行单独的测试. diff --git a/website_and_docs/content/documentation/test_practices/overview.en.md b/website_and_docs/content/documentation/test_practices/overview.en.md index a64bef71e5ec..3f8179314c58 100644 --- a/website_and_docs/content/documentation/test_practices/overview.en.md +++ b/website_and_docs/content/documentation/test_practices/overview.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/guidelines/on_test_automation/", "/documentation/ja/introduction/on_test_automation/", "/documentation/pt-br/introduction/on_test_automation/", -"/documentation/zh-cn/introduction/on_test_automation/" +"/documentation/zh-cn/introduction/on_test_automation/", +"/ja/documentation/guidelines/on_test_automation/", +"/ja/documentation/test_practices/overview/", +"/pt-br/documentation/guidelines/on_test_automation/", +"/pt-br/documentation/test_practices/overview/", +"/zh-cn/documentation/guidelines/on_test_automation/", +"/zh-cn/documentation/test_practices/overview/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/overview.ja.md b/website_and_docs/content/documentation/test_practices/overview.ja.md deleted file mode 100644 index 6f24b419b8b0..000000000000 --- a/website_and_docs/content/documentation/test_practices/overview.ja.md +++ /dev/null @@ -1,370 +0,0 @@ ---- -title: "テスト自動化について" -linkTitle: "テスト自動化について" -weight: 1 -aliases: [ -"/documentation/guidelines/on_test_automation/" -] ---- - - -まず、本当にブラウザを使用する必要があるかどうかを自問することから始めます。 -ある時点で複雑なWebアプリケーションで作業している場合、おそらくブラウザを開いて実際にテストする必要があるでしょう。 - -ただし、Seleniumテストなどの機能的なエンドユーザーテストの実行には費用がかかります。 -さらに、それらは通常、効果的に実行するために適切なインフラストラクチャを配置する必要があります。 -単体テストなどのより軽量なテストアプローチを使用して、または下位レベルのアプローチを使用して、テストすることを実行できるかどうかを常に自問するのは良いルールです。 - -Webブラウザーのテストビジネスに参加していることを確認し、Selenium環境でテストの記述を開始できるようになったら、通常は3つのステップを組み合わせて実行します。 - -* データを設定する -* 個別の一連のアクションを実行する -* 結果を評価する - -これらの手順はできるだけ短くしてください。 -ほとんどの場合、1つまたは2つの操作で十分です。 -ブラウザの自動化は"不安定"であるという評判がありますが、実際には、ユーザーが頻繁に多くを求めることが多いためです。 -後の章では、特にブラウザーとWebDriver間の[競合状態を克服する]({{< ref "waits.md" >}})方法に関する、テストでの断続的な問題を軽減するために使用できる手法に戻ります。 - -テストを短くして、代替手段がまったくない場合にのみWebブラウザーを使用することで、不安定さを最小限にして多くのテストを実行できます。 - -Seleniumテストの明確な利点は、ユーザーの観点から、バックエンドからフロントエンドまで、アプリケーションのすべてのコンポーネントをテストする固有の機能です。 -つまり、機能テストは実行に費用がかかる可能性がありますが、同時にビジネスに不可欠な大規模な部分も含まれます。 - -### テスト要件 - -前述のように、Seleniumテストの実行には費用がかかる場合があります。 -どの程度までテストを実行しているブラウザーに依存しますが、歴史的にブラウザーの動作は非常に多様であるため、多くの場合、複数のブラウザーに対するクロステストの目標として述べられてきました。 - -Seleniumを使用すると、複数のオペレーティングシステム上の複数のブラウザーに対して同じ命令を実行できますが、すべての可能なブラウザー、それらの異なるバージョン、およびそれらが実行される多くのオペレーティングシステムの列挙はすぐに重要な作業になります。 - -### 例から始めましょう - -ラリーは、ユーザーがカスタムユニコーンを注文できるWebサイトを作成しました。 - -一般的なワークフロー("ハッピーパス"と呼ぶ)は次のようなものです。 - -* アカウントを作成する -* ユニコーンを設定する -* ショッピングカートにユニコーンを追加します -* チェックアウトしてお支払い -* ユニコーンについてフィードバックを送る - -これらのすべての操作を実行するために1つの壮大なSeleniumスクリプトを作成するのは魅力的です。 -**その誘惑に抵抗しましょう!** そうすると、 -a)時間がかかる -b)ページレンダリングのタイミングの問題に関する一般的な問題が発生する -c)失敗した場合、簡潔で"一目瞭然"にならない、何がうまくいかなかったかを診断する方法がない -というテストになります。 - -このシナリオをテストするための好ましい戦略は、一連の独立した迅速なテストに分割することです。 -各テストには、1つの"理由"が存在します。 - -2番目のステップであるユニコーンの構成をテストしたいと思います。 -次のアクションを実行します。 - -* アカウントを作成する -* ユニコーンを設定する - -これらの手順の残りをスキップしていることに注意してください。 -この手順を完了した後、他の小さな個別のテストケースで残りのワークフローをテストします。 - -開始するには、アカウントを作成する必要があります。 -ここには、いくつかの選択があります。 - -* 既存のアカウントを使用しますか? -* 新しいアカウントを作成しますか? -* 設定を開始する前に考慮する必要があるそのようなユーザーの特別なプロパティはありますか? - - -この質問への回答方法に関係なく、テストの"データのセットアップ"部分の一部にすると解決します。 -ラリーが、ユーザー(またはだれでも)がユーザーアカウントを作成および更新できるAPIを公開している場合は、それを使用してこの質問に回答してください。 -可能であれば、資格情報を使用してログインできるユーザーが"手元に"いる場合にのみブラウザを起動します。 - -各ワークフローの各テストがユーザーアカウントの作成から始まる場合、各テストの実行に何秒も追加されます。 -APIの呼び出しとデータベースとの対話は、ブラウザを開いたり、適切なページに移動したり、フォームをクリックして送信されるのを待つなどの高価なプロセスを必要としない、迅速な"ヘッドレス"操作です。 - -理想的には、1行のコードでこのセットアップフェーズに対処できます。 -これは、ブラウザーが起動する前に実行されます。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -// Create a user who has read-only permissions--they can configure a unicorn, -// but they do not have payment information set up, nor do they have -// administrative privileges. At the time the user is created, its email -// address and password are randomly generated--you don't even need to -// know them. -User user = UserFactory.createCommonUser(); //This method is defined elsewhere. - -// Log in as this user. -// Logging in on this site takes you to your personal "My Account" page, so the -// AccountPage object is returned by the loginAs method, allowing you to then -// perform actions from the AccountPage. -AccountPage accountPage = loginAs(user.getEmail(), user.getPassword()); - {{< /tab >}} - {{< tab header="Python" >}} -# Create a user who has read-only permissions--they can configure a unicorn, -# but they do not have payment information set up, nor do they have -# administrative privileges. At the time the user is created, its email -# address and password are randomly generated--you don't even need to -# know them. -user = user_factory.create_common_user() #This method is defined elsewhere. - -# Log in as this user. -# Logging in on this site takes you to your personal "My Account" page, so the -# AccountPage object is returned by the loginAs method, allowing you to then -# perform actions from the AccountPage. -account_page = login_as(user.get_email(), user.get_password()) - {{< /tab >}} - {{< tab header="CSharp" >}} -// Create a user who has read-only permissions--they can configure a unicorn, -// but they do not have payment information set up, nor do they have -// administrative privileges. At the time the user is created, its email -// address and password are randomly generated--you don't even need to -// know them. -User user = UserFactory.CreateCommonUser(); //This method is defined elsewhere. - -// Log in as this user. -// Logging in on this site takes you to your personal "My Account" page, so the -// AccountPage object is returned by the loginAs method, allowing you to then -// perform actions from the AccountPage. -AccountPage accountPage = LoginAs(user.Email, user.Password); - {{< /tab >}} - {{< tab header="Ruby" >}} -# Create a user who has read-only permissions--they can configure a unicorn, -# but they do not have payment information set up, nor do they have -# administrative privileges. At the time the user is created, its email -# address and password are randomly generated--you don't even need to -# know them. -user = UserFactory.create_common_user #This method is defined elsewhere. - -# Log in as this user. -# Logging in on this site takes you to your personal "My Account" page, so the -# AccountPage object is returned by the loginAs method, allowing you to then -# perform actions from the AccountPage. -account_page = login_as(user.email, user.password) - {{< /tab >}} - {{< tab header="JavaScript" >}} -// Create a user who has read-only permissions--they can configure a unicorn, -// but they do not have payment information set up, nor do they have -// administrative privileges. At the time the user is created, its email -// address and password are randomly generated--you don't even need to -// know them. -var user = userFactory.createCommonUser(); //This method is defined elsewhere. - -// Log in as this user. -// Logging in on this site takes you to your personal "My Account" page, so the -// AccountPage object is returned by the loginAs method, allowing you to then -// perform actions from the AccountPage. -var accountPage = loginAs(user.email, user.password); - {{< /tab >}} - {{< tab header="Kotlin" >}} -// Create a user who has read-only permissions--they can configure a unicorn, -// but they do not have payment information set up, nor do they have -// administrative privileges. At the time the user is created, its email -// address and password are randomly generated--you don't even need to -// know them. -val user = UserFactory.createCommonUser() //This method is defined elsewhere. - -// Log in as this user. -// Logging in on this site takes you to your personal "My Account" page, so the -// AccountPage object is returned by the loginAs method, allowing you to then -// perform actions from the AccountPage. -val accountPage = loginAs(user.getEmail(), user.getPassword()) - {{< /tab >}} -{{< /tabpane >}} - -ご想像のとおり、 `UserFactory` を拡張して `createAdminUser()` や `createUserWithPayment()` などのメソッドを提供できます。 -重要なのは、これらの2行のコードは、このテストの最終目的であるユニコーンの構成からあなたをそらすものではないということです。 - -[ページオブジェクトモデル]({{< ref "page_object_models.md" >}})の込み入った事柄については、後の章で説明しますが、ここで概念を紹介します。 - -テストは、サイトのページのコンテキスト内で、ユーザーの観点から実行されるアクションで構成される必要があります。 -これらのページはオブジェクトとして保存され、Webページがどのように構成され、アクションがどのように実行されるかに関する特定の情報が含まれます。 - -どんなユニコーンが欲しいですか? -ピンクが必要かもしれませんが、必ずしもそうではありません。 -紫は最近非常に人気があります。 -彼女はサングラスが必要ですか? -スタータトゥー? -これらの選択は困難ですが、テスターとしての最大の関心事です。 -発送センターが適切なユニコーンを適切な人に送信することを確認する必要があります。 - -この段落では、ボタン、フィールド、ドロップダウン、ラジオボタン、またはWebフォームについては説明していません。 -**また、テストするべきではありません!** -ユーザーが問題を解決しようとしているようにコードを書きたいと思います。 -これを実行する1つの方法を次に示します(前の例から継続) - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -// The Unicorn is a top-level Object--it has attributes, which are set here. -// This only stores the values; it does not fill out any web forms or interact -// with the browser in any way. -Unicorn sparkles = new Unicorn("Sparkles", UnicornColors.PURPLE, UnicornAccessories.SUNGLASSES, UnicornAdornments.STAR_TATTOOS); - -// Since we are already "on" the account page, we have to use it to get to the -// actual place where you configure unicorns. Calling the "Add Unicorn" method -// takes us there. -AddUnicornPage addUnicornPage = accountPage.addUnicorn(); - -// Now that we're on the AddUnicornPage, we will pass the "sparkles" object to -// its createUnicorn() method. This method will take Sparkles' attributes, -// fill out the form, and click submit. -UnicornConfirmationPage unicornConfirmationPage = addUnicornPage.createUnicorn(sparkles); - {{< /tab >}} - {{< tab header="Python" >}} -# The Unicorn is a top-level Object--it has attributes, which are set here. -# This only stores the values; it does not fill out any web forms or interact -# with the browser in any way. -sparkles = Unicorn("Sparkles", UnicornColors.PURPLE, UnicornAccessories.SUNGLASSES, UnicornAdornments.STAR_TATTOOS) - -# Since we're already "on" the account page, we have to use it to get to the -# actual place where you configure unicorns. Calling the "Add Unicorn" method -# takes us there. -add_unicorn_page = account_page.add_unicorn() - -# Now that we're on the AddUnicornPage, we will pass the "sparkles" object to -# its createUnicorn() method. This method will take Sparkles' attributes, -# fill out the form, and click submit. -unicorn_confirmation_page = add_unicorn_page.create_unicorn(sparkles) - {{< /tab >}} - {{< tab header="CSharp" >}} -// The Unicorn is a top-level Object--it has attributes, which are set here. -// This only stores the values; it does not fill out any web forms or interact -// with the browser in any way. -Unicorn sparkles = new Unicorn("Sparkles", UnicornColors.Purple, UnicornAccessories.Sunglasses, UnicornAdornments.StarTattoos); - -// Since we are already "on" the account page, we have to use it to get to the -// actual place where you configure unicorns. Calling the "Add Unicorn" method -// takes us there. -AddUnicornPage addUnicornPage = accountPage.AddUnicorn(); - -// Now that we're on the AddUnicornPage, we will pass the "sparkles" object to -// its createUnicorn() method. This method will take Sparkles' attributes, -// fill out the form, and click submit. -UnicornConfirmationPage unicornConfirmationPage = addUnicornPage.CreateUnicorn(sparkles); - {{< /tab >}} - {{< tab header="Ruby" >}} -# The Unicorn is a top-level Object--it has attributes, which are set here. -# This only stores the values; it does not fill out any web forms or interact -# with the browser in any way. -sparkles = Unicorn.new('Sparkles', UnicornColors.PURPLE, UnicornAccessories.SUNGLASSES, UnicornAdornments.STAR_TATTOOS) - -# Since we're already "on" the account page, we have to use it to get to the -# actual place where you configure unicorns. Calling the "Add Unicorn" method -# takes us there. -add_unicorn_page = account_page.add_unicorn - -# Now that we're on the AddUnicornPage, we will pass the "sparkles" object to -# its createUnicorn() method. This method will take Sparkles' attributes, -# fill out the form, and click submit. -unicorn_confirmation_page = add_unicorn_page.create_unicorn(sparkles) - {{< /tab >}} - {{< tab header="JavaScript" >}} -// The Unicorn is a top-level Object--it has attributes, which are set here. -// This only stores the values; it does not fill out any web forms or interact -// with the browser in any way. -var sparkles = new Unicorn("Sparkles", UnicornColors.PURPLE, UnicornAccessories.SUNGLASSES, UnicornAdornments.STAR_TATTOOS); - -// Since we are already "on" the account page, we have to use it to get to the -// actual place where you configure unicorns. Calling the "Add Unicorn" method -// takes us there. - -var addUnicornPage = accountPage.addUnicorn(); - -// Now that we're on the AddUnicornPage, we will pass the "sparkles" object to -// its createUnicorn() method. This method will take Sparkles' attributes, -// fill out the form, and click submit. -var unicornConfirmationPage = addUnicornPage.createUnicorn(sparkles); - - {{< /tab >}} - {{< tab header="Kotlin" >}} -// The Unicorn is a top-level Object--it has attributes, which are set here. -// This only stores the values; it does not fill out any web forms or interact -// with the browser in any way. -val sparkles = Unicorn("Sparkles", UnicornColors.PURPLE, UnicornAccessories.SUNGLASSES, UnicornAdornments.STAR_TATTOOS) - -// Since we are already "on" the account page, we have to use it to get to the -// actual place where you configure unicorns. Calling the "Add Unicorn" method -// takes us there. -val addUnicornPage = accountPage.addUnicorn() - -// Now that we're on the AddUnicornPage, we will pass the "sparkles" object to -// its createUnicorn() method. This method will take Sparkles' attributes, -// fill out the form, and click submit. -unicornConfirmationPage = addUnicornPage.createUnicorn(sparkles) - - {{< /tab >}} -{{< /tabpane >}} - -ユニコーンの設定が完了したら、ステップ3に進んで、ユニコーンが実際に機能することを確認する必要があります。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -// The exists() method from UnicornConfirmationPage will take the Sparkles -// object--a specification of the attributes you want to see, and compare -// them with the fields on the page. -Assert.assertTrue("Sparkles should have been created, with all attributes intact", unicornConfirmationPage.exists(sparkles)); - {{< /tab >}} - {{< tab header="Python" >}} -# The exists() method from UnicornConfirmationPage will take the Sparkles -# object--a specification of the attributes you want to see, and compare -# them with the fields on the page. -assert unicorn_confirmation_page.exists(sparkles), "Sparkles should have been created, with all attributes intact" - {{< /tab >}} - {{< tab header="CSharp" >}} -// The exists() method from UnicornConfirmationPage will take the Sparkles -// object--a specification of the attributes you want to see, and compare -// them with the fields on the page. -Assert.True(unicornConfirmationPage.Exists(sparkles), "Sparkles should have been created, with all attributes intact"); - {{< /tab >}} - {{< tab header="Ruby" >}} -# The exists() method from UnicornConfirmationPage will take the Sparkles -# object--a specification of the attributes you want to see, and compare -# them with the fields on the page. -expect(unicorn_confirmation_page.exists?(sparkles)).to be, 'Sparkles should have been created, with all attributes intact' - {{< /tab >}} - {{< tab header="JavaScript" >}} -// The exists() method from UnicornConfirmationPage will take the Sparkles -// object--a specification of the attributes you want to see, and compare -// them with the fields on the page. -assert(unicornConfirmationPage.exists(sparkles), "Sparkles should have been created, with all attributes intact"); - - {{< /tab >}} - {{< tab header="Kotlin" >}} -// The exists() method from UnicornConfirmationPage will take the Sparkles -// object--a specification of the attributes you want to see, and compare -// them with the fields on the page. -assertTrue("Sparkles should have been created, with all attributes intact", unicornConfirmationPage.exists(sparkles)) - {{< /tab >}} -{{< /tabpane >}} - -テスターはまだこのコードでユニコーンについて話しているだけです。 -ボタンもロケーターもブラウザーコントロールもありません。 -ラリーが来週、Ruby-on-Railsが好きではなくなったと判断し、Fortranフロントエンドを使用して最新のHaskellバインディングでサイト全体を再実装することを決めた場合でも、アプリケーションを _モデル化する_ この方法により、これらのテストレベルのコマンドを所定の位置に変えずに維持できます。 - -ページオブジェクトは、サイトの再設計に準拠するために若干のメンテナンスが必要になりますが、これらのテストは同じままです。 -この基本的な設計を採用することで、可能な限りブラウザに面した最小限の手順でワークフローを進めていきたいと思うでしょう。 -次のワークフローでは、ユニコーンをショッピングカートに追加します。 -カートの状態が適切に維持されていることを確認するために、おそらくこのテストを何度も繰り返す必要があります。 -開始する前に、カートに複数のユニコーンがありますか? -ショッピングカートには何個収容できますか? -同じ名前や機能で複数作成すると、壊れますか? -既存のものを保持するだけですか、それとも別のものを追加しますか? - -ワークフローを移動するたびに、アカウントを作成し、ユーザーとしてログインし、ユニコーンを設定する必要を避けたいと考えています。 -理想的には、APIまたはデータベースを介してアカウントを作成し、ユニコーンを事前設定できるようになります。 -その後、ユーザーとしてログインし、きらめきを見つけてカートに追加するだけです。 - -### 自動化するかしないか - -自動化は常に有利ですか? -テストケースの自動化をいつ決定する必要がありますか? - -テストケースを自動化することは必ずしも有利ではありません。 -手動テストがより適切な場合があります。 -たとえば、近い将来にアプリケーションのユーザーインターフェースが大幅に変更される場合は、自動化を書き換える必要があるかもしれません。 -また、テストの自動化を構築する時間が足りない場合もあります。 -短期的には、手動テストの方が効果的です。 -アプリケーションの期限が非常に厳しい場合、現在利用できるテストの自動化はなく、その期間内にテストを実施することが不可欠です。 -手動テストが最適なソリューションです。 diff --git a/website_and_docs/content/documentation/test_practices/overview.pt-br.md b/website_and_docs/content/documentation/test_practices/overview.pt-br.md deleted file mode 100644 index cfe998152a24..000000000000 --- a/website_and_docs/content/documentation/test_practices/overview.pt-br.md +++ /dev/null @@ -1,431 +0,0 @@ ---- -title: "Sobre automação de testes" -linkTitle: "Sobre automação de testes" -weight: 2 -aliases: [ -"/documentation/guidelines/on_test_automation/" -] ---- - -Primeiro, comece perguntando a si mesmo se você realmente precisa ou não de um navegador. -As probabilidades são de que, em algum ponto, se você estiver trabalhando em um aplicativo da web complexo, -você precisará abrir um navegador e realmente testá-lo. - -No entanto, os testes funcionais do usuário final, como os testes Selenium, são caros para executar. -Além disso, eles normalmente exigem infraestrutura substancial -para ser executado de forma eficaz. -É uma boa regra sempre se perguntar se o que você deseja testar -pode ser feito usando abordagens de teste mais leves, como testes de unidade -ou com uma abordagem de nível inferior. - -Depois de determinar que está no negócio de teste de navegador da web, -e você tem seu ambiente Selenium pronto para começar a escrever testes, -você geralmente executará alguma combinação de três etapas: - -* Configurar os dados -* Executar um conjunto discreto de ações -* Avaliar os resultados - -Você deve manter essas etapas o mais curtas possível; -uma ou duas operações devem ser suficientes na maioria das vezes. -A automação do navegador tem a reputação de ser "instável", -mas, na realidade, é porque os usuários freqüentemente exigem muito dele. -Em capítulos posteriores, retornaremos às técnicas que você pode usar -para mitigar problemas aparentemente intermitentes nos testes, -em particular sobre como [superar as condições de corrida]({{< ref "waits.md" >}}) -entre o navegador e o WebDriver. - -Mantendo seus testes curtos -e usando o navegador da web apenas quando você não tiver absolutamente nenhuma alternativa, -você pode ter muitos testes com instabilidade mínima. - -Uma vantagem distinta dos testes do Selenium -é sua capacidade inerente de testar todos os componentes do aplicativo, -de back-end para front-end, da perspectiva do usuário. -Em outras palavras, embora os testes funcionais possam ser caros para executar, -eles também abrangem grandes partes críticas para os negócios de uma só vez. - - -### Requerimentos de teste - -Como mencionado antes, os testes do Selenium podem ser caros para serem executados. -Até que ponto depende do navegador em que você está executando os testes, -mas historicamente o comportamento dos navegadores tem variado tanto que muitas vezes -foi uma meta declarada testar cruzado contra vários navegadores. - -Selenium permite que você execute as mesmas instruções em vários navegadores -em vários sistemas operacionais, -mas a enumeração de todos os navegadores possíveis, -suas diferentes versões e os muitos sistemas operacionais em que são executados -rapidamente se tornará uma tarefa não trivial. - - -### Vamos começar com um exemplo - -Larry escreveu um site que permite aos usuários solicitarem seus -unicórnios personalizados. - -O fluxo de trabalho geral (o que chamaremos de "caminho feliz") é algo -como isso: - -* Criar uma conta -* Configurar o unicórnio -* Adicionar ao carrinho de compras -* Verificar e pagar -* Dar feedback sobre o unicórnio - - -Seria tentador escrever um grande roteiro do Selenium -para realizar todas essas operações - muitos tentarão. -**Resista à tentação!** -Isso resultará em um teste que -a) leva muito tempo, -b) estará sujeito a alguns problemas comuns em torno de problemas de tempo de renderização de página, e -c) se falhar, -não lhe dará um método conciso e “superficial” para diagnosticar o que deu errado. - -A estratégia preferida para testar este cenário seria -dividi-lo em uma série de testes independentes e rápidos, -cada um dos quais tem uma “razão” de existir. - -Vamos fingir que você deseja testar a segunda etapa: -Configure o unicórnio. -Ele executará as seguintes ações: - -* Criar uma conta -* Configurar o unicórnio - -Observe que estamos pulando o restante dessas etapas, -vamos testar o resto do fluxo de trabalho em outros casos de teste pequenos e discretos -depois de terminarmos com este. - -Para começar, você precisa criar uma conta. -Aqui você tem algumas escolhas a fazer: - -* Deseja usar uma conta existente? -* Você deseja criar uma nova conta? -* Existem propriedades especiais de tal usuário que precisam ser - levadas em consideração antes do início da configuração? - -Independentemente de como você responde a esta pergunta, -a solução é torná-la parte da etapa de "configurar os dados" do teste. -Se Larry expôs uma API que permite a você (ou qualquer pessoa) -criar e atualizar contas de usuário, -certifique-se de usar isso para responder a esta pergunta. -Se possível, você deseja iniciar o navegador somente depois de ter um usuário "em mãos", -cujas credenciais você pode usar para fazer login. - -Se cada teste para cada fluxo de trabalho começar com a criação de uma conta de usuário, -muitos segundos serão adicionados à execução de cada teste. -Chamar uma API e falar com um banco de dados são operações rápidas, -"sem cabeçalho" que não requerem o processo caro de -abrir um navegador, navegar para as páginas certas, -clicando e aguardando o envio dos formulários, etc. - -Idealmente, você pode abordar esta fase de configuração em uma linha de código, -que será executado antes que qualquer navegador seja iniciado: - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -// Crie um usuário que tenha permissões somente leitura - eles podem configurar um unicórnio, -// mas eles não têm informações de pagamento configuradas, nem têm -// privilégios administrativos. No momento em que o usuário é criado, seu endereço -// de e-mail e senha são gerados aleatoriamente - você nem precisa -// conhecê-los. -User user = UserFactory.createCommonUser(); //Este método está definido em algum outro lugar. - -// Faça login como este usuário. -// O login neste site leva você à sua página pessoal "Minha conta", e então -// o objeto AccountPage é retornado pelo método loginAs, permitindo que você -// execute ações da AccountPage. -AccountPage accountPage = loginAs(user.getEmail(), user.getPassword()); - {{< /tab >}} - {{< tab header="Python" >}} -# Crie um usuário que tenha permissões somente leitura - eles podem configurar um unicórnio, -# mas eles não têm informações de pagamento configuradas, nem têm -# privilégios administrativos. No momento em que o usuário é criado, seu endereço -# de e-mail e senha são gerados aleatoriamente - você nem precisa -# conhecê-los. -user = user_factory.create_common_user() #This method is defined elsewhere. - -# Faça login como este usuário. -# O login neste site leva você à sua página pessoal "Minha conta", e então -# o objeto AccountPage é retornado pelo método loginAs, permitindo que você -# execute ações da AccountPage. -account_page = login_as(user.get_email(), user.get_password()) - {{< /tab >}} - {{< tab header="CSharp" >}} -// Crie um usuário que tenha permissões somente leitura - eles podem configurar um unicórnio, -// mas eles não têm informações de pagamento configuradas, nem têm -// privilégios administrativos. No momento em que o usuário é criado, seu endereço -// de e-mail e senha são gerados aleatoriamente - você nem precisa -// conhecê-los. -User user = UserFactory.CreateCommonUser(); //This method is defined elsewhere. - -// Faça login como este usuário. -// O login neste site leva você à sua página pessoal "Minha conta", e então -// o objeto AccountPage é retornado pelo método loginAs, permitindo que você -// execute ações da AccountPage. -AccountPage accountPage = LoginAs(user.Email, user.Password); - {{< /tab >}} - {{< tab header="Ruby" >}} -# Crie um usuário que tenha permissões somente leitura - eles podem configurar um unicórnio, -# mas eles não têm informações de pagamento configuradas, nem têm -# privilégios administrativos. No momento em que o usuário é criado, seu endereço -# de e-mail e senha são gerados aleatoriamente - você nem precisa -# conhecê-los. -user = UserFactory.create_common_user #This method is defined elsewhere. - -# Faça login como este usuário. -# O login neste site leva você à sua página pessoal "Minha conta", e então -# o objeto AccountPage é retornado pelo método loginAs, permitindo que você -# execute ações da AccountPage. -account_page = login_as(user.email, user.password) - {{< /tab >}} - {{< tab header="JavaScript" >}} -// Crie um usuário que tenha permissões somente leitura - eles podem configurar um unicórnio, -// mas eles não têm informações de pagamento configuradas, nem têm -// privilégios administrativos. No momento em que o usuário é criado, seu endereço -// de e-mail e senha são gerados aleatoriamente - você nem precisa -// conhecê-los. -var user = userFactory.createCommonUser(); //This method is defined elsewhere. - -// Faça login como este usuário. -// O login neste site leva você à sua página pessoal "Minha conta", e então -// o objeto AccountPage é retornado pelo método loginAs, permitindo que você -// execute ações da AccountPage. -var accountPage = loginAs(user.email, user.password); - {{< /tab >}} - {{< tab header="Kotlin" >}} -// Crie um usuário que tenha permissões somente leitura - eles podem configurar um unicórnio, -// mas eles não têm informações de pagamento configuradas, nem têm -// privilégios administrativos. No momento em que o usuário é criado, seu endereço -// de e-mail e senha são gerados aleatoriamente - você nem precisa -// conhecê-los. -val user = UserFactory.createCommonUser() //This method is defined elsewhere. - -// Faça login como este usuário. -// O login neste site leva você à sua página pessoal "Minha conta", e então -// o objeto AccountPage é retornado pelo método loginAs, permitindo que você -// execute ações da AccountPage. -val accountPage = loginAs(user.getEmail(), user.getPassword()) - {{< /tab >}} -{{< /tabpane >}} - -Como você pode imaginar, a `UserFactory` pode ser estendida -para fornecer métodos como `createAdminUser ()` e `createUserWithPayment ()`. -A questão é que essas duas linhas de código não o distraem do objetivo final deste teste: -configurando um unicórnio. - -Os detalhes do [modelo de objeto de página]({{< relref "page_object_models.md" >}}) -será discutido em capítulos posteriores, mas vamos apresentar o conceito aqui: - -Seus testes devem ser compostos de ações, -realizadas do ponto de vista do usuário, -dentro do contexto das páginas do site. -Essas páginas são armazenadas como objetos, -que conterão informações específicas sobre como a página da web é composta -e como as ações são realizadas - -muito pouco disso deve preocupar você como testador. - -Que tipo de unicórnio você quer? -Você pode querer rosa, mas não necessariamente. -Roxo tem sido bastante popular ultimamente. -Ela precisa de óculos escuros? Tatuagens de estrelas? -Essas escolhas, embora difíceis, são sua principal preocupação como testador - -você precisa garantir que seu centro de atendimento de pedidos -envia o unicórnio certo para a pessoa certa, -e isso começa com essas escolhas. - -Observe que em nenhum lugar desse parágrafo falamos sobre botões, -campos, menus suspensos, botões de opção ou formulários da web. -**Nem deveriam seus testes!** -Você deseja escrever seu código como o usuário tentando resolver seu problema. -Aqui está uma maneira de fazer isso (continuando do exemplo anterior): - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -// O Unicórnio é um objeto de nível superior - ele possui atributos, que são definidos aqui. -// Isso armazena apenas os valores; não preenche formulários da web nem interage -// com o navegador de qualquer forma. -Unicorn sparkles = new Unicorn("Sparkles", UnicornColors.PURPLE, UnicornAccessories.SUNGLASSES, UnicornAdornments.STAR_TATTOOS); - -// Uma vez que já estamos "na" página da conta, temos que usá-la para chegar ao -// lugar real onde você configura os unicórnios. Chamar o método "Add Unicorn" -// nos leva lá. -AddUnicornPage addUnicornPage = accountPage.addUnicorn(); - -// Agora que estamos na AddUnicornPage, passaremos o objeto "sparkles" para -// o método createUnicorn(). Este método pegará os atributos do Sparkles, -// preencher o formulário e clicar em enviar. -UnicornConfirmationPage unicornConfirmationPage = addUnicornPage.createUnicorn(sparkles); - {{< /tab >}} - {{< tab header="Python" >}} -# O Unicórnio é um objeto de nível superior - ele possui atributos, que são definidos aqui. -# Isso armazena apenas os valores; não preenche formulários da web nem interage -# com o navegador de qualquer forma. -sparkles = Unicorn("Sparkles", UnicornColors.PURPLE, UnicornAccessories.SUNGLASSES, UnicornAdornments.STAR_TATTOOS) - -# Uma vez que já estamos "na" página da conta, temos que usá-la para chegar ao -# lugar real onde você configura os unicórnios. Chamar o método "Add Unicorn" -# nos leva lá. -add_unicorn_page = account_page.add_unicorn() - -# Agora que estamos na AddUnicornPage, passaremos o objeto "sparkles" para -# o método createUnicorn(). Este método pegará os atributos do Sparkles, -# preencher o formulário e clicar em enviar. -unicorn_confirmation_page = add_unicorn_page.create_unicorn(sparkles) - {{< /tab >}} - {{< tab header="CSharp" >}} -// O Unicórnio é um objeto de nível superior - ele possui atributos, que são definidos aqui. -// Isso armazena apenas os valores; não preenche formulários da web nem interage -// com o navegador de qualquer forma. -Unicorn sparkles = new Unicorn("Sparkles", UnicornColors.Purple, UnicornAccessories.Sunglasses, UnicornAdornments.StarTattoos); - -// Uma vez que já estamos "na" página da conta, temos que usá-la para chegar ao -// lugar real onde você configura os unicórnios. Chamar o método "Add Unicorn" -// nos leva lá. -AddUnicornPage addUnicornPage = accountPage.AddUnicorn(); - -// Agora que estamos na AddUnicornPage, passaremos o objeto "sparkles" para -// o método createUnicorn(). Este método pegará os atributos do Sparkles, -// preencher o formulário e clicar em enviar. -UnicornConfirmationPage unicornConfirmationPage = addUnicornPage.CreateUnicorn(sparkles); - {{< /tab >}} - {{< tab header="Ruby" >}} -# O Unicórnio é um objeto de nível superior - ele possui atributos, que são definidos aqui. -# Isso armazena apenas os valores; não preenche formulários da web nem interage -# com o navegador de qualquer forma. -sparkles = Unicorn.new('Sparkles', UnicornColors.PURPLE, UnicornAccessories.SUNGLASSES, UnicornAdornments.STAR_TATTOOS) - -# Uma vez que já estamos "na" página da conta, temos que usá-la para chegar ao -# lugar real onde você configura os unicórnios. Chamar o método "Add Unicorn" -# nos leva lá. -add_unicorn_page = account_page.add_unicorn - -# Agora que estamos na AddUnicornPage, passaremos o objeto "sparkles" para -# o método createUnicorn(). Este método pegará os atributos do Sparkles, -# preencher o formulário e clicar em enviar. -unicorn_confirmation_page = add_unicorn_page.create_unicorn(sparkles) - {{< /tab >}} - {{< tab header="JavaScript" >}} -// O Unicórnio é um objeto de nível superior - ele possui atributos, que são definidos aqui. -// Isso armazena apenas os valores; não preenche formulários da web nem interage -// com o navegador de qualquer forma. -var sparkles = new Unicorn("Sparkles", UnicornColors.PURPLE, UnicornAccessories.SUNGLASSES, UnicornAdornments.STAR_TATTOOS); - -// Uma vez que já estamos "na" página da conta, temos que usá-la para chegar ao -// lugar real onde você configura os unicórnios. Chamar o método "Add Unicorn" -// nos leva lá. -var addUnicornPage = accountPage.addUnicorn(); - -// Agora que estamos na AddUnicornPage, passaremos o objeto "sparkles" para -// o método createUnicorn(). Este método pegará os atributos do Sparkles, -// preencher o formulário e clicar em enviar. -var unicornConfirmationPage = addUnicornPage.createUnicorn(sparkles); - - {{< /tab >}} - {{< tab header="Kotlin" >}} -// O Unicórnio é um objeto de nível superior - ele possui atributos, que são definidos aqui. -// Isso armazena apenas os valores; não preenche formulários da web nem interage -// com o navegador de qualquer forma. -val sparkles = Unicorn("Sparkles", UnicornColors.PURPLE, UnicornAccessories.SUNGLASSES, UnicornAdornments.STAR_TATTOOS) - -// Uma vez que já estamos "na" página da conta, temos que usá-la para chegar ao -// lugar real onde você configura os unicórnios. Chamar o método "Add Unicorn" -// nos leva lá. -val addUnicornPage = accountPage.addUnicorn() - -// Agora que estamos na AddUnicornPage, passaremos o objeto "sparkles" para -// o método createUnicorn(). Este método pegará os atributos do Sparkles, -// preencher o formulário e clicar em enviar. -unicornConfirmationPage = addUnicornPage.createUnicorn(sparkles) - - {{< /tab >}} -{{< /tabpane >}} - -Agora que você configurou seu unicórnio, -você precisa passar para a etapa 3: certifique-se de que realmente funcionou. - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -// O método exists() de UnicornConfirmationPage pegará o objeto -// Sparkles - uma especificação dos atributos que você deseja ver e compará-los -// com os campos na página -Assert.assertTrue("Sparkles should have been created, with all attributes intact", unicornConfirmationPage.exists(sparkles)); - {{< /tab >}} - {{< tab header="Python" >}} -# O método exists() de UnicornConfirmationPage pegará o objeto -# Sparkles - uma especificação dos atributos que você deseja ver e compará-los -# com os campos na página -assert unicorn_confirmation_page.exists(sparkles), "Sparkles should have been created, with all attributes intact" - {{< /tab >}} - {{< tab header="CSharp" >}} -// O método exists() de UnicornConfirmationPage pegará o objeto -// Sparkles - uma especificação dos atributos que você deseja ver e compará-los -// com os campos na página -Assert.True(unicornConfirmationPage.Exists(sparkles), "Sparkles should have been created, with all attributes intact"); - {{< /tab >}} - {{< tab header="Ruby" >}} -# O método exists() de UnicornConfirmationPage pegará o objeto -# Sparkles - uma especificação dos atributos que você deseja ver e compará-los -# com os campos na página -expect(unicorn_confirmation_page.exists?(sparkles)).to be, 'Sparkles should have been created, with all attributes intact' - {{< /tab >}} - {{< tab header="JavaScript" >}} -// O método exists() de UnicornConfirmationPage pegará o objeto -// Sparkles - uma especificação dos atributos que você deseja ver e compará-los -// com os campos na página -assert(unicornConfirmationPage.exists(sparkles), "Sparkles should have been created, with all attributes intact"); - - {{< /tab >}} - {{< tab header="Kotlin" >}} -// O método exists() de UnicornConfirmationPage pegará o objeto -// Sparkles - uma especificação dos atributos que você deseja ver e compará-los -// com os campos na página -assertTrue("Sparkles should have been created, with all attributes intact", unicornConfirmationPage.exists(sparkles)) - {{< /tab >}} -{{< /tabpane >}} - -Observe que o testador ainda não fez nada além de falar sobre unicórnios neste código– -sem botões, sem localizadores, sem controles do navegador. -Este método de _modelagem_ do aplicativo -permite que você mantenha esses comandos de nível de teste no lugar e imutáveis, -mesmo se Larry decidir na próxima semana que não gosta mais de Ruby-on-Rails -e decidir reimplementar todo o site -em Haskell com um front-end Fortran. - -Seus objetos de página exigirão alguma pequena manutenção para -estar conformidade com o redesenho do site, -mas esses testes permanecerão os mesmos. -Pegando esse design básico, -você desejará continuar seus fluxos de trabalho com o menor número possível de etapas voltadas para o navegador. -Seu próximo fluxo de trabalho envolverá adicionar um unicórnio ao carrinho de compras. -Provavelmente, você desejará muitas iterações deste teste para ter certeza de que o carrinho está mantendo o estado adequado: -Existe mais de um unicórnio no carrinho antes de você começar? -Quantos cabem no carrinho de compras? -Se você criar mais de um com o mesmo nome e / ou recursos, ele falhará? -Manterá apenas o existente ou acrescentará outro? - -Cada vez que você passa pelo fluxo de trabalho, -você deseja evitar ter que criar uma conta, -fazer login como o usuário e configurar o unicórnio. -Idealmente, você será capaz de criar uma conta -e pré-configurar um unicórnio por meio da API ou banco de dados. -Em seguida, tudo que você precisa fazer é fazer login como o usuário, localizar Sparkles, -e adicioná-lo ao carrinho. - - -### Automatizar ou não automatizar? - -A automação é sempre vantajosa? Quando se deve decidir automatizar os casos de teste? - -Nem sempre é vantajoso automatizar casos de teste. Tem vezes que -o teste manual pode ser mais apropriado. -Por exemplo, se a interface do aplicativo mudará consideravelmente em um futuro próximo, -então qualquer automação pode precisar ser reescrita de qualquer maneira. -Além disso, às vezes simplesmente não há tempo suficiente para construir automação de testes. -A curto prazo, o teste manual pode ser mais eficaz. -Se um aplicativo tem um prazo muito curto, atualmente não há -automação de teste disponível, e é imperativo que o teste seja feito dentro -nesse período, o teste manual é a melhor solução. diff --git a/website_and_docs/content/documentation/test_practices/overview.zh-cn.md b/website_and_docs/content/documentation/test_practices/overview.zh-cn.md deleted file mode 100644 index 0be347024e03..000000000000 --- a/website_and_docs/content/documentation/test_practices/overview.zh-cn.md +++ /dev/null @@ -1,378 +0,0 @@ ---- -title: "测试自动化概述" -linkTitle: "概述" -weight: 1 -aliases: [ -"/documentation/guidelines/on_test_automation/" -] ---- - - -首先,问问自己是否真的需要使用浏览器。 -在某些情况下,如果您正在开发一个复杂的 web 应用程序, -您需要打开一个浏览器并进行实际测试,这种可能性是很大的。 - -然而,诸如 Selenium 之类的功能性最终用户测试运行起来很昂贵。 -此外,它们通常需要大量的基础设施才能有效运行。 -经常问问自己,您想要测试的东西是否可以使用更轻量级的测试方法(如单元测试)完成, -还是使用较低级的方法完成,这是一个很好的规则。 - -一旦确定您正在进行Web浏览器测试业务, -并且您的 Selenium 环境已经准备好开始编写测试, -您通常会执行以下三个步骤的组合: - -* 设置数据 -* 执行一组离散的操作 -* 评估结果 - -您需要尽可能缩短这些步骤; -一到两个操作在大多数时间内应该足够了。 -浏览器自动化具有“脆弱”的美誉, -但实际上那是因为用户经常对它要求过高。 -在后面的章节中,我们将回到您可以使用的技术, -为了缓解测试中明显的间歇性问题, -特别是如何克服 浏览器 和 WebDriver 之间的[竞争条件]({{< ref "waits.md" >}})。 - -通过保持测试简短并仅在您完全没有替代方案时使用Web浏览器,您可以用最小的代码片段来完成很多测试。 - -Selenium测试的一个显著优势是,它能够从用户的角度测试应用程序的所有组件(从后端到前端)。 -因此,换句话说,虽然功能测试运行起来可能很昂贵,但它们同时也包含了大量关键业务部分。 - -### 测试要求 - -如前所述,Selenium 测试运行起来可能很昂贵。 -在多大程度上取决于您正在运行测试的浏览器, -但历史上浏览器的行为变化太大,以至于通常是针对多个浏览器进行交叉测试的既定目标。 - -Selenium 允许您在多个操作系统上的多个浏览器上运行相同的指令, -但是对所有可能的浏览器、它们的不同版本以及它们所运行的许多操作系统的枚举将很快成为一项繁重的工作。 - -### 让我们从一个例子开始 - -Larry 写了一个网站,允许用户订购他们自己定制的独角兽。 - -一般的工作流程(我们称之为“幸福之路”)是这样的: - -* 创建一个账户 -* 配置他们的独角兽 -* 添加到购物车 -* 检验并付款 -* 给出关于他们独角兽的反馈 - -编写一个宏大的 Selenium 脚本来执行所有这些操作是很诱人的 — 很多人都会尝试这样做。 -**抵制诱惑!** -这样做会导致测试: -a) 需要很长时间; -b) 会受到一些与页面呈现时间问题有关的常见问题的影响; -c) 如果失败,它不会给出一个简洁的、“可检查”的方法来诊断出了什么问题。 - -测试此场景的首选策略是将其分解为一系列独立的、快速的测试,每个测试都有一个存在的“理由”。 - -假设您想测试第二步: -配置您的独角兽。 -它将执行以下操作: - -* 创建一个帐户 -* 配置一个独角兽 - -请注意,我们跳过了这些步骤的其余部分, -在完成这一步之后,我们将在其他小的、离散的测试用例中测试工作流的其余部分。 - -首先,您需要创建一个帐户。在这里您可以做出一些选择: - -* 您想使用现有帐户吗? -* 您想创建一个新帐户吗? -* 在配置开始之前,是否需要考虑有任何特殊属性的用户需要吗? - -不管您如何回答这个问题, -解决方案是让它成为测试中“设置数据”部分的一部分 - 如果 Larry 公开了一个 API, -使您(或任何人)能够创建和更新用户帐户, -一定要用它来回答这个问题 -请确保使用这个 API 来回答这个问题 — 如果可能的话, -您希望只有在您拥有一个用户之后才启动浏览器,您可以使用该用户的凭证进行登录。 - -如果每个工作流的每个测试都是从创建用户帐户开始的,那么每个测试的执行都会增加许多秒。 -调用 API 并与数据库进行通信是快速、“无头”的操作, -不需要打开浏览器、导航到正确页面、点击并等待表单提交等昂贵的过程。 - -理想情况下,您可以在一行代码中处理这个设置阶段,这些代码将在任何浏览器启动之前执行: - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -// Create a user who has read-only permissions--they can configure a unicorn, -// but they do not have payment information set up, nor do they have -// administrative privileges. At the time the user is created, its email -// address and password are randomly generated--you don't even need to -// know them. -User user = UserFactory.createCommonUser(); //This method is defined elsewhere. - -// Log in as this user. -// Logging in on this site takes you to your personal "My Account" page, so the -// AccountPage object is returned by the loginAs method, allowing you to then -// perform actions from the AccountPage. -AccountPage accountPage = loginAs(user.getEmail(), user.getPassword()); - {{< /tab >}} - {{< tab header="Python" >}} -# Create a user who has read-only permissions--they can configure a unicorn, -# but they do not have payment information set up, nor do they have -# administrative privileges. At the time the user is created, its email -# address and password are randomly generated--you don't even need to -# know them. -user = user_factory.create_common_user() #This method is defined elsewhere. - -# Log in as this user. -# Logging in on this site takes you to your personal "My Account" page, so the -# AccountPage object is returned by the loginAs method, allowing you to then -# perform actions from the AccountPage. -account_page = login_as(user.get_email(), user.get_password()) - {{< /tab >}} - {{< tab header="CSharp" >}} -// Create a user who has read-only permissions--they can configure a unicorn, -// but they do not have payment information set up, nor do they have -// administrative privileges. At the time the user is created, its email -// address and password are randomly generated--you don't even need to -// know them. -User user = UserFactory.CreateCommonUser(); //This method is defined elsewhere. - -// Log in as this user. -// Logging in on this site takes you to your personal "My Account" page, so the -// AccountPage object is returned by the loginAs method, allowing you to then -// perform actions from the AccountPage. -AccountPage accountPage = LoginAs(user.Email, user.Password); - {{< /tab >}} - {{< tab header="Ruby" >}} -# Create a user who has read-only permissions--they can configure a unicorn, -# but they do not have payment information set up, nor do they have -# administrative privileges. At the time the user is created, its email -# address and password are randomly generated--you don't even need to -# know them. -user = UserFactory.create_common_user #This method is defined elsewhere. - -# Log in as this user. -# Logging in on this site takes you to your personal "My Account" page, so the -# AccountPage object is returned by the loginAs method, allowing you to then -# perform actions from the AccountPage. -account_page = login_as(user.email, user.password) - {{< /tab >}} - {{< tab header="JavaScript" >}} -// Create a user who has read-only permissions--they can configure a unicorn, -// but they do not have payment information set up, nor do they have -// administrative privileges. At the time the user is created, its email -// address and password are randomly generated--you don't even need to -// know them. -var user = userFactory.createCommonUser(); //This method is defined elsewhere. - -// Log in as this user. -// Logging in on this site takes you to your personal "My Account" page, so the -// AccountPage object is returned by the loginAs method, allowing you to then -// perform actions from the AccountPage. -var accountPage = loginAs(user.email, user.password); - {{< /tab >}} - {{< tab header="Kotlin" >}} -// Create a user who has read-only permissions--they can configure a unicorn, -// but they do not have payment information set up, nor do they have -// administrative privileges. At the time the user is created, its email -// address and password are randomly generated--you don't even need to -// know them. -val user = UserFactory.createCommonUser() //This method is defined elsewhere. - -// Log in as this user. -// Logging in on this site takes you to your personal "My Account" page, so the -// AccountPage object is returned by the loginAs method, allowing you to then -// perform actions from the AccountPage. -val accountPage = loginAs(user.getEmail(), user.getPassword()) - {{< /tab >}} -{{< /tabpane >}} - -您可以想象,`UserFactory`可以扩展为提供诸如`createAdminUser()`、`createUserWithPayment()`的方法。 -关键是,这两行代码不会分散您对此测试的最终目的的注意力: -配置独角兽。 - -[页面对象模型]({{< ref "page_object_models.md" >}}) -的复杂性将在后面的章节中讨论,但我们将在这里介绍这个概念: - -您的测试应该由操作组成,从用户的角度出发,在站点的页面上下文中执行。 -这些页面被存储为对象, -其中包含关于 web 页面如何组成以及如何执行操作的特定信息 — 作为测试人员,您应该很少关注这些信息。 - -您想要什么样的独角兽? -您可能想要粉红色,但不一定。 -紫色最近很流行。 -她需要太阳镜吗? -明星纹身? -这些选择虽然困难,但是作为测试人员, -您的主要关注点是 — 您需要确保您的订单履行中心将正确的独角兽发送给正确的人,而这就要从这些选择开始。 - -请注意,我们在该段落中没有讨论按钮,字段,下拉菜单,单选按钮或 Web 表单。 -**您的测试也不应该!** -您希望像尝试解决问题的用户一样编写代码。 -这是一种方法(从前面的例子继续): - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -// The Unicorn is a top-level Object--it has attributes, which are set here. -// This only stores the values; it does not fill out any web forms or interact -// with the browser in any way. -Unicorn sparkles = new Unicorn("Sparkles", UnicornColors.PURPLE, UnicornAccessories.SUNGLASSES, UnicornAdornments.STAR_TATTOOS); - -// Since we're already "on" the account page, we have to use it to get to the -// actual place where you configure unicorns. Calling the "Add Unicorn" method -// takes us there. -AddUnicornPage addUnicornPage = accountPage.addUnicorn(); - -// Now that we're on the AddUnicornPage, we will pass the "sparkles" object to -// its createUnicorn() method. This method will take Sparkles' attributes, -// fill out the form, and click submit. -UnicornConfirmationPage unicornConfirmationPage = addUnicornPage.createUnicorn(sparkles); - {{< /tab >}} - {{< tab header="Python" >}} -# The Unicorn is a top-level Object--it has attributes, which are set here. -# This only stores the values; it does not fill out any web forms or interact -# with the browser in any way. -sparkles = Unicorn("Sparkles", UnicornColors.PURPLE, UnicornAccessories.SUNGLASSES, UnicornAdornments.STAR_TATTOOS) - -# Since we're already "on" the account page, we have to use it to get to the -# actual place where you configure unicorns. Calling the "Add Unicorn" method -# takes us there. -add_unicorn_page = account_page.add_unicorn() - -# Now that we're on the AddUnicornPage, we will pass the "sparkles" object to -# its createUnicorn() method. This method will take Sparkles' attributes, -# fill out the form, and click submit. -unicorn_confirmation_page = add_unicorn_page.create_unicorn(sparkles) - {{< /tab >}} - {{< tab header="CSharp" >}} -// The Unicorn is a top-level Object--it has attributes, which are set here. -// This only stores the values; it does not fill out any web forms or interact -// with the browser in any way. -Unicorn sparkles = new Unicorn("Sparkles", UnicornColors.Purple, UnicornAccessories.Sunglasses, UnicornAdornments.StarTattoos); - -// Since we are already "on" the account page, we have to use it to get to the -// actual place where you configure unicorns. Calling the "Add Unicorn" method -// takes us there. -AddUnicornPage addUnicornPage = accountPage.AddUnicorn(); - -// Now that we're on the AddUnicornPage, we will pass the "sparkles" object to -// its createUnicorn() method. This method will take Sparkles' attributes, -// fill out the form, and click submit. -UnicornConfirmationPage unicornConfirmationPage = addUnicornPage.CreateUnicorn(sparkles); - {{< /tab >}} - {{< tab header="Ruby" >}} -# The Unicorn is a top-level Object--it has attributes, which are set here. -# This only stores the values; it does not fill out any web forms or interact -# with the browser in any way. -sparkles = Unicorn.new('Sparkles', UnicornColors.PURPLE, UnicornAccessories.SUNGLASSES, UnicornAdornments.STAR_TATTOOS) - -# Since we're already "on" the account page, we have to use it to get to the -# actual place where you configure unicorns. Calling the "Add Unicorn" method -# takes us there. -add_unicorn_page = account_page.add_unicorn - -# Now that we're on the AddUnicornPage, we will pass the "sparkles" object to -# its createUnicorn() method. This method will take Sparkles' attributes, -# fill out the form, and click submit. -unicorn_confirmation_page = add_unicorn_page.create_unicorn(sparkles) - {{< /tab >}} - {{< tab header="JavaScript" >}} -// The Unicorn is a top-level Object--it has attributes, which are set here. -// This only stores the values; it does not fill out any web forms or interact -// with the browser in any way. -var sparkles = new Unicorn("Sparkles", UnicornColors.PURPLE, UnicornAccessories.SUNGLASSES, UnicornAdornments.STAR_TATTOOS); - -// Since we are already "on" the account page, we have to use it to get to the -// actual place where you configure unicorns. Calling the "Add Unicorn" method -// takes us there. - -var addUnicornPage = accountPage.addUnicorn(); - -// Now that we're on the AddUnicornPage, we will pass the "sparkles" object to -// its createUnicorn() method. This method will take Sparkles' attributes, -// fill out the form, and click submit. -var unicornConfirmationPage = addUnicornPage.createUnicorn(sparkles); - - {{< /tab >}} - {{< tab header="Kotlin" >}} -// The Unicorn is a top-level Object--it has attributes, which are set here. -// This only stores the values; it does not fill out any web forms or interact -// with the browser in any way. -val sparkles = Unicorn("Sparkles", UnicornColors.PURPLE, UnicornAccessories.SUNGLASSES, UnicornAdornments.STAR_TATTOOS) - -// Since we are already "on" the account page, we have to use it to get to the -// actual place where you configure unicorns. Calling the "Add Unicorn" method -// takes us there. -val addUnicornPage = accountPage.addUnicorn() - -// Now that we're on the AddUnicornPage, we will pass the "sparkles" object to -// its createUnicorn() method. This method will take Sparkles' attributes, -// fill out the form, and click submit. -unicornConfirmationPage = addUnicornPage.createUnicorn(sparkles) - - {{< /tab >}} -{{< /tabpane >}} - -既然您已经配置好了独角兽, -您需要进入第三步:确保它确实有效。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -// The exists() method from UnicornConfirmationPage will take the Sparkles -// object--a specification of the attributes you want to see, and compare -// them with the fields on the page. -Assert.assertTrue("Sparkles should have been created, with all attributes intact", unicornConfirmationPage.exists(sparkles)); - {{< /tab >}} - {{< tab header="Python" >}} -# The exists() method from UnicornConfirmationPage will take the Sparkles -# object--a specification of the attributes you want to see, and compare -# them with the fields on the page. -assert unicorn_confirmation_page.exists(sparkles), "Sparkles should have been created, with all attributes intact" - {{< /tab >}} - {{< tab header="CSharp" >}} -// The exists() method from UnicornConfirmationPage will take the Sparkles -// object--a specification of the attributes you want to see, and compare -// them with the fields on the page. -Assert.True(unicornConfirmationPage.Exists(sparkles), "Sparkles should have been created, with all attributes intact"); - {{< /tab >}} - {{< tab header="Ruby" >}} -# The exists() method from UnicornConfirmationPage will take the Sparkles -# object--a specification of the attributes you want to see, and compare -# them with the fields on the page. -expect(unicorn_confirmation_page.exists?(sparkles)).to be, 'Sparkles should have been created, with all attributes intact' - {{< /tab >}} - {{< tab header="JavaScript" >}} -// The exists() method from UnicornConfirmationPage will take the Sparkles -// object--a specification of the attributes you want to see, and compare -// them with the fields on the page. -assert(unicornConfirmationPage.exists(sparkles), "Sparkles should have been created, with all attributes intact"); - - {{< /tab >}} - {{< tab header="Kotlin" >}} -// The exists() method from UnicornConfirmationPage will take the Sparkles -// object--a specification of the attributes you want to see, and compare -// them with the fields on the page. -assertTrue("Sparkles should have been created, with all attributes intact", unicornConfirmationPage.exists(sparkles)) - {{< /tab >}} -{{< /tabpane >}} - -请注意,测试人员在这段代码中除了谈论独角兽之外还没有做任何事情 — 没有按钮、定位器和浏览器控件。 -这种对应用程序建模的方法允许您保持这些测试级别的命令不变, -即使 Larry 下周决定不再喜欢 Ruby-on-Rails, -并决定用最新的带有 Fortran 前端的 Haskell 绑定重新实现整个站点。 - -为了符合站点的重新设计,您的页面对象需要进行一些小的维护,但是这些测试将保持不变。 -采用这一基本设计,您将希望继续使用尽可能少的面向浏览器的步骤来完成您的工作流。 -您的下一个工作流程将包括在购物车中添加独角兽。 -您可能需要多次迭代此测试,以确保购物车正确地保持其状态: -在开始之前,购物车中是否有多个独角兽? -购物车能装多少? -如果您创建多个具有相同名称或特性,它会崩溃吗? -它将只保留现有的一个还是添加另一个? - -每次通过工作流时,您都希望尽量避免创建帐户、以用户身份登录和配置独角兽。 -理想情况下,您将能够创建一个帐户,并通过 API 或数据库预先配置独角兽。 -然后,您只需作为用户登录,找到 Sparkles,并将它添加到购物车中。 - -### 是否自动化? - -自动化总是有优势吗? 什么时候应该决定去自动化测试用例? - -自动化测试用例并不总是有利的. 有时候手动测试可能更合适. 例如,如果应用程序的用户界面,在不久的将来会发生很大变化,那么任何自动化都可能需要重写. 此外,有时根本没有足够的时间来构建自动化测试. 从短期来看,手动测试可能更有效. 如果应用程序的截止日期非常紧迫,当前没有可用的自动化测试,并且必须在特定时间范围内完成,那么手动测试是最好的解决方案. diff --git a/website_and_docs/content/documentation/test_practices/testing_types.en.md b/website_and_docs/content/documentation/test_practices/testing_types.en.md index efc7692a11a1..0ee94f40cb31 100644 --- a/website_and_docs/content/documentation/test_practices/testing_types.en.md +++ b/website_and_docs/content/documentation/test_practices/testing_types.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/guidelines/types_of_testing/", "/documentation/ja/introduction/types_of_testing/", "/documentation/pt-br/introduction/types_of_testing/", -"/documentation/zh-cn/introduction/types_of_testing/" +"/documentation/zh-cn/introduction/types_of_testing/", +"/ja/documentation/guidelines/types_of_testing/", +"/ja/documentation/test_practices/testing_types/", +"/pt-br/documentation/guidelines/types_of_testing/", +"/pt-br/documentation/test_practices/testing_types/", +"/zh-cn/documentation/guidelines/types_of_testing/", +"/zh-cn/documentation/test_practices/testing_types/" ] --- diff --git a/website_and_docs/content/documentation/test_practices/testing_types.ja.md b/website_and_docs/content/documentation/test_practices/testing_types.ja.md deleted file mode 100644 index cd84fb3c584c..000000000000 --- a/website_and_docs/content/documentation/test_practices/testing_types.ja.md +++ /dev/null @@ -1,97 +0,0 @@ ---- -title: "テストの種類" -linkTitle: "テストの種類" -weight: 2 -aliases: [ -"/documentation/guidelines/types_of_testing/" -] ---- - -### 受け入れテスト -このタイプのテストは、機能またはシステムが顧客の期待と要件を満たしているかどうかを判断するために行われます。 -このタイプのテストには通常、顧客の協力またはフィードバックが関与します。 -下記質問に答えることで確認することができます。 -> **_正しい_** 製品を作っていますか? - -Webアプリケーションの場合、ユーザーの予想される動作をシミュレートすることで、 -このテストの自動化をSeleniumで直接実行できます。 -このシミュレーションは、このドキュメントで説明されているように、記録/再生によって、 -またはサポートされているさまざまな言語によって実行できます。 -注:受け入れテストは **_機能テスト_** のサブタイプであり、一部の人はこれにも言及する場合があります。 - -### 機能テスト -このタイプのテストは、機能またはシステムが問題なく正常に機能するかどうかを判断するために行われます。 -システムをさまざまなレベルでチェックして、すべてのシナリオがカバーされていること、 -およびシステムが実行すべきことを実行していることを確認します。 -下記質問に答えることで確認することができます。 ->製品を **_正しく_** 作っていますか? - -これは通常以下を含みます。 -テストがエラーなし(404、例外...)、使用可能な方法(正しいリダイレクト)で機能する、 -利用しやすく、仕様に一致します(上記の **_受け入れテスト_** を参照)。 - -Webアプリケーションの場合、期待されるリターンをシミュレートすることにより、このテストの自動化をSeleniumで直接実行できます。 -このシミュレーションは、このドキュメントで説明されているように、記録/再生またはサポートされているさまざまな言語で実行できます。 - -### パフォーマンステスト -その名前が示すように、パフォーマンステストは、アプリケーションのパフォーマンスを測定するために行われます。 - -パフォーマンステストには2つの主なサブタイプがあります。 - -#### ロードテスト -ロードテストは、定義されたさまざまな負荷(通常、特定の数のユーザーが同時に接続されている場合)でアプリケーションがどの程度機能するかを確認するために行われます。 - ->For example, **_Testing that the site can handle numerous orders/users at once._** - -#### ストレステスト -ストレステストは、ストレス下(またはサポートされている最大負荷以上)でアプリケーションがどの程度機能するかを確認するために行われます。 - ->For example, **_Testing that your ecommerce site can handle Black Friday_** - -一般に、パフォーマンステストは、Seleniumで書かれたテストを実行して、さまざまなユーザーがWebアプリの特定の機能を押して、意味のある測定値を取得することをシミュレートして実行されます。 - -これは通常、メトリックを取得する他のツールによって行われます。 -そのようなツールの1つが **_JMeter_** です。 - -Webアプリケーションの場合、測定する詳細には、スループット、待ち時間、データ損失、個々のコンポーネントの読み込み時間などが含まれます… - -注1:すべてのブラウザには、開発者のツールセクションにパフォーマンスタブがあります(F12キーを押すとアクセス可能) - -注2:これは一般に機能/機能ごとではなくシステムごとに測定されるため、 **_非機能テスト_** のサブタイプです。 - -### 回帰テスト -このテストは通常、変更、修正、または機能の追加後に行われます。 - -変更によって既存の機能が破壊されないようにするために、すでに実行されたいくつかのテストが再度実行されます。 - -再実行されるテストのセットは、完全または部分的なものにすることができ、アプリケーションおよび開発チームに応じて、いくつかの異なるタイプを含めることができます。 - ->For example, **_Testing that your new search bar doesn't break the other buttons on the menu_** - -### テスト駆動開発 (TDD) -テストタイプそのものではなく、TDDはテストが機能の設計を推進する反復的な開発方法論です。 - -各サイクルは、機能がパスする単体テストのセットを作成することから始まります(最初に実行すると失敗します)。 - -この後、テストに合格するための開発が行われます。 -別のサイクルを開始してテストが再度実行され、すべてのテストに合格するまでこのプロセスが続行されます。 - -これは、欠陥が発見されるほどコストが安くなるという事実に基づいて、アプリケーションの開発をスピードアップすることを目的としています。 - -### ビヘイビア駆動開発 (BDD) -BDDは、上記に基づいた反復開発方法論(TDD)でもあり、その目的は、アプリケーションの開発にすべての関係者を関与させることです。 - -各サイクルは、いくつかの仕様を作成することから始まります(これは失敗するはずです)。 -次に、失敗する単体テスト(これも失敗するはずです)を作成し、開発を作成します。 - -このサイクルは、すべてのタイプのテストに合格するまで繰り返されます。 - -そのためには、仕様言語が使用されます。 -すべての関係者が理解でき、単純で、標準的かつ明示的でなければなりません。 -ほとんどのツールは、この言語として **_Gherkin_** を使用します。 - -目標は、潜在的な受入エラーも対象とすることでTDDよりも多くのエラーを検出し、当事者間のコミュニケーションを円滑にすることです。 - -現在、仕様を記述し、 **_Cucumber_** や **_SpecFlow_** などのコード関数と一致させるための一連のツールが利用可能です。 - -Selenium上に一連のツールが構築されており、BDD仕様を実行可能コードに直接変換することにより、このプロセスをさらに高速化しています。 これらのいくつかは、 _**JBehave、Capybara、およびRobot Framework**_ です。 diff --git a/website_and_docs/content/documentation/test_practices/testing_types.pt-br.md b/website_and_docs/content/documentation/test_practices/testing_types.pt-br.md deleted file mode 100644 index 7ed9c71a17f4..000000000000 --- a/website_and_docs/content/documentation/test_practices/testing_types.pt-br.md +++ /dev/null @@ -1,143 +0,0 @@ ---- -title: "Tipos de teste" -linkTitle: "Tipos de teste" -weight: 2 -aliases: [ -"/documentation/guidelines/types_of_testing/" -] ---- - -### Teste de aceitação -Este tipo de teste é feito para determinar se um recurso ou sistema -atende às expectativas e requisitos do cliente. -Este tipo de teste geralmente envolve -cooperação ou feedback do cliente, sendo uma atividade de validação que -responde a pergunta: ->Estamos construindo o produto **_certo_**?. - -Para aplicações web, a automação desse teste pode ser feita -diretamente com o Selenium, simulando o comportamento esperado do usuário. -Esta simulação pode ser feita por gravação / reprodução ou por meio dos -diferentes idiomas suportados, conforme explicado nesta documentação. -Observação: o teste de aceitação é um subtipo de **_teste funcional_**, -ao qual algumas pessoas também podem se referir. - -### Teste funcional -Este tipo de teste é feito para determinar se um -recurso ou sistema funciona corretamente sem problemas. Verifica -o sistema em diferentes níveis para garantir que todos os cenários -são cobertos e que o sistema faz _o que está_ -suposto fazer. É uma atividade de verificação que -responde a pergunta: ->Estamos construindo o produto **_corretamente?_**. - -Isso geralmente inclui: os testes funcionam sem erros -(404, exceções ...), de forma utilizável (redirecionamentos corretos), -de forma acessível e atendendo às suas especificações -(consulte **_teste de aceitação_** acima). - -Para aplicativos da web, a automação desse teste pode ser -feito diretamente com o Selenium, simulando os retornos esperados. -Esta simulação pode ser feita por gravação / reprodução ou por meio de -os diferentes idiomas suportados, conforme explicado nesta documentação. - -### Testes de Integração - -Os testes de integração verificam as interações entre diferentes componentes ou módulos de um sistema. Vários módulos são testados juntos. O objetivo dos testes de integração é garantir que todos os módulos se integrem e funcionem juntos conforme esperado. Os testes de integração automatizados ajudam a garantir que essas interações funcionem conforme o esperado e que os componentes integrados funcionem corretamente juntos. ->Por exemplo, **_Testando o fluxo de pedido de um item em um site de comércio eletrônico junto com o pagamento._** - -### Testes de sistema - -O System Testing é um teste de produto completo e totalmente integrado. É um teste ponta a ponta onde o ambiente de teste é semelhante ao ambiente de produção. Aqui, navegamos por todos os recursos do software e testamos se o negócio final/recurso final funciona. Apenas testamos o recurso final e não verificamos o fluxo de dados, nem fazemos testes funcionais e tudo mais. ->Por exemplo, **_Testando o fluxo de ponta a ponta desde o login até a colocação e pedido e verificando novamente o pedido na página Meus Pedidos e logoff de um site de comércio eletrônico._** - -### Teste de performance/desempenho -Como o próprio nome indica, testes de desempenho são feitos -para medir o desempenho de um aplicativo. - -Existem dois subtipos principais para testes de desempenho: - -#### Teste de carga -O teste de carga é feito para verificar o quão bem o -aplicativo funciona sob diferentes cargas definidas -(geralmente um determinado número de usuários conectados ao mesmo tempo). - ->For example, **_Testing that the site can handle numerous orders/users at once._** - -#### Teste de estresse -O teste de estresse é feito para verificar o quão bem -a aplicação funciona sob estresse (ou acima da carga máxima suportada). - ->For example, **_Testing that your ecommerce site can handle Black Friday_** - -Geralmente, os testes de estresse são feitos executando alguns -testes escritos com Selenium simulando diferentes usuários -utilizando uma função específica no aplicativo da web e -recuperando algumas medições significativas. - -Isso geralmente é feito por outras ferramentas que recuperam as métricas. -Uma dessas ferramentas é a **_JMeter_**. - -Para um aplicativo da web, os detalhes a serem medidos incluem -taxa de transferência, latência, perda de dados, tempos de carregamento de componentes individuais ... - -Nota 1: todos os navegadores têm uma guia de desempenho em seus -seção de ferramentas para desenvolvedores (acessível pressionando F12) - -Nota 2: é um subtipo de **_teste não funcional_** -já que isso geralmente é medido por sistema e não por função / recurso. - -### Teste regressivo -Esse teste geralmente é feito após uma alteração, correção ou adição de recurso. - -Para garantir que a mudança não quebrou nenhumas das -funcionalidades, alguns testes já executados são executados novamente. - ->For example, **_Testing that your new search bar doesn't break the other buttons on the menu_** - -O conjunto de testes re-executados pode ser total ou parcial -e pode incluir vários tipos diferentes, dependendo -da equipe de aplicação e desenvolvimento. - -### Desenvolvimento orientado a testes (TDD) -Em vez de um tipo de teste _per se_, o TDD é uma metodologia iterativa de desenvolvimento na qual os testes conduzem o design de um recurso. - -Cada ciclo começa criando um conjunto de testes de unidade no qual -o recurso deve eventualmente ser aprovado (eles devem falhar na primeira execução). - -Depois disso, ocorre o desenvolvimento para fazer os testes passarem. -Os testes são executados novamente, iniciando outro ciclo -e esse processo continua até que todos os testes sejam aprovados. - -Visa acelerar o desenvolvimento de um aplicativo -com base no fato de que os defeitos custam menos quanto mais cedo são encontrados. - -### Desenvolvimento orientado a comportamento (BDD) -BDD também é uma metodologia de desenvolvimento iterativa -com base no TDD acima, em que o objetivo é envolver -todas as partes no desenvolvimento de um aplicativo. - -Cada ciclo começa criando algumas especificações -(que deve falhar). Em seguida, crie a os testes de unidade com falha -(que também devem falhar) e, em seguida, faça o desenvolvimento. - -Este ciclo é repetido até que todos os tipos de testes sejam aprovados. - -Para fazer isso, uma linguagem de especificação é -usada. Deve ser compreensível por todas as partes e ser -simples, padronizada e explícita. -A maioria das ferramentas usa **_Gherkin_** como esse idioma. - -O objetivo é ser capaz de detectar ainda mais erros -do que TDD, visando potenciais erros de aceitação -também e tornar a comunicação entre as partes mais fácil. - -Um conjunto de ferramentas está atualmente disponível -para escrever as especificações e combiná-las com funções de código, -como **_Cucumber_** ou **_SpecFlow_**. - -Um conjunto de ferramentas é construído em cima do Selenium para tornar este processo -ainda mais rápido, transformando diretamente as especificações BDD em -código executável. -Alguns deles são **_JBehave, Capybara e Robot Framework_**. - diff --git a/website_and_docs/content/documentation/test_practices/testing_types.zh-cn.md b/website_and_docs/content/documentation/test_practices/testing_types.zh-cn.md deleted file mode 100644 index 3f83c2683171..000000000000 --- a/website_and_docs/content/documentation/test_practices/testing_types.zh-cn.md +++ /dev/null @@ -1,127 +0,0 @@ ---- -title: "测试类型" -linkTitle: "测试类型" -weight: 2 -aliases: [ -"/documentation/guidelines/types_of_testing/" -] ---- - -### 验收测试 -进行这种类型的测试以确定功能或系统是否满足客户的期望和要求. -这种测试通常涉及客户的合作或反馈, -是一种验证活动, -可以用于回答以下问题: ->我们是否在制造 **_正确的_** 产品? - -对于Web应用程序, -可以通过模拟用户期望的行为 -直接使用Selenium来完成此测试的自动化. -可以通过记录/回放, 或通过本文档中介绍的各种支持的语言来完成此类模拟. -注意:有些人可能还会提到, 验收测试是 **_功能测试_** 的子类型. - -### 功能测试 -进行这种类型的测试是为了确定功能或系统是否正常运行而没有问题. -它会在不同级别检查系统, -以确保涵盖所有方案并且系统能够执行预期的 _工作_ . -这是一个验证活动, 它回答了以下问题: ->我们是否在 **_正确地_** 制造产品? - -这通常包括: -测试没有错误 (404, 异常…) , -以可用的方式 (正确的重定向) 正常运行, -以可访问的方式并匹配其规格 (请参见前述的 **_验收测试_** ) . - -对于Web应用程序, -可以通过模拟预期的结果, 直接使用Selenium来完成此测试的自动化. -可以通过记录/回放或通过本文档中说明的各种支持的语言来完成此模拟. - -### 性能测试 -顾名思义, 进行性能测试是为了衡量应用程序的性能. - -性能测试主要有两种类型: - -#### 负载测试 -进行了负载测试, -以验证应用程序在各种特定的负载 - (通常是同时连接一定数量的用户) 下的运行状况 - ->For example, **_Testing that the site can handle numerous orders/users at once._** - -#### 压力测试 -进行压力测试, -以验证应用程序在压力 (或高于最大支持负载) 下的运行状况. - ->For example, **_Testing that your ecommerce site can handle Black Friday_** - -通常, 性能测试是通过执行一些Selenium书写的测试来完成的, -这些测试模拟了不同的用户 -使用Web应用程序的特定功能 -并检索了一些有意义的指标. - -通常, 这是由其他检索指标的工具完成的. -**_JMeter_** 就是这样一种工具. - -对于Web应用程序, -要测量的详细信息包括 -吞吐量、 延迟、数据丢失、单个组件加载时间... - -注意1:所有浏览器的开发人员工具 -均具有“性能”标签 (可通过按F12进行访问) - -注2:这属于 **_非功能测试_** 的类型, -因为它通常是按系统而不是按功能/特征进行测量. - -### 回归测试 -此测试通常在修改, 修复或添加功能之后进行. - -为了确保所做的更改没有破坏任何现有功能, -将再次执行一些已经执行过的测试. - ->For example, **_Testing that your new search bar doesn't break the other buttons on the menu_** - -重新执行的测试集可以是全部或部分, -并且可以包括几种不同的类型, -具体取决于具体的应用程序和开发团队. - -### 测试驱动开发 (TDD) -TDD本身不是一种测试类型, -而是一种迭代开发方法, -用于测试驱动功能的设计. - -每个周期都从创建功能应通过的一组单元测试开始 - (这将使首次执行失败) . - -此后, 进行开发以使测试通过. -在另一个周期开始再次执行测试, -此过程一直持续到所有测试通过为止. - -如此做的目的是基于以下情况, -既缺陷发现的时间越早成本越低, -从而加快了应用程序的开发. - -### 行为驱动开发 (BDD) -BDD还是基于上述 (TDD) 的迭代开发方法, -其目的是让各方参与到应用程序的开发中. - -每个周期都从创建一些规范开始 (应该失败) . -然后创建会失败的单元测试 (也应该失败) , -之后着手开发. - -重复此循环, 直到所有类型的测试通过. - -为此, 使用了规范语言. -因为简单、标准和明确, 各方都应该能够理解. -大多数工具都使用 **_Gherkin_** 作为这种语言. - -目标是为了解决潜在的验收问题, -从而能够检测出比TDD还要多的错误, -并使各方之间的沟通更加顺畅. - -当前有一组工具可用于编写规范 -并将其与编码功能 (例如 **_Cucumber_** 或 **_SpecFlow_** ) 匹配. - -在Selenium之上构建了一系列工具, -可通过将BDD规范直接转换为可执行代码, 使得上述过程更为迅速. -例如 **_JBehave, Capybara 和 Robot Framework_**. - diff --git a/website_and_docs/content/documentation/webdriver/_index.en.md b/website_and_docs/content/documentation/webdriver/_index.en.md index 08855dafc963..77012a988bff 100644 --- a/website_and_docs/content/documentation/webdriver/_index.en.md +++ b/website_and_docs/content/documentation/webdriver/_index.en.md @@ -4,7 +4,11 @@ linkTitle: "WebDriver" weight: 2 description: > WebDriver drives a browser natively; learn more about it. -aliases: ["/documentation/en/webdriver/", "/documentation/ja/webdriver/", "/documentation/pt-br/webdriver/", "/documentation/zh-cn/webdriver/"] +aliases: ["/documentation/en/webdriver/", "/documentation/ja/webdriver/", "/documentation/pt-br/webdriver/", "/documentation/zh-cn/webdriver/", +"/ja/documentation/webdriver/", +"/pt-br/documentation/webdriver/", +"/zh-cn/documentation/webdriver/" +] --- diff --git a/website_and_docs/content/documentation/webdriver/_index.ja.md b/website_and_docs/content/documentation/webdriver/_index.ja.md deleted file mode 100644 index 74e046ad3329..000000000000 --- a/website_and_docs/content/documentation/webdriver/_index.ja.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "WebDriver" -linkTitle: "WebDriver" -weight: 2 -description: > - WebDriverはブラウザをネイティブに操作します。詳細については、こちらをご覧ください。 ---- - -WebDriverは、ユーザーがローカルまたはSeleniumサーバーを使用するリモートマシンで行うように、ブラウザをネイティブに動かし、ブラウザの自動化に関して大きく前進します。 - -Selenium WebDriverは言語バインディングと個々のブラウザ制御コードの実装の両方を参照します。 -これは通常、単に _WebDriver_ と呼ばれます。 - -Selenium WebDriverは、[W3C勧告](https://www.w3.org/TR/webdriver1/)です。 - -* WebDriverはシンプルでより簡潔なプログラミングインターフェイスとして設計されています。 - -* WebDriverはコンパクトなオブジェクト指向APIです。 - -* ブラウザーを効果的に動かします。 diff --git a/website_and_docs/content/documentation/webdriver/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/_index.pt-br.md deleted file mode 100644 index f7e4e8f563e1..000000000000 --- a/website_and_docs/content/documentation/webdriver/_index.pt-br.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "WebDriver" -linkTitle: "WebDriver" -weight: 2 -description: WebDriver manipula um navegador nativamente; aprenda mais sobre isso. ---- - -O WebDriver manipula um navegador nativamente, como um usuário faria, seja localmente -ou em uma máquina remota usando o servidor Selenium, -marca um salto em termos de automação do navegador. - -Selenium WebDriver refere-se a ambas as ligações de linguagem -e as implementações do código de controle do navegador individual. -Isso é comumente referido como apenas _WebDriver_. - -Selenium WebDriver é uma [recomendação W3C](https://www.w3.org/TR/webdriver1/) - -* WebDriver é projetado como uma interface de programação simples e mais concisa. - -* WebDriver é uma API compacta orientada a objetos. - -* Ele manipula o navegador de forma eficaz. diff --git a/website_and_docs/content/documentation/webdriver/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/_index.zh-cn.md deleted file mode 100644 index 5a84a51ad946..000000000000 --- a/website_and_docs/content/documentation/webdriver/_index.zh-cn.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -title: "WebDriver" -linkTitle: "WebDriver" -weight: 2 -description: > - WebDriver以原生的方式驱动浏览器; 在此了解更多内容. ---- - - -WebDriver 以本地化方式驱动浏览器,就像用户在本地或使用 Selenium -服务器的远程机器上所做的那样,这标志着浏览器自动化的飞跃。 - -Selenium WebDriver 指的是语言绑定和各个浏览器控制代码的实现。 -这通常被称为 _WebDriver_。 - -Selenium WebDriver 是 [W3C 推荐标准](https://www.w3.org/TR/webdriver1/) - -* WebDriver 被设计成一个简单和简洁的编程接口。 - -* WebDriver 是一个简洁的面向对象 API。 - -* 它能有效地驱动浏览器。 diff --git a/website_and_docs/content/documentation/webdriver/actions_api/_index.ja.md b/website_and_docs/content/documentation/webdriver/actions_api/_index.ja.md index 7f23990cf685..5ec82f8812c0 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/_index.ja.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/_index.ja.md @@ -24,7 +24,7 @@ manage more than one device, you are responsible for ensuring proper synchroniza Thankfully, you likely do not need to learn how to use the low level commands directly, since almost everything you might want to do has been given a convenience method that combines the lower level commands for you. These are all documented in -[keyboard]({{< ref "keyboard" >}}), [mouse]({{< ref "mouse" >}}), [pen]({{< ref "pen" >}}), and [wheel]({{< ref "wheel" >}}) pages. +[keyboard]({{< ref path="keyboard" lang="en" >}}), [mouse]({{< ref path="mouse" lang="en" >}}), [pen]({{< ref "pen" >}}), and [wheel]({{< ref "wheel" >}}) pages. ## Pause diff --git a/website_and_docs/content/documentation/webdriver/actions_api/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/actions_api/_index.pt-br.md index eee680b49ad8..b413317f0557 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/_index.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/_index.pt-br.md @@ -11,7 +11,7 @@ Além das [interações de alto nível]({{< ref "/documentation/webdriver/elemen Na transição do antigo Protocolo JSON Wire para o novo Protocolo W3C WebDriver, os componentes de construção de ações de baixo nível se tornaram especialmente detalhados. Isso é extremamente poderoso, mas cada dispositivo de entrada possui várias maneiras de ser utilizado e, se você precisa gerenciar mais de um dispositivo, é responsável por garantir a sincronização adequada entre eles. -Felizmente, provavelmente você não precisa aprender a usar os comandos de baixo nível diretamente, uma vez que quase tudo o que você pode querer fazer foi fornecido com um método de conveniência que combina os comandos de nível inferior para você. Todos esses métodos estão documentados nas páginas de [teclado]({{< ref "keyboard" >}}), [mouse]({{< ref "mouse" >}}), [caneta]({{< ref "pen" >}}) e [roda]({{< ref "wheel" >}}). +Felizmente, provavelmente você não precisa aprender a usar os comandos de baixo nível diretamente, uma vez que quase tudo o que você pode querer fazer foi fornecido com um método de conveniência que combina os comandos de nível inferior para você. Todos esses métodos estão documentados nas páginas de [teclado]({{< ref path="keyboard" lang="en" >}}), [mouse]({{< ref path="mouse" lang="en" >}}), [caneta]({{< ref "pen" >}}) e [roda]({{< ref "wheel" >}}). ## Pausa diff --git a/website_and_docs/content/documentation/webdriver/actions_api/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/actions_api/_index.zh-cn.md index a1702dd79030..e4c4ef9058a7 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/_index.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/_index.zh-cn.md @@ -32,8 +32,8 @@ Selenium允许您构建分配给特定输入的独立操作命令, 因为您可能要执行的几乎所有操作, 都已提供了相应的简便方法, 这些方法可以为您组合较低级别的命令. -请分别参阅相应的[键盘]({{< ref "keyboard" >}}), -[鼠标]({{< ref "mouse" >}}), +请分别参阅相应的[键盘]({{< ref path="keyboard" lang="en" >}}), +[鼠标]({{< ref path="mouse" lang="en" >}}), [笔]({{< ref "pen" >}}) 和[滚轮]({{< ref "wheel" >}}) 页面. diff --git a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.en.md b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.en.md index 34dcb4dc2d8d..80b8acbe30a2 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.en.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.en.md @@ -9,7 +9,13 @@ aliases: [ "/documentation/webdriver/keyboard/", "/documentation/ja/webdriver/keyboard/", "/documentation/pt-br/webdriver/keyboard/", -"/documentation/zh-cn/webdriver/keyboard/" +"/documentation/zh-cn/webdriver/keyboard/", +"/ja/documentation/webdriver/actions_api/keyboard/", +"/ja/documentation/webdriver/keyboard/", +"/pt-br/documentation/webdriver/actions_api/keyboard/", +"/pt-br/documentation/webdriver/keyboard/", +"/zh-cn/documentation/webdriver/actions_api/keyboard/", +"/zh-cn/documentation/webdriver/keyboard/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.ja.md b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.ja.md deleted file mode 100644 index 79f5934ab6f4..000000000000 --- a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.ja.md +++ /dev/null @@ -1,169 +0,0 @@ ---- -title: "Keyboard actions" -linkTitle: "Keyboard" -weight: 2 -description: > - A representation of any key input device for interacting with a web page. -aliases: [ -"/documentation/webdriver/keyboard/" -] ---- - -There are only 2 actions that can be accomplished with a keyboard: -pressing down on a key, and releasing a pressed key. -In addition to supporting ASCII characters, each keyboard key has -a representation that can be pressed or released in designated sequences. - -## Keys - -In addition to the keys represented by regular unicode, -unicode values have been assigned to other keyboard keys for use with Selenium. -Each language has its own way to reference these keys; the full list can be found -[here](https://www.w3.org/TR/webdriver/#keyboard-actions). - -{{< tabpane text=true >}} - {{< tab header="Java" >}} -Use the [Java Keys enum](https://github.com/SeleniumHQ/selenium/blob/selenium-4.2.0/java/src/org/openqa/selenium/Keys.java#L28) - {{< /tab >}} - {{< tab header="Python" >}} -Use the [Python Keys class](https://github.com/SeleniumHQ/selenium/blob/selenium-4.2.0/py/selenium/webdriver/common/keys.py#L23) - {{< /tab >}} - {{< tab header="CSharp" >}} -Use the [.NET static Keys class](https://github.com/SeleniumHQ/selenium/blob/selenium-4.2.0/dotnet/src/webdriver/Keys.cs#L28) - {{< /tab >}} - {{< tab header="Ruby" >}} -Use the [Ruby KEYS constant](https://github.com/SeleniumHQ/selenium/blob/selenium-4.2.0/rb/lib/selenium/webdriver/common/keys.rb#L28) - {{< /tab >}} - {{< tab header="JavaScript" >}} -Use the [JavaScript KEYS constant](https://github.com/SeleniumHQ/selenium/blob/selenium-4.2.0/javascript/node/selenium-webdriver/lib/input.js#L44) - {{< /tab >}} - {{< tab header="Kotlin" >}} -Use the [Java Keys enum](https://github.com/SeleniumHQ/selenium/blob/selenium-4.2.0/java/src/org/openqa/selenium/Keys.java#L28) - {{< /tab >}} -{{< /tabpane >}} - -## Key down - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java#L17-L20" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_keys.py#L10-L13" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs#L17-L20" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/keys_spec.rb#L13-L16" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/keysTest.spec.js#L20-L23" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/KeysTest.kt#L19-L22" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Key up - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java#L30-L35" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_keys.py#L21-L26" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs#L30-L35" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/keys_spec.rb#L25-L30" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/keysTest.spec.js#L34-L39" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/KeysTest.kt#L32-L37" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Send keys - -This is a convenience method in the Actions API that combines keyDown and keyUp commands in one action. -Executing this command differs slightly from using the element method, but -primarily this gets used when needing to type multiple characters in the middle of other actions. - -### Active Element - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java#L45-L47" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_keys.py#L34-L36" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs#L45-L47" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/keys_spec.rb#L39-L41" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/keysTest.spec.js#L50-L52" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/KeysTest.kt#L47-L49" >}} -{{< /tab >}} -{{< /tabpane >}} - -### Designated Element - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java#L59-L62" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_keys.py#L45-L48" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs#L58-L61" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/keys_spec.rb#L51-L54" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-version version="4.5.0" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/keysTest.spec.js#L61-L65" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/KeysTest.kt#L60-L63" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Copy and Paste - -Here's an example of using all of the above methods to conduct a copy / paste action. -Note that the key to use for this operation will be different depending on if it is a Mac OS or not. -This code will end up with the text: `SeleniumSelenium!` - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java#L70-L84" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_keys.py#L56-L67" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs#L72-L82" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/keys_spec.rb#L64-L74" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/keysTest.spec.js#L75-L87" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/KeysTest.kt#L74-L86" >}} -{{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.pt-br.md b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.pt-br.md deleted file mode 100644 index b0922ddd4d5e..000000000000 --- a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.pt-br.md +++ /dev/null @@ -1,162 +0,0 @@ ---- -title: "Ações de Teclado" -linkTitle: "Teclado" -weight: 2 -description: > - Uma representação de qualquer dispositivo de entrada de teclado para interagir com uma página da web. -aliases: [ -"/documentation/webdriver/keyboard/" -] ---- - -Existem apenas 2 ações que podem ser realizadas com um teclado: pressionar uma tecla e liberar uma tecla pressionada. Além de suportar caracteres ASCII, cada tecla do teclado possui uma representação que pode ser pressionada ou liberada em sequências designadas. - -## Chaves - -Além das teclas representadas pelo Unicode regular, valores Unicode foram atribuídos a outras teclas de teclado para uso com o Selenium. Cada linguagem tem sua própria maneira de fazer referência a essas teclas; a lista completa pode ser encontrada -[aqui](https://www.w3.org/TR/webdriver/#keyboard-actions). - -{{< tabpane text=true >}} - {{< tab header="Java" >}} -Use the [Java Keys enum](https://github.com/SeleniumHQ/selenium/blob/selenium-4.2.0/java/src/org/openqa/selenium/Keys.java#L28) - {{< /tab >}} - {{< tab header="Python" >}} -Use the [Python Keys class](https://github.com/SeleniumHQ/selenium/blob/selenium-4.2.0/py/selenium/webdriver/common/keys.py#L23) - {{< /tab >}} - {{< tab header="CSharp" >}} -Use the [.NET static Keys class](https://github.com/SeleniumHQ/selenium/blob/selenium-4.2.0/dotnet/src/webdriver/Keys.cs#L28) - {{< /tab >}} - {{< tab header="Ruby" >}} -Use the [Ruby KEYS constant](https://github.com/SeleniumHQ/selenium/blob/selenium-4.2.0/rb/lib/selenium/webdriver/common/keys.rb#L28) - {{< /tab >}} - {{< tab header="JavaScript" >}} -Use the [JavaScript KEYS constant](https://github.com/SeleniumHQ/selenium/blob/selenium-4.2.0/javascript/node/selenium-webdriver/lib/input.js#L44) - {{< /tab >}} - {{< tab header="Kotlin" >}} -Use the [Java Keys enum](https://github.com/SeleniumHQ/selenium/blob/selenium-4.2.0/java/src/org/openqa/selenium/Keys.java#L28) - {{< /tab >}} -{{< /tabpane >}} - -## Pressione a tecla - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java#L17-L20" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_keys.py#L10-L13" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs#L17-L20" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/keys_spec.rb#L13-L16" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/keysTest.spec.js#L20-L23" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/KeysTest.kt#L19-L22" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Liberar a tecla - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java#L30-L35" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_keys.py#L21-L26" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs#L30-L35" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/keys_spec.rb#L25-L30" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/keysTest.spec.js#L34-L39" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/KeysTest.kt#L32-L37" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Enviar teclas - -This is a convenience method in the Actions API that combines keyDown and keyUp commands in one action. -Executing this command differs slightly from using the element method, but -primarily this gets used when needing to type multiple characters in the middle of other actions. - -### Elemento Ativo - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java#L45-L47" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_keys.py#L34-L36" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs#L45-L47" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/keys_spec.rb#L39-L41" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/keysTest.spec.js#L50-L52" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/KeysTest.kt#L47-L49" >}} -{{< /tab >}} -{{< /tabpane >}} - -### Elemento Designado - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java#L59-L62" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_keys.py#L45-L48" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs#L58-L61" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/keys_spec.rb#L51-L54" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-version version="4.5.0" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/keysTest.spec.js#L61-L65" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/KeysTest.kt#L60-L63" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Copiar e Colar - -Aqui está um exemplo de uso de todos os métodos acima para realizar uma ação de copiar/colar. Note que a tecla a ser usada para essa operação será diferente, dependendo se for um sistema Mac OS ou não. Este código resultará no texto: `SeleniumSelenium!` - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java#L70-L84" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_keys.py#L56-L67" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs#L72-L82" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/keys_spec.rb#L64-L74" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/keysTest.spec.js#L75-L87" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/KeysTest.kt#L74-L86" >}} -{{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.zh-cn.md b/website_and_docs/content/documentation/webdriver/actions_api/keyboard.zh-cn.md deleted file mode 100644 index 1b732de1dc8d..000000000000 --- a/website_and_docs/content/documentation/webdriver/actions_api/keyboard.zh-cn.md +++ /dev/null @@ -1,171 +0,0 @@ ---- -title: "键盘操作" -linkTitle: "键盘" -weight: 2 -description: > - 一种适用于任何与网页交互的按键输入设备的表现形式. -aliases: [ -"/documentation/webdriver/keyboard/" -] ---- - -只有 2 个操作可以使用键盘完成: -按下某个键,以及释放一个按下的键. -除了支持 ASCII 字符外,每个键盘按键还具有 -可以按特定顺序按下或释放的表现形式. - -## 按键 - -除了由常规unicode表示的按键, -其他键盘按键被分配了一些unicode值以用于操作Selenium -每种语言都有自己的方式来援引这些按键; -[这里](https://www.w3.org/TR/webdriver/#keyboard-actions) -可以找到完整列表 - -{{< tabpane text=true >}} -{{% tab header="Java" %}} -Use the [Java Keys enum](https://github.com/SeleniumHQ/selenium/blob/selenium-4.2.0/java/src/org/openqa/selenium/Keys.java#L28) -{{% /tab %}} -{{% tab header="Python" %}} -Use the [Python Keys class](https://github.com/SeleniumHQ/selenium/blob/selenium-4.2.0/py/selenium/webdriver/common/keys.py#L23) -{{% /tab %}} -{{% tab header="CSharp" %}} -Use the [.NET static Keys class](https://github.com/SeleniumHQ/selenium/blob/selenium-4.2.0/dotnet/src/webdriver/Keys.cs#L28) -{{% /tab %}} -{{% tab header="Ruby" %}} -Use the [Ruby KEYS constant](https://github.com/SeleniumHQ/selenium/blob/selenium-4.2.0/rb/lib/selenium/webdriver/common/keys.rb#L28) -{{% /tab %}} -{{% tab header="JavaScript" %}} -Use the [JavaScript KEYS constant](https://github.com/SeleniumHQ/selenium/blob/selenium-4.2.0/javascript/node/selenium-webdriver/lib/input.js#L44) -{{% /tab %}} -{{% tab header="Kotlin" %}} -Use the [Java Keys enum](https://github.com/SeleniumHQ/selenium/blob/selenium-4.2.0/java/src/org/openqa/selenium/Keys.java#L28) -{{% /tab %}} -{{< /tabpane >}} - -## 按下按键 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java#L17-L20" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_keys.py#L10-L13" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs#L17-L20" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/keys_spec.rb#L13-L16" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/keysTest.spec.js#L20-L23" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/KeysTest.kt#L19-L22" >}} -{{< /tab >}} -{{< /tabpane >}} - -## 释放按键 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java#L30-L35" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_keys.py#L21-L26" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs#L30-L35" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/keys_spec.rb#L25-L30" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/keysTest.spec.js#L34-L39" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/KeysTest.kt#L32-L37" >}} -{{< /tab >}} -{{< /tabpane >}} - -## 键入 - -这是Actions API的一种便捷方法, -它将 keyDown 和 keyUp 命令组合在一个操作中. -执行此命令与使用 element 方法略有不同, -但这主要用于,需要在其他操作之间键入多个字符时使用. - -### 活跃元素 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java#L45-L47" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_keys.py#L34-L36" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs#L45-L47" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/keys_spec.rb#L39-L41" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/keysTest.spec.js#L50-L52" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/KeysTest.kt#L47-L49" >}} -{{< /tab >}} -{{< /tabpane >}} - -### 指定元素 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java#L59-L62" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_keys.py#L45-L48" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs#L58-L61" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/keys_spec.rb#L51-L54" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-version version="4.5.0" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/keysTest.spec.js#L61-L65" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/KeysTest.kt#L60-L63" >}} -{{< /tab >}} -{{< /tabpane >}} - -## 复制粘贴 - -下面是使用上述所有方法执行复制/粘贴操作的示例. -请注意, 用于此操作的键位会有所不同, 具体取决于它是否是 Mac OS. -此代码将以文本收尾: `SeleniumSelenium!` - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/KeysTest.java#L70-L84" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_keys.py#L56-L67" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/KeysTest.cs#L72-L82" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/keys_spec.rb#L64-L74" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/keysTest.spec.js#L75-L87" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/KeysTest.kt#L74-L86" >}} -{{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/actions_api/mouse.en.md b/website_and_docs/content/documentation/webdriver/actions_api/mouse.en.md index 656d535f1c9b..84240f8af6fa 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/mouse.en.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/mouse.en.md @@ -10,7 +10,13 @@ aliases: [ "/documentation/support_packages/mouse_and_keyboard_actions_in_detail/", "/documentation/ja/support_packages/mouse_and_keyboard_actions_in_detail/", "/documentation/pt-br/support_packages/mouse_and_keyboard_actions_in_detail/", -"/documentation/zh-cn/support_packages/mouse_and_keyboard_actions_in_detail/" +"/documentation/zh-cn/support_packages/mouse_and_keyboard_actions_in_detail/", +"/ja/documentation/support_packages/mouse_and_keyboard_actions_in_detail/", +"/ja/documentation/webdriver/actions_api/mouse/", +"/pt-br/documentation/support_packages/mouse_and_keyboard_actions_in_detail/", +"/pt-br/documentation/webdriver/actions_api/mouse/", +"/zh-cn/documentation/support_packages/mouse_and_keyboard_actions_in_detail/", +"/zh-cn/documentation/webdriver/actions_api/mouse/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/actions_api/mouse.ja.md b/website_and_docs/content/documentation/webdriver/actions_api/mouse.ja.md deleted file mode 100644 index 5fcd7a7ce334..000000000000 --- a/website_and_docs/content/documentation/webdriver/actions_api/mouse.ja.md +++ /dev/null @@ -1,353 +0,0 @@ ---- -title: "Mouse actions" -linkTitle: "Mouse" -weight: 4 -needsTranslation: true -description: > - A representation of any pointer device for interacting with a web page. -aliases: [ -"/documentation/support_packages/mouse_and_keyboard_actions_in_detail/" -] ---- - -There are only 3 actions that can be accomplished with a mouse: -pressing down on a button, releasing a pressed button, and moving the mouse. -Selenium provides convenience methods that combine these actions in the most common ways. - -## Click and hold - -This method combines moving the mouse to the center of an element with pressing the left mouse button. -This is useful for focusing a specific element: - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L22-L25" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L14-L17" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L17-L20" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L11-L14" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/clickAndHold.spec.js#L14-L16" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L23-L26" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Click and release - -This method combines moving to the center of an element with pressing and releasing the left mouse button. -This is otherwise known as "clicking": - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L34-L37" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L26-L29" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L30-L33" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L22-L25" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/clickAndRelease.spec.js#L14-L16" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L35-L38" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Alternate Button Clicks - -There are a total of 5 defined buttons for a Mouse: -* 0 — Left Button (the default) -* 1 — Middle Button (currently unsupported) -* 2 — Right Button -* 3 — X1 (Back) Button -* 4 — X2 (Forward) Button - -### Context Click - -This method combines moving to the center of an element with pressing and releasing the right mouse button (button 2). -This is otherwise known as "right-clicking": - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L46-L49" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L37-L40" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L43-L46" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L34-L37" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/rightClick.spec.js#L15-L17" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L47-L50" >}} -{{< /tab >}} -{{< /tabpane >}} - -### Back Click - -There is no convenience method for this, it is just pressing and releasing mouse button 3 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L60-L66" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< badge-version version="4.2" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L51-L54" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< badge-version version="4.2" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L59-L63" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-version version="4.2" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L47-L50" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-version version="4.5.0" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/backAndForwardClick.spec.js#L19-L20" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L61-L67" >}} -{{< /tab >}} -{{< /tabpane >}} - -### Forward Click - -There is no convenience method for this, it is just pressing and releasing mouse button 4 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L78-L84" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< badge-version version="4.2" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L65-L68" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< badge-version version="4.2" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L77-L81" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-version version="4.2" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L61-L64" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-version version="4.5.0" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/backAndForwardClick.spec.js#L32-L33" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L79-L85" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Double click - -This method combines moving to the center of an element with pressing and releasing the left mouse button twice. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L93-L96" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L76-L79" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L91-L94" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L73-L76" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/doubleClick.spec.js#L15-L17" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L94-L97" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Move to element - -This method moves the mouse to the in-view center point of the element. -This is otherwise known as "hovering." -Note that the element must be in the viewport or else the command will error. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L105-L108" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L87-L90" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L104-L107" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L84-L87" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/moveToElement.spec.js#L15-L17" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L106-L109" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Move by offset - -These methods first move the mouse to the designated origin and then -by the number of pixels in the provided offset. -Note that the position of the mouse must be in the viewport or else the command will error. - -### Offset from Element - -This method moves the mouse to the in-view center point of the element, -then moves by the provided offset. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L118-L121" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L98-L101" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L132-L135" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L97-L100" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/moveByOffset.spec.js#L15-L17" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L119-L122" >}} -{{< /tab >}} -{{< /tabpane >}} - -### Offset from Viewport - -This method moves the mouse from the upper left corner of the current viewport by the provided -offset. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L131-L136" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L110-L112" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L146-L150" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L114-L116" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/moveByOffset.spec.js#L27-L28" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L132-L137" >}} -{{< /tab >}} -{{< /tabpane >}} - -### Offset from Current Pointer Location - -This method moves the mouse from its current position by the offset provided by the user. -If the mouse has not previously been moved, the position will be in the upper left -corner of the viewport. -Note that the pointer position does not change when the page is scrolled. - -Note that the first argument X specifies to move right when positive, while the second argument -Y specifies to move down when positive. So `moveByOffset(30, -10)` moves right 30 and up 10 from -the current mouse position. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L153-L155" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L126-L128" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L167-L169" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L128-L130" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/moveByOffset.spec.js#L40" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L154-L156" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Drag and Drop on Element - -This method firstly performs a click-and-hold on the source element, -moves to the location of the target element and then releases the mouse. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L166-L170" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L139-L143" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L181-L185" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L141-L145" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/dragAndDrop.spec.js#L27-L30" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L167-L171" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Drag and Drop by Offset - -This method firstly performs a click-and-hold on the source element, moves to the given offset and then releases the mouse. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L179-L184" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L151-L156" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L195-L200" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L153-L158" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/dragAndDrop.spec.js#L15-L19" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L180-L185" >}} -{{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/actions_api/mouse.pt-br.md b/website_and_docs/content/documentation/webdriver/actions_api/mouse.pt-br.md deleted file mode 100644 index 604ae58f26c1..000000000000 --- a/website_and_docs/content/documentation/webdriver/actions_api/mouse.pt-br.md +++ /dev/null @@ -1,336 +0,0 @@ ---- -title: "Ações do Mouse" -linkTitle: "Mouse" -weight: 4 -needsTranslation: true -description: > - Uma representação de qualquer dispositivo de ponteiro para interagir com uma página da web. -aliases: [ -"/documentation/support_packages/mouse_and_keyboard_actions_in_detail/" -] ---- - -Existem apenas 3 ações que podem ser realizadas com um mouse: pressionar um botão, liberar um botão pressionado e mover o mouse. O Selenium fornece métodos de conveniência que combinam essas ações da maneira mais comum. - -## Clicar e Manter Pressionado - -Este método combina mover o mouse para o centro de um elemento com a pressão do botão esquerdo do mouse. Isso é útil para focar em um elemento específico: - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L22-L25" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L14-L17" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L17-L20" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L11-L14" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/clickAndHold.spec.js#L14-L16" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L23-L26" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Clicar e Liberar - -Este método combina mover o mouse para o centro de um elemento com a pressão e liberação do botão esquerdo do mouse. Isso é conhecido como "clicar": - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L34-L37" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L26-L29" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L30-L33" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L22-L25" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/clickAndRelease.spec.js#L14-L16" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L35-L38" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Clique com o Botão Alternativo - -Existem um total de 5 botões definidos para um mouse: -- 0 — Botão Esquerdo (o padrão) -- 1 — Botão do Meio (atualmente não suportado) -- 2 — Botão Direito -- 3 — Botão X1 (Voltar) -- 4 — Botão X2 (Avançar) - -### Context Click - -Este método combina mover o mouse para o centro de um elemento com a pressão e liberação do botão direito do mouse (botão 2). Isso é conhecido como "clicar com o botão direito" ou "menu de contexto" - - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L46-L49" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L37-L40" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L43-L46" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L34-L37" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/rightClick.spec.js#L15-L17" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L47-L50" >}} -{{< /tab >}} -{{< /tabpane >}} - -### Click botão de voltar do mouse - -Este termo pode se referir a um clique com o botão X1 (botão de voltar) do mouse. No entanto, essa terminologia específica pode variar dependendo do contexto. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L60-L66" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< badge-version version="4.2" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L51-L54" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< badge-version version="4.2" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L59-L63" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-version version="4.2" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L47-L50" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-version version="4.5.0" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/backAndForwardClick.spec.js#L19-L20" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L61-L67" >}} -{{< /tab >}} -{{< /tabpane >}} - -### botão de avançar) do mouse - -Este termo se refere a um clique com o botão X2 (botão de avançar) do mouse. Não existe um método de conveniência específico para essa ação, sendo apenas a pressão e liberação do botão do mouse de número 4. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L78-L84" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< badge-version version="4.2" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L65-L68" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< badge-version version="4.2" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L77-L81" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-version version="4.2" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L61-L64" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-version version="4.5.0" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/backAndForwardClick.spec.js#L32-L33" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L79-L85" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Duplo click - -Este método combina mover o mouse para o centro de um elemento com a pressão e liberação do botão esquerdo do mouse duas vezes. Isso é conhecido como "duplo clique". - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L93-L96" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L76-L79" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L91-L94" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L73-L76" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/doubleClick.spec.js#L15-L17" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L94-L97" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Mover para o Elemento - -Este método move o mouse para o ponto central do elemento que está visível na tela. Isso é conhecido como "hovering" ou "pairar". É importante observar que o elemento deve estar no viewport (área visível na tela) ou então o comando resultará em erro. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L105-L108" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L87-L90" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L104-L107" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L84-L87" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/moveToElement.spec.js#L15-L17" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L106-L109" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Mover por Deslocamento - -Esses métodos primeiro movem o mouse para a origem designada e, em seguida, pelo número de pixels especificado no deslocamento fornecido. É importante observar que a posição do mouse deve estar dentro da janela de visualização (viewport) ou, caso contrário, o comando resultará em erro. - -### Deslocamento a partir do Elemento - -Este método move o mouse para o ponto central do elemento visível na tela e, em seguida, move o mouse pelo deslocamento fornecido. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L118-L121" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L98-L101" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L132-L135" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L97-L100" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/moveByOffset.spec.js#L15-L17" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L119-L122" >}} -{{< /tab >}} -{{< /tabpane >}} - -### Deslocamento a partir da Janela de Visualização - -Este método move o mouse a partir do canto superior esquerdo da janela de visualização atual pelo deslocamento fornecido. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L131-L136" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L110-L112" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L146-L150" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L114-L116" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/moveByOffset.spec.js#L27-L28" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L132-L137" >}} -{{< /tab >}} -{{< /tabpane >}} - -### Deslocamento a partir da Localização Atual do Ponteiro -Este método move o mouse a partir de sua posição atual pelo deslocamento fornecido pelo usuário. Se o mouse não tiver sido movido anteriormente, a posição será no canto superior esquerdo da janela de visualização. É importante notar que a posição do ponteiro não muda quando a página é rolada. - -Observe que o primeiro argumento, X, especifica o movimento para a direita quando positivo, enquanto o segundo argumento, Y, especifica o movimento para baixo quando positivo. Portanto, `moveByOffset(30, -10)` move o mouse 30 unidades para a direita e 10 unidades para cima a partir da posição atual do mouse. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L153-L155" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L126-L128" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L167-L169" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L128-L130" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/moveByOffset.spec.js#L40" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L154-L156" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Arrastar e Soltar no Elemento - -Este método primeiro realiza um clique e mantém pressionado no elemento de origem, move para a localização do elemento de destino e, em seguida, libera o botão do mouse. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L166-L170" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L139-L143" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L181-L185" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L141-L145" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/dragAndDrop.spec.js#L27-L30" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L167-L171" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Arrastar e Soltar pelo Deslocamento - -Este método primeiro realiza um clique e mantém pressionado no elemento de origem, move para o deslocamento fornecido e, em seguida, libera o botão do mouse. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L179-L184" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L151-L156" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L195-L200" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L153-L158" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/dragAndDrop.spec.js#L15-L19" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L180-L185" >}} -{{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/actions_api/mouse.zh-cn.md b/website_and_docs/content/documentation/webdriver/actions_api/mouse.zh-cn.md deleted file mode 100644 index 05ae1ebb744e..000000000000 --- a/website_and_docs/content/documentation/webdriver/actions_api/mouse.zh-cn.md +++ /dev/null @@ -1,345 +0,0 @@ ---- -title: "鼠标操作" -linkTitle: "鼠标" -weight: 4 -description: > - 任何用于与网页进行交互的指针设备的表示形式. -aliases: [ -"/documentation/support_packages/mouse_and_keyboard_actions_in_detail/" -] ---- - -一个鼠标仅可以完成3个操作: -按住按钮,松开按钮,还有移动光标。 -Selenium组合了常见的操作并提供了方便的方法。 - - -## 按住鼠标左键 - -这个方法包含2个操作,首先将光标移动到被操作元素的正中心,然后按下鼠标左键不松开。 -这对于聚焦一个特殊元素很有用: - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L22-L25" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L14-L17" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L17-L20" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L11-L14" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/clickAndHold.spec.js#L14-L16" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L23-L26" >}} -{{< /tab >}} -{{< /tabpane >}} - -## 点击鼠标左键 - -这个方法包含2个操作,首先将光标移动到被操作元素的正中心,然后按下鼠标左键后再松开。 -另一种叫法“点击”: - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L34-L37" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L26-L29" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L30-L33" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L22-L25" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/clickAndRelease.spec.js#L14-L16" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L35-L38" >}} -{{< /tab >}} -{{< /tabpane >}} - -## 点击鼠标备用按钮 - -鼠标一共有5个定义好的按钮: -* 0 — 左键 (默认值) -* 1 — 中间键 (当前不支持) -* 2 — 右键 -* 3 — X1 (返回) 按钮 -* 4 — X2 (前进) 按钮 - -### 点击鼠标右键 - -这个方法包含2个操作,首先将光标移动到被操作元素的正中心,然后点击鼠标右键。 -另一种叫法“点击右键”: - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L46-L49" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L37-L40" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L43-L46" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L34-L37" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/rightClick.spec.js#L15-L17" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L47-L50" >}} -{{< /tab >}} -{{< /tabpane >}} - -### 点击鼠标回退键 - -除了这个没有更方便的方法,只是点击鼠标回退按钮 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L60-L66" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< badge-version version="4.2" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L51-L54" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< badge-version version="4.2" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L59-L63" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-version version="4.2" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L47-L50" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-version version="4.5.0" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/backAndForwardClick.spec.js#L19-L20" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L61-L67" >}} -{{< /tab >}} -{{< /tabpane >}} - -### 点击鼠标前进键 - -除了这个没有更方便的方法,只是点击鼠标前进按钮 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L78-L84" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< badge-version version="4.2" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L65-L68" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< badge-version version="4.2" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L77-L81" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-version version="4.2" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L61-L64" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-version version="4.5.0" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/backAndForwardClick.spec.js#L32-L33" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L79-L85" >}} -{{< /tab >}} -{{< /tabpane >}} - -## 双击鼠标左键 - -这个方法包含2个操作,首先将光标移动到被操作元素的正中心,然后双击鼠标左键。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L93-L96" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L76-L79" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L91-L94" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L73-L76" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/doubleClick.spec.js#L15-L17" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L94-L97" >}} -{{< /tab >}} -{{< /tabpane >}} - -## 移动光标到元素上 - -这个方法是将光标移动到元素的中心点。 -另一种叫法“悬停”。 -元素必须在可视窗口范围内否则这条命令将会报错。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L105-L108" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L87-L90" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L104-L107" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L84-L87" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/moveToElement.spec.js#L15-L17" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L106-L109" >}} -{{< /tab >}} -{{< /tabpane >}} - -## 通过偏移量移动动光标 - -这些方法让光标先移动到指定的坐标原点,然后通过单位为px的偏移量进行光标相对原点的偏移移动。 -注意光标位置必须在可视窗口区域否则会报错。 - -### 从元素中心点(原点)偏移 - -这个方法是指先将光标移动到元素中心点(原点),然后通过偏移量进行光标相对原点的偏移。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L118-L121" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L98-L101" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L132-L135" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L97-L100" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/moveByOffset.spec.js#L15-L17" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L119-L122" >}} -{{< /tab >}} -{{< /tabpane >}} - -### 从视窗左上角(原点)偏移 - -这个方法是指先将光标移动到视窗左上角(原点),然后通过偏移量进行光标相对原点的偏移。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L131-L136" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L110-L112" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L146-L150" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L114-L116" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/moveByOffset.spec.js#L27-L28" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L132-L137" >}} -{{< /tab >}} -{{< /tabpane >}} - -### 从当前光标位置(原点)偏移 - -这个方法是指光标位于当前位置(原点),然后通过偏移量进行光标相对原点的偏移。 -如果之前没有移动过光标位置,则这个位置是视窗左上角(原点)。 -注意当页面发生滚动后光标位置不会发生变化。 - -注意第一个参数指定为正数时向右移动,第二个参数指定为正数时向下移动。所以 `moveByOffset(30, -10)` 是指从当前光标位置向右移动30个像素位置和向上移动10个像素位置。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L153-L155" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L126-L128" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L167-L169" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L128-L130" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/moveByOffset.spec.js#L40" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L154-L156" >}} -{{< /tab >}} -{{< /tabpane >}} - -## 拖放元素 - -这个方法首先在原元素上提交执行按下鼠标左键,移动到目标元素位置后是释放鼠标左键。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L166-L170" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L139-L143" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L181-L185" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L141-L145" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/dragAndDrop.spec.js#L27-L30" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L167-L171" >}} -{{< /tab >}} -{{< /tabpane >}} - -## 通过偏移量拖放元素 -这个方法首先在原元素上提交执行按下鼠标左键,通过给出的偏移量移动元素后释放鼠标左键。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/actions_api/MouseTest.java#L179-L184" >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/actions_api/test_mouse.py#L151-L156" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/ActionsAPI/MouseTest.cs#L195-L200" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/actions_api/mouse_spec.rb#L153-L158" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/actionsApi/mouse/dragAndDrop.spec.js#L15-L19" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/actions_api/MouseTest.kt#L180-L185" >}} -{{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/bidi/logging.en.md b/website_and_docs/content/documentation/webdriver/bidi/logging.en.md index 121c2937cfa2..8c6d5838189e 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/logging.en.md +++ b/website_and_docs/content/documentation/webdriver/bidi/logging.en.md @@ -9,7 +9,11 @@ aliases: [ "/documentation/en/webdriver/bidirectional/bidirectional_w3c/log", "/documentation/webdriver/bidirectional/webdriver_bidi/log", "/documentation/ja/webdriver/bidirectional/bidirectional_w3c/log", -"/documentation/zh-cn/webdriver/bidirectional/bidirectional_w3c/log" +"/documentation/zh-cn/webdriver/bidirectional/bidirectional_w3c/log", +"/ja/documentation/webdriver/bidi/logging/", +"/ja/documentation/webdriver/bidirectional/webdriver_bidi/log", +"/zh-cn/documentation/webdriver/bidi/logging/", +"/zh-cn/documentation/webdriver/bidirectional/webdriver_bidi/log" ] --- diff --git a/website_and_docs/content/documentation/webdriver/bidi/logging.ja.md b/website_and_docs/content/documentation/webdriver/bidi/logging.ja.md deleted file mode 100644 index bf0b34bcf76e..000000000000 --- a/website_and_docs/content/documentation/webdriver/bidi/logging.ja.md +++ /dev/null @@ -1,118 +0,0 @@ ---- -title: "WebDriver BiDi Logging Features" -linkTitle: "Logging" -weight: 1 -description: > - These features are related to logging. Because "logging" can refer to so many - different things, these methods are made available via a "script" namespace. -aliases: [ -"/documentation/webdriver/bidirectional/webdriver_bidi/log" -] ---- - -Remember that to use WebDriver BiDi, you must enable it in Options. -For more details, see [Enabling BiDi]({{< ref "BiDi" >}}) - -## Console Message Handlers - -Record or take actions on `console.log` events. - -### Add Handler - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/bidi/test_bidi_logging.py#L11" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/bidi/logging_spec.rb#L11" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### Remove Handler - -You need to store the ID returned when adding the handler to delete it. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/bidi/test_bidi_logging.py#L23-24" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/bidi/logging_spec.rb#L22-L23" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -## JavaScript Exception Handlers - -Record or take actions on JavaScript exception events. - -### Add Handler - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/bidi/test_bidi_logging.py#L35" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/bidi/logging_spec.rb#L33" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### Remove Handler - -You need to store the ID returned when adding the handler to delete it. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/bidi/test_bidi_logging.py#L47-48" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/bidi/logging_spec.rb#L44-L45" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/bidi/logging.zh-cn.md b/website_and_docs/content/documentation/webdriver/bidi/logging.zh-cn.md deleted file mode 100644 index c447199f34e6..000000000000 --- a/website_and_docs/content/documentation/webdriver/bidi/logging.zh-cn.md +++ /dev/null @@ -1,120 +0,0 @@ ---- -title: "WebDriver BiDi 日志功能" -linkTitle: "日志" -weight: 1 -description: > - 这些功能与日志记录有关。 - 由于"logging"可以指代许多不同的事物, - 因此这些方法通过"script"命名空间提供. -aliases: [ -"/documentation/webdriver/bidirectional/webdriver_bidi/log" -] ---- - -请记住, 要使用 WebDriver BiDi, -您必须在选项中启用它. -更多详情, 请参阅 [启用 BiDi]({{< ref "BiDi" >}}) . - -## 控制台消息处理程序 - -记录或对 `console.log` 事件采取行动. - -### 添加处理程序 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/bidi/test_bidi_logging.py#L11" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/bidi/logging_spec.rb#L11" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### 删除处理程序 - -您需要存储添加处理程序时返回的 ID 以便将其删除. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/bidi/test_bidi_logging.py#L23-24" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/bidi/logging_spec.rb#L22-L23" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -## JavaScript 异常处理程序 - -记录或对 JavaScript 异常事件采取行动. - -### 添加处理程序 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/bidi/test_bidi_logging.py#L35" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/bidi/logging_spec.rb#L33" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### 删除处理程序 - -您需要存储添加处理程序时返回的 ID 以便将其删除. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/bidi/test_bidi_logging.py#L47-48" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/bidi/logging_spec.rb#L44-L45" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/bidi/script.en.md b/website_and_docs/content/documentation/webdriver/bidi/script.en.md index 94028e664fdd..7f0665597079 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/script.en.md +++ b/website_and_docs/content/documentation/webdriver/bidi/script.en.md @@ -9,7 +9,13 @@ aliases: [ "/documentation/webdriver/bidirectional/webdriver_bidi/script", "/documentation/ja/webdriver/bidirectional/bidirectional_w3c/script", "/documentation/pt-br/webdriver/bidirectional/bidirectional_w3c/script", -"/documentation/zh-cn/webdriver/bidirectional/bidirectional_w3c/script" +"/documentation/zh-cn/webdriver/bidirectional/bidirectional_w3c/script", +"/ja/documentation/webdriver/bidi/script/", +"/ja/documentation/webdriver/bidirectional/webdriver_bidi/script", +"/pt-br/documentation/webdriver/bidi/script/", +"/pt-br/documentation/webdriver/bidirectional/webdriver_bidi/script", +"/zh-cn/documentation/webdriver/bidi/script/", +"/zh-cn/documentation/webdriver/bidirectional/webdriver_bidi/script" ] --- diff --git a/website_and_docs/content/documentation/webdriver/bidi/script.ja.md b/website_and_docs/content/documentation/webdriver/bidi/script.ja.md deleted file mode 100644 index 74272e4cf635..000000000000 --- a/website_and_docs/content/documentation/webdriver/bidi/script.ja.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "WebDriver BiDi Script Features" -linkTitle: "Script" -weight: 1 -description: > - These features are related to scripts, and are made available via a "script" namespace. -aliases: [ -"/documentation/webdriver/bidirectional/webdriver_bidi/script" -] ---- - -The implementation of these features is being tracked here: [#13992](https://github.com/SeleniumHQ/selenium/issues/13992) - -Remember that to use WebDriver BiDi, you must enable it in Options. -For more details, see [Enabling BiDi]({{< ref "BiDi" >}}) - -## Script Pinning - -## Execute Script - -## DOM Mutation Handlers diff --git a/website_and_docs/content/documentation/webdriver/bidi/script.pt-br.md b/website_and_docs/content/documentation/webdriver/bidi/script.pt-br.md deleted file mode 100644 index 74272e4cf635..000000000000 --- a/website_and_docs/content/documentation/webdriver/bidi/script.pt-br.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "WebDriver BiDi Script Features" -linkTitle: "Script" -weight: 1 -description: > - These features are related to scripts, and are made available via a "script" namespace. -aliases: [ -"/documentation/webdriver/bidirectional/webdriver_bidi/script" -] ---- - -The implementation of these features is being tracked here: [#13992](https://github.com/SeleniumHQ/selenium/issues/13992) - -Remember that to use WebDriver BiDi, you must enable it in Options. -For more details, see [Enabling BiDi]({{< ref "BiDi" >}}) - -## Script Pinning - -## Execute Script - -## DOM Mutation Handlers diff --git a/website_and_docs/content/documentation/webdriver/bidi/script.zh-cn.md b/website_and_docs/content/documentation/webdriver/bidi/script.zh-cn.md deleted file mode 100644 index 74272e4cf635..000000000000 --- a/website_and_docs/content/documentation/webdriver/bidi/script.zh-cn.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "WebDriver BiDi Script Features" -linkTitle: "Script" -weight: 1 -description: > - These features are related to scripts, and are made available via a "script" namespace. -aliases: [ -"/documentation/webdriver/bidirectional/webdriver_bidi/script" -] ---- - -The implementation of these features is being tracked here: [#13992](https://github.com/SeleniumHQ/selenium/issues/13992) - -Remember that to use WebDriver BiDi, you must enable it in Options. -For more details, see [Enabling BiDi]({{< ref "BiDi" >}}) - -## Script Pinning - -## Execute Script - -## DOM Mutation Handlers diff --git a/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.en.md b/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.en.md index 901049a76082..95609ddd294e 100644 --- a/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.en.md +++ b/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.en.md @@ -11,7 +11,13 @@ aliases: [ "/documentation/webdriver/bidi_apis/bidi_w3c", "/documentation/ja/webdriver/bidi_apis/bidi_w3c", "/documentation/pt-br/webdriver/bidi_apis/bidi_w3c", -"/documentation/zh-cn/webdriver/bidi_apis/bidi_w3c" +"/documentation/zh-cn/webdriver/bidi_apis/bidi_w3c", +"/ja/documentation/webdriver/bidi/w3c/", +"/ja/documentation/webdriver/bidi_apis/bidi_w3c", +"/pt-br/documentation/webdriver/bidi/w3c/", +"/pt-br/documentation/webdriver/bidi_apis/bidi_w3c", +"/zh-cn/documentation/webdriver/bidi/w3c/", +"/zh-cn/documentation/webdriver/bidi_apis/bidi_w3c" ] --- diff --git a/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.ja.md b/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.ja.md deleted file mode 100644 index ef405b5f33c3..000000000000 --- a/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.ja.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "BiDirectional API (W3C compliant)" -linkTitle: "BiDi API (W3C compliant)" -weight: 16 -aliases: [ -"/documentation/webdriver/bidi_apis/bidi_w3c" -] ---- - -{{% pageinfo color="warning" %}} -

- - Page being translated from English to Japanese. - Do you speak Japanese? Help us to translate - it by sending us pull requests! -

-{{% /pageinfo %}} - -The following list of APIs will be growing as the [WebDriver BiDirectional Protocol](https://w3c.github.io/webdriver-bidi/) grows -and browser vendors implement the same. -Additionally, Selenium will try to support real-world use cases that internally use a combination of W3C BiDi protocol APIs. - -If there is additional functionality you'd like to see, please raise a -[feature request](https://github.com/SeleniumHQ/selenium/issues/new?assignees=&labels=&template=feature.md). diff --git a/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.pt-br.md deleted file mode 100644 index d2d8ee08f475..000000000000 --- a/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.pt-br.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -title: "BiDirectional API (W3C compliant)" -linkTitle: "BiDi API (W3C compliant)" -weight: 16 -aliases: [ -"/documentation/webdriver/bidi_apis/bidi_w3c" -] ---- - -{{% pageinfo color="warning" %}} -

- - Page being translated from - English to Portuguese. Do you speak Portuguese? Help us to translate - it by sending us pull requests! -

-{{% /pageinfo %}} - -The following list of APIs will be growing as the [WebDriver BiDirectional Protocol](https://w3c.github.io/webdriver-bidi/) grows -and browser vendors implement the same. -Additionally, Selenium will try to support real-world use cases that internally use a combination of W3C BiDi protocol APIs. - -If there is additional functionality you'd like to see, please raise a -[feature request](https://github.com/SeleniumHQ/selenium/issues/new?assignees=&labels=&template=feature.md). \ No newline at end of file diff --git a/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.zh-cn.md deleted file mode 100644 index 5ffb6e94c3a0..000000000000 --- a/website_and_docs/content/documentation/webdriver/bidi/w3c/_index.zh-cn.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "BiDirectional API (W3C compliant)" -linkTitle: "BiDi API (W3C compliant)" -weight: 16 -aliases: [ -"/documentation/webdriver/bidi_apis/bidi_w3c" -] ---- - -The following list of APIs will be growing as the [WebDriver BiDirectional Protocol](https://w3c.github.io/webdriver-bidi/) grows -and browser vendors implement the same. -Additionally, Selenium will try to support real-world use cases that internally use a combination of W3C BiDi protocol APIs. - -If there is additional functionality you'd like to see, please raise a -[feature request](https://github.com/SeleniumHQ/selenium/issues/new?assignees=&labels=&template=feature.md). \ No newline at end of file diff --git a/website_and_docs/content/documentation/webdriver/browsers/_index.en.md b/website_and_docs/content/documentation/webdriver/browsers/_index.en.md index 88219fe5e6dc..dc08c474c1f4 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/_index.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/_index.en.md @@ -13,7 +13,19 @@ aliases: [ "/documentation/pt-br/driver_idiosyncrasies/", "/documentation/pt-br/driver_idiosyncrasies/driver_specific_capabilities/", "/documentation/zh-cn/driver_idiosyncrasies/", -"/documentation/zh-cn/driver_idiosyncrasies/driver_specific_capabilities/" +"/documentation/zh-cn/driver_idiosyncrasies/driver_specific_capabilities/", +"/ja/documentation/capabilities/", +"/ja/documentation/getting_started/open_browser/", +"/ja/documentation/webdriver/browsers/", +"/ja/documentation/webdriver/capabilities/driver_specific_capabilities/", +"/pt-br/documentation/capabilities/", +"/pt-br/documentation/getting_started/open_browser/", +"/pt-br/documentation/webdriver/browsers/", +"/pt-br/documentation/webdriver/capabilities/driver_specific_capabilities/", +"/zh-cn/documentation/capabilities/", +"/zh-cn/documentation/getting_started/open_browser/", +"/zh-cn/documentation/webdriver/browsers/", +"/zh-cn/documentation/webdriver/capabilities/driver_specific_capabilities/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/browsers/_index.ja.md b/website_and_docs/content/documentation/webdriver/browsers/_index.ja.md deleted file mode 100644 index ec07fd908e35..000000000000 --- a/website_and_docs/content/documentation/webdriver/browsers/_index.ja.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "対応ブラウザ" -linkTitle: "ブラウザ" -weight: 4 -aliases: [ -"/documentation/webdriver/capabilities/driver_specific_capabilities/", -"/documentation/getting_started/open_browser/", -"/documentation/capabilities/" -] ---- - -各ブラウザにはカスタム機能とユニークな特徴があります。 \ No newline at end of file diff --git a/website_and_docs/content/documentation/webdriver/browsers/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/_index.pt-br.md deleted file mode 100644 index 06a79cf2c87b..000000000000 --- a/website_and_docs/content/documentation/webdriver/browsers/_index.pt-br.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "Navegadores suportados" -linkTitle: "Navegadores" -weight: 4 -aliases: [ -"/documentation/webdriver/capabilities/driver_specific_capabilities/", -"/documentation/getting_started/open_browser/", -"/documentation/capabilities/" -] ---- - -Cada navegador tem capacidades e características únicas. diff --git a/website_and_docs/content/documentation/webdriver/browsers/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/_index.zh-cn.md deleted file mode 100644 index 96338477a868..000000000000 --- a/website_and_docs/content/documentation/webdriver/browsers/_index.zh-cn.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "支持的浏览器列表" -linkTitle: "浏览器" -weight: 4 -aliases: [ -"/documentation/webdriver/capabilities/driver_specific_capabilities/", -"/documentation/getting_started/open_browser/", -"/documentation/capabilities/" -] ---- - -每个浏览器都有定制和特有的功能。 diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md index 74a1c0aea4b8..b5defe2b9a13 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md @@ -14,7 +14,7 @@ aliases: [ ## Options -すべてのブラウザに共通する機能は [オプション ページ]({{< ref "../drivers/options.md" >}})に記載されています。 +すべてのブラウザに共通する機能は [オプション ページ]({{< ref path="../drivers/options.md" lang="en" >}})に記載されています。 ChromeおよびChromiumに特有の機能は、Googleの [Capabilities & ChromeOptions](https://chromedriver.chromium.org/capabilities)のページにドキュメントされています。 @@ -386,7 +386,7 @@ Chrome Castデバイスを操作することができ、タブの共有も含ま さまざまなネットワークの状態をシミュレートできます。 -以下の例はローカルWebDriver用です。リモートWebDriverについては、[リモートWebDriver]({{< ref "../drivers/remote_webdriver" >}})ページを参照してください。 +以下の例はローカルWebDriver用です。リモートWebDriverについては、[リモートWebDriver]({{< ref path="../drivers/remote_webdriver" lang="en" >}})ページを参照してください。 {{< tabpane text=true >}} {{< tab header="Java" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md index a1e0b8a7c720..eea373a6e1cf 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md @@ -13,7 +13,7 @@ Por omissão, Selenium 4 é compatível com Chrome v75 e superiores. Note que a ## Opções -Capacidades comuns a todos os navegadores estão descritas na [página Opções]({{< ref "../drivers/options.md" >}}). +Capacidades comuns a todos os navegadores estão descritas na [página Opções]({{< ref path="../drivers/options.md" lang="en" >}}). Capacidades únicas ao Chrome podem ser encontradas na página da Google para [Capacidades e & ChromeOptions](https://chromedriver.chromium.org/capabilities) @@ -395,7 +395,7 @@ Pode simular vários estados de rede (como exemplo, simular situações com pouc The following examples are for local webdrivers. For remote webdrivers, please refer to the -[Remote WebDriver]({{< ref "../drivers/remote_webdriver" >}}) page. +[Remote WebDriver]({{< ref path="../drivers/remote_webdriver" lang="en" >}}) page. {{< tabpane text=true >}} {{< tab header="Java" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md index 83bd255a5184..029ae0e91ccc 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md @@ -13,7 +13,7 @@ aliases: [ ## Options -所有浏览器的通用功能请看这 [Options page]({{< ref "../drivers/options.md" >}}). +所有浏览器的通用功能请看这 [Options page]({{< ref path="../drivers/options.md" lang="en" >}}). Chrome浏览器的特有功能可以在谷歌的页面找到: [Capabilities & ChromeOptions](https://chromedriver.chromium.org/capabilities) @@ -395,7 +395,7 @@ Chromedriver 和 Chrome 浏览器版本应该匹配, 如果它们不匹配, 驱 以下示例适用于本地 webdrivers. 针对远程 webdrivers, 请参考 -[Remote WebDriver]({{< ref "../drivers/remote_webdriver" >}}) 页面. +[Remote WebDriver]({{< ref path="../drivers/remote_webdriver" lang="en" >}}) 页面. {{< tabpane text=true >}} {{< tab header="Java" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md index 1588ec392666..b721ca2386c6 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md @@ -13,7 +13,7 @@ Chromeと同様に、edgedriverのメジャー バージョン番号は、Edge ## オプション -すべてのブラウザに共通する機能は[オプション ページ]({{< ref "../drivers/options.md" >}})に記載されています。 +すべてのブラウザに共通する機能は[オプション ページ]({{< ref path="../drivers/options.md" lang="en" >}})に記載されています。 Chromiumに特有の機能は、Googleの[Capabilities & ChromeOptions](https://chromedriver.chromium.org/capabilities)ページに文書化されています。 diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md index 99fa48e95727..646c32e9e2a1 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.pt-br.md @@ -13,7 +13,7 @@ Todas as capacidades e opções encontradas na página [Chrome page]({{< ref "ch ## Opções -Capabilities common to all browsers are described on the [Options page]({{< ref "../drivers/options.md" >}}). +Capabilities common to all browsers are described on the [Options page]({{< ref path="../drivers/options.md" lang="en" >}}). Capabilities unique to Chromium are documented at Google's page for [Capabilities & ChromeOptions](https://chromedriver.chromium.org/capabilities) diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md index 14b866a6c99b..bac601cab2d5 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.zh-cn.md @@ -13,7 +13,7 @@ description: >- ## 选项 -所有浏览器的共有功能在 [Options 页面]({{< ref "../drivers/options.md" >}}). +所有浏览器的共有功能在 [Options 页面]({{< ref path="../drivers/options.md" lang="en" >}}). Chromium独有的功能记录在谷歌的 [Capabilities & ChromeOptions](https://chromedriver.chromium.org/capabilities) diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md index 54b971a7c87d..44986c99a030 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md @@ -14,7 +14,7 @@ Selenium 4 には Firefox 78 以降が必要です。 ## オプション -全ブラウザに共通のCapabilityについては、[オプションページ]({{< ref "../drivers/options.md" >}})で説明しています。 +全ブラウザに共通のCapabilityについては、[オプションページ]({{< ref path="../drivers/options.md" lang="en" >}})で説明しています。 Firefox に固有のCapabilityは、Mozilla のページの [firefoxOptions](https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities/firefoxOptions) にあります。 @@ -325,7 +325,7 @@ Chromeとは異なり、Firefoxの拡張機能はCapabilityの一部として追 Chromeとは異なり、Firefoxの拡張機能は[この問題](https://github.com/mozilla/geckodriver/issues/1476)に記載されているように、機能の一部として追加されるのではなく、ドライバーの起動後に作成されます。 -T以下の例はローカルWebDriver用です。リモートWebDriverについては、[Remote WebDriver]({{< ref "../drivers/remote_webdriver" >}})ページを参照してください。 +T以下の例はローカルWebDriver用です。リモートWebDriverについては、[Remote WebDriver]({{< ref path="../drivers/remote_webdriver" lang="en" >}})ページを参照してください。 #### インストール @@ -410,7 +410,7 @@ IDはアドオンインストール時の戻り値から取得できます。 ### ページ全体のスクリーンショット -以下の例はローカルWebDriver用です。リモートWebDriverについては、[Remote WebDriver]({{< ref "../drivers/remote_webdriver" >}})ページを参照してください。 +以下の例はローカルWebDriver用です。リモートWebDriverについては、[Remote WebDriver]({{< ref path="../drivers/remote_webdriver" lang="en" >}})ページを参照してください。 {{< tabpane text=true >}} {{< tab header="Java" >}} @@ -435,7 +435,7 @@ IDはアドオンインストール時の戻り値から取得できます。 ### コンテキスト -以下の例はローカルWebDriver用です。リモートWebDriverについては、[Remote WebDriver]({{< ref "../drivers/remote_webdriver" >}})ページを参照してください。 +以下の例はローカルWebDriver用です。リモートWebDriverについては、[Remote WebDriver]({{< ref path="../drivers/remote_webdriver" lang="en" >}})ページを参照してください。 {{< tabpane text=true >}} {{< tab header="Java" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md index 819de462656e..c80401af46cb 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.pt-br.md @@ -13,7 +13,7 @@ Por omissão, Selenium 4 é compatível com Firefox 78 ou superior. Recomendamos ## Opções -Capacidades comuns a todos os navegadores estão descritas na [página Opções]({{< ref "../drivers/options.md" >}}). +Capacidades comuns a todos os navegadores estão descritas na [página Opções]({{< ref path="../drivers/options.md" lang="en" >}}). Capacidades únicas ao Firefox podem ser encontradas na página da Mozilla para [firefoxOptions](https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities/firefoxOptions) @@ -331,7 +331,7 @@ they are created after starting the driver. The following examples are for local webdrivers. For remote webdrivers, please refer to the -[Remote WebDriver]({{< ref "../drivers/remote_webdriver" >}}) page. +[Remote WebDriver]({{< ref path="../drivers/remote_webdriver" lang="en" >}}) page. #### Instalação @@ -417,7 +417,7 @@ uma pasta, este é um exemplo com uma pasta: The following examples are for local webdrivers. For remote webdrivers, please refer to the -[Remote WebDriver]({{< ref "../drivers/remote_webdriver" >}}) page. +[Remote WebDriver]({{< ref path="../drivers/remote_webdriver" lang="en" >}}) page. {{< tabpane text=true >}} {{< tab header="Java" >}} @@ -444,7 +444,7 @@ please refer to the The following examples are for local webdrivers. For remote webdrivers, please refer to the -[Remote WebDriver]({{< ref "../drivers/remote_webdriver" >}}) page. +[Remote WebDriver]({{< ref path="../drivers/remote_webdriver" lang="en" >}}) page. {{< tabpane text=true >}} {{< tab header="Java" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md index 652caa943eb4..50335071354b 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.zh-cn.md @@ -13,7 +13,7 @@ Selenium 4 requires Firefox 78 or greater. It is recommended to always use the l ## Options -Capabilities common to all browsers are described on the [Options page]({{< ref "../drivers/options.md" >}}). +Capabilities common to all browsers are described on the [Options page]({{< ref path="../drivers/options.md" lang="en" >}}). Capabilities unique to Firefox can be found at Mozilla's page for [firefoxOptions](https://developer.mozilla.org/en-US/docs/Web/WebDriver/Capabilities/firefoxOptions) @@ -328,7 +328,7 @@ they are created after starting the driver. The following examples are for local webdrivers. For remote webdrivers, please refer to the -[Remote WebDriver]({{< ref "../drivers/remote_webdriver" >}}) page. +[Remote WebDriver]({{< ref path="../drivers/remote_webdriver" lang="en" >}}) page. #### Installation @@ -414,7 +414,7 @@ example with a directory: The following examples are for local webdrivers. For remote webdrivers, please refer to the -[Remote WebDriver]({{< ref "../drivers/remote_webdriver" >}}) page. +[Remote WebDriver]({{< ref path="../drivers/remote_webdriver" lang="en" >}}) page. {{< tabpane text=true >}} {{< tab header="Java" >}} @@ -441,7 +441,7 @@ please refer to the The following examples are for local webdrivers. For remote webdrivers, please refer to the -[Remote WebDriver]({{< ref "../drivers/remote_webdriver" >}}) page. +[Remote WebDriver]({{< ref path="../drivers/remote_webdriver" lang="en" >}}) page. {{< tabpane text=true >}} {{< tab header="Java" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md b/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md index 72e6d3a129c2..4ac10d6c1f59 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md @@ -19,7 +19,7 @@ safaridriver --enable ## オプション -すべてのブラウザに共通する機能は、[オプションページ]({{< ref "../drivers/options.md" >}})で説明しています。 +すべてのブラウザに共通する機能は、[オプションページ]({{< ref path="../drivers/options.md" lang="en" >}})で説明しています。 Safari 固有の機能については、Apple の [About WebDriver for Safari](https://developer.apple.com/documentation/webkit/about_webdriver_for_safari#2957227) diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md b/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md index f84630aecc81..74c9513310a8 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.pt-br.md @@ -18,7 +18,7 @@ safaridriver --enable ## Opções -Capacidades comuns a todos os navegadores estão descritas na [página Opções]({{< ref "../drivers/options.md" >}}). +Capacidades comuns a todos os navegadores estão descritas na [página Opções]({{< ref path="../drivers/options.md" lang="en" >}}). Capacidades únicas ao Safari podem ser encontradas na página da Apple [WebDriver para Safari](https://developer.apple.com/documentation/webkit/about_webdriver_for_safari#2957227) diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md b/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md index ad66615b8576..cb855dbbf31b 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.zh-cn.md @@ -18,7 +18,7 @@ safaridriver --enable ## 选项 -所有浏览器通用的Capabilities在[选项页]({{< ref "../drivers/options.md" >}}). +所有浏览器通用的Capabilities在[选项页]({{< ref path="../drivers/options.md" lang="en" >}}). Safari独有的Capabilities可以在Apple的页面[关于Safari的WebDriver](https://developer.apple.com/documentation/webkit/about_webdriver_for_safari#2957227) 上找到 diff --git a/website_and_docs/content/documentation/webdriver/drivers/_index.ja.md b/website_and_docs/content/documentation/webdriver/drivers/_index.ja.md index 993422a44e0b..8ed637caec95 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/_index.ja.md +++ b/website_and_docs/content/documentation/webdriver/drivers/_index.ja.md @@ -14,7 +14,7 @@ weight: 3 各言語では、次のいずれかのクラス (または同等のもの) の引数を使用してセッションを作成することができます。 -* [オプション]({{< ref "options.md" >}}) 作成を希望するセッションの種類 ; ローカルにはデフォルト値を使用しますが、リモートには必須です。 +* [オプション]({{< ref path="options.md" lang="en" >}}) 作成を希望するセッションの種類 ; ローカルにはデフォルト値を使用しますが、リモートには必須です。 * 何らかの形の[HTTP Client configuration]({{< ref "http_client.md" >}}) (実装は言語によって異なります) * [リスナー]({{< ref "listeners.md" >}}) @@ -48,7 +48,7 @@ weight: 3 ### リモートドライバー リモートドライバーを起動するための主な一意の引数には、コードを実行する場所に関する情報を含みます。 -詳細は、[リモートドライバー]({{< ref "remote_webdriver.md" >}})をご覧ください。 +詳細は、[リモートドライバー]({{< ref path="remote_webdriver.md" lang="en" >}})をご覧ください。 ## セッションの終了 diff --git a/website_and_docs/content/documentation/webdriver/drivers/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/drivers/_index.pt-br.md index 76bb5d7e3765..e7fffb951b69 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/_index.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/drivers/_index.pt-br.md @@ -14,7 +14,7 @@ A sessão é criada automaticamente ao inicializar um novo objeto da classe Driv Cada linguagem permite que uma sessão seja criada com argumentos de uma dessas classes (ou equivalentes): -* [Options]({{< ref "options.md" >}}) to describe the kind of session you want; default values are used for local, but +* [Options]({{< ref path="options.md" lang="en" >}}) to describe the kind of session you want; default values are used for local, but this is required for remote * Alguma forma de [configuração do cliente HTTP]({{< ref "http_client.md" >}}) (a implementação varia entre as linguagens) * [Ouvintes]({{< ref "listeners.md" >}}) @@ -48,7 +48,7 @@ O principal argumento exclusivo para iniciar um driver local inclui informaçõe ### Driver Remoto -O principal argumento exclusivo para iniciar um driver remoto inclui informações sobre onde executar o código. Leia os detalhes na [seção Driver Remoto]({{< ref "remote_webdriver.md" >}}) +O principal argumento exclusivo para iniciar um driver remoto inclui informações sobre onde executar o código. Leia os detalhes na [seção Driver Remoto]({{< ref path="remote_webdriver.md" lang="en" >}}) ## Encerrando Sessões diff --git a/website_and_docs/content/documentation/webdriver/drivers/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/drivers/_index.zh-cn.md index 6dd9fc198f4e..7aed4bb29ca8 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/_index.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/drivers/_index.zh-cn.md @@ -14,7 +14,7 @@ weight: 3 每种语言都允许使用来自这些类 (或等效类) 之一的参数创建会话: -* [选项]({{< ref "options.md" >}}) 描述您想要的会话类型; 默认值为local,但是对于remote则是必须设置的 +* [选项]({{< ref path="options.md" lang="en" >}}) 描述您想要的会话类型; 默认值为local,但是对于remote则是必须设置的 * 各种形式的 [HTTP Client configuration]({{< ref "http_client.md" >}}) (实现因语言而异) * [监听器]({{< ref "listeners.md" >}}) @@ -49,7 +49,7 @@ weight: 3 ### 远程驱动 用于启动远程驱动的首要唯一参数包括有关在何处执行代码的信息. -请浏览 [远程驱动章节]({{< ref "remote_webdriver.md" >}})中的详细信息 +请浏览 [远程驱动章节]({{< ref path="remote_webdriver.md" lang="en" >}})中的详细信息 ## 退出会话 diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.en.md b/website_and_docs/content/documentation/webdriver/drivers/options.en.md index a799240efcbd..5206ea6ca690 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/options.en.md +++ b/website_and_docs/content/documentation/webdriver/drivers/options.en.md @@ -22,7 +22,28 @@ aliases: [ "/documentation/pt-br/webdriver/page_loading_strategy/", "/documentation/zh-cn/driver_idiosyncrasies/shared_capabilities/", "/documentation/zh-cn/webdriver/http_proxies/", -"/documentation/zh-cn/webdriver/page_loading_strategy/" +"/documentation/zh-cn/webdriver/page_loading_strategy/", +"/ja/documentation/capabilitis/shared/", +"/ja/documentation/webdriver/capabilities/http_proxies/", +"/ja/documentation/webdriver/capabilities/page_loading_strategy/", +"/ja/documentation/webdriver/capabilities/shared_capabilities/", +"/ja/documentation/webdriver/drivers/options/", +"/ja/documentation/webdriver/http_proxies/", +"/ja/documentation/webdriver/page_loading_strategy/", +"/pt-br/documentation/capabilitis/shared/", +"/pt-br/documentation/webdriver/capabilities/http_proxies/", +"/pt-br/documentation/webdriver/capabilities/page_loading_strategy/", +"/pt-br/documentation/webdriver/capabilities/shared_capabilities/", +"/pt-br/documentation/webdriver/drivers/options/", +"/pt-br/documentation/webdriver/http_proxies/", +"/pt-br/documentation/webdriver/page_loading_strategy/", +"/zh-cn/documentation/capabilitis/shared/", +"/zh-cn/documentation/webdriver/capabilities/http_proxies/", +"/zh-cn/documentation/webdriver/capabilities/page_loading_strategy/", +"/zh-cn/documentation/webdriver/capabilities/shared_capabilities/", +"/zh-cn/documentation/webdriver/drivers/options/", +"/zh-cn/documentation/webdriver/http_proxies/", +"/zh-cn/documentation/webdriver/page_loading_strategy/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.ja.md b/website_and_docs/content/documentation/webdriver/drivers/options.ja.md deleted file mode 100644 index 43af93aba9db..000000000000 --- a/website_and_docs/content/documentation/webdriver/drivers/options.ja.md +++ /dev/null @@ -1,568 +0,0 @@ ---- -title: "ブラウザーオプション" -linkTitle: "オプション" -weight: 2 -description: >- - これらの機能はすべてのブラウザで共有されています。 -aliases: [ -"/documentation/webdriver/capabilities/shared_capabilities/", -"/documentation/webdriver/http_proxies/", -"/documentation/webdriver/capabilities/http_proxies/", -"/documentation/webdriver/page_loading_strategy/", -"/documentation/webdriver/capabilities/page_loading_strategy/", -"/documentation/capabilitis/shared/" -] ---- - -Selenium 3 では、Capabilitiesは Desired Capabilities クラスを使用してセッションで定義していました。 -Selenium 4 以降、ブラウザ オプション クラスを使用する必要があります。 -リモート ドライバー セッションの場合、使用するブラウザーを決めるため、ブラウザーオプションインスタンスが必要です。 - -これらのオプションは、[Capabilities](https://w3c.github.io/webdriver/#capabilities) の w3c仕様で説明しています。 - -各ブラウザには、w3c仕様で定義しているものに加えて定義可能な [カスタム オプション]({{< ref "../browsers/" >}}) があります。 - -## browserName - -オプションクラスのインスタンスを使用すると、ブラウザ名はデフォルトで設定されます。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L73-74" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L79-80" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L11" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## browserVersion - -この機能はオプションであり、リモート側で使用可能なブラウザのバージョンを設定するために使用されます。最近のSeleniumのバージョンでは、システムにバージョンが見つからない場合、[Selenium Manager]({{< ref "../../selenium_manager" >}}) によって自動的にダウンロードされます。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L80-82" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L86-88" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L40" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## pageLoadStrategy - -3種類のページ読み込み戦略を利用できます。 - -ページ読み込み戦略は、次の表で説明しています。 - -| 戦略 | 準備完了状態 | 注釈 | -| -------- | ----------- | ----- | -| normal | complete | デフォルトで使用され、すべてのリソースをダウンロードするのを待ちます | -| eager | interactive | DOM アクセスの準備は整っていますが、画像などの他のリソースはまだロード中の可能性があります | -| none | Any | WebDriver をまったくブロックしません | - -ドキュメントの [document.readyState](//developer.mozilla.org/en-US/docs/Web/API/Document/readyState) -プロパティは、現在のドキュメントの読み込み状態を示します。 - -URL 経由で新しいページに移動する場合、デフォルトでは、WebDriver は、ドキュメントの準備完了状態が完了するまで、 -ナビゲーション メソッド (driver.navigate().get() など) の完了を保留します。 -_これは必ずしもページの読み込みが完了したことを意味するわけではありません。_ -特に、Ready State が完了した後に JavaScript を使用してコンテンツを動的に読み込むシングル ページ アプリケーションのようなサイトの場合はそうです。 -また、この動作は、要素のクリックまたはフォームの送信の結果であるナビゲーションには適用されないことに注意してください。 - -自動化にとって重要ではないアセット (画像、css、js など) をダウンロードした結果、ページの読み込みに時間がかかる場合は、 -デフォルトのパラメーターである `normal` を `eager` または `none` に変更して、セッションの読み込みを高速化できます。 -この値はセッション全体に適用されるため、 [待機戦略]({{< ref "/documentation/webdriver/waits.md" >}}) -が不安定さを最小限に抑えるのに十分であることを確認してください。 - -### normal (デフォルト) - -WebDriver は [load](https://developer.mozilla.org/ja/docs/Web/API/Window/load_event) -イベント検知するまで待機します。 - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L21-L23">}} -{{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L7-9">}} -{{< /tab >}} -{{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L13-14" >}} -{{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L11-L12">}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/capabilities/pageLoading.spec.js#L28-L34">}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -import org.openqa.selenium.PageLoadStrategy -import org.openqa.selenium.chrome.ChromeDriver -import org.openqa.selenium.chrome.ChromeOptions - -fun main() { - val chromeOptions = ChromeOptions() - chromeOptions.setPageLoadStrategy(PageLoadStrategy.NORMAL) - val driver = ChromeDriver(chromeOptions) - try { - driver.get("https://www.google.com") - } - finally { - driver.quit() - } -} -{{< /tab >}} -{{< /tabpane >}} - -### eager - -WebDriver は、[DOMContentLoaded](https://developer.mozilla.org/ja/docs/Web/API/Document/DOMContentLoaded_event) -イベントを検知するまで待機します。 - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L34-L36">}} -{{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L15-L17">}} -{{< /tab >}} -{{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L29-30" >}} -{{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L20-L21">}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/capabilities/pageLoading.spec.js#L8-L14">}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -import org.openqa.selenium.PageLoadStrategy -import org.openqa.selenium.chrome.ChromeDriver -import org.openqa.selenium.chrome.ChromeOptions - -fun main() { - val chromeOptions = ChromeOptions() - chromeOptions.setPageLoadStrategy(PageLoadStrategy.EAGER) - val driver = ChromeDriver(chromeOptions) - try { - driver.get("https://www.google.com") - } - finally { - driver.quit() - } -} -{{< /tab >}} -{{< /tabpane >}} - -### none - -WebDriver は、最初のページがダウンロードされるまで待機します。 - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L47-L49">}} -{{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L23-L25">}} -{{< /tab >}} -{{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L41-42" >}} -{{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L29-L30">}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/capabilities/pageLoading.spec.js#L18-L24">}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -import org.openqa.selenium.PageLoadStrategy -import org.openqa.selenium.chrome.ChromeDriver -import org.openqa.selenium.chrome.ChromeOptions - -fun main() { - val chromeOptions = ChromeOptions() - chromeOptions.setPageLoadStrategy(PageLoadStrategy.NONE) - val driver = ChromeDriver(chromeOptions) - try { - driver.get("https://www.google.com") - } - finally { - driver.quit() - } -} -{{< /tab >}} -{{< /tabpane >}} - - -## platformName - -これにより、リモートエンドのオペレーティングシステムが識別され、 `platformName` を取得するとOS名が返されます。 - -クラウドベースのプロバイダーでは、 `platformName` を設定すると、リモートエンドのOSが設定されます。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L88-L90">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L94-96">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L38-L39" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -## acceptInsecureCerts - -この機能は、セッション中のナビゲーション中に、期限切れ(または)無効な `TLS証明書` が使用されているかどうかを確認します。 - -機能が `false` に設定されている場合、ナビゲーションでドメイン証明書の問題が発生すると、 -[insecure certificate error](//developer.mozilla.org/ja/docs/Web/WebDriver/Errors/InsecureCertificate) が返されます。 -`true` に設定すると、無効な証明書はブラウザーによって信頼されます。 - -すべての自己署名証明書は、デフォルトでこの機能によって信頼されます。 -一度設定すると、 `acceptInsecureCerts` Capabilityはセッション全体に影響します。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L60-L61">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L101-103">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L51-L52" >}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/capabilities/pageLoading.spec.js#L38-L41">}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -## timeouts - -WebDriverの `セッション` には特定の `セッションタイムアウト` 間隔が設定されており、 -その間、ユーザーはスクリプトの実行またはブラウザーからの情報の取得の動作を制御できます。 - -各セッションタイムアウトは、以下で説明するように、異なる `タイムアウト` の組み合わせで構成されます。 - -### Script Timeout: -現在のブラウジングコンテキストで実行中のスクリプトをいつ中断するかを指定します。 -新しいセッションがWebDriverによって作成されると、デフォルトのタイムアウト **30,000** が課されます。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L96-L98">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L30-32">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L114-L115" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -### Page Load Timeout: -現在のブラウジングコンテキストでWebページをロードする必要がある時間間隔を指定します。 -新しいセッションがWebDriverによって作成されると、デフォルトのタイムアウト **300,000** が課されます。 -ページの読み込みが指定/デフォルトの時間枠を制限する場合、スクリプトは _TimeoutException_ によって停止されます。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L111-L113">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L37-39">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L105-L106" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -### Implicit Wait Timeout -これは、要素を検索するときに暗黙的な要素の検索戦略を待つ時間を指定します。 -新しいセッションがWebDriverによって作成されると、デフォルトのタイムアウト **0** が課されます。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L126-L128">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L44-46">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L96-L97" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -## unhandledPromptBehavior - -現在のセッションの `ユーザープロンプトハンドラー` の状態を指定します。 -デフォルトでは、 **dismiss and notify (却下して通知する) 状態** となります。 - -### User Prompt Handler - -これは、リモートエンドでユーザープロンプトが表示されたときに実行する必要があるアクションを定義します。 -これは、 `unhandledPromptBehavior` Capabilityによって定義され、次の状態があります。 - -* dismiss (却下) -* accept (受入) -* dismiss and notify (却下して通知) -* accept and notify (受け入れて通知) -* ignore (無視) - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L141-L142">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L51-53">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L59-L60">}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L60-L61" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -注:`beforeunload` プロンプトに関しては、 -プロンプトを開いたままにするために、[BiDi]({{< ref "../bidi/" >}}) を有効にすることに加えて、 -ChromeDriver で `ignore` を設定する必要があります。 - -## setWindowRect - -リモート エンドがすべての [サイズ変更および再配置](https://w3c.github.io/webdriver/#resizing-and-positioning-windows) -[コマンド](https://w3c.github.io/webdriver/#dfn-commands) をサポートするかどうかを示します。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L151-L152">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L58-60">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L69-L70" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -## strictFileInteractability - -この新しいcapabilityは、厳密な相互作用チェックを _input type = file_ 要素に適用する必要があるかどうかを示します。 -厳密な相互作用チェックはデフォルトでオフになっているため、隠しファイルのアップロードコントロールで _Element Send Keys_ -を使用する場合の動作が変更されます。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L163-L164">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L65-67">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L78-L79" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -## proxy - -プロキシサーバーは、クライアントとサーバー間の要求の仲介役として機能します。 -簡単に言えば、トラフィックはプロキシサーバーを経由して、要求したアドレスに戻り、戻ってきます。 - -Seleniumを使用した自動化スクリプト用のプロキシサーバーは、 - -* ネットワークトラフィックをキャプチャする -* ウェブサイトによって行われた模擬バックエンドを呼び出す -* 複雑なネットワークトポロジーまたは厳格な企業の制限/ポリシーの下で、必要なWebサイトにアクセスします。 - -企業環境でブラウザがURLへの接続に失敗した場合、環境にアクセスするにはプロキシが必要であることが原因であることが最も可能性が高いです。 - -Selenium WebDriverは設定をプロキシする方法を提供します。 - - -{{< tabpane text=true >}} -{{< badge-examples >}} -{{% tab header="Java" %}} -```java -import org.openqa.selenium.Proxy; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.chrome.ChromeDriver; -import org.openqa.selenium.chrome.ChromeOptions; - -public class ProxyTest { - public static void main(String[] args) { - Proxy proxy = new Proxy(); - proxy.setHttpProxy(""); - ChromeOptions options = new ChromeOptions(); - options.setCapability("proxy", proxy); - WebDriver driver = new ChromeDriver(options); - driver.get("https://www.google.com/"); - driver.manage().window().maximize(); - driver.quit(); - } -} -``` -{{% /tab %}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L72-74">}} -{{% /tab %}} -{{% tab header="CSharp" %}} -```CSharp -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; - -public class ProxyTest{ -public static void Main() { -ChromeOptions options = new ChromeOptions(); -Proxy proxy = new Proxy(); -proxy.Kind = ProxyKind.Manual; -proxy.IsAutoDetect = false; -proxy.SslProxy = ""; -options.Proxy = proxy; -options.AddArgument("ignore-certificate-errors"); -IWebDriver driver = new ChromeDriver(options); -driver.Navigate().GoToUrl("https://www.selenium.dev/"); -} -} -``` -{{% /tab %}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L87-L88" >}} -{{< /tab >}} -{{% tab header="JavaScript" %}} -```javascript -let webdriver = require('selenium-webdriver'); -let chrome = require('selenium-webdriver/chrome'); -let proxy = require('selenium-webdriver/proxy'); -let opts = new chrome.Options(); - -(async function example() { -opts.setProxy(proxy.manual({http: ''})); -let driver = new webdriver.Builder() -.forBrowser('chrome') -.setChromeOptions(opts) -.build(); -try { -await driver.get("https://selenium.dev"); -} -finally { -await driver.quit(); -} -}()); -``` -{{% /tab %}} -{{% tab header="Kotlin" %}} -```kotlin -import org.openqa.selenium.Proxy -import org.openqa.selenium.WebDriver -import org.openqa.selenium.chrome.ChromeDriver -import org.openqa.selenium.chrome.ChromeOptions - -class proxyTest { -fun main() { - - val proxy = Proxy() - proxy.setHttpProxy("") - val options = ChromeOptions() - options.setCapability("proxy", proxy) - val driver: WebDriver = ChromeDriver(options) - driver["https://www.google.com/"] - driver.manage().window().maximize() - driver.quit() - } -} -``` -{{% /tab %}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md b/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md deleted file mode 100644 index 60bda9fcd64f..000000000000 --- a/website_and_docs/content/documentation/webdriver/drivers/options.pt-br.md +++ /dev/null @@ -1,610 +0,0 @@ ---- -title: "Opções do navegador" -linkTitle: "Options" -weight: 2 -needsTranslation: true -description: >- - Esses recursos são compartilhados por todos os navegadores. -aliases: [ -"/documentation/webdriver/capabilities/shared_capabilities/", -"/documentation/webdriver/http_proxies/", -"/documentation/webdriver/capabilities/http_proxies/", -"/documentation/webdriver/page_loading_strategy/", -"/documentation/webdriver/capabilities/page_loading_strategy/", -"/documentation/capabilitis/shared/" -] ---- - -{{% pageinfo color="warning" %}} -

- - Page being translated from English to Portuguese. - Do you speak Portuguese? Help us to translate - it by sending us pull requests! -

-{{% /pageinfo %}} - -No Selenium 3, os recursos foram definidos em uma sessão usando classes de recursos desejados. -A partir do Selenium 4, você deve usar as classes de opções do navegador. -Para sessões remotas de driver, uma instância de opções do navegador é necessária, pois determina qual navegador será usado. - -Essas opções são descritas na especificação w3c para [Capabilities](https://w3c.github.io/webdriver/#capabilities). - -Cada navegador tem [custom options]({{< ref "../browsers/" >}}) que podem ser definidas além das definidas na especificação. - -## browserName - -Esta capacidade é usada para definir o `browserName` para uma determinada sessão. -Se o navegador especificado não estiver instalado no -extremidade remota, a criação da sessão falhará. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L73-74" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L79-80" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L11" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -## browserVersion - -Esta capacidade é opcional, é usada para -defina a versão do navegador disponível na extremidade remota. -Por exemplo, se solicitar o Chrome versão 75 em um sistema que -tiver apenas 80 instalados, a criação da sessão falhará. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L80-82" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L86-88" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L40" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## pageLoadStrategy - -Três tipos de estratégias de carregamento de página estão disponíveis. - -A estratégia de carregamento da página consulta o -[document.readyState](//developer.mozilla.org/en-US/docs/Web/API/Document/readyState) -conforme descrito na tabela abaixo: - -| Estratégia | Estado pronto | Notas | -| -------- | ----------- | ----- | -| normal | completo | Usado por padrão, aguarda o download de todos os recursos | -| ansioso | interativo | O acesso DOM está pronto, mas outros recursos como imagens ainda podem estar carregando | -| nenhum | Qualquer | Não bloqueia o WebDriver | - -A propriedade `document.readyState` de um documento descreve o estado de carregamento do documento atual. - -Ao navegar para uma nova página via URL, por padrão, o WebDriver irá adiar a conclusão de uma navegação -(por exemplo, driver.navigate().get()) até que o estado pronto do documento seja concluído. isso _não -significa necessariamente que a página terminou de carregar_, especialmente para sites como Single Page Applications -que usam JavaScript para carregar conteúdo dinamicamente depois que o estado Pronto retorna completo. Observe também -que esse comportamento não se aplica à navegação resultante de clicar em um elemento ou enviar um formulário. - -Se uma página demorar muito para carregar como resultado do download de ativos (por exemplo, imagens, css, js) -que não são importantes para a automação, você pode mudar do parâmetro padrão de `normal` para -`eager` ou `none` para acelerar a sessão. Esse valor se aplica a toda a sessão, portanto, certifique-se -que sua [waiting strategy]({{< ref "/documentation/webdriver/waits.md" >}}) é suficiente para minimizar -descamação. - - -### normal (default) - -WebDriver waits until the [load](https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event) -event fire is returned. - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L21-L23">}} -{{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L7-9">}} -{{< /tab >}}{{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L13-14" >}} -{{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L11-L12">}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/capabilities/pageLoading.spec.js#L28-L34">}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -import org.openqa.selenium.PageLoadStrategy -import org.openqa.selenium.chrome.ChromeDriver -import org.openqa.selenium.chrome.ChromeOptions - -fun main() { - val chromeOptions = ChromeOptions() - chromeOptions.setPageLoadStrategy(PageLoadStrategy.NORMAL) - val driver = ChromeDriver(chromeOptions) - try { - driver.get("https://www.google.com") - } - finally { - driver.quit() - } -} -{{< /tab >}} -{{< /tabpane >}} - -### eager - -WebDriver waits until [DOMContentLoaded](https://developer.mozilla.org/en-US/docs/Web/API/Document/DOMContentLoaded_event) -event fire is returned. - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L34-L36">}} -{{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L15-L17">}} -{{< /tab >}} -{{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L29-30" >}} -{{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L20-L21">}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/capabilities/pageLoading.spec.js#L8-L14">}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -import org.openqa.selenium.PageLoadStrategy -import org.openqa.selenium.chrome.ChromeDriver -import org.openqa.selenium.chrome.ChromeOptions - -fun main() { - val chromeOptions = ChromeOptions() - chromeOptions.setPageLoadStrategy(PageLoadStrategy.EAGER) - val driver = ChromeDriver(chromeOptions) - try { - driver.get("https://www.google.com") - } - finally { - driver.quit() - } -} -{{< /tab >}} -{{< /tabpane >}} - -### none - -WebDriver only waits until the initial page is downloaded. - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L47-L49">}} -{{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L23-L25">}} -{{< /tab >}} -{{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L41-42" >}} -{{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L29-L30">}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/capabilities/pageLoading.spec.js#L18-L24">}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -import org.openqa.selenium.PageLoadStrategy -import org.openqa.selenium.chrome.ChromeDriver -import org.openqa.selenium.chrome.ChromeOptions - -fun main() { - val chromeOptions = ChromeOptions() - chromeOptions.setPageLoadStrategy(PageLoadStrategy.NONE) - val driver = ChromeDriver(chromeOptions) - try { - driver.get("https://www.google.com") - } - finally { - driver.quit() - } -} -{{< /tab >}} -{{< /tabpane >}} - - -## platformName - -This identifies the operating system at the remote-end, -fetching the `platformName` returns the OS name. - -In cloud-based providers, -setting `platformName` sets the OS at the remote-end. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L88-L90">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L94-96">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L38-L39" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## acceptInsecureCerts - -This capability checks whether an expired (or) -invalid `TLS Certificate` is used while navigating -during a session. - -If the capability is set to `false`, an -[insecure certificate error](//developer.mozilla.org/en-US/docs/Web/WebDriver/Errors/InsecureCertificate) -will be returned as navigation encounters any domain -certificate problems. If set to `true`, invalid certificate will be -trusted by the browser. - -All self-signed certificates will be trusted by this capability by default. -Once set, `acceptInsecureCerts` capability will have an -effect for the entire session. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L60-L61">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L101-103">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L51-L52" >}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/capabilities/pageLoading.spec.js#L38-L41">}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## timeouts - -A WebDriver `session` is imposed with a certain `session timeout` -interval, during which the user can control the behaviour -of executing scripts or retrieving information from the browser. - -Each session timeout is configured with -combination of different `timeouts` as described below: - -### Script Timeout -Specifies when to interrupt an executing script in -a current browsing context. The default timeout **30,000** -is imposed when a new session is created by WebDriver. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L96-L98">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L30-32">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L114-L115" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -### Page Load Timeout -Specifies the time interval in which web page -needs to be loaded in a current browsing context. -The default timeout **300,000** is imposed when a -new session is created by WebDriver. If page load limits -a given/default time frame, the script will be stopped by -_TimeoutException_. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L111-L113">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L37-39">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L105-L106" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -### Implicit Wait Timeout -This specifies the time to wait for the -implicit element location strategy when -locating elements. The default timeout **0** -is imposed when a new session is created by WebDriver. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L126-L128">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L44-46">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L96-L97" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## unhandledPromptBehavior - -Specifies the state of current session's `user prompt handler`. -Defaults to **dismiss and notify state** - -### User Prompt Handler - -This defines what action must take when a -user prompt encounters at the remote-end. This is defined by -`unhandledPromptBehavior` capability and has the following states: - -* dismiss -* accept -* dismiss and notify -* accept and notify -* ignore - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L141-L142">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L51-53">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L59-L60">}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L60-L61" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -Nota: Para prompts de `beforeunload` especificamente, -o ChromeDriver precisa que `ignore` seja definido além de ter o -[BiDi]({{< ref "../bidi/" >}}) habilitado para manter o prompt aberto. - -## setWindowRect - -Indicates whether the remote end supports all of the [resizing and repositioning](https://w3c.github.io/webdriver/#resizing-and-positioning-windows) [commands](https://w3c.github.io/webdriver/#dfn-commands). - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L151-L152">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L58-60">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L69-L70" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## strictFileInteractability - -This new capability indicates if strict interactability checks -should be applied to _input type=file_ elements. As strict interactability -checks are off by default, there is a change in behaviour -when using _Element Send Keys_ with hidden file upload controls. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L163-L164">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L65-67">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L78-L79" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## proxy - -A proxy server acts as an intermediary for -requests between a client and a server. In simple, -the traffic flows through the proxy server -on its way to the address you requested and back. - -A proxy server for automation scripts -with Selenium could be helpful for: - -* Capture network traffic -* Mock backend calls made by the website -* Access the required website under complex network - topologies or strict corporate restrictions/policies. - -If you are in a corporate environment, and a -browser fails to connect to a URL, this is most -likely because the environment needs a proxy to be accessed. - -Selenium WebDriver provides a way to proxy settings: - -{{< tabpane text=true >}} -{{< badge-examples >}} -{{% tab header="Java" %}} -```java -import org.openqa.selenium.Proxy; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.chrome.ChromeDriver; -import org.openqa.selenium.chrome.ChromeOptions; - -public class ProxyTest { - public static void main(String[] args) { - Proxy proxy = new Proxy(); - proxy.setHttpProxy(""); - ChromeOptions options = new ChromeOptions(); - options.setCapability("proxy", proxy); - WebDriver driver = new ChromeDriver(options); - driver.get("https://www.google.com/"); - driver.manage().window().maximize(); - driver.quit(); - } -} -``` -{{% /tab %}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L72-74">}} -{{% /tab %}} -{{% tab header="CSharp" %}} -```CSharp -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; - -public class ProxyTest{ -public static void Main() { -ChromeOptions options = new ChromeOptions(); -Proxy proxy = new Proxy(); -proxy.Kind = ProxyKind.Manual; -proxy.IsAutoDetect = false; -proxy.SslProxy = ""; -options.Proxy = proxy; -options.AddArgument("ignore-certificate-errors"); -IWebDriver driver = new ChromeDriver(options); -driver.Navigate().GoToUrl("https://www.selenium.dev/"); -} -} -``` -{{% /tab %}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L87-L88" >}} -{{< /tab >}} -{{% tab header="JavaScript" %}} -```javascript -let webdriver = require('selenium-webdriver'); -let chrome = require('selenium-webdriver/chrome'); -let proxy = require('selenium-webdriver/proxy'); -let opts = new chrome.Options(); - -(async function example() { -opts.setProxy(proxy.manual({http: ''})); -let driver = new webdriver.Builder() -.forBrowser('chrome') -.setChromeOptions(opts) -.build(); -try { -await driver.get("https://selenium.dev"); -} -finally { -await driver.quit(); -} -}()); -``` -{{% /tab %}} -{{% tab header="Kotlin" %}} -```kotlin -import org.openqa.selenium.Proxy -import org.openqa.selenium.WebDriver -import org.openqa.selenium.chrome.ChromeDriver -import org.openqa.selenium.chrome.ChromeOptions - -class proxyTest { -fun main() { - - val proxy = Proxy() - proxy.setHttpProxy("") - val options = ChromeOptions() - options.setCapability("proxy", proxy) - val driver: WebDriver = ChromeDriver(options) - driver["https://www.google.com/"] - driver.manage().window().maximize() - driver.quit() - } -} -``` -{{% /tab %}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md b/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md deleted file mode 100644 index 0d8e9688681e..000000000000 --- a/website_and_docs/content/documentation/webdriver/drivers/options.zh-cn.md +++ /dev/null @@ -1,598 +0,0 @@ ---- -title: "浏览器选项" -linkTitle: "选项" -weight: 2 -description: >- - 这些capabilities用于所有浏览器. -aliases: [ -"/documentation/webdriver/capabilities/shared_capabilities/", -"/documentation/webdriver/http_proxies/", -"/documentation/webdriver/capabilities/http_proxies/", -"/documentation/webdriver/page_loading_strategy/", -"/documentation/webdriver/capabilities/page_loading_strategy/", -"/documentation/capabilitis/shared/" -] ---- - -在 Selenium 3 中, capabilities是借助"Desired Capabilities"类定义于会话中的. -从 Selenium 4 开始, 您必须使用浏览器选项类. -对于远程驱动程序会话, 浏览器选项实例是必需的, 因为它确定将使用哪个浏览器. - - -这些选项在 [Capabilities](https://w3c.github.io/webdriver/#capabilities) 的 w3c 规范中进行了描述. - - -每个浏览器都有 [自定义选项]({{< ref "../browsers/" >}}) , 是规范定义之外的内容. - - -## browserName - -默认情况下,使用 Options 类实例时会设置浏览器名称. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L73-74" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L79-80" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L11" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## browserVersion - -此功能是可选的,用于在远程端设置可用的浏览器版本. -在最新版本的 Selenium 中,如果在系统上找不到该版本, -它将被 [Selenium Manager]({{< ref "../../selenium_manager" >}}) 自动下载 - - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L80-82" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L86-88" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L40" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## pageLoadStrategy - -共有三种类型的页面加载策略. - -页面加载策略可以在此链接查询 -[document.readyState](//developer.mozilla.org/en-US/docs/Web/API/Document/readyState) , -如下表所述: - -| 策略 | 就绪状态 | 备注 | -|--------|-------------|-------------------------------| -| normal | complete | 默认值, 等待所有资源下载 | -| eager | interactive | DOM 访问已准备就绪, 但诸如图像的其他资源可能仍在加载 | -| none | Any | 完全不会阻塞 WebDriver | - -文档的 `document.readyState` 属性描述当前文档的加载状态. - -当通过URL导航到新页面时, -默认情况下, WebDriver将暂缓完成导航方法 -(例如, driver.navigate().get())直到文档就绪状态完成. -这 _并非意味着该页面已完成加载_, -特别是对于使用 JavaScript 在就绪状态返回完成后 -动态加载内容单页应用程序的站点. -另请注意此行为不适用于单击元素或提交表单后出现的导航行为. - -如果由于下载对自动化不重要的资源(例如, 图像、css、js) -而需要很长时间才能加载页面, -您可以将默认参数`normal`更改为 -`eager` 或 `none` 以加快会话加载速度. -此值适用于整个会话, -因此请确保您的 [等待策略]({{< ref "/documentation/webdriver/waits.md" >}}) -足够普适. - - -### normal (默认值) - -WebDriver一直等到 [load](https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event) -事件触发并返回. - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L21-L23">}} -{{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L7-9">}} -{{< /tab >}}{{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L13-14" >}} -{{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L11-L12">}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/capabilities/pageLoading.spec.js#L28-L34">}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -import org.openqa.selenium.PageLoadStrategy -import org.openqa.selenium.chrome.ChromeDriver -import org.openqa.selenium.chrome.ChromeOptions - -fun main() { - val chromeOptions = ChromeOptions() - chromeOptions.setPageLoadStrategy(PageLoadStrategy.NORMAL) - val driver = ChromeDriver(chromeOptions) - try { - driver.get("https://www.google.com") - } - finally { - driver.quit() - } -} -{{< /tab >}} -{{< /tabpane >}} - -### eager - -WebDriver一直等到 [DOMContentLoaded](https://developer.mozilla.org/en-US/docs/Web/API/Document/DOMContentLoaded_event) -事件触发并返回. - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L34-L36">}} -{{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L15-L17">}} -{{< /tab >}} -{{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L29-30" >}} -{{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L20-L21">}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/capabilities/pageLoading.spec.js#L8-L14">}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -import org.openqa.selenium.PageLoadStrategy -import org.openqa.selenium.chrome.ChromeDriver -import org.openqa.selenium.chrome.ChromeOptions - -fun main() { - val chromeOptions = ChromeOptions() - chromeOptions.setPageLoadStrategy(PageLoadStrategy.EAGER) - val driver = ChromeDriver(chromeOptions) - try { - driver.get("https://www.google.com") - } - finally { - driver.quit() - } -} -{{< /tab >}} -{{< /tabpane >}} - -### none - -WebDriver 仅等待初始页面已下载. - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L47-L49">}} -{{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L23-L25">}} -{{< /tab >}} -{{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L41-42" >}} -{{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L29-L30">}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/capabilities/pageLoading.spec.js#L18-L24">}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -import org.openqa.selenium.PageLoadStrategy -import org.openqa.selenium.chrome.ChromeDriver -import org.openqa.selenium.chrome.ChromeOptions - -fun main() { - val chromeOptions = ChromeOptions() - chromeOptions.setPageLoadStrategy(PageLoadStrategy.NONE) - val driver = ChromeDriver(chromeOptions) - try { - driver.get("https://www.google.com") - } - finally { - driver.quit() - } -} -{{< /tab >}} -{{< /tabpane >}} - - -## platformName - -这标识了远端的操作系统, -获取 `platformName` 将返回操作系统的名称. - -在基于云的供应者中, -设置 `platformName` 将在远程端设置操作系统. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L88-L90">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L94-96">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L38-L39" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## acceptInsecureCerts - -此功能检查在会话期间导航时 -是否使用了过期的 (或) 无效的 `TLS Certificate` . - -如果将功能设置为 `false`, -则页面浏览遇到任何域证书问题时, -将返回[insecure certificate error](//developer.mozilla.org/zh-CN/docs/Web/WebDriver/Errors/InsecureCertificate) . -如果设置为 `true`, 则浏览器将信任无效证书. - -默认情况下, 此功能将信任所有自签名证书. -设置后, `acceptInsecureCerts` 功能将在整个会话中生效. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L60-L61">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L101-103">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L51-L52" >}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/capabilities/pageLoading.spec.js#L38-L41">}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## timeouts - -WebDriver `session` 具有一定的 `session timeout` 间隔, -在此间隔内, 用户可以控制执行脚本或从浏览器检索信息的行为. - -每个会话超时都配置有不同 `timeouts` 的组合, -如下所述: - -### Script Timeout: -指定在当前浏览上下文中, 中断正在执行脚本的时机. -WebDriver创建新会话时, -将设置默认的超时时间为 **30,000** . - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L96-L98">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L30-32">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L114-L115" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -### Page Load Timeout: -指定在当前浏览上下文中, 加载网页的时间间隔. -WebDriver创建新会话时, -默认设置超时时间为 **300,000** . -如果页面加载限制了给定 (或默认) 的时间范围, -则该脚本将被 _TimeoutException_ 停止. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L111-L113">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L37-39">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L105-L106" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -### Implicit Wait Timeout -指定在定位元素时, 等待隐式元素定位策略的时间. -WebDriver创建新会话时, -将设置默认超时时间为 **0** . - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L126-L128">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L44-46">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L96-L97" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## unhandledPromptBehavior - -指定当前会话 `user prompt handler` 的状态. -默认为 **dismiss and notify state** . - -### User Prompt Handler - -这定义了在远端出现用户提示时必须采取的措施. -该行为由`unhandledPromptBehavior` 功能定义, -具有以下状态: - -* dismiss -* accept -* dismiss and notify -* accept and notify -* ignore - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L141-L142">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L51-53">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/OptionsTest.cs#L59-L60">}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L60-L61" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -注意:对于 `beforeunload` 提示框, -除了启用 [BiDi]({{< ref "../bidi/" >}}) 外, -ChromeDriver 还需要设置 `ignore` 才能保持提示框打开。 - -## setWindowRect - -用于所有支持 [调整大小和重新定位](https://w3c.github.io/webdriver/#resizing-and-positioning-windows) -[命令](https://w3c.github.io/webdriver/#dfn-commands) 的远程终端. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L151-L152">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L58-60">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L69-L70" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## strictFileInteractability - -新功能用于是否对 _类型为文件的输入(input type=file)_ 元素进行严格的交互性检查. -默认关闭严格性检查, -在将 _元素的Send Keys_ 方法作用于隐藏的文件上传时, -会有控制方面的行为区别. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/OptionsTest.java#L163-L164">}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L65-67">}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L78-L79" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## proxy - -代理服务器充当客户端和服务器之间的请求中介. -简述而言, 流量将通过代理服务器流向您请求的地址, 然后返回. - -使用代理服务器用于Selenium的自动化脚本, -可能对以下方面有益: - -* 捕获网络流量 -* 模拟网站后端响应 -* 在复杂的网络拓扑结构或严格的公司限制/政策下访问目标站点. - -如果您在公司环境中, -并且浏览器无法连接到URL, -则最有可能是因为环境, 需要借助代理进行访问. - -Selenium WebDriver提供了如下设置代理的方法 - -{{< tabpane text=true >}} -{{< badge-examples >}} -{{% tab header="Java" %}} -```java -import org.openqa.selenium.Proxy; -import org.openqa.selenium.WebDriver; -import org.openqa.selenium.chrome.ChromeDriver; -import org.openqa.selenium.chrome.ChromeOptions; - -public class ProxyTest { - public static void main(String[] args) { - Proxy proxy = new Proxy(); - proxy.setHttpProxy(""); - ChromeOptions options = new ChromeOptions(); - options.setCapability("proxy", proxy); - WebDriver driver = new ChromeDriver(options); - driver.get("https://www.google.com/"); - driver.manage().window().maximize(); - driver.quit(); - } -} -``` -{{% /tab %}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_options.py#L72-74">}} -{{% /tab %}} -{{% tab header="CSharp" %}} -```CSharp -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; - -public class ProxyTest{ -public static void Main() { -ChromeOptions options = new ChromeOptions(); -Proxy proxy = new Proxy(); -proxy.Kind = ProxyKind.Manual; -proxy.IsAutoDetect = false; -proxy.SslProxy = ""; -options.Proxy = proxy; -options.AddArgument("ignore-certificate-errors"); -IWebDriver driver = new ChromeDriver(options); -driver.Navigate().GoToUrl("https://www.selenium.dev/"); -} -} -``` -{{% /tab %}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/options_spec.rb#L87-L88" >}} -{{< /tab >}} -{{% tab header="JavaScript" %}} -```javascript -let webdriver = require('selenium-webdriver'); -let chrome = require('selenium-webdriver/chrome'); -let proxy = require('selenium-webdriver/proxy'); -let opts = new chrome.Options(); - -(async function example() { -opts.setProxy(proxy.manual({http: ''})); -let driver = new webdriver.Builder() -.forBrowser('chrome') -.setChromeOptions(opts) -.build(); -try { -await driver.get("https://selenium.dev"); -} -finally { -await driver.quit(); -} -}()); -``` -{{% /tab %}} -{{% tab header="Kotlin" %}} -```kotlin -import org.openqa.selenium.Proxy -import org.openqa.selenium.WebDriver -import org.openqa.selenium.chrome.ChromeDriver -import org.openqa.selenium.chrome.ChromeOptions - -class proxyTest { -fun main() { - - val proxy = Proxy() - proxy.setHttpProxy("") - val options = ChromeOptions() - options.setCapability("proxy", proxy) - val driver: WebDriver = ChromeDriver(options) - driver["https://www.google.com/"] - driver.manage().window().maximize() - driver.quit() - } -} -``` -{{% /tab %}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.en.md b/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.en.md index 456098987ca8..eed4543c0da5 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.en.md +++ b/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.en.md @@ -11,7 +11,13 @@ aliases: [ "/documentation/pt-br/remote_webdriver/", "/documentation/pt-br/remote_webdriver/remote_webdriver_client/", "/documentation/zh-cn/remote_webdriver/", -"/documentation/zh-cn/remote_webdriver/remote_webdriver_client/" +"/documentation/zh-cn/remote_webdriver/remote_webdriver_client/", +"/ja/documentation/webdriver/drivers/remote_webdriver/", +"/ja/documentation/webdriver/remote_webdriver/", +"/pt-br/documentation/webdriver/drivers/remote_webdriver/", +"/pt-br/documentation/webdriver/remote_webdriver/", +"/zh-cn/documentation/webdriver/drivers/remote_webdriver/", +"/zh-cn/documentation/webdriver/remote_webdriver/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.ja.md b/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.ja.md deleted file mode 100644 index 82f776341eec..000000000000 --- a/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.ja.md +++ /dev/null @@ -1,273 +0,0 @@ ---- -title: "リモートWebDriver" -linkTitle: "リモートWebDriver" -weight: 10 -aliases: [ -"/documentation/webdriver/remote_webdriver/" -] - ---- - -Seleniumは、リモートコンピュータ上でブラウザを自動化することができます。これには、リモートコンピュータ上で [Selenium Grid]({{< ref "../../grid" >}}) が実行されている必要があります。コードを実行するコンピュータはクライアントコンピュータと呼ばれ、ブラウザとドライバーがあるコンピュータはリモートコンピュータまたは時々エンドノードと呼ばれます。Seleniumテストをリモートコンピュータに向けるには、Remote WebDriverクラスを使用し、そのマシンのグリッドのポートを含むURLを渡す必要があります。グリッドの設定方法については、グリッドのドキュメントを参照してください。 - -## 基本的な例 - -ドライバーは、コマンドを送信する場所と、リモートコンピュータ上で開始するブラウザを知る必要があります。そのため、アドレスとオプションインスタンスの両方が必要です。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L38-L39" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_remote_webdriver.py#L13-L14" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L28-L29" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/remote_webdriver_spec.rb#L20-L21" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## アップロード - -[ファイルのアップロード]() は、リモートWebDriverセッションではより複雑です。アップロードしたいファイルはコードを実行しているコンピュータ上にあることが多いですが、リモートコンピュータ上のドライバーはそのローカルファイルシステム上で指定されたパスを探しています。この解決策として、ローカルファイルディテクターを使用します。これを設定すると、Seleniumはファイルをパッケージ化し、リモートマシンに送信するため、ドライバーはその参照を認識できるようになります。一部のバインディングでは、デフォルトで基本的なローカルファイルディテクターが含まれており、すべてのバインディングでカスタムファイルディテクターを設定できます。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -Javaにはデフォルトでローカルファイルディテクターが含まれていないため、アップロードを行う際には必ず追加する必要があります。 -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L49-L52" >}} -{{< /tab >}} -{{% tab header="Python" %}} -Pythonでは、リモートWebDriverインスタンスにデフォルトでローカルファイルディテクターが追加されますが、独自のクラスを作成することも可能です。 -{{< gh-codeblock path="/examples/python/tests/drivers/test_remote_webdriver.py#LL29-L32" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -.NETでは、リモートWebDriverインスタンスにデフォルトでローカルファイルディテクターが追加されますが、独自のクラスを作成することも可能です。 -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L47-L50" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -Rubyでは、リモートWebDriverインスタンスにデフォルトでローカルファイルディテクターが追加されますが、独自のラムダを作成することも可能です。 -{{< gh-codeblock path="/examples/ruby/spec/drivers/remote_webdriver_spec.rb#L33-L36" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## ダウンロード - -Chrome、Edge、およびFirefoxでは、それぞれダウンロードディレクトリの場所を設定できます。 ただし、リモートコンピュータでこれを行う場合、その場所はリモートコンピュータのローカルファイルシステム上にあります。Seleniumを使用すると、クライアントコンピュータにこれらのファイルをダウンロードできるように設定することが可能です。 - -### グリッドでのダウンロードを有効化 - -クライアントに関係なく、ノードまたはスタンドアロンモードでグリッドを起動する際には、次のフラグを追加する必要があります: -``` ---enable-managed-downloads true -``` - -### クライアントでのダウンロードを有効化 - -グリッドは、`se:downloadsEnabled` 機能を使用して、ブラウザの場所を管理する責任を持つかどうかを切り替えます。各バインディングには、これを設定するためのオプションクラスのメソッドがあります。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L60-L62" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_remote_webdriver.py#L42-L44" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L59-L64" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/remote_webdriver_spec.rb#L43-L44" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -### ダウンロード可能なファイルの一覧 - -Seleniumはファイルのダウンロードが完了するのを待たないため、リストは指定されたセッションのディレクトリに現在存在するファイル名の即時スナップショットであることに注意してください。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L73" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_remote_webdriver.py#L52" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L72" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/remote_webdriver_spec.rb#L52" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -### ファイルをダウンロード - -Seleniumは、提供されたファイルの名前をリストの中で探し、指定されたターゲットディレクトリにダウンロードします。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L83" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_remote_webdriver.py#L58" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L79" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/remote_webdriver_spec.rb#L57" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -### ダウンロードしたファイルの削除 - -デフォルトでは、ダウンロードディレクトリは該当するセッションの終了時に削除されますが、セッション中にすべてのファイルを削除することもできます。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L88" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_remote_webdriver.py#L64" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L84" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/remote_webdriver_spec.rb#L62" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## ブラウザ特有の機能 - -各 [ブラウザ]({{< ref "../browsers/" >}}) は、そのブラウザにのみ利用可能な特別な機能を実装しています。各Seleniumバインディングは、リモートセッションでそれらの機能を使用するための異なる方法を実装しています。 - -{{< tabpane text=true >}} -{{% tab header="Java" %}} -Javaでは、Augmenterクラスを使用する必要があります。これにより、RemoteWebDriverで使用される機能に一致するすべてのインターフェースの実装を自動的に取り込むことができます。 -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L98" >}} - -興味深いことに、RemoteWebDriverBuilderを使用すると、ドライバーが自動的に拡張されるため、デフォルトで全ての機能を取得するのに最適な方法です。 - -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L106-L111" >}} -{{% /tab %}} -{{% tab header="Python" %}} -{{< badge-implementation >}} -{{% /tab %}} -{{< tab header="CSharp" >}} - -.NETでは、リモートドライバーで指定されたブラウザに対して有効なコマンドを実行するために、カスタムコマンドエグゼキュータを使用します。 -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L96-L100" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -Rubyでは、ミキシンを使用してリモートWebDriverセッションに適用可能なブラウザ特有のメソッドを追加します。これらのメソッドは常にそのまま機能するはずです。 -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -## クライアントのリクエストをトレースする - -この機能は、Java クライアント バインディング (ベータ版以降) でのみ利用できます。 -Remote WebDriver クライアントは Selenium Grid サーバーにリクエストを送信し、 -Selenium Grid サーバーはリクエストを WebDriver に渡します。 -HTTP リクエストをエンド ツー エンドでトレースするには、サーバー側とクライアント側でトレースを有効にする必要があります。 -両端には、視覚化フレームワークを指すトレース エクスポーターのセットアップが必要です。 -デフォルトでは、トレースはクライアントとサーバーの両方で有効になっています。 -視覚化フレームワークの Jaeger UI と Selenium Grid 4 を設定するには、目的のバージョンの -[トレースのセットアップ](https://github.com/SeleniumHQ/selenium/blob/selenium-4.0.0-beta-1/java/server/src/org/openqa/selenium/grid/commands/tracing.txt) を参照してください。 - -クライアント側のセットアップについては、以下の手順に従ってください。 - -### 必要な依存関係を追加する - -トレーシング エクスポーターの外部ライブラリのインストールは、Maven を使って実行できます。 -プロジェクト pom.xml に _opentelemetry-exporter-jaeger_ および _grpc-netty_ の依存関係を追加します。 - -```xml - - io.opentelemetry - opentelemetry-exporter-jaeger - 1.0.0 - - - io.grpc - grpc-netty - 1.35.0 - -``` - -### クライアントの実行中に必要なシステムプロパティを追加/渡す - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -System.setProperty("otel.traces.exporter", "jaeger"); -System.setProperty("otel.exporter.jaeger.endpoint", "http://localhost:14250"); -System.setProperty("otel.resource.attributes", "service.name=selenium-java-client"); - -ImmutableCapabilities capabilities = new ImmutableCapabilities("browserName", "chrome"); - -WebDriver driver = new RemoteWebDriver(new URL("http://www.example.com"), capabilities); - -driver.get("http://www.google.com"); - -driver.quit(); - - {{< /tab >}} -{{< /tabpane >}} - -ご希望のSeleniumのバージョンに必要な外部依存関係のバージョンの詳細については、 -[トレースのセットアップ](https://github.com/SeleniumHQ/selenium/blob/selenium-4.0.0-beta-1/java/server/src/org/openqa/selenium/grid/commands/tracing.txt) を参照してください。 - -詳細については、下記URLを参照してください。 - -* OpenTelemetry: https://opentelemetry.io -* OpenTelemetryの構成: - https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure -* Jaeger: https://www.jaegertracing.io -* [Selenium Grid 可観測性]({{< ref "observability.md" >}}) - diff --git a/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.pt-br.md b/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.pt-br.md deleted file mode 100644 index 5d9578a1b08f..000000000000 --- a/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.pt-br.md +++ /dev/null @@ -1,297 +0,0 @@ ---- -title: "WebDriver Remoto" -linkTitle: "Remote WebDriver" -weight: 10 -aliases: [ -"/documentation/webdriver/remote_webdriver/" -] - ---- - -{{% pageinfo color="warning" %}} -

- - Page being translated from - English to Portuguese. Do you speak Portuguese? Help us to translate - it by sending us pull requests! -

-{{% /pageinfo %}} - -Selenium lets you automate browsers on remote computers if -there is a [Selenium Grid]({{< ref "../../grid" >}}) running on them. The computer that -executes the code is referred to as the client computer, and the computer with the browser and driver is -referred to as the remote computer or sometimes as an end-node. -To direct Selenium tests to the remote computer, you need to use a Remote WebDriver class -and pass the URL including the port of the grid on that machine. Please see the grid documentation -for all the various ways the grid can be configured. - -## Basic Example - -The driver needs to know where to send commands to and which browser to start on the Remote computer. So an address -and an options instance are both required. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L38-L39" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_remote_webdriver.py#L13-L14" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L28-L29" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/remote_webdriver_spec.rb#L20-L21" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## Uploads - -[Uploading a file]() is more complicated for Remote WebDriver sessions because the file you want to -upload is likely on the computer executing the code, but the driver on the -remote computer is looking for the provided path on its local file system. -The solution is to use a Local File Detector. When one is set, Selenium will bundle -the file, and send it to the remote machine, so the driver can see the reference to it. -Some bindings include a basic local file detector by default, and all of them allow -for a custom file detector. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -Java does not include a Local File Detector by default, so you must always add one to do uploads. -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L49-L52" >}} -{{< /tab >}} -{{% tab header="Python" %}} -Python adds a local file detector to remote webdriver instances by default, but you can also create your own class. -{{< gh-codeblock path="/examples/python/tests/drivers/test_remote_webdriver.py#LL29-L32" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -.NET adds a local file detector to remote webdriver instances by default, but you can also create your own class. -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L47-L50" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -Ruby adds a local file detector to remote webdriver instances by default, but you can also create your own lambda: -{{< gh-codeblock path="/examples/ruby/spec/drivers/remote_webdriver_spec.rb#L33-L36" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## Downloads - -Chrome, Edge and Firefox each allow you to set the location of the download directory. -When you do this on a remote computer, though, the location is on the remote computer's local file system. -Selenium allows you to enable downloads to get these files onto the client computer. - -### Enable Downloads in the Grid - -Regardless of the client, when starting the grid in node or standalone mode, -you must add the flag: -``` ---enable-managed-downloads true -``` - -### Enable Downloads in the Client - -The grid uses the `se:downloadsEnabled` capability to toggle whether to be responsible for managing the browser location. -Each of the bindings have a method in the options class to set this. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L60-L62" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_remote_webdriver.py#L42-L44" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L59-L64" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/remote_webdriver_spec.rb#L43-L44" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -### List Downloadable Files - -Be aware that Selenium is not waiting for files to finish downloading, -so the list is an immediate snapshot of what file names are currently in the directory for the given session. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L73" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_remote_webdriver.py#L52" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L72" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/remote_webdriver_spec.rb#L52" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -### Download a File - -Selenium looks for the name of the provided file in the list and downloads it to the provided target directory. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L83" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_remote_webdriver.py#L58" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L79" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/remote_webdriver_spec.rb#L57" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -### Delete Downloaded Files - -By default, the download directory is deleted at the end of the applicable session, -but you can also delete all files during the session. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L88" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_remote_webdriver.py#L64" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L84" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/remote_webdriver_spec.rb#L62" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## Browser specific functionalities - -Each [browser]({{< ref "../browsers/" >}}) has implemented special functionality that is available only to that browser. -Each of the Selenium bindings has implemented a different way to use those features in a Remote Session - -{{< tabpane text=true >}} -{{% tab header="Java" %}} -Java requires you to use the Augmenter class, which allows it to automatically pull in implementations for -all interfaces that match the capabilities used with the RemoteWebDriver -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L98" >}} - -Of interest, using the `RemoteWebDriverBuilder` automatically augments the driver, so it is a great way -to get all the functionality by default: - -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L106-L111" >}} -{{% /tab %}} -{{% tab header="Python" %}} -{{< badge-implementation >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -.NET uses a custom command executor for executing commands that are valid for the given browser in the remote driver. -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L96-L100" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -Ruby uses mixins to add applicable browser specific methods to the Remote WebDriver session; -the methods should always just work for you. -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -## Tracing client requests - -This feature is only available for Java client binding (Beta onwards). The Remote WebDriver client sends requests to the Selenium Grid server, which passes them to the WebDriver. Tracing should be enabled at the server and client-side to trace the HTTP requests end-to-end. Both ends should have a trace exporter setup pointing to the visualization framework. -By default, tracing is enabled for both client and server. -To set up the visualization framework Jaeger UI and Selenium Grid 4, please refer to [Tracing Setup](https://github.com/SeleniumHQ/selenium/blob/selenium-4.0.0-beta-1/java/server/src/org/openqa/selenium/grid/commands/tracing.txt) for the desired version. - -For client-side setup, follow the steps below. - -### Add the required dependencies - -Installation of external libraries for tracing exporter can be done using Maven. -Add the _opentelemetry-exporter-jaeger_ and _grpc-netty_ dependency in your project pom.xml: - -```xml - - io.opentelemetry - opentelemetry-exporter-jaeger - 1.0.0 - - - io.grpc - grpc-netty - 1.35.0 - -``` - -### Add/pass the required system properties while running the client - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" >}} -System.setProperty("otel.traces.exporter", "jaeger"); -System.setProperty("otel.exporter.jaeger.endpoint", "http://localhost:14250"); -System.setProperty("otel.resource.attributes", "service.name=selenium-java-client"); - -ImmutableCapabilities capabilities = new ImmutableCapabilities("browserName", "chrome"); - -WebDriver driver = new RemoteWebDriver(new URL("http://www.example.com"), capabilities); - -driver.get("http://www.google.com"); - -driver.quit(); - -{{< /tab >}} -{{< /tabpane >}} - -Please refer to [Tracing Setup](https://github.com/SeleniumHQ/selenium/blob/selenium-4.0.0-beta-1/java/server/src/org/openqa/selenium/grid/commands/tracing.txt) for more information on external dependencies versions required for the desired Selenium version. - -More information can be found at: - -* OpenTelemetry: https://opentelemetry.io -* Configuring OpenTelemetry: - https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure -* Jaeger: https://www.jaegertracing.io -* [Selenium Grid Observability]({{< ref "observability.md" >}}) diff --git a/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.zh-cn.md b/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.zh-cn.md deleted file mode 100644 index a924c10abb69..000000000000 --- a/website_and_docs/content/documentation/webdriver/drivers/remote_webdriver.zh-cn.md +++ /dev/null @@ -1,302 +0,0 @@ ---- -title: "远程WebDriver" -linkTitle: "远程WebDriver" -weight: 10 -aliases: [ -"/documentation/webdriver/remote_webdriver/" -] - ---- - -如果远程计算机上正在运行 [Selenium Grid]({{< ref "../../grid" >}}), -则 Selenium 允许您自动化远程计算机上的浏览器. -执行代码的计算机称为客户端计算机, -具有浏览器和驱动程序的计算机称为远程计算机, -有时也称为终端节点. -要将 Selenium 测试指向到远程计算机, -您需要使用 Remote WebDriver 类并传递包含该机器上网格端口的URL. -请参阅网格文档, 了解配置网格的全部方式. - -## 基本样例 - -驱动程序需要知道在远程计算机上向何处发送命令, -以及启动哪个浏览器. -所以地址和选项实例都是必需的. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L38-L39" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_remote_webdriver.py#L13-L14" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L28-L29" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/remote_webdriver_spec.rb#L20-L21" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## 上传 - -对于远程WebDriver会话, [上传文件]({{< ref "../elements/file_upload" >}}) 更为复杂, -因为要上传的文件可能在执行代码的计算机上, -但远程计算机上的驱动程序正在其本地文件系统上查找提供的路径. -解决方案是使用本地文件检测器. -设置一个后, Selenium将捆绑文件, -并将其发送到远程计算机, 以便驱动程序可以看到对它的引用. -默认情况下, 某些实现包含一个基本的本地文件检测器, -并且所有这些实现都允许自定义文件检测器. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -Java does not include a Local File Detector by default, so you must always add one to do uploads. -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L49-L52" >}} -{{< /tab >}} -{{% tab header="Python" %}} -Python adds a local file detector to remote webdriver instances by default, but you can also create your own class. -{{< gh-codeblock path="/examples/python/tests/drivers/test_remote_webdriver.py#LL29-L32" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -.NET adds a local file detector to remote webdriver instances by default, but you can also create your own class. -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L47-L50" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -Ruby adds a local file detector to remote webdriver instances by default, but you can also create your own lambda: -{{< gh-codeblock path="/examples/ruby/spec/drivers/remote_webdriver_spec.rb#L33-L36" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## 下载 - -Chrome、Edge和Firefox都允许您设置下载目录的位置. -但是, 当您在远程计算机上执行此操作时, 位置在远程计算机的本地文件系统上. -Selenium允许您启用下载功能, 将这些文件下载到客户端计算机上. - -### 在网格中启用下载 - -当以节点或独立模式启动网格时, -你必须添加参数: -``` ---enable-managed-downloads true -``` - -### 在客户端中启用下载 - -网格使用 `se:downloadsEnabled` 功能来切换是否负责管理浏览器位置. -每个实现在options类中都有一个方法来设置. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L60-L62" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_remote_webdriver.py#L42-L44" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L59-L64" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/remote_webdriver_spec.rb#L43-L44" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -### 列出可下载文件 - -请注意, Selenium不会等待文件下载完成, -因此, 该列表是给定会话目录中当前文件名的即时快照. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L73" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_remote_webdriver.py#L52" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L72" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/remote_webdriver_spec.rb#L52" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -### 下载文件 - -Selenium在列表中查找提供的文件的名称, -并将其下载到提供的目标目录. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L83" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_remote_webdriver.py#L58" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L79" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/remote_webdriver_spec.rb#L57" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -### 删除已下载的文件 - -默认情况下, 下载目录在可用会话结束时被删除, -但您也可以在会话期间删除所有文件. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L88" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/drivers/test_remote_webdriver.py#L64" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L84" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/drivers/remote_webdriver_spec.rb#L62" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - - -## 浏览器特定功能 - -每个[浏览器]({{< ref "../browsers/" >}}) 都实现了仅对该浏览器可用的特殊功能. -每种Selenium实现都实现了在远程会话中使用这些功能的不同方式 - -{{< tabpane text=true >}} -{{% tab header="Java" %}} -Java requires you to use the Augmenter class, which allows it to automatically pull in implementations for -all interfaces that match the capabilities used with the RemoteWebDriver -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L98" >}} - -Of interest, using the `RemoteWebDriverBuilder` automatically augments the driver, so it is a great way -to get all the functionality by default: - -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/drivers/RemoteWebDriverTest.java#L106-L111" >}} -{{% /tab %}} -{{% tab header="Python" %}} -{{< badge-implementation >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -.NET uses a custom command executor for executing commands that are valid for the given browser in the remote driver. -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Drivers/RemoteWebDriverTest.cs#L96-L100" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -Ruby uses mixins to add applicable browser specific methods to the Remote WebDriver session; -the methods should always just work for you. -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -## 追踪客户端请求 - -此功能仅适用于Java客户端绑定 (Beta版以后). -远程WebDriver客户端向Selenium网格服务器发送请求, -后者将请求传递给WebDriver. -应该在服务器端和客户端启用跟踪, -以便端到端地追踪HTTP请求. -两端都应该有一个指向可视化框架的追踪导出器设置. -默认情况下, -对客户端和服务器都启用追踪. -若设置可视化框架Jaeger UI及Selenium Grid 4, -请参阅所需版本的[追踪设置](https://github.com/SeleniumHQ/selenium/blob/selenium-4.0.0-beta-1/java/server/src/org/openqa/selenium/grid/commands/tracing.txt) . - -对于客户端设置, 请执行以下步骤. - -### 添加所需依赖 - -可以使用Maven安装追踪导出器的外部库. -在项目pom.xml中添加 _opentelemetry-exporter-jaeger_ -和 _grpc-netty_ 的依赖项: - -```xml - - io.opentelemetry - opentelemetry-exporter-jaeger - 1.0.0 - - - io.grpc - grpc-netty - 1.35.0 - -``` - -### 在运行客户端时添加/传递所需的系统属性 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -System.setProperty("otel.traces.exporter", "jaeger"); -System.setProperty("otel.exporter.jaeger.endpoint", "http://localhost:14250"); -System.setProperty("otel.resource.attributes", "service.name=selenium-java-client"); - -ImmutableCapabilities capabilities = new ImmutableCapabilities("browserName", "chrome"); - -WebDriver driver = new RemoteWebDriver(new URL("http://www.example.com"), capabilities); - -driver.get("http://www.google.com"); - -driver.quit(); - - {{< /tab >}} -{{< /tabpane >}} - -有关所需Selenium版本 -及其外部依赖关系版本等更多信息, -请参阅[追踪设置](https://github.com/SeleniumHQ/selenium/blob/selenium-4.0.0-beta-1/java/server/src/org/openqa/selenium/grid/commands/tracing.txt) . - -更多信息请访问: - -* OpenTelemetry: https://opentelemetry.io -* 配置OpenTelemetry: - https://github.com/open-telemetry/opentelemetry-java/tree/main/sdk-extensions/autoconfigure -* Jaeger: https://www.jaegertracing.io -* [Selenium Grid 可观测性]({{< ref "observability.md" >}}) diff --git a/website_and_docs/content/documentation/webdriver/elements/_index.en.md b/website_and_docs/content/documentation/webdriver/elements/_index.en.md index 9838bc2d4414..a94b34e1eea5 100644 --- a/website_and_docs/content/documentation/webdriver/elements/_index.en.md +++ b/website_and_docs/content/documentation/webdriver/elements/_index.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/webdriver/web_element/", "/documentation/ja/webdriver/web_element/", "/documentation/pt-br/webdriver/web_element/", -"/documentation/zh-cn/webdriver/web_element/" +"/documentation/zh-cn/webdriver/web_element/", +"/ja/documentation/webdriver/elements/", +"/ja/documentation/webdriver/web_element/", +"/pt-br/documentation/webdriver/elements/", +"/pt-br/documentation/webdriver/web_element/", +"/zh-cn/documentation/webdriver/elements/", +"/zh-cn/documentation/webdriver/web_element/" ] description: > Identifying and working with element objects in the DOM. diff --git a/website_and_docs/content/documentation/webdriver/elements/_index.ja.md b/website_and_docs/content/documentation/webdriver/elements/_index.ja.md deleted file mode 100644 index 8cf98fdf8f41..000000000000 --- a/website_and_docs/content/documentation/webdriver/elements/_index.ja.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "Web要素" -linkTitle: "Web要素" -weight: 8 -aliases: [ -"/documentation/webdriver/web_element/" -] -description: > - DOM内の要素オブジェクトの識別と操作 ---- - -ほとんどの人のSeleniumコードの大部分は、Web要素の操作に関連しています。 diff --git a/website_and_docs/content/documentation/webdriver/elements/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/elements/_index.pt-br.md deleted file mode 100644 index 3e1d547d6ab1..000000000000 --- a/website_and_docs/content/documentation/webdriver/elements/_index.pt-br.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -title: "Elemento Web" -linkTitle: "Elemento Web" -weight: 8 -needsTranslation: true -aliases: [ -"/documentation/webdriver/web_element/" -] -description: > - Identificando e trabalhando com elementos no DOM. ---- - -A maioria do código que é escrito recorrendo às bibliotecas Selenium envolve trabalhar com elementos. - diff --git a/website_and_docs/content/documentation/webdriver/elements/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/elements/_index.zh-cn.md deleted file mode 100644 index d91305d47ac5..000000000000 --- a/website_and_docs/content/documentation/webdriver/elements/_index.zh-cn.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -title: "网络元素" -linkTitle: "元素" -weight: 8 -aliases: [ -"/documentation/webdriver/web_element/" -] -description: > - 在DOM中识别和使用元素对象. ---- - -大多数人的Selenium代码都涉及使用web元素. diff --git a/website_and_docs/content/documentation/webdriver/elements/finders.en.md b/website_and_docs/content/documentation/webdriver/elements/finders.en.md index 0036b10bceed..a7bf1055cc07 100644 --- a/website_and_docs/content/documentation/webdriver/elements/finders.en.md +++ b/website_and_docs/content/documentation/webdriver/elements/finders.en.md @@ -7,7 +7,13 @@ aliases: [ "/documentation/webdriver/locating_elements/", "/documentation/ja/webdriver/locating_elements/", "/documentation/pt-br/webdriver/locating_elements/", -"/documentation/zh-cn/webdriver/locating_elements/" +"/documentation/zh-cn/webdriver/locating_elements/", +"/ja/documentation/webdriver/elements/finders/", +"/ja/documentation/webdriver/locating_elements/", +"/pt-br/documentation/webdriver/elements/finders/", +"/pt-br/documentation/webdriver/locating_elements/", +"/zh-cn/documentation/webdriver/elements/finders/", +"/zh-cn/documentation/webdriver/locating_elements/" ] description: > Locating the elements based on the provided locator values. diff --git a/website_and_docs/content/documentation/webdriver/elements/finders.ja.md b/website_and_docs/content/documentation/webdriver/elements/finders.ja.md deleted file mode 100644 index 3bd2315d696f..000000000000 --- a/website_and_docs/content/documentation/webdriver/elements/finders.ja.md +++ /dev/null @@ -1,475 +0,0 @@ ---- -title: "Web要素の検索" -linkTitle: "検索" -weight: 2 -aliases: [ -"/documentation/webdriver/locating_elements/" -] -description: > - 提供されたロケーターの値に基づいて要素を検索します。 ---- - -Seleniumを使用する最も基本的な側面の1つは、操作する要素の参照を取得することです。 -Seleniumは、要素を一意に識別するための多数の組み込み[ロケーター戦略]({{< ref "locators.md" >}})を提供します。 -非常に高度なシナリオでロケーターを使用する方法はたくさんあります。 -このドキュメントの目的のために、このHTMLスニペットについて考えてみましょう。 - -```html -
    -
  1. … -
  2. … -
  3. Tomato is a Vegetable… -
-
    -
  • … -
  • … -
  • Tomato is a Fruit… -
-``` - -## 最初に一致する要素 - -多くのロケーターは、ページ上の複数の要素と一致します。 -単数の find elementメソッドは、指定されたコンテキスト内で最初に見つかった要素への参照を返します。 - -### DOM全体の評価 - -ドライバーインスタンスで要素の検索メソッドが呼び出されると、提供されたロケーターと一致するDOMの最初の要素への参照が返されます。 -この値は保存して、将来の要素アクションに使用できます。 -上記のHTMLの例では、クラス名が "tomatoes" の要素が2つあるため、このメソッドは "vegetables" リストの要素を返します。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -WebElement vegetable = driver.findElement(By.className("tomatoes")); - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L23">}} - {{< /tab >}} - {{< tab header="CSharp" >}} -var vegetable = driver.FindElement(By.ClassName("tomatoes")); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L10" >}} -{{< /tab >}} - {{< tab header="JavaScript" >}} -const vegetable = await driver.findElement(By.className('tomatoes')); - {{< /tab >}} - {{< tab header="Kotlin" >}} -val vegetable: WebElement = driver.findElement(By.className("tomatoes")) - {{< /tab >}} -{{< /tabpane >}} - - -### DOMのサブセットの評価 - -DOM全体で一意のロケーターを見つけるのではなく、検索を別の検索された要素のスコープに絞り込むと便利なことがよくあります。 -上記の例では、クラス名が "トマト" の2つの要素があり、2番目の要素の参照を取得するのは少し困難です。 - -1つの解決策は、目的の要素の祖先であり、不要な要素の祖先ではない一意の属性を持つ要素を見つけて、そのオブジェクトでfind要素を呼び出すことです。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -WebElement fruits = driver.findElement(By.id("fruits")); -WebElement fruit = fruits.findElement(By.className("tomatoes")); - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L28-L29">}} - {{< /tab >}} - {{< tab header="CSharp" >}} -IWebElement fruits = driver.FindElement(By.Id("fruits")); -IWebElement fruit = fruits.FindElement(By.ClassName("tomatoes")); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L14-L15" >}} -{{< /tab >}} - {{< tab header="JavaScript" >}} -const fruits = await driver.findElement(By.id('fruits')); -const fruit = fruits.findElement(By.className('tomatoes')); - {{< /tab >}} - {{< tab header="Kotlin" >}} -val fruits = driver.findElement(By.id("fruits")) -val fruit = fruits.findElement(By.className("tomatoes")) - {{< /tab >}} -{{< /tabpane >}} - -{{% pageinfo color="info" %}} -**Java and C#**
-`WebDriver` 、 `WebElement` 、および `ShadowRoot` クラスはすべて、 _ロールベースのインターフェイス_ と見なされる `SearchContext` インターフェイスを実装します。 -ロールベースのインターフェイスを使用すると、特定のドライバーの実装が特定の機能をサポートしているかどうかを判断できます。 -これらのインターフェースは明確に定義されており、責任の役割を1つだけ持つように努めています。 -{{% /pageinfo %}} - -### Evaluating the Shadow DOM - -The Shadow DOM is an encapsulated DOM tree hidden inside an element. -With the release of v96 in Chromium Browsers, Selenium can now allow you to access this tree -with easy-to-use shadow root methods. NOTE: These methods require Selenium 4.0 or greater. - -{{< tabpane langEqualsHeader=true >}} -{{< badge-examples >}} -{{< tab header="Java" >}} -WebElement shadowHost = driver.findElement(By.cssSelector("#shadow_host")); -SearchContext shadowRoot = shadowHost.getShadowRoot(); -WebElement shadowContent = shadowRoot.findElement(By.cssSelector("#shadow_content")); -{{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L47-L50">}} -{{< /tab >}} -{{< tab header="CSharp" >}} -var shadowHost = _driver.FindElement(By.CssSelector("#shadow_host")); -var shadowRoot = shadowHost.GetShadowRoot(); -var shadowContent = shadowRoot.FindElement(By.CssSelector("#shadow_content")); -{{< /tab >}} -{{< tab header="Ruby" >}} -shadow_host = @driver.find_element(css: '#shadow_host') -shadow_root = shadow_host.shadow_root -shadow_content = shadow_root.find_element(css: '#shadow_content') -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" text=true >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -### 最適化されたロケーター - -ネストされたルックアップは、ブラウザに2つの別々のコマンドを発行する必要があるため、最も効果的なロケーション戦略ではない可能性があります。 - -パフォーマンスをわずかに向上させるために、CSSまたはXPathのいずれかを使用して、単一のコマンドでこの要素を見つけることができます。 -[推奨されるテストプラクティス]({{< ref "/documentation/test_practices/encouraged" >}})の章で、[ロケーター戦略]({{< ref "/documentation/test_practices/encouraged/locators" >}})の提案を参照してください。 - -この例では、CSSセレクターを使用します。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -WebElement fruit = driver.findElement(By.cssSelector("#fruits .tomatoes")); - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L34" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -var fruit = driver.FindElement(By.CssSelector("#fruits .tomatoes")); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L19" >}} -{{< /tab >}} - {{< tab header="JavaScript" >}} -const fruit = await driver.findElement(By.css('#fruits .tomatoes')); - {{< /tab >}} - {{< tab header="Kotlin" >}} -val fruit = driver.findElement(By.cssSelector("#fruits .tomatoes")) - {{< /tab >}} -{{< /tabpane >}} - - -## 一致するすべての要素 - -最初の要素だけでなく、ロケーターに一致するすべての要素への参照を取得する必要があるユースケースがいくつかあります。 -複数の要素の検索メソッドは、要素参照のコレクションを返します。 -一致するものがない場合は、空のリストが返されます。 -この場合、すべてのfruitsとvegetableのリストアイテムへの参照がコレクションに返されます。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -List plants = driver.findElements(By.tagName("li")); - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L39" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -IReadOnlyList plants = driver.FindElements(By.TagName("li")); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L23" >}} -{{< /tab >}} - {{< tab header="JavaScript" >}} -const plants = await driver.findElements(By.tagName('li')); - {{< /tab >}} - {{< tab header="Kotlin" >}} -val plants: List = driver.findElements(By.tagName("li")) - {{< /tab >}} -{{< /tabpane >}} - -### 要素の取得 -多くの場合、要素のコレクションを取得しますが、特定の要素を操作したいので、コレクションを繰り返し処理して、 -必要な要素を特定する必要があります。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -List elements = driver.findElements(By.tagName("li")); - -for (WebElement element : elements) { - System.out.println("Paragraph text:" + element.getText()); -} - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L62-L64" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Firefox; -using System.Collections.Generic; - -namespace FindElementsExample { - class FindElementsExample { - public static void Main(string[] args) { - IWebDriver driver = new FirefoxDriver(); - try { - // Navigate to Url - driver.Navigate().GoToUrl("https://example.com"); - - // Get all the elements available with tag name 'p' - IList < IWebElement > elements = driver.FindElements(By.TagName("p")); - foreach(IWebElement e in elements) { - System.Console.WriteLine(e.Text); - } - - } finally { - driver.Quit(); - } - } - } -} - {{< /tab >}} - {{< tab header="Ruby" text=true >}} - {{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L28-L29" >}} - {{< /tab >}} - {{< tab header="JavaScript" >}} -const {Builder, By} = require('selenium-webdriver'); -(async function example() { - let driver = await new Builder().forBrowser('firefox').build(); - try { - // Navigate to Url - await driver.get('https://www.example.com'); - - // Get all the elements available with tag 'p' - let elements = await driver.findElements(By.css('p')); - for(let e of elements) { - console.log(await e.getText()); - } - } - finally { - await driver.quit(); - } -})(); - {{< /tab >}} - {{< tab header="Kotlin" >}} -import org.openqa.selenium.By -import org.openqa.selenium.firefox.FirefoxDriver - -fun main() { - val driver = FirefoxDriver() - try { - driver.get("https://example.com") - // Get all the elements available with tag name 'p' - val elements = driver.findElements(By.tagName("p")) - for (element in elements) { - println("Paragraph text:" + element.text) - } - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} - -## 要素から要素を検索 - -これは、親要素のコンテキスト内で一致する子のWebElementのリストを見つけるために利用されます。 -これを実現するために、親WebElementは'findElements'と連鎖して子要素にアクセスします。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} - import org.openqa.selenium.By; - import org.openqa.selenium.WebDriver; - import org.openqa.selenium.WebElement; - import org.openqa.selenium.chrome.ChromeDriver; - import java.util.List; - - public class findElementsFromElement { - public static void main(String[] args) { - WebDriver driver = new ChromeDriver(); - try { - driver.get("https://example.com"); - - // Get element with tag name 'div' - WebElement element = driver.findElement(By.tagName("div")); - - // Get all the elements available with tag name 'p' - List elements = element.findElements(By.tagName("p")); - for (WebElement e : elements) { - System.out.println(e.getText()); - } - } finally { - driver.quit(); - } - } - } - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L75-L78" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; -using System.Collections.Generic; - -namespace FindElementsFromElement { - class FindElementsFromElement { - public static void Main(string[] args) { - IWebDriver driver = new ChromeDriver(); - try { - driver.Navigate().GoToUrl("https://example.com"); - - // Get element with tag name 'div' - IWebElement element = driver.FindElement(By.TagName("div")); - - // Get all the elements available with tag name 'p' - IList < IWebElement > elements = element.FindElements(By.TagName("p")); - foreach(IWebElement e in elements) { - System.Console.WriteLine(e.Text); - } - } finally { - driver.Quit(); - } - } - } -} - {{< /tab >}} - {{< tab header="Ruby" text=true >}} - {{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L33-L35" >}} - {{< /tab >}} - {{< tab header="JavaScript" >}} - const {Builder, By} = require('selenium-webdriver'); - - (async function example() { - let driver = new Builder() - .forBrowser('chrome') - .build(); - - await driver.get('https://www.example.com'); - - // Get element with tag name 'div' - let element = driver.findElement(By.css("div")); - - // Get all the elements available with tag name 'p' - let elements = await element.findElements(By.css("p")); - for(let e of elements) { - console.log(await e.getText()); - } - })(); - {{< /tab >}} - {{< tab header="Kotlin" >}} - import org.openqa.selenium.By - import org.openqa.selenium.chrome.ChromeDriver - - fun main() { - val driver = ChromeDriver() - try { - driver.get("https://example.com") - - // Get element with tag name 'div' - val element = driver.findElement(By.tagName("div")) - - // Get all the elements available with tag name 'p' - val elements = element.findElements(By.tagName("p")) - for (e in elements) { - println(e.text) - } - } finally { - driver.quit() - } - } - {{< /tab >}} -{{< /tabpane >}} - -## アクティブな要素を取得する - -これは、現在のブラウジングコンテキストでフォーカスを持っているDOM要素を追跡(または)検索するために使用されます。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} - import org.openqa.selenium.*; - import org.openqa.selenium.chrome.ChromeDriver; - - public class activeElementTest { - public static void main(String[] args) { - WebDriver driver = new ChromeDriver(); - try { - driver.get("http://www.google.com"); - driver.findElement(By.cssSelector("[name='q']")).sendKeys("webElement"); - - // Get attribute of current active element - String attr = driver.switchTo().activeElement().getAttribute("title"); - System.out.println(attr); - } finally { - driver.quit(); - } - } - } - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L89-L90" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} - using OpenQA.Selenium; - using OpenQA.Selenium.Chrome; - - namespace ActiveElement { - class ActiveElement { - public static void Main(string[] args) { - IWebDriver driver = new ChromeDriver(); - try { - // Navigate to Url - driver.Navigate().GoToUrl("https://www.google.com"); - driver.FindElement(By.CssSelector("[name='q']")).SendKeys("webElement"); - - // Get attribute of current active element - string attr = driver.SwitchTo().ActiveElement().GetAttribute("title"); - System.Console.WriteLine(attr); - } finally { - driver.Quit(); - } - } - } - } - {{< /tab >}} - {{< tab header="Ruby" text=true >}} - {{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L40-L41" >}} - {{< /tab >}} - {{< tab header="JavaScript" >}} - const {Builder, By} = require('selenium-webdriver'); - - (async function example() { - let driver = await new Builder().forBrowser('chrome').build(); - await driver.get('https://www.google.com'); - await driver.findElement(By.css('[name="q"]')).sendKeys("webElement"); - - // Get attribute of current active element - let attr = await driver.switchTo().activeElement().getAttribute("title"); - console.log(`${attr}`) - })(); - {{< /tab >}} - {{< tab header="Kotlin" >}} - import org.openqa.selenium.By - import org.openqa.selenium.chrome.ChromeDriver - - fun main() { - val driver = ChromeDriver() - try { - driver.get("https://www.google.com") - driver.findElement(By.cssSelector("[name='q']")).sendKeys("webElement") - - // Get attribute of current active element - val attr = driver.switchTo().activeElement().getAttribute("title") - print(attr) - } finally { - driver.quit() - } - } - {{< /tab >}} -{{< /tabpane >}} - - diff --git a/website_and_docs/content/documentation/webdriver/elements/finders.pt-br.md b/website_and_docs/content/documentation/webdriver/elements/finders.pt-br.md deleted file mode 100644 index 5baa1b63b9ce..000000000000 --- a/website_and_docs/content/documentation/webdriver/elements/finders.pt-br.md +++ /dev/null @@ -1,479 +0,0 @@ ---- -title: "Encontrando Elementos Web" -linkTitle: "Finders" -weight: 2 -needsTranslation: true -aliases: [ -"/documentation/webdriver/locating_elements/" -] -description: > - Localizando elementos com base nos valores providenciados pelo localizador. ---- -Um dos aspectos mais fundamentais do uso do Selenium é obter referências de elementos para trabalhar. -O Selenium oferece várias [estratégias de localizador]({{< ref "locators.md" >}}) para identificar exclusivamente um elemento. -Há muitas maneiras de usar os localizadores em cenários complexos. Para os propósitos desta documentação, -vamos considerar este trecho de HTML: - - -```html -
    -
  1. … -
  2. … -
  3. O tomate é um vegetal… -
-
    -
  • … -
  • … -
  • O tomate é uma fruta… -
-``` - -## Primeiro Elemento correspondente -Muitos localizadores irão corresponder a vários elementos na página. -O método de elemento de localização singular retornará uma referência ao -primeiro elemento encontrado dentro de um determinado contexto. - -### Avaliando o DOM inteiro -Quando o metodo find element é chamado na instância do driver, ele -retorna uma referência ao primeiro elemento no DOM que corresponde ao localizador fornecido. -Esse valor pode ser guardado e usado para ações futuras do elemento. Em nosso exemplo HTML acima, existem -dois elementos que têm um nome de classe de "tomatoes" então este método retornará o elemento na lista "vegetables". - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -WebElement vegetable = driver.findElement(By.className("tomatoes")); - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L23">}} - {{< /tab >}} - {{< tab header="CSharp" >}} -var vegetable = driver.FindElement(By.ClassName("tomatoes")); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L10" >}} -{{< /tab >}} - {{< tab header="JavaScript" >}} -const vegetable = await driver.findElement(By.className('tomatoes')); - {{< /tab >}} - {{< tab header="Kotlin" >}} -val vegetable: WebElement = driver.findElement(By.className("tomatoes")) - {{< /tab >}} -{{< /tabpane >}} - - -### Avaliando um subconjunto do DOM -Ao em vez de tentar encontrar um localizador unico no DOM inteiro, normalmente é útil restringir a busca ao escopo de outro elemento -já localizado. No exemplo acima existem dois elementos com um nome de classe de "tomatoes" e -é um pouco mais desafiador obter a referência para o segundo. - -Uma possível solução seria localizar um elemento com um atributo único que seja um ancestral do elemento desejado e não um -ancestral do elemento indesejado, então invoque o find element nesse objeto: - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -WebElement fruits = driver.findElement(By.id("fruits")); -WebElement fruit = fruits.findElement(By.className("tomatoes")); - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L28-L29">}} - {{< /tab >}} - {{< tab header="CSharp" >}} -IWebElement fruits = driver.FindElement(By.Id("fruits")); -IWebElement fruit = fruits.FindElement(By.ClassName("tomatoes")); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L14-L15" >}} -{{< /tab >}} - {{< tab header="JavaScript" >}} -const fruits = await driver.findElement(By.id('fruits')); -const fruit = fruits.findElement(By.className('tomatoes')); - {{< /tab >}} - {{< tab header="Kotlin" >}} -val fruits = driver.findElement(By.id("fruits")) -val fruit = fruits.findElement(By.className("tomatoes")) - {{< /tab >}} -{{< /tabpane >}} - -{{% pageinfo color="info" %}} -**Java e C#**
-As classes `WebDriver`, `WebElement` e `ShadowRoot` todas implementam o `SearchContext` interface, que é -considerada uma _role-based interface_(interface baseada em função). As interfaces baseadas em função permitem determinar se uma determinada -implementação de driver suporta um recurso específico. Essas interfaces são claramente definidas e tentam -aderir a ter apenas um único papel de responsabilidade. -{{% /pageinfo %}} - -### Evaluating the Shadow DOM - -The Shadow DOM is an encapsulated DOM tree hidden inside an element. -With the release of v96 in Chromium Browsers, Selenium can now allow you to access this tree -with easy-to-use shadow root methods. NOTE: These methods require Selenium 4.0 or greater. - -{{< tabpane langEqualsHeader=true >}} -{{< badge-examples >}} -{{< tab header="Java" >}} -WebElement shadowHost = driver.findElement(By.cssSelector("#shadow_host")); -SearchContext shadowRoot = shadowHost.getShadowRoot(); -WebElement shadowContent = shadowRoot.findElement(By.cssSelector("#shadow_content")); -{{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L47-L50">}} -{{< /tab >}} -{{< tab header="CSharp" >}} -var shadowHost = _driver.FindElement(By.CssSelector("#shadow_host")); -var shadowRoot = shadowHost.GetShadowRoot(); -var shadowContent = shadowRoot.FindElement(By.CssSelector("#shadow_content")); -{{< /tab >}} -{{< tab header="Ruby" >}} -shadow_host = @driver.find_element(css: '#shadow_host') -shadow_root = shadow_host.shadow_root -shadow_content = shadow_root.find_element(css: '#shadow_content') -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" text=true >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -### Localizador otimizado -Uma pesquisa aninhada pode não ser a estratégia de localização mais eficaz, pois requer dois -comandos separados a serem emitidos para o navegador. - -Para melhorar um pouco o desempenho, podemos usar CSS ou XPath para encontrar esse elemento com um único comando. -Veja as [sugestões de estratégia do localizador]({{< ref "/documentation/test_practices/encouraged/locators" >}}) na nossa sessão de -[Práticas de teste incentivadas]({{< ref "/documentation/test_practices/encouraged" >}}). - -Para esse exemplo, utilizaremos o CSS Selector: - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -WebElement fruit = driver.findElement(By.cssSelector("#fruits .tomatoes")); - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L34" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -var fruit = driver.FindElement(By.CssSelector("#fruits .tomatoes")); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L19" >}} -{{< /tab >}} - {{< tab header="JavaScript" >}} -const fruit = await driver.findElement(By.css('#fruits .tomatoes')); - {{< /tab >}} - {{< tab header="Kotlin" >}} -val fruit = driver.findElement(By.cssSelector("#fruits .tomatoes")) - {{< /tab >}} -{{< /tabpane >}} - - -## Todos os elementos correspondentes -Existem vários casos de uso para a necessidade de obter referências a todos os elementos que correspondem a um localizador, em vez -do que apenas o primeiro. Os métodos plurais find elements retornam uma coleção de referências de elementos. -Se não houver correspondências, uma lista vazia será retornada. Nesse caso, -referências a todos os itens da lista de frutas e vegetais serão devolvidas em uma coleção. - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -List plants = driver.findElements(By.tagName("li")); - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L39" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -IReadOnlyList plants = driver.FindElements(By.TagName("li")); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L23" >}} -{{< /tab >}} - {{< tab header="JavaScript" >}} -const plants = await driver.findElements(By.tagName('li')); - {{< /tab >}} - {{< tab header="Kotlin" >}} -val plants: List = driver.findElements(By.tagName("li")) - {{< /tab >}} -{{< /tabpane >}} - -### Obter Elemento -Muitas vezes você obterá uma coleção de elementos, mas quer trabalhar apenas com um elemento específico, o que significa que você -precisa iterar sobre a coleção e identificar o que você deseja. - - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -List elements = driver.findElements(By.tagName("li")); - -for (WebElement element : elements) { - System.out.println("Paragraph text:" + element.getText()); -} - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L62-L64" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Firefox; -using System.Collections.Generic; - -namespace FindElementsExample { - class FindElementsExample { - public static void Main(string[] args) { - IWebDriver driver = new FirefoxDriver(); - try { - // Navegar até a URL - driver.Navigate().GoToUrl("https://example.com"); - - // Obtém todos os elementos disponiveis com o nome da tag 'p' - IList < IWebElement > elements = driver.FindElements(By.TagName("p")); - foreach(IWebElement e in elements) { - System.Console.WriteLine(e.Text); - } - - } finally { - driver.Quit(); - } - } - } -} - {{< /tab >}} - {{< tab header="Ruby" text=true >}} - {{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L28-L29" >}} - {{< /tab >}} - {{< tab header="JavaScript" >}} -const {Builder, By} = require('selenium-webdriver'); -(async function example() { - let driver = await new Builder().forBrowser('firefox').build(); - try { - // Navegar até a URL - await driver.get('https://www.example.com'); - - // Obtém todos os elementos disponiveis com o nome da tag 'p' - let elements = await driver.findElements(By.css('p')); - for(let e of elements) { - console.log(await e.getText()); - } - } - finally { - await driver.quit(); - } -})(); - {{< /tab >}} - {{< tab header="Kotlin" >}} -import org.openqa.selenium.By -import org.openqa.selenium.firefox.FirefoxDriver - -fun main() { - val driver = FirefoxDriver() - try { - driver.get("https://example.com") - // Obtém todos os elementos disponiveis com o nome da tag 'p' - val elements = driver.findElements(By.tagName("p")) - for (element in elements) { - println("Paragraph text:" + element.text) - } - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} - -## Localizar Elementos em um Elemento - -Ele é usado para localizar a lista de WebElements filhos correspondentes dentro do contexto do elemento pai. -Para realizar isso, o WebElement pai é encadeado com o 'findElements' para acessar seus elementos filhos. - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} - import org.openqa.selenium.By; - import org.openqa.selenium.WebDriver; - import org.openqa.selenium.WebElement; - import org.openqa.selenium.chrome.ChromeDriver; - import java.util.List; - - public class findElementsFromElement { - public static void main(String[] args) { - WebDriver driver = new ChromeDriver(); - try { - driver.get("https://example.com"); - - // Obtém o elemento com o nome da tag 'div' - WebElement element = driver.findElement(By.tagName("div")); - - // Obtém todos os elementos disponiveis com o nome da tag 'p' - List elements = element.findElements(By.tagName("p")); - for (WebElement e : elements) { - System.out.println(e.getText()); - } - } finally { - driver.quit(); - } - } - } - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L75-L78" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; -using System.Collections.Generic; - -namespace FindElementsFromElement { - class FindElementsFromElement { - public static void Main(string[] args) { - IWebDriver driver = new ChromeDriver(); - try { - driver.Navigate().GoToUrl("https://example.com"); - - // Obtém o elemento com o nome da tag 'div' - IWebElement element = driver.FindElement(By.TagName("div")); - - // Obtém todos os elementos disponíveis com o nome da tag 'p' - IList < IWebElement > elements = element.FindElements(By.TagName("p")); - foreach(IWebElement e in elements) { - System.Console.WriteLine(e.Text); - } - } finally { - driver.Quit(); - } - } - } -} - {{< /tab >}} - {{< tab header="Ruby" text=true >}} - {{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L33-L35" >}} - {{< /tab >}} - {{< tab header="JavaScript" >}} - const {Builder, By} = require('selenium-webdriver'); - - (async function example() { - let driver = new Builder() - .forBrowser('chrome') - .build(); - - await driver.get('https://www.example.com'); - - // Obtém o elemento com o nome da tag 'div' - let element = driver.findElement(By.css("div")); - - // Obtém todos os elementos disponíveis com o nome da tag 'p' - let elements = await element.findElements(By.css("p")); - for(let e of elements) { - console.log(await e.getText()); - } - })(); - {{< /tab >}} - {{< tab header="Kotlin" >}} - import org.openqa.selenium.By - import org.openqa.selenium.chrome.ChromeDriver - - fun main() { - val driver = ChromeDriver() - try { - driver.get("https://example.com") - - // Obtém o elemento com o nome da tag 'div' - val element = driver.findElement(By.tagName("div")) - - // Obtém todos os elementos disponíveis com o nome da tag 'p' - val elements = element.findElements(By.tagName("p")) - for (e in elements) { - println(e.text) - } - } finally { - driver.quit() - } - } - {{< /tab >}} -{{< /tabpane >}} - -## Obter elemento ativo - -Ele é usado para rastrear (ou) encontrar um elemento DOM que tem o foco no contexto de navegação atual. - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} - import org.openqa.selenium.*; - import org.openqa.selenium.chrome.ChromeDriver; - - public class activeElementTest { - public static void main(String[] args) { - WebDriver driver = new ChromeDriver(); - try { - driver.get("http://www.google.com"); - driver.findElement(By.cssSelector("[name='q']")).sendKeys("webElement"); - - // Obter atributo do elemento atualmente ativo - String attr = driver.switchTo().activeElement().getAttribute("title"); - System.out.println(attr); - } finally { - driver.quit(); - } - } - } - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L89-L90" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} - using OpenQA.Selenium; - using OpenQA.Selenium.Chrome; - - namespace ActiveElement { - class ActiveElement { - public static void Main(string[] args) { - IWebDriver driver = new ChromeDriver(); - try { - // Navegar até a URL - driver.Navigate().GoToUrl("https://www.google.com"); - driver.FindElement(By.CssSelector("[name='q']")).SendKeys("webElement"); - - // Obter atributo do elemento atualmente ativo - string attr = driver.SwitchTo().ActiveElement().GetAttribute("title"); - System.Console.WriteLine(attr); - } finally { - driver.Quit(); - } - } - } - } - {{< /tab >}} - {{< tab header="Ruby" text=true >}} - {{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L40-L41" >}} - {{< /tab >}} - {{< tab header="JavaScript" >}} - const {Builder, By} = require('selenium-webdriver'); - - (async function example() { - let driver = await new Builder().forBrowser('chrome').build(); - await driver.get('https://www.google.com'); - await driver.findElement(By.css('[name="q"]')).sendKeys("webElement"); - - // Obter atributo do elemento atualmente ativo - let attr = await driver.switchTo().activeElement().getAttribute("title"); - console.log(`${attr}`) - })(); - {{< /tab >}} - {{< tab header="Kotlin" >}} - import org.openqa.selenium.By - import org.openqa.selenium.chrome.ChromeDriver - - fun main() { - val driver = ChromeDriver() - try { - driver.get("https://www.google.com") - driver.findElement(By.cssSelector("[name='q']")).sendKeys("webElement") - - // Obter atributo do elemento atualmente ativo - val attr = driver.switchTo().activeElement().getAttribute("title") - print(attr) - } finally { - driver.quit() - } - } - {{< /tab >}} -{{< /tabpane >}} - - diff --git a/website_and_docs/content/documentation/webdriver/elements/finders.zh-cn.md b/website_and_docs/content/documentation/webdriver/elements/finders.zh-cn.md deleted file mode 100644 index 3ca864b23595..000000000000 --- a/website_and_docs/content/documentation/webdriver/elements/finders.zh-cn.md +++ /dev/null @@ -1,485 +0,0 @@ ---- -title: "查询网络元素" -linkTitle: "查询器" -weight: 2 -aliases: [ -"/documentation/webdriver/locating_elements/" -] -description: > - 根据提供的定位值定位元素. ---- - - -使用 Selenium 最基本的特点之一是获取可用于操作的元素引用。 -Selenium 提供了许多内置的 [定位策略]({{< ref "locators.md" >}}),用于唯一标识元素。 -在更复杂的场景中,可以用多种方式使用这些定位器。为了本篇文档的目的, -我们来考虑下面的 HTML 片段: - -```html -
    -
  1. … -
  2. … -
  3. Tomato is a Vegetable… -
-
    -
  • … -
  • … -
  • Tomato is a Fruit… -
-``` - -## 第一个匹配的元素 - -许多定位器会匹配页面上的多个元素。 -单个的 find element 方法会返回在给定上下文中找到的第一个元素的引用。 - -### 在整个 DOM 中查找 - -当在 driver 实例上调用 find element 方法时, -它会返回 DOM 中与所提供定位器匹配的第一个元素的引用。 -该引用可以被保存并用于后续的元素操作。 -在上面的示例 HTML 中,有两个 class 名称为 "tomatoes" 的元素, -因此此方法会返回位于 "vegetables" 列表中的那个元素。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -WebElement vegetable = driver.findElement(By.className("tomatoes")); - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L23">}} - {{< /tab >}} - {{< tab header="CSharp" >}} -var vegetable = driver.FindElement(By.ClassName("tomatoes")); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L10" >}} -{{< /tab >}} - {{< tab header="JavaScript" >}} -const vegetable = await driver.findElement(By.className('tomatoes')); - {{< /tab >}} - {{< tab header="Kotlin" >}} -val vegetable: WebElement = driver.findElement(By.className("tomatoes")) - {{< /tab >}} -{{< /tabpane >}} - - - -### 在 DOM 的子集内评估 - -与其在整个 DOM 中寻找唯一的定位器, -通常更有用的是将搜索范围缩小到另一个已定位元素的作用域内。 -在上面的示例中,有两个 class 名为 "tomatoes" 的元素, -因此要获取第二个元素的引用会更具挑战性。 - -一种解决办法是先定位一个具有唯一属性的元素, -该元素是目标元素的祖先但不是非目标元素的祖先, -然后在该对象上调用 `find element`: - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -WebElement fruits = driver.findElement(By.id("fruits")); -WebElement fruit = fruits.findElement(By.className("tomatoes")); - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L28-L29">}} - {{< /tab >}} - {{< tab header="CSharp" >}} -IWebElement fruits = driver.FindElement(By.Id("fruits")); -IWebElement fruit = fruits.FindElement(By.ClassName("tomatoes")); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L14-L15" >}} -{{< /tab >}} - {{< tab header="JavaScript" >}} -const fruits = await driver.findElement(By.id('fruits')); -const fruit = fruits.findElement(By.className('tomatoes')); - {{< /tab >}} - {{< tab header="Kotlin" >}} -val fruits = driver.findElement(By.id("fruits")) -val fruit = fruits.findElement(By.className("tomatoes")) - {{< /tab >}} -{{< /tabpane >}} - -{{% pageinfo color="info" %}} -**Java 和 C#**
-`WebDriver`、`WebElement` 和 `ShadowRoot` 类都实现了 `SearchContext` 接口, -该接口被视为一种 _基于角色的接口_。基于角色的接口可以让你判断特定的驱动实现是否支持某项功能。 -这些接口定义清晰,并尽量遵循单一职责原则。 -{{% /pageinfo %}} - -### 评估 Shadow DOM - -Shadow DOM 是隐藏在元素内部的封装 DOM 树。 -自 Chromium 浏览器在 v96 发布后,Selenium 已支持通过易用的 shadow root 方法访问该树。注意:这些方法需要 Selenium 4.0 或更高版本。 - -{{< tabpane langEqualsHeader=true >}} -{{< badge-examples >}} -{{< tab header="Java" >}} -WebElement shadowHost = driver.findElement(By.cssSelector("#shadow_host")); -SearchContext shadowRoot = shadowHost.getShadowRoot(); -WebElement shadowContent = shadowRoot.findElement(By.cssSelector("#shadow_content")); -{{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L47-L50">}} -{{< /tab >}} -{{< tab header="CSharp" >}} -var shadowHost = _driver.FindElement(By.CssSelector("#shadow_host")); -var shadowRoot = shadowHost.GetShadowRoot(); -var shadowContent = shadowRoot.FindElement(By.CssSelector("#shadow_content")); -{{< /tab >}} -{{< tab header="Ruby" >}} -shadow_host = @driver.find_element(css: '#shadow_host') -shadow_root = shadow_host.shadow_root -shadow_content = shadow_root.find_element(css: '#shadow_content') -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< badge-code >}} -{{< /tab >}} -{{< tab header="Kotlin" text=true >}} -{{< badge-code >}} -{{< /tab >}} -{{< /tabpane >}} - -### 优化后的定位器 - -嵌套查找可能不是最有效的定位策略, -因为它需要向浏览器发送两次独立的命令。 - -为略微提升性能,我们可以使用 CSS 或 XPath,在一次命令中定位到该元素。 -请参阅本节中关于[定位策略建议]({{< ref "/documentation/test_practices/encouraged/locators" >}})的说明 -以及[推荐的测试实践]({{< ref "/documentation/test_practices/encouraged" >}})。 - -在本例中,我们将使用 CSS 选择器: - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -WebElement fruit = driver.findElement(By.cssSelector("#fruits .tomatoes")); - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L34" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -var fruit = driver.FindElement(By.CssSelector("#fruits .tomatoes")); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L19" >}} -{{< /tab >}} - {{< tab header="JavaScript" >}} -const fruit = await driver.findElement(By.css('#fruits .tomatoes')); - {{< /tab >}} - {{< tab header="Kotlin" >}} -val fruit = driver.findElement(By.cssSelector("#fruits .tomatoes")) - {{< /tab >}} -{{< /tabpane >}} - - - -## 所有匹配的元素 - -在某些情况下,需要获取与定位器匹配的所有元素的引用,而不是仅获取第一个。 -复数形式的 `find elements` 方法会返回一组元素引用。如果没有匹配项,则返回空列表。 -在本例中,将返回所有水果和蔬菜列表项的引用集合。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -List plants = driver.findElements(By.tagName("li")); - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L39" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -IReadOnlyList plants = driver.FindElements(By.TagName("li")); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L23" >}} -{{< /tab >}} - {{< tab header="JavaScript" >}} -const plants = await driver.findElements(By.tagName('li')); - {{< /tab >}} - {{< tab header="Kotlin" >}} -val plants: List = driver.findElements(By.tagName("li")) - {{< /tab >}} -{{< /tabpane >}} - -### 获取元素 -有时你会得到一组元素,但想操作其中某个特定元素, -这意味着需要遍历该集合并找到目标元素。 - - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -List elements = driver.findElements(By.tagName("li")); - -for (WebElement element : elements) { - System.out.println("Paragraph text:" + element.getText()); -} - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L62-L64" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Firefox; -using System.Collections.Generic; - -namespace FindElementsExample { - class FindElementsExample { - public static void Main(string[] args) { - IWebDriver driver = new FirefoxDriver(); - try { - // Navigate to Url - driver.Navigate().GoToUrl("https://example.com"); - - // Get all the elements available with tag name 'p' - IList < IWebElement > elements = driver.FindElements(By.TagName("p")); - foreach(IWebElement e in elements) { - System.Console.WriteLine(e.Text); - } - - } finally { - driver.Quit(); - } - } - } -} - {{< /tab >}} - {{< tab header="Ruby" text=true >}} - {{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L28-L29" >}} - {{< /tab >}} - {{< tab header="JavaScript" >}} -const {Builder, By} = require('selenium-webdriver'); -(async function example() { - let driver = await new Builder().forBrowser('firefox').build(); - try { - // Navigate to Url - await driver.get('https://www.example.com'); - - // Get all the elements available with tag 'p' - let elements = await driver.findElements(By.css('p')); - for(let e of elements) { - console.log(await e.getText()); - } - } - finally { - await driver.quit(); - } -})(); - {{< /tab >}} - {{< tab header="Kotlin" >}} -import org.openqa.selenium.By -import org.openqa.selenium.firefox.FirefoxDriver - -fun main() { - val driver = FirefoxDriver() - try { - driver.get("https://example.com") - // Get all the elements available with tag name 'p' - val elements = driver.findElements(By.tagName("p")) - for (element in elements) { - println("Paragraph text:" + element.text) - } - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} - -## 从元素查找子元素 - -用于在父元素的上下文中查找匹配的子 WebElement 列表。 -为此,可在父 WebElement 上链式调用 `findElements` 来访问子元素。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} - import org.openqa.selenium.By; - import org.openqa.selenium.WebDriver; - import org.openqa.selenium.WebElement; - import org.openqa.selenium.chrome.ChromeDriver; - import java.util.List; - - public class findElementsFromElement { - public static void main(String[] args) { - WebDriver driver = new ChromeDriver(); - try { - driver.get("https://example.com"); - - // Get element with tag name 'div' - WebElement element = driver.findElement(By.tagName("div")); - - // Get all the elements available with tag name 'p' - List elements = element.findElements(By.tagName("p")); - for (WebElement e : elements) { - System.out.println(e.getText()); - } - } finally { - driver.quit(); - } - } - } - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L75-L78" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; -using System.Collections.Generic; - -namespace FindElementsFromElement { - class FindElementsFromElement { - public static void Main(string[] args) { - IWebDriver driver = new ChromeDriver(); - try { - driver.Navigate().GoToUrl("https://example.com"); - - // Get element with tag name 'div' - IWebElement element = driver.FindElement(By.TagName("div")); - - // Get all the elements available with tag name 'p' - IList < IWebElement > elements = element.FindElements(By.TagName("p")); - foreach(IWebElement e in elements) { - System.Console.WriteLine(e.Text); - } - } finally { - driver.Quit(); - } - } - } -} - {{< /tab >}} - {{< tab header="Ruby" text=true >}} - {{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L33-L35" >}} - {{< /tab >}} - {{< tab header="JavaScript" >}} - const {Builder, By} = require('selenium-webdriver'); - - (async function example() { - let driver = new Builder() - .forBrowser('chrome') - .build(); - - await driver.get('https://www.example.com'); - - // Get element with tag name 'div' - let element = driver.findElement(By.css("div")); - - // Get all the elements available with tag name 'p' - let elements = await element.findElements(By.css("p")); - for(let e of elements) { - console.log(await e.getText()); - } - })(); - {{< /tab >}} - {{< tab header="Kotlin" >}} - import org.openqa.selenium.By - import org.openqa.selenium.chrome.ChromeDriver - - fun main() { - val driver = ChromeDriver() - try { - driver.get("https://example.com") - - // Get element with tag name 'div' - val element = driver.findElement(By.tagName("div")) - - // Get all the elements available with tag name 'p' - val elements = element.findElements(By.tagName("p")) - for (e in elements) { - println(e.text) - } - } finally { - driver.quit() - } - } - {{< /tab >}} -{{< /tabpane >}} - -## 获取活动元素 - -用于跟踪或查找当前浏览上下文中具有焦点的 DOM 元素。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} - import org.openqa.selenium.*; - import org.openqa.selenium.chrome.ChromeDriver; - - public class activeElementTest { - public static void main(String[] args) { - WebDriver driver = new ChromeDriver(); - try { - driver.get("http://www.google.com"); - driver.findElement(By.cssSelector("[name='q']")).sendKeys("webElement"); - - // Get attribute of current active element - String attr = driver.switchTo().activeElement().getAttribute("title"); - System.out.println(attr); - } finally { - driver.quit(); - } - } - } - {{< /tab >}} - {{< tab header="Python" text=true >}} - {{< gh-codeblock path="/examples/python/tests/elements/test_finders.py#L89-L90" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} - using OpenQA.Selenium; - using OpenQA.Selenium.Chrome; - - namespace ActiveElement { - class ActiveElement { - public static void Main(string[] args) { - IWebDriver driver = new ChromeDriver(); - try { - // Navigate to Url - driver.Navigate().GoToUrl("https://www.google.com"); - driver.FindElement(By.CssSelector("[name='q']")).SendKeys("webElement"); - - // Get attribute of current active element - string attr = driver.SwitchTo().ActiveElement().GetAttribute("title"); - System.Console.WriteLine(attr); - } finally { - driver.Quit(); - } - } - } - } - {{< /tab >}} - {{< tab header="Ruby" text=true >}} - {{< gh-codeblock path="/examples/ruby/spec/elements/finders_spec.rb#L40-L41" >}} - {{< /tab >}} - {{< tab header="JavaScript" >}} - const {Builder, By} = require('selenium-webdriver'); - - (async function example() { - let driver = await new Builder().forBrowser('chrome').build(); - await driver.get('https://www.google.com'); - await driver.findElement(By.css('[name="q"]')).sendKeys("webElement"); - - // Get attribute of current active element - let attr = await driver.switchTo().activeElement().getAttribute("title"); - console.log(`${attr}`) - })(); - {{< /tab >}} - {{< tab header="Kotlin" >}} - import org.openqa.selenium.By - import org.openqa.selenium.chrome.ChromeDriver - - fun main() { - val driver = ChromeDriver() - try { - driver.get("https://www.google.com") - driver.findElement(By.cssSelector("[name='q']")).sendKeys("webElement") - - // Get attribute of current active element - val attr = driver.switchTo().activeElement().getAttribute("title") - print(attr) - } finally { - driver.quit() - } - } - {{< /tab >}} -{{< /tabpane >}} - - diff --git a/website_and_docs/content/documentation/webdriver/elements/interactions.ja.md b/website_and_docs/content/documentation/webdriver/elements/interactions.ja.md index bd0f2c65cdf2..a08756907927 100644 --- a/website_and_docs/content/documentation/webdriver/elements/interactions.ja.md +++ b/website_and_docs/content/documentation/webdriver/elements/interactions.ja.md @@ -12,7 +12,7 @@ There are only 5 basic commands that can be executed on an element: * [send keys](https://w3c.github.io/webdriver/#element-send-keys) (only applies to text fields and keyboard interactable elements) * [clear](https://w3c.github.io/webdriver/#element-send-keys) (only applies to text fields and content editable elements) * submit (only applies to form elements) -* select (see [Select List Elements]({{< ref "select_lists.md" >}})) +* select (see [Select List Elements]({{< ref path="select_lists.md" lang="en" >}})) ## Additional validations diff --git a/website_and_docs/content/documentation/webdriver/elements/interactions.pt-br.md b/website_and_docs/content/documentation/webdriver/elements/interactions.pt-br.md index 63c57f834610..7ebebf9eedb6 100644 --- a/website_and_docs/content/documentation/webdriver/elements/interactions.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/elements/interactions.pt-br.md @@ -12,7 +12,7 @@ There are only 5 basic commands that can be executed on an element: * [send keys](https://w3c.github.io/webdriver/#element-send-keys) (only applies to text fields and keyboard interactable elements) * [clear](https://w3c.github.io/webdriver/#element-send-keys) (only applies to text fields and content editable elements) * submit (only applies to form elements) -* select (see [Select List Elements]({{< ref "select_lists.md" >}})) +* select (see [Select List Elements]({{< ref path="select_lists.md" lang="en" >}})) ## Additional validations diff --git a/website_and_docs/content/documentation/webdriver/elements/interactions.zh-cn.md b/website_and_docs/content/documentation/webdriver/elements/interactions.zh-cn.md index e2d073cceaf9..2eed5e21710d 100644 --- a/website_and_docs/content/documentation/webdriver/elements/interactions.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/elements/interactions.zh-cn.md @@ -12,7 +12,7 @@ description: > * [发送键位](https://w3c.github.io/webdriver/#element-send-keys) (仅适用于文本字段和内容可编辑元素) * [清除](https://w3c.github.io/webdriver/#element-send-keys) (仅适用于文本字段和内容可编辑元素) * 提交 (仅适用于表单元素) -* 选择 (参见 [选择列表元素]({{< ref "select_lists.md" >}})) +* 选择 (参见 [选择列表元素]({{< ref path="select_lists.md" lang="en" >}})) ## 附加验证 diff --git a/website_and_docs/content/documentation/webdriver/elements/locators.ja.md b/website_and_docs/content/documentation/webdriver/elements/locators.ja.md index e39faff030e5..40c65bd81b73 100644 --- a/website_and_docs/content/documentation/webdriver/elements/locators.ja.md +++ b/website_and_docs/content/documentation/webdriver/elements/locators.ja.md @@ -9,11 +9,11 @@ description: > DOM内の1つ以上の特定の要素を識別する方法 --- -ロケーターは、ページ上の要素を識別する方法です。 これは、[検索要素]({{< ref "finders.md" >}}) メソッドに渡される引数です。 +ロケーターは、ページ上の要素を識別する方法です。 これは、[検索要素]({{< ref path="finders.md" lang="en" >}}) メソッドに渡される引数です。 検出方法とは別にロケーターを宣言するタイミングと理由など、 [ロケーター]({{< ref "/documentation/test_practices/encouraged/locators.md" >}})に関するヒントについては、 -[推奨されるテストプラクティス]({{< ref "/documentation/test_practices/encouraged" >}}) を確認してください。 +[推奨されるテストプラクティス]({{< ref path="/documentation/test_practices/encouraged" lang="en" >}}) を確認してください。 ### 要素選択の方法 diff --git a/website_and_docs/content/documentation/webdriver/elements/locators.pt-br.md b/website_and_docs/content/documentation/webdriver/elements/locators.pt-br.md index 351c80d1d76a..cfc78c062ce0 100644 --- a/website_and_docs/content/documentation/webdriver/elements/locators.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/elements/locators.pt-br.md @@ -11,9 +11,9 @@ description: > --- Um localizador é uma forma de identificar elementos numa página. São os argumentos passados aos métodos -[Finders]({{< ref "finders.md" >}}) . +[Finders]({{< ref path="finders.md" lang="en" >}}) . -Visite os nossas [directrizes e recomendações]({{< ref "/documentation/test_practices/encouraged" >}}) para dicas sobre +Visite os nossas [directrizes e recomendações]({{< ref path="/documentation/test_practices/encouraged" lang="en" >}}) para dicas sobre [locators]({{< ref "/documentation/test_practices/encouraged/locators.md" >}}), incluindo quais usar e quando, e também porque é que deve declarar localizadores separadamente dos finders. diff --git a/website_and_docs/content/documentation/webdriver/elements/locators.zh-cn.md b/website_and_docs/content/documentation/webdriver/elements/locators.zh-cn.md index 6cd1c9326e14..7fb9ba8860c1 100644 --- a/website_and_docs/content/documentation/webdriver/elements/locators.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/elements/locators.zh-cn.md @@ -11,9 +11,9 @@ description: > --- 定位器是在页面上标识元素的一种方法。它是传送给 -[查找元素]({{< ref "finders.md" >}}) 方法的参数。 +[查找元素]({{< ref path="finders.md" lang="en" >}}) 方法的参数。 -查看 [鼓励测试练习]({{< ref "/documentation/test_practices/encouraged" >}}) 寻找 +查看 [鼓励测试练习]({{< ref path="/documentation/test_practices/encouraged" lang="en" >}}) 寻找 [定位器]({{< ref "/documentation/test_practices/encouraged/locators.md" >}})的小技巧, 包含在查找方法中,不同时间,不同原因下,单独声明的定位器的使用方法。 diff --git a/website_and_docs/content/documentation/webdriver/getting_started/_index.en.md b/website_and_docs/content/documentation/webdriver/getting_started/_index.en.md index 94b82bb00871..670b6c00da4d 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/_index.en.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/_index.en.md @@ -21,7 +21,13 @@ aliases: [ "/documentation/zh-cn/getting_started/", "/documentation/zh-cn/getting_started/quick/", "/documentation/zh-cn/selenium_installation/", -"/documentation/zh-cn/getting_started_with_webdriver/" +"/documentation/zh-cn/getting_started_with_webdriver/", +"/ja/documentation/getting_started/", +"/ja/documentation/webdriver/getting_started/", +"/pt-br/documentation/getting_started/", +"/pt-br/documentation/webdriver/getting_started/", +"/zh-cn/documentation/getting_started/", +"/zh-cn/documentation/webdriver/getting_started/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/getting_started/_index.ja.md b/website_and_docs/content/documentation/webdriver/getting_started/_index.ja.md deleted file mode 100644 index 2aa669bc6209..000000000000 --- a/website_and_docs/content/documentation/webdriver/getting_started/_index.ja.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: "入門" -linkTitle: "入門" -weight: 2 -needsTranslation: true -description: > - Seleniumを初めて使用する場合は、すぐに習得するのに役立つリソースがいくつかあります。 -aliases: [ -"/documentation/getting_started/" -] ---- - -Seleniumは市場で主要なブラウザの全てを _WebDriver_ を使うことでサポートしています。 -WebDriverとはAPI群とプロトコルです。これらはウェブブラウザの動作をコントロールするための言語中立なインターフェイスを定義しています。 -それぞれのブラウザは特定のWebDriverの実装を持っており、これらは *driver* と呼ばれます。 -driverはブラウザに委譲する責務を持つコンポーネントであり、Seleniumとブラウザ間の通信を処理します。 - -この分離は、ブラウザベンダーに自分たちのブラウザでの実装の責任を持たせるための意図的な努力のひとつです。 -Seleniumは可能な場合これらのサードパーティ製のdriverを使いますが、それが現実的でない場合のためにプロジェクトでメンテナンスしているdriverも提供しています。 - -Seleniumフレームワークはこれら全ての要素をユーザ向けのインターフェイスを通して結びつけます。このインターフェイスは異なるブラウザバックエンドを透過的に使えるようにし、クロスブラウザ・クロスプラットフォームの自動化を可能にします。 - -Seleniumのセットアップは、他の商用ツールのセットアップとはかなり異なります。 -Seleniumコードの記述を開始する前に、次のことを行う必要があります -選択した言語、つまりブラウザーの言語バインディングライブラリをインストールします -使用したい、そのブラウザのドライバ。 - -***以下のリンクをたどって、Selenium WebDriverを起動してください。*** - -ローコード/録音および再生ツールから始めたい場合は、確認してください -[Selenium IDE](https://selenium.dev/selenium-ide) - -物事がうまくいったら、テストをスケールアップしたい場合は、[Selenium Grid]({{< ref "/documentation/grid" >}}). diff --git a/website_and_docs/content/documentation/webdriver/getting_started/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/getting_started/_index.pt-br.md deleted file mode 100644 index 82ec00f7a3af..000000000000 --- a/website_and_docs/content/documentation/webdriver/getting_started/_index.pt-br.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: "Começando" -linkTitle: "Começando" -weight: 2 -needsTranslation: true -description: > - Se você é novo no Selenium, nós temos alguns recursos que podem te ajudar a se atualizar imediatamente. -aliases: [ -"/documentation/getting_started/" -] ---- - -Selenium suporta automação de todos os principais navegadores do mercado -por meio do uso do _WebDriver_. -WebDriver é uma API e protocolo que define uma interface de linguagem neutra -para controlar o comportamento dos navegadores da web. -Cada navegador é apoiado por uma implementação WebDriver específica, chamada de *driver*. -O driver é o componente responsável por delegar ao navegador, -e lida com a comunicação de e para o Selenium e o navegador. - -Essa separação é parte de um esforço consciente para que os fornecedores de navegadores -assumam a responsabilidade pela implementação de seus navegadores. -Selenium faz uso desses drivers de terceiros sempre que possível, -mas também fornece seus próprios drivers mantidos pelo projeto -para os casos em que isso não é uma realidade. - -A estrutura do Selenium une todas essas peças -por meio de uma interface voltada para o usuário que permite aos diferentes back-ends de navegador -serem usados de forma transparente, -permitindo a automação entre navegadores e plataformas cruzadas. - -Selenium setup is quite different from the setup of other commercial tools. -Before you can start writing Selenium code, you have to -install the language bindings libraries for your language of choice, the browser you -want to use, and the driver for that browser. - -***Follow the links below to get up and going with Selenium WebDriver.*** - -If you wish to start with a low-code/record and playback tool, please check -[Selenium IDE](https://selenium.dev/selenium-ide) - -Once you get things working, if you want to scale up your tests, check out the -[Selenium Grid]({{< ref "/documentation/grid" >}}). diff --git a/website_and_docs/content/documentation/webdriver/getting_started/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/getting_started/_index.zh-cn.md deleted file mode 100644 index 712a1b8988ff..000000000000 --- a/website_and_docs/content/documentation/webdriver/getting_started/_index.zh-cn.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: "入门指南" -linkTitle: "入门指南" -weight: 2 -needsTranslation: false -description: > - 如果你是Selenium的新手, 我们有一些资源帮助你快速入门. -aliases: [ -"/documentation/getting_started/" -] ---- - - -Selenium 通过使用 _WebDriver_ 支持市场上所有主流浏览器的自动化。 -WebDriver 是一个 API 和协议,它定义了一个语言中立的接口,用于控制 web 浏览器的行为。 -每个浏览器都有一个特定的 WebDriver 实现,称为驱动程序。 -驱动程序是负责委派给浏览器的组件,并处理与 Selenium 和浏览器之间的通信。 - -这种分离是有意识地努力让浏览器供应商为其浏览器的实现负责的一部分。 -Selenium 在可能的情况下使用这些第三方驱动程序, -但是在这些驱动程序不存在的情况下,它也提供了由项目自己维护的驱动程序。 - -Selenium 框架通过一个面向用户的界面将所有这些部分连接在一起, -该界面允许透明地使用不同的浏览器后端, -从而实现跨浏览器和跨平台自动化。 - -Selenium的设置与其他商业工具有很大不同. -在开始编写 Selenium 代码之前, -您必须安装所选语言的相关类库, -目标浏览器的驱动程序. - -***请点击以下链接,开始使用 Selenium WebDriver.*** - -如果您希望从低代码/录制和播放工具开始,请查看 -[Selenium IDE](https://selenium.dev/selenium-ide) - -开始工作后,如果想扩展您的测试,请查看 -[Selenium Grid]({{< ref "/documentation/grid" >}}). diff --git a/website_and_docs/content/documentation/webdriver/getting_started/first_script.ja.md b/website_and_docs/content/documentation/webdriver/getting_started/first_script.ja.md index b16aa8205aaa..a673b3dbce5a 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/first_script.ja.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/first_script.ja.md @@ -7,7 +7,7 @@ description: > Seleniumスクリプトを作成するための段階的な説明 --- -[Seleniumをインストール]({{< ref "install_library.md" >}})し、 +[Seleniumをインストール]({{< ref path="install_library.md" lang="en" >}})し、 すると、Seleniumコードを書く準備が整います。 ## 8つの基本コンポーネント @@ -66,9 +66,9 @@ Seleniumで行うことのほとんどは、次の基本的なコマンドの組 {{< /tab >}} {{< /tabpane >}} -### 3. [ブラウザに関する情報]({{< ref "/documentation/webdriver/interactions" >}})をリクエストします +### 3. [ブラウザに関する情報]({{< ref path="/documentation/webdriver/interactions" lang="en" >}})をリクエストします -ブラウザに関する [情報]({{< ref "/documentation/webdriver/interactions" >}}) として、ウィンドウハンドル、ブラウザのサイズ/位置、クッキー、アラートなど、さまざまな種類のデータをリクエストできます。 +ブラウザに関する [情報]({{< ref path="/documentation/webdriver/interactions" lang="en" >}}) として、ウィンドウハンドル、ブラウザのサイズ/位置、クッキー、アラートなど、さまざまな種類のデータをリクエストできます。 {{< tabpane text=true >}} {{< tab header="Java" >}} @@ -102,7 +102,7 @@ Seleniumを使用して、それをうまく行うことは高度なトピック 暗黙的な待機が最善の解決策になることはめったにありませんが、ここで示すのが最も簡単なので、 プレースホルダーとして使用します。 -[待機戦略]({{< ref "/documentation/webdriver/waits.md" >}})についてさらに読む。 +[待機戦略]({{< ref path="/documentation/webdriver/waits.md" lang="en" >}})についてさらに読む。 {{< tabpane text=true >}} {{< tab header="Java" >}} @@ -125,8 +125,8 @@ Seleniumを使用して、それをうまく行うことは高度なトピック {{< /tab >}} {{< /tabpane >}} -### 5. [要素を検索する]({{< ref "/documentation/webdriver/elements" >}})ためのコマンドを送信します -ほとんどのSeleniumセッションにおけるコマンドの大部分は要素に関連しており、[要素を見つける]({{< ref "/documentation/webdriver/elements" >}}) ことなしにはそれと対話することができません。 +### 5. [要素を検索する]({{< ref path="/documentation/webdriver/elements" lang="en" >}})ためのコマンドを送信します +ほとんどのSeleniumセッションにおけるコマンドの大部分は要素に関連しており、[要素を見つける]({{< ref path="/documentation/webdriver/elements" lang="en" >}}) ことなしにはそれと対話することができません。 {{< tabpane text=true >}} {{< tab header="Java" >}} diff --git a/website_and_docs/content/documentation/webdriver/getting_started/first_script.pt-br.md b/website_and_docs/content/documentation/webdriver/getting_started/first_script.pt-br.md index 6153e09b34f6..4d2b46fe5728 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/first_script.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/first_script.pt-br.md @@ -7,7 +7,7 @@ description: > Instruções passo a passo para programar um script Selenium --- -Assim que você tiver o [Selenium instalado]({{< ref "install_library.md" >}}), +Assim que você tiver o [Selenium instalado]({{< ref path="install_library.md" lang="en" >}}), você estará pronto para programar códigos Selenium. ## Oito Componentes Básicos @@ -65,7 +65,7 @@ Nesse exemplo estamos [navegando]({{< ref "/documentation/webdriver/interactions {{< /tabpane >}} ### 3. Solicitando informação do navegador de internet -Existem diversos tipos de [informação sobre o navegador de internet]({{< ref "/documentation/webdriver/interactions" >}}) que você +Existem diversos tipos de [informação sobre o navegador de internet]({{< ref path="/documentation/webdriver/interactions" lang="en" >}}) que você pode solicitar, incluindo window handles, tamanho / posição do navegador, cookies, alertas e etc. {{< tabpane text=true >}} @@ -101,7 +101,7 @@ e o elemento está em um estado interativo antes de você tentar interagir com e Uma espera implícita raramente é a melhor solução, mas é a mais fácil de demonstrar aqui, então vamos usá-la como um substituto. -Leia mais sobre [Estratégias de espera]({{< ref "/documentation/webdriver/waits.md" >}}). +Leia mais sobre [Estratégias de espera]({{< ref path="/documentation/webdriver/waits.md" lang="en" >}}). {{< tabpane text=true >}} {{< tab header="Java" >}} @@ -127,7 +127,7 @@ Leia mais sobre [Estratégias de espera]({{< ref "/documentation/webdriver/waits ### 5. Encontrando um elemento A maioria dos comandos na maior parte das sessões do Selenium são relacionados a elementos e você não pode interagir -com um sem o primeiro [encontrando um elemento]({{< ref "/documentation/webdriver/elements" >}}) +com um sem o primeiro [encontrando um elemento]({{< ref path="/documentation/webdriver/elements" lang="en" >}}) {{< tabpane text=true >}} {{< tab header="Java" >}} diff --git a/website_and_docs/content/documentation/webdriver/getting_started/first_script.zh-cn.md b/website_and_docs/content/documentation/webdriver/getting_started/first_script.zh-cn.md index 3cb1e3c438f5..99755e5d8934 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/first_script.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/first_script.zh-cn.md @@ -6,7 +6,7 @@ description: > 逐步构建一个Selenium脚本的说明 --- -当你完成 [Selenium安装]({{< ref "install_library.md" >}}) 后, 便可以开始书写Selenium脚本了. +当你完成 [Selenium安装]({{< ref path="install_library.md" lang="en" >}}) 后, 便可以开始书写Selenium脚本了. ## 八个基本组成部分 @@ -70,9 +70,9 @@ Selenium所做的一切, {{< /tab >}} {{< /tabpane >}} -### 3. 请求 [浏览器信息]({{< ref "/documentation/webdriver/interactions" >}}) +### 3. 请求 [浏览器信息]({{< ref path="/documentation/webdriver/interactions" lang="en" >}}) -您可以请求一系列关于[浏览器的信息]({{< ref "/documentation/webdriver/interactions" >}}) , +您可以请求一系列关于[浏览器的信息]({{< ref path="/documentation/webdriver/interactions" lang="en" >}}) , 包括窗口句柄、浏览器尺寸/位置、cookie、警报等. {{< tabpane text=true >}} @@ -111,7 +111,7 @@ Selenium所做的一切, 但在这里最容易演示, 所以我们将使用它作为占位符. -阅读更多关于[等待策略]({{< ref "/documentation/webdriver/waits.md" >}}) +阅读更多关于[等待策略]({{< ref path="/documentation/webdriver/waits.md" lang="en" >}}) 的信息. {{< tabpane text=true >}} @@ -135,9 +135,9 @@ Selenium所做的一切, {{< /tab >}} {{< /tabpane >}} -### 5. 发送命令 [查找元素]({{< ref "/documentation/webdriver/elements" >}}) +### 5. 发送命令 [查找元素]({{< ref path="/documentation/webdriver/elements" lang="en" >}}) 大多数Selenium会话中的主要命令都与元素相关, -如果不先[找到元素]({{< ref "/documentation/webdriver/elements" >}}), +如果不先[找到元素]({{< ref path="/documentation/webdriver/elements" lang="en" >}}), 就无法与之交互. {{< tabpane text=true >}} diff --git a/website_and_docs/content/documentation/webdriver/getting_started/install_library.en.md b/website_and_docs/content/documentation/webdriver/getting_started/install_library.en.md index a128fc0633f5..d40bf386e09a 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/install_library.en.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/install_library.en.md @@ -10,7 +10,16 @@ aliases: [ "/documentation/getting_started/install_selenium_library/", "/documentation/ja/selenium_installation/installing_selenium_libraries/", "/documentation/pt-br/selenium_installation/installing_selenium_libraries/", -"/documentation/zh-cn/selenium_installation/installing_selenium_libraries/" +"/documentation/zh-cn/selenium_installation/installing_selenium_libraries/", +"/ja/documentation/getting_started/install_selenium_library/", +"/ja/documentation/getting_started/installing_selenium_libraries/", +"/ja/documentation/webdriver/getting_started/install_library/", +"/pt-br/documentation/getting_started/install_selenium_library/", +"/pt-br/documentation/getting_started/installing_selenium_libraries/", +"/pt-br/documentation/webdriver/getting_started/install_library/", +"/zh-cn/documentation/getting_started/install_selenium_library/", +"/zh-cn/documentation/getting_started/installing_selenium_libraries/", +"/zh-cn/documentation/webdriver/getting_started/install_library/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/getting_started/install_library.ja.md b/website_and_docs/content/documentation/webdriver/getting_started/install_library.ja.md deleted file mode 100644 index e2f12d13e613..000000000000 --- a/website_and_docs/content/documentation/webdriver/getting_started/install_library.ja.md +++ /dev/null @@ -1,161 +0,0 @@ ---- -title: "Seleniumライブラリのインストール" -linkTitle: "ライブラリのインストール" -weight: 2 -description: > - お気に入りのプログラミング言語用にSeleniumライブラリを設定します。 -aliases: [ -"/documentation/getting_started/installing_selenium_libraries/", -"/documentation/getting_started/install_selenium_library/" -] ---- - -最初にあなたの自動化プロジェクトにSeleniumのバインディングをインストールする必要があります。 -インストールの方法は選択した言語によって異なります。 - -## 言語別の要件 - -{{< tabpane text=true >}} - {{% tab header="Java" %}} -サポートされている最小のJavaバージョンを表示する [ここ](https://github.com/SeleniumHQ/selenium/blob/trunk/.bazelrc#L32). - -Java用のSeleniumライブラリのインストールは、ビルドツールを使用して行います。 - -### Maven -プロジェクトの 'pom.xml' ファイルで依存関係を指定します: - -{{< gh-codeblock path="/examples/java/pom.xml#L35-L38" >}} - -### Gradle -プロジェクトの 'build.gradle' ファイル内の依存関係を 'testImplementation' として指定します: - -{{< gh-codeblock path="/examples/java/build.gradle#L13-L14" >}} - - {{% /tab %}} - {{% tab header="Python" %}} -各 Selenium バージョンでサポートされている最小の Python バージョンは、 -[PyPI](https://pypi.org/project/selenium/) の「Supported Python Versions」で確認できます。 - -Seleniumをインストールするには、いくつかの方法があります。 - -### Pip - -```shell -pip install selenium -``` -
- -### ダウンロード - -または、ダウンロードすることもできます[PyPI ソースアーカイブ](https://pypi.org/project/selenium/#files) -(selenium-x.x.x.-py3-none-any.whl) を使用してインストールします _pip_: - -```shell -pip install selenium-x.x.x.-py3-none-any.whl -``` -
- -### プロジェクトで必要 - -プロジェクトで使用するには、requirements.txt ファイルに追加します: -{{< gh-codeblock path="/examples/python/requirements.txt#L1" >}} - - {{% /tab %}} - {{% tab header="CSharp" %}} -Seleniumの各バージョンでサポートされているすべてのフレームワークのリスト -で利用可能です[Nuget](https://www.nuget.org/packages/Selenium.WebDriver) - -Seleniumのインストールにはいくつかのオプションがあります。 - -### パケットマネージャー - -```shell -Install-Package Selenium.WebDriver -``` -
- -### .NET CLI - -```shell -dotnet add package Selenium.WebDriver -``` -
- -### CSProj - -プロジェクトの `csproj`ファイルで、`ItemGroup` の `PackageReference`として依存関係を指定します。: - -{{< gh-codeblock language="xml" path="/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj#L14" >}} - -### その他の考慮事項 - -その他、使用上の注意点 Visual Studio Code (vscode) そして C# - -上記のセクションに従って、互換性のある .NET SDK をインストールします。 -また、C# と NuGet の vscode 拡張機能 (Ctrl-Shift-X) もインストールします。に従ってください[指示はこちら](https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code?pivots=dotnet-5-0) -C# を使用して "Hello World" コンソール プロジェクトを作成および実行します。 -コマンドラインを使用してNUnitスタータープロジェクトを作成することもできます `dotnet new NUnit`. -ファイルを確認してください `%appdata%\NuGet\nuget.config`一部の開発者がいくつかの問題のために空になると報告したため、適切に構成されています。 -もし`nuget.config`が空であるか、正しく構成されていない場合、Selenium プロジェクトの .NET ビルドは失敗します。 -次のセクションをファイルに追加します`nuget.config` 空の場合: -``` - - - - - -... -``` -詳細については、`nuget.config` [ここをクリック](https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file). -カスタマイズする必要があるかもしれません `nuget.config` あなたのニーズを満たすために。 - -さて、戻ってください vscode、プレス Ctrl-Shift-P、およびタイプ "NuGet Add Package"をクリックし、必要な Selenium パッケージ `Selenium.WebDriver`. -Enter キーを押して、バージョンを選択します。 -これで、C# と vscode に関連するドキュメントの例を使用できるようになりました。 - - {{% /tab %}} - {{% tab header="Ruby" %}} -特定の Selenium バージョンに必要な最小 Ruby バージョンは、 -[rubygems.org](https://rubygems.org/gems/selenium-webdriver/) で確認できます。 - -Seleniumは2つの異なる方法でインストールできます。 - -### 手動でインストールする - -```shell -gem install selenium-webdriver -``` -
- -### プロジェクトの gemfile に追加 - -{{< gh-codeblock language="ruby" path="/examples/ruby/Gemfile#L10" >}} - - {{% /tab %}} - {{% tab header="JavaScript" %}} -Selenium の特定のバージョンに必要な最小 Node.js バージョンは、 -[npmjs](https://www.npmjs.com/package/selenium-webdriver) の「Node Support Policy」で確認できます。 - -Seleniumは通常、npmを使用してインストールされます。 - -### ローカルにインストールする - -```shell -npm install selenium-webdriver -``` -
- -### プロジェクトに加える - -プロジェクトの `package.json`で、要件を `dependencies`: - -{{< gh-codeblock path="/examples/javascript/package.json#L14" >}} - - {{% /tab %}} - {{< tab header="Kotlin" >}} - Kotlin の Java バインディングを使用します。 - {{< /tab >}} -{{< /tabpane >}} - -## 次のステップ -[初めてのSeleniumスクリプトを作成する]({{< ref "first_script.md" >}}) diff --git a/website_and_docs/content/documentation/webdriver/getting_started/install_library.pt-br.md b/website_and_docs/content/documentation/webdriver/getting_started/install_library.pt-br.md deleted file mode 100644 index a5e6dd8f6dd7..000000000000 --- a/website_and_docs/content/documentation/webdriver/getting_started/install_library.pt-br.md +++ /dev/null @@ -1,166 +0,0 @@ ---- -title: "Instalando bibliotecas do Selenium" -linkTitle: "Instalando bibliotecas do Selenium" -weight: 2 -needsTranslation: true -description: > - Configurando a biblioteca Selenium para sua linguagem de programação favorita. -aliases: [ -"/documentation/getting_started/installing_selenium_libraries/", -"/documentation/getting_started/install_selenium_library/" -] ---- - -Primeiro você precisa instalar as bibliotecas Selenium para seu projeto de automação. -O processo de instalação de bibliotecas depende da linguagem que você escolher usar. - -## Requisitos por linguagem - -{{< tabpane text=true >}} - {{% tab header="Java" %}} -Veja a mínima versão do Java suportada [aqui](https://github.com/SeleniumHQ/selenium/blob/trunk/.bazelrc#L32). - -A instalação da biblioteca Selenium para Java é feita a partir de uma build tool. - - -### Maven -Especifique a dependência no `pom.xml` do seu projeto. - -{{< gh-codeblock path="/examples/java/pom.xml#L35-L38" >}} - -### Gradle -Especifique a dependência no `build.gradle` do seu projeto como `testImplementation`: - -{{< gh-codeblock path="/examples/java/build.gradle#L13-L14" >}} - - {{% /tab %}} - {{% tab header="Python" %}} -A mínima versão suportada do Python para cada versão do Selenium pode ser encontrada -em "Supported Python Versions" no [PyPi](https://pypi.org/project/selenium/). - -Existe muitas formas diferentes de instalar Selenium. - -### Pip - -```shell -pip install selenium -``` -
- -### Download - -Como uma alternativa você pode baixar o [código fonte PyPI](https://pypi.org/project/selenium/#files) -(selenium-x.x.x.-py3-none-any.whl) e instalar usando _pip_: - -```shell -pip install selenium-x.x.x.-py3-none-any.whl -``` -
- -### Exigir em um projeto - -Para usar em um projeto, adicione no arquivo `requirements.txt`. -{{< gh-codeblock path="/examples/python/requirements.txt#L1" >}} - - {{% /tab %}} - {{% tab header="CSharp" %}} -Uma lista com todos os frameworks suportados para cada versão do Selenium -pode ser encontrada em [Nuget](https://www.nuget.org/packages/Selenium.WebDriver) - -Existe algumas opções para instalar o Selenium. - -### Packet Manager - -```shell -Install-Package Selenium.WebDriver -``` -
- -### .NET CLI - -```shell -dotnet add package Selenium.WebDriver -``` -
- -### CSProj - -No arquivo `csproj` do seu projeto, especifique a dependência como `PackageReference` no `ItemGroup`: - -{{< gh-codeblock language="xml" path="/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj#L14" >}} - -### Considerações adicionais - -Outras observações para usar o Visual Studio Code (vscode) e C# - -Instale a versão compatível do .NET SDK conforme a seção acima. -Instale também as extensões do vscode (Ctrl-Shift-X) para C# e NuGet. -Siga as instruções [aqui ](https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code?pivots=dotnet-5-0)para criar e rodar o seu projeto de "Hello World" no console usando C#. - -Você também pode criar um projeto inicial do NUnit usando a linha de comando `dotnet new NUnit`. -Certifique-se de que o arquivo `%appdata%\NuGet\nuget.config` esteja configurado corretamente, pois alguns desenvolvedores relataram que ele estará vazio devido a alguns problemas. -Se o `nuget.config` estiver vazio ou não estiver configurado corretamente, as compilações .NET falharão para projetos que estiverem usando Selenium. -Adicione a seguinte seção ao arquivo `nuget.config` se esse estiver vazio: - -``` - - - - - -... -``` -Para mais informações sobre `nuget.config` [clique aqui](https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file). -Você pode ter que customizar `nuget.config` para atender às suas necessidades. - -Agora, volte para o vscode, aperte Ctrl-Shift-P, e digite "NuGet Add Package", e adicione os pacotes necessários para -o Selenium como o `Selenium.WebDriver`. -Aperte Enter e selecione a versão. -Agora você pode usar os exemplos da documentação relacionados ao C# com o vscode. - - {{% /tab %}} - {{% tab header="Ruby" %}} -Você pode ver a minima versão suportada do Ruby para cada versão do Selenium em -[rubygems.org](https://rubygems.org/gems/selenium-webdriver/) - -O Selenium pode ser instalado de duas formas diferentes. - -### Instalação manual - -```shell -gem install selenium-webdriver -``` -
- -### Adicione para o gemfile do projeto - -{{< gh-codeblock language="ruby" path="/examples/ruby/Gemfile#L10" >}} - - {{% /tab %}} - {{% tab header="JavaScript" %}} -Você pode encontrar a mínima versão suportada do Node para cada versão do Selenium -na seção `Node Support Policy` no site [npmjs](https://www.npmjs.com/package/selenium-webdriver) - -Selenium é normalmente instalado usando npm. - -### Instalação local - -```shell -npm install selenium-webdriver -``` -
- -### Adicione ao seu projeto - -No `package.json` do seu projeto, adicione os requisitos em `dependencies`: - -{{< gh-codeblock path="/examples/javascript/package.json#L14" >}} - - {{% /tab %}} - {{< tab header="Kotlin" >}} - Use as ligações Java para Kotlin. - {{< /tab >}} -{{< /tabpane >}} - -## Próximo passo -[Programando o seu primeiro script Selenium]({{< ref "first_script.md" >}}) diff --git a/website_and_docs/content/documentation/webdriver/getting_started/install_library.zh-cn.md b/website_and_docs/content/documentation/webdriver/getting_started/install_library.zh-cn.md deleted file mode 100644 index 8970d8427606..000000000000 --- a/website_and_docs/content/documentation/webdriver/getting_started/install_library.zh-cn.md +++ /dev/null @@ -1,163 +0,0 @@ ---- -title: "安装Selenium类库" -linkTitle: "安装类库" -weight: 2 -description: > - 配置自动化的浏览器. -aliases: [ -"/documentation/getting_started/installing_selenium_libraries/", -"/documentation/getting_started/install_selenium_library/" -] ---- - -首先,您需要为自动化项目安装 Selenium 绑定库。 -库的安装过程取决于您选择使用的语言。 - -## 请求对应的程序语言 - -{{< tabpane text=true >}} - {{% tab header="Java" %}} -查看该库所支持java的最低版本 [here](https://github.com/SeleniumHQ/selenium/blob/trunk/.bazelrc#L32). - -应熟练掌握build tool以安装支持java的Selenium库 - -### Maven -具体的依赖位于项目中的 `pom.xml` 文件: - -{{< gh-codeblock path="/examples/java/pom.xml#L35-L38" >}} - -### Gradle -具体的依赖位于项目中的 `build.gradle` 文件中的 `testImplementation`: - -{{< gh-codeblock path="/examples/java/build.gradle#L13-L14" >}} - - {{% /tab %}} - {{% tab header="Python" %}} -该库所支持的Python版本最低版本可以在 - `支持的Python版本` 章节中找到 [PyPi](https://pypi.org/project/selenium/) - -这里提供了几种不同的方式来安装 Selenium . - -### Pip - -```shell -pip install selenium -``` -
- -### 下载 - -此外你可以从这里下载 [PyPI Built Distribution](https://pypi.org/project/selenium/#files) -(selenium-x.x.x.-py3-none-any.whl) 并通过: _pip_ 文件安装: - -```shell -pip install selenium-x.x.x.-py3-none-any.whl -``` -
- -### 在项目中使用 - -为了在项目中使用它,需要将它添加到 `requirements.txt` 文件中: -{{< gh-codeblock path="/examples/python/requirements.txt#L1" >}} - - {{% /tab %}} - {{% tab header="CSharp" %}} -Selenium 所支持的所有平台的列表一览 -见诸于 [Nuget](https://www.nuget.org/packages/Selenium.WebDriver) - -该处阐述了一些安装Selenium的选项. - -### 包管理器 - -```shell -Install-Package Selenium.WebDriver -``` -
- -### .NET CLI - -```shell -dotnet add package Selenium.WebDriver -``` -
- -### CSProj - -在 `csproj` 文件里, 具体的依赖 `PackageReference`(包参数) 位于 `ItemGroup` (项目组)中: - -{{< gh-codeblock language="xml" path="/examples/dotnet/SeleniumDocs/SeleniumDocs.csproj#L14" >}} - -### 其他附加思虑事项 - -更多的注意事项,适用于使用 Visual Studio Code (vscode) 和 C# - -安装兼容的 .NET SDK 作为章节的先决条件 -同时安装 vscode 的扩展 (Ctrl-Shift-X)以适配 C# 和 NuGet -可以遵照此处进行 [操作指南](https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio-code?pivots=dotnet-5-0) -创建 C# 控制台项目并运行 "Hello World". -你也可以用命令行 `dotnet new NUnit` 创建NUnit初阶项目. -确保文件 `%appdata%\NuGet\nuget.config` 已经配置完成,就像某位开发者报告的问题一样,它可能因为某种因素被自动清空. -如果 `nuget.config` 是空的,或者未配置的,那么 .NET 创建的Selenium项目可能失败. -加入如下章节到文件 `nuget.config` 如果出现清空的情况: -``` - - - - - -... -``` -更多关于 `nuget.config` 的信息 [点击](https://docs.microsoft.com/en-us/nuget/reference/nuget-config-file). -你可能需要按照自己的需求配置 `nuget.config` . - -现在,返回 vscode ,按下 Ctrl-Shift-P, 然后键入 "NuGet Add Package", 并选择自己需要的 Selenium 包,例如 `Selenium.WebDriver`. -按下回车并选择版本. -现在你可以使用说明文档中关于 C# vscode下的案例了. - - {{% /tab %}} - {{% tab header="Ruby" %}} -你可以查看 Selenium 对 Ruby 版本支持和最低支持. -具体位于 [rubygems.org](https://rubygems.org/gems/selenium-webdriver/) - -Selenium 可以使用两种不同方法安装. - -### 手动安装 - -```shell -gem install selenium-webdriver -``` -
- -### 加入项目的 gemfile - -{{< gh-codeblock language="ruby" path="/examples/ruby/Gemfile#L10" >}} - - {{% /tab %}} - {{% tab header="JavaScript" %}} -You can find the minimum required version of Node for any given version of Selenium in the -你可以在此查看 Selenium 对 Node 的版本支持情况 -位于 `Node Support Policy` 中的相关章节 [npmjs](https://www.npmjs.com/package/selenium-webdriver) - -Selenium is typically installed using npm. - -### 本地安装 - -```shell -npm install selenium-webdriver -``` -
- -### 加入项目 - -在你的项目 `package.json`, 必须加入到 `dependencies`: - -{{< gh-codeblock path="/examples/javascript/package.json#L14" >}} - - {{% /tab %}} - {{< tab header="Kotlin" >}} - Use the Java bindings for Kotlin. - {{< /tab >}} -{{< /tabpane >}} - -## 下一步 -[创建你的第一个Selenium脚本]({{< ref "first_script.md" >}}) diff --git a/website_and_docs/content/documentation/webdriver/getting_started/using_selenium.ja.md b/website_and_docs/content/documentation/webdriver/getting_started/using_selenium.ja.md index f97b67c35b81..da35887f3e74 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/using_selenium.ja.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/using_selenium.ja.md @@ -98,7 +98,7 @@ Seleniumコードの使用方法に関係なく、優れた統合開発環境が ### インストール -これは[Seleniumライブラリのインストール]({{< ref "install_library.md" >}})で必要な手順と非常によく似ています。 +これは[Seleniumライブラリのインストール]({{< ref path="install_library.md" lang="en" >}})で必要な手順と非常によく似ています。 このコードは、ドキュメント用のサンプルプロジェクトで使用しているものの例を示すだけです。 {{< tabpane text=true >}} @@ -285,4 +285,4 @@ npx mocha runningTests.spec.js 学んだことを活かして、Seleniumコードを構築します! 必要な機能が他にも見つかったら、残りの機能をお読みください -[WebDriver ドキュメント]({{< ref "/documentation/webdriver/" >}}). +[WebDriver ドキュメント]({{< ref path="/documentation/webdriver/" lang="en" >}}). diff --git a/website_and_docs/content/documentation/webdriver/getting_started/using_selenium.pt-br.md b/website_and_docs/content/documentation/webdriver/getting_started/using_selenium.pt-br.md index 10740da49b79..6a7770a9d231 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/using_selenium.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/using_selenium.pt-br.md @@ -100,7 +100,7 @@ que será usado para todos os exemplos nesta página. ### Instalando -Isto é muito semelhante ao que foi requerido em [Install a Selenium Library]({{< ref "install_library.md" >}}). +Isto é muito semelhante ao que foi requerido em [Install a Selenium Library]({{< ref path="install_library.md" lang="en" >}}). Este código está apenas a mostrar exemplos do que está a ser usado no nosso projeto de Exemplos de Documentação. {{< tabpane text=true >}} @@ -287,4 +287,4 @@ Here's an example of that code using a test runner: Pegue no que aprendeu e desenvolva o seu código Selenium! À medida que encontrar mais funcionalidades de que precisa, leia o resto da nossa -[documentação do WebDriver]({{< ref "/documentation/webdriver/" >}}). +[documentação do WebDriver]({{< ref path="/documentation/webdriver/" lang="en" >}}). diff --git a/website_and_docs/content/documentation/webdriver/getting_started/using_selenium.zh-cn.md b/website_and_docs/content/documentation/webdriver/getting_started/using_selenium.zh-cn.md index 36a11c675022..a0d6db16b878 100644 --- a/website_and_docs/content/documentation/webdriver/getting_started/using_selenium.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/getting_started/using_selenium.zh-cn.md @@ -93,7 +93,7 @@ description: > ### 安装 -在[安装 Selenium 类库]({{< ref "install_library.md" >}})一节中详细说明了需要哪些东西。 +在[安装 Selenium 类库]({{< ref path="install_library.md" lang="en" >}})一节中详细说明了需要哪些东西。 这里的代码只展示在我们的文档示例项目中用到的示例。 {{< tabpane text=true >}} @@ -280,4 +280,4 @@ npx mocha runningTests.spec.js 使用你目前所学到的知识构建你自己的 Selenium 代码吧! 想要了解更多的功能特性, -请继续阅读我们接下来的[WebDriver 教程]({{< ref "/documentation/webdriver/" >}}) +请继续阅读我们接下来的[WebDriver 教程]({{< ref path="/documentation/webdriver/" lang="en" >}}) diff --git a/website_and_docs/content/documentation/webdriver/interactions/_index.en.md b/website_and_docs/content/documentation/webdriver/interactions/_index.en.md index 6037f15c96c5..f25e48d69804 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/_index.en.md +++ b/website_and_docs/content/documentation/webdriver/interactions/_index.en.md @@ -8,7 +8,15 @@ aliases: [ "/documentation/webdriver/browser/", "/documentation/ja/webdriver/browser_manipulation/", "/documentation/pt-br/webdriver/browser_manipulation/", -"/documentation/zh-cn/webdriver/browser_manipulation/" +"/documentation/zh-cn/webdriver/browser_manipulation/", +"/ja/documentation/webdriver/browser_manipulation/", +"/ja/documentation/webdriver/interactions/", +"/pt-br/documentation/webdriver/browser/", +"/pt-br/documentation/webdriver/browser_manipulation/", +"/pt-br/documentation/webdriver/interactions/", +"/zh-cn/documentation/webdriver/browser/", +"/zh-cn/documentation/webdriver/browser_manipulation/", +"/zh-cn/documentation/webdriver/interactions/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/_index.ja.md b/website_and_docs/content/documentation/webdriver/interactions/_index.ja.md deleted file mode 100644 index 197d74faa73b..000000000000 --- a/website_and_docs/content/documentation/webdriver/interactions/_index.ja.md +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: "ブラウザのインタラクション" -linkTitle: "Interactions" -weight: 10 -aliases: [ -"/documentation/webdriver/browser_manipulation/", -"ja/documentation/webdriver/browser/" -] ---- - -## ブラウザーの情報 - -### タイトルの取得 - -ブラウザーから現在のページタイトルを読むことができます。 - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/InteractionsTest.java#L15" >}} -{{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_interactions.py#L7" >}} -{{< /tab >}} -{{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/InteractionsTest.cs#L37" >}} -{{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/browser_spec.rb#L8" >}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/interactionsIndex.spec.js#L20" >}} -{{< /tab >}} - {{< tab header="Kotlin" >}}driver.title{{< /tab >}} -{{< /tabpane >}} - - -### 現在のURLを取得 - -ブラウザーのアドレスバーから現在のURLを読むには、次を使用します。 - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/InteractionsTest.java#L26" >}} -{{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_interactions.py#L10" >}} -{{< /tab >}} -{{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/InteractionsTest.cs#L41" >}} -{{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/browser_spec.rb#L14" >}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/interactionsIndex.spec.js#L24" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}}driver.currentUrl{{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/interactions/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/interactions/_index.pt-br.md deleted file mode 100644 index e25340bbd86f..000000000000 --- a/website_and_docs/content/documentation/webdriver/interactions/_index.pt-br.md +++ /dev/null @@ -1,59 +0,0 @@ ---- -title: "Browser interactions" -linkTitle: "Interactions" -weight: 10 -requiresTranslation: true -aliases: [ -"/documentation/webdriver/browser_manipulation/", -"/documentation/webdriver/browser/" -] ---- - -## Get browser information - -### Coletar título - -Você pode ler o título da página atual no navegador: - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/InteractionsTest.java#L15" >}} -{{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_interactions.py#L7" >}} -{{< /tab >}} -{{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/InteractionsTest.cs#L37" >}} -{{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/browser_spec.rb#L8" >}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/interactionsIndex.spec.js#L20" >}} -{{< /tab >}} - {{< tab header="Kotlin" >}}driver.title{{< /tab >}} -{{< /tabpane >}} - - -### Coletar a URL atual - -Você pode ler a URL atual na barra de endereço do navegador usando: - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/InteractionsTest.java#L26" >}} -{{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_interactions.py#L10" >}} -{{< /tab >}} -{{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/InteractionsTest.cs#L41" >}} -{{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/browser_spec.rb#L14" >}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/interactionsIndex.spec.js#L24" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}}driver.currentUrl{{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/interactions/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/interactions/_index.zh-cn.md deleted file mode 100644 index 6af3e50fe706..000000000000 --- a/website_and_docs/content/documentation/webdriver/interactions/_index.zh-cn.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -title: "浏览器交互" -linkTitle: "交互" -weight: 10 -aliases: [ -"/documentation/webdriver/browser_manipulation/", -"/documentation/webdriver/browser/" -] ---- - -## 获取浏览器信息 - -### 获取标题 - -从浏览器中读取当前页面的标题: - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/InteractionsTest.java#L15" >}} -{{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_interactions.py#L7" >}} -{{< /tab >}} -{{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/InteractionsTest.cs#L37" >}} -{{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/browser_spec.rb#L8" >}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/interactionsIndex.spec.js#L20" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}}driver.title{{< /tab >}} -{{< /tabpane >}} - -### 获取当前 URL - -您可以从浏览器的地址栏读取当前的 URL,使用: - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/InteractionsTest.java#L26" >}} -{{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_interactions.py#L10" >}} -{{< /tab >}} -{{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/InteractionsTest.cs#L41" >}} -{{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/browser_spec.rb#L14" >}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/interactionsIndex.spec.js#L24" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}}driver.currentUrl{{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/interactions/alerts.en.md b/website_and_docs/content/documentation/webdriver/interactions/alerts.en.md index 32cb0198def9..3b937f0f6cb3 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/alerts.en.md +++ b/website_and_docs/content/documentation/webdriver/interactions/alerts.en.md @@ -8,7 +8,16 @@ aliases: [ "/documentation/webdriver/browser/alerts", "/documentation/ja/webdriver/js_alerts_prompts_and_confirmations/", "/documentation/pt-br/webdriver/js_alerts_prompts_and_confirmations/", -"/documentation/zh-cn/webdriver/js_alerts_prompts_and_confirmations/" +"/documentation/zh-cn/webdriver/js_alerts_prompts_and_confirmations/", +"/ja/documentation/webdriver/browser/alerts", +"/ja/documentation/webdriver/interactions/alerts/", +"/ja/documentation/webdriver/js_alerts_prompts_and_confirmations/", +"/pt-br/documentation/webdriver/browser/alerts/", +"/pt-br/documentation/webdriver/interactions/alerts/", +"/pt-br/documentation/webdriver/js_alerts_prompts_and_confirmations/", +"/zh-cn/documentation/webdriver/browser/alerts/", +"/zh-cn/documentation/webdriver/interactions/alerts/", +"/zh-cn/documentation/webdriver/js_alerts_prompts_and_confirmations/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/alerts.ja.md b/website_and_docs/content/documentation/webdriver/interactions/alerts.ja.md deleted file mode 100644 index c33d5a0b3356..000000000000 --- a/website_and_docs/content/documentation/webdriver/interactions/alerts.ja.md +++ /dev/null @@ -1,176 +0,0 @@ ---- -title: "JavaScript アラート、プロンプトおよび確認" -linkTitle: "JavaScript アラート、プロンプトおよび確認" -weight: 2 -aliases: [ -"/documentation/webdriver/js_alerts_prompts_and_confirmations/", -"/documentation/webdriver/browser/alerts" -] ---- - -WebDriverは、JavaScriptが提供する3種類のネイティブポップアップメッセージを操作するためのAPIを提供します。 -これらのポップアップはブラウザーによってスタイルが設定され、カスタマイズが制限されています。 - -## アラート - -これらの最も単純なものはアラートと呼ばれ、カスタムメッセージと、ほとんどのブラウザーでOKのラベルが付いたアラートを非表示にする単一のボタンを表示します。 -ほとんどのブラウザーでは閉じるボタンを押すことで閉じることもできますが、これは常にOKボタンと同じことを行います。 -アラートの例を参照してください。 - -WebDriverはポップアップからテキストを取得し、これらのアラートを受け入れるか、または閉じることができます。 - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/AlertsTest.java#L36-L41" >}} -{{< /tab >}} - -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_alerts.py#L13-L19" >}} -{{< /tab >}} - - {{< tab header="CSharp" >}} -//Click the link to activate the alert -driver.FindElement(By.LinkText("See an example alert")).Click(); - -//Wait for the alert to be displayed and store it in a variable -IAlert alert = wait.Until(ExpectedConditions.AlertIsPresent()); - -//Store the alert text in a variable -string text = alert.Text; - -//Press the OK button -alert.Accept(); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/alerts_spec.rb#L15-L22" >}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/alert.spec.js#L19-L21" >}} -{{< /tab >}} - {{< tab header="Kotlin" >}} -//Click the link to activate the alert -driver.findElement(By.linkText("See an example alert")).click() - -//Wait for the alert to be displayed and store it in a variable -val alert = wait.until(ExpectedConditions.alertIsPresent()) - -//Store the alert text in a variable -val text = alert.getText() - -//Press the OK button -alert.accept() - {{< /tab >}} -{{< /tabpane >}} - -## 確認 - -確認ダイアログボックスはアラートに似ていますが、ユーザーがメッセージをキャンセルすることも選択できる点が異なります。 -サンプルを確認してください。 - -この例は、アラートを保存する別の方法も示しています。 - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/AlertsTest.java#L131-L138" >}} -{{< /tab >}} - -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_alerts.py#L27-L33" >}} -{{< /tab >}} - - {{< tab header="CSharp" >}} -//Click the link to activate the alert -driver.FindElement(By.LinkText("See a sample confirm")).Click(); - -//Wait for the alert to be displayed -wait.Until(ExpectedConditions.AlertIsPresent()); - -//Store the alert in a variable -IAlert alert = driver.SwitchTo().Alert(); - -//Store the alert in a variable for reuse -string text = alert.Text; - -//Press the Cancel button -alert.Dismiss(); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/alerts_spec.rb#L28-L35" >}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/alert.spec.js#L30-L32" >}} -{{< /tab >}} - {{< tab header="Kotlin" >}} -//Click the link to activate the alert -driver.findElement(By.linkText("See a sample confirm")).click() - -//Wait for the alert to be displayed -wait.until(ExpectedConditions.alertIsPresent()) - -//Store the alert in a variable -val alert = driver.switchTo().alert() - -//Store the alert in a variable for reuse -val text = alert.text - -//Press the Cancel button -alert.dismiss() - {{< /tab >}} -{{< /tabpane >}} - -## プロンプト - -プロンプトは確認ボックスに似ていますが、テキスト入力も含まれている点が異なります。 -フォーム要素の操作と同様に、WebDriverの送信キーを使用して応答を入力できます。 -これにより、プレースホルダーテキストが完全に置き換えられます。 -キャンセルボタンを押してもテキストは送信されません。 -サンプルプロンプトを参照してください。 - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/AlertsTest.java#L79-L84" >}} -{{< /tab >}} - -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_alerts.py#L41-L48" >}} -{{< /tab >}} - - {{< tab header="CSharp" >}} -//Click the link to activate the alert -driver.FindElement(By.LinkText("See a sample prompt")).Click(); - -//Wait for the alert to be displayed and store it in a variable -IAlert alert = wait.Until(ExpectedConditions.AlertIsPresent()); - -//Type your message -alert.SendKeys("Selenium"); - -//Press the OK button -alert.Accept(); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/alerts_spec.rb#L41-L48" >}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/alert.spec.js#L42-L45" >}} -{{< /tab >}} - {{< tab header="Kotlin" >}} -//Click the link to activate the alert -driver.findElement(By.linkText("See a sample prompt")).click() - -//Wait for the alert to be displayed and store it in a variable -val alert = wait.until(ExpectedConditions.alertIsPresent()) - -//Type your message -alert.sendKeys("Selenium") - -//Press the OK button -alert.accept() - {{< /tab >}} -{{< /tabpane >}} - -## beforeunload - -最近のドライバーでは、デフォルトで `beforeunload` プロンプトを自動的に閉じます。 -以前の動作を維持するには、 -[unhandledPromptBehavior]({{< ref "../drivers/options#unhandledpromptbehavior" >}}) を参照してください。 diff --git a/website_and_docs/content/documentation/webdriver/interactions/alerts.pt-br.md b/website_and_docs/content/documentation/webdriver/interactions/alerts.pt-br.md deleted file mode 100644 index feb7213828e3..000000000000 --- a/website_and_docs/content/documentation/webdriver/interactions/alerts.pt-br.md +++ /dev/null @@ -1,169 +0,0 @@ ---- -title: "Alertas, prompts e confirmações JavaScript" -linkTitle: "Alertas, prompts e confirmações JavaScript" -weight: 2 -aliases: [ -"/documentation/webdriver/js_alerts_prompts_and_confirmations/", -"/documentation/webdriver/browser/alerts/" -] ---- - -WebDriver fornece uma API para trabalhar com os três tipos nativos de -mensagens pop-up oferecidas pelo JavaScript. Esses pop-ups são estilizados pelo -navegador e oferecem personalização limitada. - -## Alertas - -O mais simples deles é referido como um alerta, que mostra um -mensagem personalizada e um único botão que dispensa o alerta, rotulado -na maioria dos navegadores como OK. Ele também pode ser dispensado na maioria dos navegadores -pressionando o botão Fechar, mas isso sempre fará a mesma coisa que -o botão OK. Veja um exemplo de alerta . - -O WebDriver pode obter o texto do pop-up e aceitar ou dispensar esses -alertas. - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/AlertsTest.java#L36-L41" >}} -{{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_alerts.py#L13-L19" >}} -{{< /tab >}} - -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/alerts_spec.rb#L15-L22" >}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/alert.spec.js#L19-L21" >}} -{{< /tab >}} - {{< tab header="Kotlin" >}} -//Click the link to activate the alert -driver.findElement(By.linkText("See an example alert")).click() - -//Wait for the alert to be displayed and store it in a variable -val alert = wait.until(ExpectedConditions.alertIsPresent()) - -//Store the alert text in a variable -val text = alert.getText() - -//Press the OK button -alert.accept() - {{< /tab >}} -{{< /tabpane >}} - -## Confirmação - -Uma caixa de confirmação é semelhante a um alerta, exceto que o usuário também pode escolher -cancelar a mensagem. Veja -uma amostra de confirmação . - -Este exemplo também mostra uma abordagem diferente para armazenar um alerta: - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/AlertsTest.java#L131-L138" >}} -{{< /tab >}} - -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_alerts.py#L27-L33" >}} -{{< /tab >}} - - {{< tab header="CSharp" >}} -//Click the link to activate the alert -driver.FindElement(By.LinkText("See a sample confirm")).Click(); - -//Wait for the alert to be displayed -wait.Until(ExpectedConditions.AlertIsPresent()); - -//Store the alert in a variable -IAlert alert = driver.SwitchTo().Alert(); - -//Store the alert in a variable for reuse -string text = alert.Text; - -//Press the Cancel button -alert.Dismiss(); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/alerts_spec.rb#L28-L35" >}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/alert.spec.js#L30-L32" >}} -{{< /tab >}} - {{< tab header="Kotlin" >}} -//Click the link to activate the alert -driver.findElement(By.linkText("See a sample confirm")).click() - -//Wait for the alert to be displayed -wait.until(ExpectedConditions.alertIsPresent()) - -//Store the alert in a variable -val alert = driver.switchTo().alert() - -//Store the alert in a variable for reuse -val text = alert.text - -//Press the Cancel button -alert.dismiss() - {{< /tab >}} -{{< /tabpane >}} - -## Prompt - -Os prompts são semelhantes às caixas de confirmação, exceto que também incluem um texto de -entrada. Semelhante a trabalhar com elementos de formulário, você pode -usar o sendKeys do WebDriver para preencher uma resposta. Isso substituirá -completamente o espaço de texto de exemplo. Pressionar o botão Cancelar não enviará nenhum texto. - -Veja um exemplo de prompt . - - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/AlertsTest.java#L79-L84" >}} -{{< /tab >}} - -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_alerts.py#L41-L48" >}} -{{< /tab >}} - - {{< tab header="CSharp" >}} -//Click the link to activate the alert -driver.FindElement(By.LinkText("See a sample prompt")).Click(); - -//Wait for the alert to be displayed and store it in a variable -IAlert alert = wait.Until(ExpectedConditions.AlertIsPresent()); - -//Type your message -alert.SendKeys("Selenium"); - -//Press the OK button -alert.Accept(); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/alerts_spec.rb#L41-L48" >}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/alert.spec.js#L42-L45" >}} -{{< /tab >}} - {{< tab header="Kotlin" >}} -//Click the link to activate the alert -driver.findElement(By.linkText("See a sample prompt")).click() - -//Wait for the alert to be displayed and store it in a variable -val alert = wait.until(ExpectedConditions.alertIsPresent()) - -//Type your message -alert.sendKeys("Selenium") - -//Press the OK button -alert.accept() - {{< /tab >}} -{{< /tabpane >}} - -## beforeunload - -Drivers recentes descartam automaticamente os prompts de `beforeunload` por padrão. -Para manter o comportamento antigo, -veja [unhandledPromptBehavior]({{< ref "../drivers/options#unhandledpromptbehavior" >}}). diff --git a/website_and_docs/content/documentation/webdriver/interactions/alerts.zh-cn.md b/website_and_docs/content/documentation/webdriver/interactions/alerts.zh-cn.md deleted file mode 100644 index 233aac3f8107..000000000000 --- a/website_and_docs/content/documentation/webdriver/interactions/alerts.zh-cn.md +++ /dev/null @@ -1,171 +0,0 @@ ---- -title: "JavaScript 警告框,提示框和确认框" -linkTitle: "警告框" -weight: 2 -aliases: [ -"/documentation/webdriver/js_alerts_prompts_and_confirmations/", -"/documentation/webdriver/browser/alerts/" -] ---- - -WebDriver提供了一个API, 用于处理JavaScript提供的三种类型的原生弹窗消息. 这些弹窗由浏览器提供限定的样式. - -## Alerts 警告框 - -其中最基本的称为警告框, 它显示一条自定义消息, 以及一个用于关闭该警告的按钮, 在大多数浏览器中标记为"确定"(OK). 在大多数浏览器中, 也可以通过按"关闭"(close)按钮将其关闭, 但这始终与“确定”按钮具有相同的作用. 查看样例警告框. - -WebDriver可以从弹窗获取文本并接受或关闭这些警告. - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/AlertsTest.java#L36-L41" >}} -{{< /tab >}} - -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_alerts.py#L13-L19" >}} -{{< /tab >}} - - {{< tab header="CSharp" >}} -//Click the link to activate the alert -driver.FindElement(By.LinkText("See an example alert")).Click(); - -//Wait for the alert to be displayed and store it in a variable -IAlert alert = wait.Until(ExpectedConditions.AlertIsPresent()); - -//Store the alert text in a variable -string text = alert.Text; - -//Press the OK button -alert.Accept(); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/alerts_spec.rb#L15-L22" >}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/alert.spec.js#L19-L21" >}} -{{< /tab >}} - {{< tab header="Kotlin" >}} -//Click the link to activate the alert -driver.findElement(By.linkText("See an example alert")).click() - -//Wait for the alert to be displayed and store it in a variable -val alert = wait.until(ExpectedConditions.alertIsPresent()) - -//Store the alert text in a variable -val text = alert.getText() - -//Press the OK button -alert.accept() - {{< /tab >}} -{{< /tabpane >}} - -## Confirm 确认框 - -确认框类似于警告框, 不同之处在于用户还可以选择取消消息. 查看样例确认框. - -此示例还呈现了警告的另一种实现: - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/AlertsTest.java#L131-L138" >}} -{{< /tab >}} - -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_alerts.py#L27-L33" >}} -{{< /tab >}} - - {{< tab header="CSharp" >}} -//Click the link to activate the alert -driver.FindElement(By.LinkText("See a sample confirm")).Click(); - -//Wait for the alert to be displayed -wait.Until(ExpectedConditions.AlertIsPresent()); - -//Store the alert in a variable -IAlert alert = driver.SwitchTo().Alert(); - -//Store the alert in a variable for reuse -string text = alert.Text; - -//Press the Cancel button -alert.Dismiss(); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/alerts_spec.rb#L28-L35" >}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/alert.spec.js#L30-L32" >}} -{{< /tab >}} - {{< tab header="Kotlin" >}} -//Click the link to activate the alert -driver.findElement(By.linkText("See a sample confirm")).click() - -//Wait for the alert to be displayed -wait.until(ExpectedConditions.alertIsPresent()) - -//Store the alert in a variable -val alert = driver.switchTo().alert() - -//Store the alert in a variable for reuse -val text = alert.text - -//Press the Cancel button -alert.dismiss() - {{< /tab >}} -{{< /tabpane >}} - -## Prompt 提示框 - -提示框与确认框相似, 不同之处在于它们还包括文本输入. 与处理表单元素类似, 您可以使用WebDriver的sendKeys来填写响应. 这将完全替换占位符文本. 按下取消按钮将不会提交任何文本. - -查看样例提示框. - - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/AlertsTest.java#L79-L84" >}} -{{< /tab >}} - -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_alerts.py#L41-L48" >}} -{{< /tab >}} - - {{< tab header="CSharp" >}} -//Click the link to activate the alert -driver.FindElement(By.LinkText("See a sample prompt")).Click(); - -//Wait for the alert to be displayed and store it in a variable -IAlert alert = wait.Until(ExpectedConditions.AlertIsPresent()); - -//Type your message -alert.SendKeys("Selenium"); - -//Press the OK button -alert.Accept(); - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/alerts_spec.rb#L41-L48" >}} -{{< /tab >}} -{{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/alert.spec.js#L42-L45" >}} -{{< /tab >}} - {{< tab header="Kotlin" >}} -//Click the link to activate the alert -driver.findElement(By.linkText("See a sample prompt")).click() - -//Wait for the alert to be displayed and store it in a variable -val alert = wait.until(ExpectedConditions.alertIsPresent()) - -//Type your message -alert.sendKeys("Selenium") - -//Press the OK button -alert.accept() - {{< /tab >}} -{{< /tabpane >}} - -## beforeunload - -较新版本的驱动默认会自动关闭 `beforeunload` 提示框。 -如果需要恢复旧的行为, -请参阅 [unhandledPromptBehavior]({{< ref "../drivers/options#unhandledpromptbehavior" >}})。 diff --git a/website_and_docs/content/documentation/webdriver/interactions/cookies.en.md b/website_and_docs/content/documentation/webdriver/interactions/cookies.en.md index cd3de1d3b13a..3fc48f4b26ff 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/cookies.en.md +++ b/website_and_docs/content/documentation/webdriver/interactions/cookies.en.md @@ -8,7 +8,16 @@ aliases: [ "/documentation/webdriver/browser/cookies", "/documentation/ja/support_packages/working_with_cookies/", "/documentation/pt-br/support_packages/working_with_cookies/", -"/documentation/zh-cn/support_packages/working_with_cookies/" +"/documentation/zh-cn/support_packages/working_with_cookies/", +"/ja/documentation/support_packages/working_with_cookies/", +"/ja/documentation/webdriver/browser/cookies/", +"/ja/documentation/webdriver/interactions/cookies/", +"/pt-br/documentation/support_packages/working_with_cookies/", +"/pt-br/documentation/webdriver/browser/cookies/", +"/pt-br/documentation/webdriver/interactions/cookies/", +"/zh-cn/documentation/support_packages/working_with_cookies/", +"/zh-cn/documentation/webdriver/browser/cookies/", +"/zh-cn/documentation/webdriver/interactions/cookies/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/cookies.ja.md b/website_and_docs/content/documentation/webdriver/interactions/cookies.ja.md deleted file mode 100644 index b1bb02bbf8ef..000000000000 --- a/website_and_docs/content/documentation/webdriver/interactions/cookies.ja.md +++ /dev/null @@ -1,321 +0,0 @@ ---- -title: "クッキーの使用" -linkTitle: "クッキーの使用" -weight: 4 -aliases: [ -"/documentation/support_packages/working_with_cookies/", -"/documentation/webdriver/browser/cookies/" -] ---- - - -Cookieは、Webサイトから送信され、コンピューターに保存される小さなデータです。 -Cookieは、主にユーザーを認識し、保存されている情報を読み込むために使用されます。 - -WebDriver APIは、組み込みメソッドでCookieと対話するメソッドを提供します。 - -## クッキーの追加 -現在のブラウジングコンテキストにCookieを追加するために使用されます。 -Cookieの追加では、一連の定義済みのシリアル化可能なJSONオブジェクトのみを受け入れます。 -受け入れられたJSONキー値のリストへのリンクはこちらにあります。 - -まず、Cookieが有効になるドメインにいる必要があります。 -サイトとの対話を開始する前にCookieを事前設定しようとしていて、ホームページが大きい場合/代替の読み込みに時間がかかる場合は、サイトで小さいページを見つけることです。(通常、たとえば http://example.com/some404page のような、404ページは小さいです。) - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/CookiesTest.java#L30-L32" >}} - {{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_cookies.py#L5-L9" >}} - {{< /tab >}} -{{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/CookiesTest.cs#L32-L34" >}} - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/cookies_spec.rb#L9-L11" >}} - {{< /tab >}} - {{< tab header="JavaScript" text=true >}} - {{< gh-codeblock path="/examples/javascript/test/interactions/cookies.spec.js#L18">}} - {{< /tab >}} -{{< tab header="Kotlin" >}} -import org.openqa.selenium.Cookie -import org.openqa.selenium.chrome.ChromeDriver - -fun main() { - val driver = ChromeDriver() - try { - driver.get("https://example.com") - - // Adds the cookie into current browser context - driver.manage().addCookie(Cookie("key", "value")) - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} - -## 命名されたクッキーの取得 - -関連付けられているすべてのCookieの中で、Cookie名と一致するシリアル化されたCookieデータを返します。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/CookiesTest.java#L38-L42" >}} - {{< /tab >}} - {{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_cookies.py#L13-L20" >}} - {{< /tab >}} - {{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/CookiesTest.cs#L40-L44" >}} - {{< /tab >}} - {{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/cookies_spec.rb#L17-L21" >}} - {{< /tab >}} - {{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/cookies.spec.js#L35-L38">}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -import org.openqa.selenium.Cookie -import org.openqa.selenium.chrome.ChromeDriver - -fun main() { - val driver = ChromeDriver() - try { - driver.get("https://example.com") - driver.manage().addCookie(Cookie("foo", "bar")) - - // Get cookie details with named cookie 'foo' - val cookie = driver.manage().getCookieNamed("foo") - println(cookie) - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} - -## 全てのクッキーの取得 - -現在のブラウジングコンテキストの '成功したシリアル化されたCookieデータ' を返します。 -ブラウザが使用できなくなった場合、エラーが返されます。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/CookiesTest.java#L52-L66" >}} - {{< /tab >}} - {{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_cookies.py#L24-L32" >}} - {{< /tab >}} - {{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/CookiesTest.cs#L51-L64" >}} - {{< /tab >}} - {{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/cookies_spec.rb#L26-L31" >}} - {{< /tab >}} - {{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/cookies.spec.js#L49-L51">}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -import org.openqa.selenium.Cookie -import org.openqa.selenium.chrome.ChromeDriver - -fun main() { - val driver = ChromeDriver() - try { - driver.get("https://example.com") - driver.manage().addCookie(Cookie("test1", "cookie1")) - driver.manage().addCookie(Cookie("test2", "cookie2")) - - // Get All available cookies - val cookies = driver.manage().cookies - println(cookies) - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} - - -## クッキーの削除 - -指定されたCookie名と一致するCookieデータを削除します。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/CookiesTest.java#L74-L77" >}} - {{< /tab >}} - {{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_cookies.py#L35-L43" >}} - {{< /tab >}} - {{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/CookiesTest.cs#L70-L73" >}} - {{< /tab >}} - {{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/cookies_spec.rb#L40-L43" >}} - {{< /tab >}} - {{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/cookies.spec.js#L61-L62">}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -import org.openqa.selenium.Cookie -import org.openqa.selenium.chrome.ChromeDriver - -fun main() { - val driver = ChromeDriver() - try { - driver.get("https://example.com") - driver.manage().addCookie(Cookie("test1", "cookie1")) - val cookie1 = Cookie("test2", "cookie2") - driver.manage().addCookie(cookie1) - - // delete a cookie with name 'test1' - driver.manage().deleteCookieNamed("test1") - - // delete cookie by passing cookie object of current browsing context. - driver.manage().deleteCookie(cookie1) - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} - - -## 全てのクッキーの削除 - -現在のブラウジングコンテキストの全てのCookieを削除します。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/CookiesTest.java#L100-L105" >}} - {{< /tab >}} - {{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_cookies.py#L47-L55" >}} - {{< /tab >}} - {{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/CookiesTest.cs#L92-L97" >}} - {{< /tab >}} - {{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/cookies_spec.rb#L49-L54" >}} - {{< /tab >}} - {{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/cookies.spec.js#L77-L78">}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -import org.openqa.selenium.Cookie -import org.openqa.selenium.chrome.ChromeDriver - -fun main() { - val driver = ChromeDriver() - try { - driver.get("https://example.com") - driver.manage().addCookie(Cookie("test1", "cookie1")) - driver.manage().addCookie(Cookie("test2", "cookie2")) - - // deletes all cookies - driver.manage().deleteAllCookies() - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} - -## SameSite Cookie属性 - -これにより、ユーザーは、サードパーティのサイトによって開始されたリクエストとともに -Cookieを送信するかどうかをブラウザに指示できます。 -CSRF(クロスサイトリクエストフォージェリ)攻撃を防ぐために導入されました。 - -SameSite Cookie属性は、2つのパラメーターを命令として受け入れます。 - -## Strict: -SameSite属性が **Strict** に設定されている場合、CookieはサードパーティのWebサイトによって -開始されたリクエストとともに送信されません。 - -## Lax: -CookieのSameSite属性を **Lax** に設定すると、CookieはサードパーティのWebサイトによって -開始されたGETリクエストとともに送信されます。 - -**注**: **現在、この機能は Chrome(バージョン 80 以降)および Firefox(バージョン 79 以降)で -実装されており、Selenium 4 以降で動作します。** - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/CookiesTest.java#L112-L121" >}} - {{< /tab >}} - {{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_cookies.py#L59-L71" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; - -namespace SameSiteCookie { - class SameSiteCookie { - static void Main(string[] args) { - IWebDriver driver = new ChromeDriver(); - try { - driver.Navigate().GoToUrl("http://www.example.com"); - - var cookie1Dictionary = new System.Collections.Generic.Dictionary() { - { "name", "test1" }, { "value", "cookie1" }, { "sameSite", "Strict" } }; - var cookie1 = Cookie.FromDictionary(cookie1Dictionary); - - var cookie2Dictionary = new System.Collections.Generic.Dictionary() { - { "name", "test2" }, { "value", "cookie2" }, { "sameSite", "Lax" } }; - var cookie2 = Cookie.FromDictionary(cookie2Dictionary); - - driver.Manage().Cookies.AddCookie(cookie1); - driver.Manage().Cookies.AddCookie(cookie2); - - System.Console.WriteLine(cookie1.SameSite); - System.Console.WriteLine(cookie2.SameSite); - } finally { - driver.Quit(); - } - } - } -} - {{< /tab >}} - {{< tab header="Ruby" >}} -require 'selenium-webdriver' -driver = Selenium::WebDriver.for :chrome - -begin - driver.get 'https://www.example.com' - # Adds the cookie into current browser context with sameSite 'Strict' (or) 'Lax' - driver.manage.add_cookie(name: "foo", value: "bar", same_site: "Strict") - driver.manage.add_cookie(name: "foo1", value: "bar", same_site: "Lax") - puts driver.manage.cookie_named('foo') - puts driver.manage.cookie_named('foo1') -ensure - driver.quit -end - {{< /tab >}} - {{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/cookies.spec.js#L24-L26">}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -import org.openqa.selenium.Cookie -import org.openqa.selenium.chrome.ChromeDriver - -fun main() { - val driver = ChromeDriver() - try { - driver.get("http://www.example.com") - val cookie = Cookie.Builder("key", "value").sameSite("Strict").build() - val cookie1 = Cookie.Builder("key", "value").sameSite("Lax").build() - driver.manage().addCookie(cookie) - driver.manage().addCookie(cookie1) - println(cookie.getSameSite()) - println(cookie1.getSameSite()) - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/interactions/cookies.pt-br.md b/website_and_docs/content/documentation/webdriver/interactions/cookies.pt-br.md deleted file mode 100644 index 8ad37192c55b..000000000000 --- a/website_and_docs/content/documentation/webdriver/interactions/cookies.pt-br.md +++ /dev/null @@ -1,325 +0,0 @@ ---- -title: "Trabalhando com cookies" -linkTitle: "Trabalhando com cookies" -weight: 4 -aliases: [ -"/documentation/support_packages/working_with_cookies/", -"/documentation/webdriver/browser/cookies/" -] ---- - -Um cookie é um pequeno pedaço de dado enviado de um site e armazenado no seu computador. -Os cookies são usados principalmente para reconhecer o usuário e carregar as informações armazenadas. - -A API WebDriver fornece uma maneira de interagir com cookies com métodos integrados: - -## Add Cookie -É usado para adicionar um cookie ao contexto de navegação atual. -Add Cookie aceita apenas um conjunto de objetos JSON serializáveis definidos. Aqui -é o link para a lista de valores-chave JSON aceitos. - -Em primeiro lugar, você precisa estar no domínio para qual o cookie será -valido. Se você está tentando predefinir cookies antes -de começar a interagir com um site e sua página inicial é grande / demora um pouco para carregar -uma alternativa é encontrar uma página menor no site (normalmente a página 404 é pequena, -por exemplo http://example.com/some404page) - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/CookiesTest.java#L30-L32" >}} - {{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_cookies.py#L5-L9" >}} - {{< /tab >}} -{{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/CookiesTest.cs#L32-L34" >}} - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/cookies_spec.rb#L9-L11" >}} - {{< /tab >}} - {{< tab header="JavaScript" text=true >}} - {{< gh-codeblock path="/examples/javascript/test/interactions/cookies.spec.js#L18">}} - {{< /tab >}} -{{< tab header="Kotlin" >}} -import org.openqa.selenium.Cookie -import org.openqa.selenium.chrome.ChromeDriver - -fun main() { - val driver = ChromeDriver() - try { - driver.get("https://example.com") - - // Adds the cookie into current browser context - driver.manage().addCookie(Cookie("key", "value")) - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} - -## Get Named Cookie - -Retorna os dados do cookie serializado correspondentes ao nome do cookie entre todos os cookies associados. - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/CookiesTest.java#L38-L42" >}} - {{< /tab >}} - {{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_cookies.py#L13-L20" >}} - {{< /tab >}} - {{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/CookiesTest.cs#L40-L44" >}} - {{< /tab >}} - {{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/cookies_spec.rb#L17-L21" >}} - {{< /tab >}} - {{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/cookies.spec.js#L35-L38">}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -import org.openqa.selenium.Cookie -import org.openqa.selenium.chrome.ChromeDriver - -fun main() { - val driver = ChromeDriver() - try { - driver.get("https://example.com") - driver.manage().addCookie(Cookie("foo", "bar")) - - // Get cookie details with named cookie 'foo' - val cookie = driver.manage().getCookieNamed("foo") - println(cookie) - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} - -## Get All Cookies - -Retorna 'dados de cookie serializados com sucesso' para o contexto de navegação atual. -Se o navegador não estiver mais disponível, ele retornará um erro. - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/CookiesTest.java#L52-L66" >}} - {{< /tab >}} - {{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_cookies.py#L24-L32" >}} - {{< /tab >}} - {{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/CookiesTest.cs#L51-L64" >}} - {{< /tab >}} - {{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/cookies_spec.rb#L26-L31" >}} - {{< /tab >}} - {{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/cookies.spec.js#L49-L51">}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -import org.openqa.selenium.Cookie -import org.openqa.selenium.chrome.ChromeDriver - -fun main() { - val driver = ChromeDriver() - try { - driver.get("https://example.com") - driver.manage().addCookie(Cookie("test1", "cookie1")) - driver.manage().addCookie(Cookie("test2", "cookie2")) - - // Get All available cookies - val cookies = driver.manage().cookies - println(cookies) - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} - - -## Delete Cookie - -Exclui os dados do cookie que correspondem ao nome do cookie fornecido. - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/CookiesTest.java#L74-L77" >}} - {{< /tab >}} - {{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_cookies.py#L35-L43" >}} - {{< /tab >}} - {{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/CookiesTest.cs#L70-L73" >}} - {{< /tab >}} - {{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/cookies_spec.rb#L40-L43" >}} - {{< /tab >}} - {{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/cookies.spec.js#L61-L62">}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -import org.openqa.selenium.Cookie -import org.openqa.selenium.chrome.ChromeDriver - -fun main() { - val driver = ChromeDriver() - try { - driver.get("https://example.com") - driver.manage().addCookie(Cookie("test1", "cookie1")) - val cookie1 = Cookie("test2", "cookie2") - driver.manage().addCookie(cookie1) - - // delete a cookie with name 'test1' - driver.manage().deleteCookieNamed("test1") - - // delete cookie by passing cookie object of current browsing context. - driver.manage().deleteCookie(cookie1) - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} - - -## Delete All Cookies - -Exclui todos os cookies do contexto de navegação atual. - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/CookiesTest.java#L100-L105" >}} - {{< /tab >}} - {{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_cookies.py#L47-L55" >}} - {{< /tab >}} - {{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/CookiesTest.cs#L92-L97" >}} - {{< /tab >}} - {{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/cookies_spec.rb#L49-L54" >}} - {{< /tab >}} - {{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/cookies.spec.js#L77-L78">}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -import org.openqa.selenium.Cookie -import org.openqa.selenium.chrome.ChromeDriver - -fun main() { - val driver = ChromeDriver() - try { - driver.get("https://example.com") - driver.manage().addCookie(Cookie("test1", "cookie1")) - driver.manage().addCookie(Cookie("test2", "cookie2")) - - // deletes all cookies - driver.manage().deleteAllCookies() - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} - -## Same-Site Cookie Attribute - -Permite que um usuário instrua os navegadores a controlar se os cookies -são enviados junto com a solicitação iniciada por sites de terceiros. -É usado para evitar ataques CSRF (Cross-Site Request Forgery). - -O atributo de cookie Same-Site aceita dois parâmetros como instruções - -## Strict: -Quando o atributo sameSite é definido como **Strict**, -o cookie não será enviado junto com -solicitações iniciadas por sites de terceiros. - -## Lax: -Quando você define um atributo cookie sameSite como **Lax**, -o cookie será enviado junto com uma solicitação GET -iniciada por um site de terceiros. - -**Nota**: **a partir de agora, esse recurso está disponível no Chrome (versão 80+), -Firefox (versão 79+) e funciona com Selenium 4 e versões posteriores.** - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/CookiesTest.java#L112-L121" >}} - {{< /tab >}} - {{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_cookies.py#L59-L71" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; - -namespace SameSiteCookie { - class SameSiteCookie { - static void Main(string[] args) { - IWebDriver driver = new ChromeDriver(); - try { - driver.Navigate().GoToUrl("http://www.example.com"); - - var cookie1Dictionary = new System.Collections.Generic.Dictionary() { - { "name", "test1" }, { "value", "cookie1" }, { "sameSite", "Strict" } }; - var cookie1 = Cookie.FromDictionary(cookie1Dictionary); - - var cookie2Dictionary = new System.Collections.Generic.Dictionary() { - { "name", "test2" }, { "value", "cookie2" }, { "sameSite", "Lax" } }; - var cookie2 = Cookie.FromDictionary(cookie2Dictionary); - - driver.Manage().Cookies.AddCookie(cookie1); - driver.Manage().Cookies.AddCookie(cookie2); - - System.Console.WriteLine(cookie1.SameSite); - System.Console.WriteLine(cookie2.SameSite); - } finally { - driver.Quit(); - } - } - } -} - {{< /tab >}} - {{< tab header="Ruby" >}} -require 'selenium-webdriver' -driver = Selenium::WebDriver.for :chrome - -begin - driver.get 'https://www.example.com' - # Adds the cookie into current browser context with sameSite 'Strict' (or) 'Lax' - driver.manage.add_cookie(name: "foo", value: "bar", same_site: "Strict") - driver.manage.add_cookie(name: "foo1", value: "bar", same_site: "Lax") - puts driver.manage.cookie_named('foo') - puts driver.manage.cookie_named('foo1') -ensure - driver.quit -end - {{< /tab >}} - {{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/cookies.spec.js#L24-L26">}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -import org.openqa.selenium.Cookie -import org.openqa.selenium.chrome.ChromeDriver - -fun main() { - val driver = ChromeDriver() - try { - driver.get("http://www.example.com") - val cookie = Cookie.Builder("key", "value").sameSite("Strict").build() - val cookie1 = Cookie.Builder("key", "value").sameSite("Lax").build() - driver.manage().addCookie(cookie) - driver.manage().addCookie(cookie1) - println(cookie.getSameSite()) - println(cookie1.getSameSite()) - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/interactions/cookies.zh-cn.md b/website_and_docs/content/documentation/webdriver/interactions/cookies.zh-cn.md deleted file mode 100644 index b2e2af952828..000000000000 --- a/website_and_docs/content/documentation/webdriver/interactions/cookies.zh-cn.md +++ /dev/null @@ -1,327 +0,0 @@ ---- -title: "同cookies一起工作" -linkTitle: "Cookies" -weight: 4 -aliases: [ -"/documentation/support_packages/working_with_cookies/", -"/documentation/webdriver/browser/cookies/" -] ---- - - -Cookie是从网站发送并存储在您的计算机中的一小段数据. Cookies主要用于识别用户并加载存储的信息. - -WebDriver API提供了一种使用内置的方法与Cookie进行交互: - -## 添加 Cookie -这个方法常常用于将cookie添加到当前访问的上下文中. 添加Cookie仅接受一组已定义的可序列化JSON对象. 这里 -是一个链接, 用于描述可接受的JSON键值的列表 - -首先, 您需要位于有效Cookie的域上. 如果您在开始与网站进行交互之前尝试预设cookie, 并且您的首页很大或需要一段时间才能加载完毕, 则可以选择在网站上找到一个较小的页面 (通常404页很小, -例如 http://example.com/some404page) - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/CookiesTest.java#L30-L32" >}} - {{< /tab >}} -{{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_cookies.py#L5-9" >}} - {{< /tab >}} - {{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/CookiesTest.cs#L32-L34" >}} - {{< /tab >}} -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/cookies_spec.rb#L9-L11" >}} - {{< /tab >}} - {{< tab header="JavaScript" text=true >}} - {{< gh-codeblock path="/examples/javascript/test/interactions/cookies.spec.js#L18">}} - {{< /tab >}} -{{< tab header="Kotlin" >}} -import org.openqa.selenium.Cookie -import org.openqa.selenium.chrome.ChromeDriver - -fun main() { - val driver = ChromeDriver() - try { - driver.get("https://example.com") - - // Adds the cookie into current browser context - driver.manage().addCookie(Cookie("key", "value")) - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} - -## 获取命名的 Cookie - -此方法返回与cookie名称匹配的序列化cookie数据中所有关联的cookie. - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/CookiesTest.java#L38-L42" >}} - {{< /tab >}} - {{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_cookies.py#L13-L20" >}} - {{< /tab >}} - {{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/CookiesTest.cs#L40-L44" >}} - {{< /tab >}} - - {{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/cookies_spec.rb#L17-L21" >}} - {{< /tab >}} - - {{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/cookies.spec.js#L35-L38">}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -import org.openqa.selenium.Cookie -import org.openqa.selenium.chrome.ChromeDriver - -fun main() { - val driver = ChromeDriver() - try { - driver.get("https://example.com") - driver.manage().addCookie(Cookie("foo", "bar")) - - // Get cookie details with named cookie 'foo' - val cookie = driver.manage().getCookieNamed("foo") - println(cookie) - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} - -## 获取全部 Cookies - -此方法会针对当前访问上下文返回“成功的序列化cookie数据”. 如果浏览器不再可用, 则返回错误. - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/CookiesTest.java#L52-L66" >}} - {{< /tab >}} - {{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_cookies.py#L24-L32" >}} - {{< /tab >}} - {{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/CookiesTest.cs#L51-L64" >}} - {{< /tab >}} - -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/cookies_spec.rb#L26-L31" >}} -{{< /tab >}} - - {{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/cookies.spec.js#L49-L51">}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -import org.openqa.selenium.Cookie -import org.openqa.selenium.chrome.ChromeDriver - -fun main() { - val driver = ChromeDriver() - try { - driver.get("https://example.com") - driver.manage().addCookie(Cookie("test1", "cookie1")) - driver.manage().addCookie(Cookie("test2", "cookie2")) - - // Get All available cookies - val cookies = driver.manage().cookies - println(cookies) - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} - - -## 删除 Cookie - -此方法删除与提供的cookie名称匹配的cookie数据. - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/CookiesTest.java#L74-L77" >}} - {{< /tab >}} - {{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_cookies.py#L35-L43" >}} - {{< /tab >}} - {{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/CookiesTest.cs#L70-L73" >}} - {{< /tab >}} - -{{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/cookies_spec.rb#L40-L43" >}} -{{< /tab >}} - - {{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/cookies.spec.js#L61-L62">}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -import org.openqa.selenium.Cookie -import org.openqa.selenium.chrome.ChromeDriver - -fun main() { - val driver = ChromeDriver() - try { - driver.get("https://example.com") - driver.manage().addCookie(Cookie("test1", "cookie1")) - val cookie1 = Cookie("test2", "cookie2") - driver.manage().addCookie(cookie1) - - // delete a cookie with name 'test1' - driver.manage().deleteCookieNamed("test1") - - // delete cookie by passing cookie object of current browsing context. - driver.manage().deleteCookie(cookie1) - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} - - -## 删除所有 Cookies - -此方法删除当前访问上下文的所有cookie. - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/CookiesTest.java#L100-L105" >}} - {{< /tab >}} - {{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_cookies.py#L47-L55" >}} - {{< /tab >}} - {{< tab header="CSharp" text=true >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/CookiesTest.cs#L92-L97" >}} - {{< /tab >}} - - {{< tab header="Ruby" text=true >}} -{{< gh-codeblock path="/examples/ruby/spec/interactions/cookies_spec.rb#L49-L54" >}} - {{< /tab >}} - - {{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/cookies.spec.js#L77-L78">}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -import org.openqa.selenium.Cookie -import org.openqa.selenium.chrome.ChromeDriver - -fun main() { - val driver = ChromeDriver() - try { - driver.get("https://example.com") - driver.manage().addCookie(Cookie("test1", "cookie1")) - driver.manage().addCookie(Cookie("test2", "cookie2")) - - // deletes all cookies - driver.manage().deleteAllCookies() - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} - -## Same-Site Cookie属性 - -此属性允许用户引导浏览器控制cookie, 是否与第三方站点发起的请求一起发送. -引入其是为了防止CSRF(跨站请求伪造)攻击. - -Same-Site cookie属性接受以下两种参数作为指令 - -## Strict: -当sameSite属性设置为 **Strict**, -cookie不会与来自第三方网站的请求一起发送. - -## Lax: -当您将cookie sameSite属性设置为 **Lax**, -cookie将与第三方网站发起的GET请求一起发送. - -**注意**: **到目前为止, -此功能已在Chrome(80+版本), -Firefox(79+版本)中提供, -并适用于Selenium 4以及更高版本.** - -{{< tabpane langEqualsHeader=true >}} -{{< tab header="Java" text=true >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/CookiesTest.java#L112-L121" >}} - {{< /tab >}} - {{< tab header="Python" text=true >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_cookies.py#L59-L71" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -using OpenQA.Selenium; -using OpenQA.Selenium.Chrome; - -namespace SameSiteCookie { - class SameSiteCookie { - static void Main(string[] args) { - IWebDriver driver = new ChromeDriver(); - try { - driver.Navigate().GoToUrl("http://www.example.com"); - - var cookie1Dictionary = new System.Collections.Generic.Dictionary() { - { "name", "test1" }, { "value", "cookie1" }, { "sameSite", "Strict" } }; - var cookie1 = Cookie.FromDictionary(cookie1Dictionary); - - var cookie2Dictionary = new System.Collections.Generic.Dictionary() { - { "name", "test2" }, { "value", "cookie2" }, { "sameSite", "Lax" } }; - var cookie2 = Cookie.FromDictionary(cookie2Dictionary); - - driver.Manage().Cookies.AddCookie(cookie1); - driver.Manage().Cookies.AddCookie(cookie2); - - System.Console.WriteLine(cookie1.SameSite); - System.Console.WriteLine(cookie2.SameSite); - } finally { - driver.Quit(); - } - } - } -} - {{< /tab >}} - {{< tab header="Ruby" >}} -require 'selenium-webdriver' -driver = Selenium::WebDriver.for :chrome - -begin - driver.get 'https://www.example.com' - # Adds the cookie into current browser context with sameSite 'Strict' (or) 'Lax' - driver.manage.add_cookie(name: "foo", value: "bar", same_site: "Strict") - driver.manage.add_cookie(name: "foo1", value: "bar", same_site: "Lax") - puts driver.manage.cookie_named('foo') - puts driver.manage.cookie_named('foo1') -ensure - driver.quit -end - {{< /tab >}} - {{< tab header="JavaScript" text=true >}} -{{< gh-codeblock path="/examples/javascript/test/interactions/cookies.spec.js#L24-L26">}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -import org.openqa.selenium.Cookie -import org.openqa.selenium.chrome.ChromeDriver - -fun main() { - val driver = ChromeDriver() - try { - driver.get("http://www.example.com") - val cookie = Cookie.Builder("key", "value").sameSite("Strict").build() - val cookie1 = Cookie.Builder("key", "value").sameSite("Lax").build() - driver.manage().addCookie(cookie) - driver.manage().addCookie(cookie1) - println(cookie.getSameSite()) - println(cookie1.getSameSite()) - } finally { - driver.quit() - } -} - {{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/interactions/print_page.en.md b/website_and_docs/content/documentation/webdriver/interactions/print_page.en.md index fa8e5698112c..463d1ae352dd 100644 --- a/website_and_docs/content/documentation/webdriver/interactions/print_page.en.md +++ b/website_and_docs/content/documentation/webdriver/interactions/print_page.en.md @@ -6,7 +6,10 @@ aliases: [ "/documentation/en/support_packages/print_page/", "/documentation/ja/support_packages/print_page/", "/documentation/pt-br/support_packages/print_page/", -"/documentation/zh-cn/support_packages/print_page/" +"/documentation/zh-cn/support_packages/print_page/", +"/ja/documentation/webdriver/interactions/print_page/", +"/pt-br/documentation/webdriver/interactions/print_page/", +"/zh-cn/documentation/webdriver/interactions/print_page/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/interactions/print_page.ja.md b/website_and_docs/content/documentation/webdriver/interactions/print_page.ja.md deleted file mode 100644 index f409d6fc5817..000000000000 --- a/website_and_docs/content/documentation/webdriver/interactions/print_page.ja.md +++ /dev/null @@ -1,220 +0,0 @@ ---- -title: "Print Page" -linkTitle: "Print Page" -weight: 7 ---- - -Printing a webpage is a common task, whether for sharing information or maintaining archives. -Selenium simplifies this process through its PrintOptions, PrintsPage, and browsingContext -classes, which provide a flexible and intuitive interface for automating the printing of web pages. -These classes enable you to configure printing preferences, such as page layout, margins, and scaling, -ensuring that the output meets your specific requirements. - -## Configuring - -### Orientation -Using the `getOrientation()` and `setOrientation()` methods, you can get/set the page orientation --- either `PORTRAIT` or `LANDSCAPE`. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L14-L17" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L12-L19" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L12-L14" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### Range -Using the `getPageRanges()` and `setPageRanges()` methods, you can get/set the range of pages to print --- e.g. "2-4". - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L23-L26" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L22-L29" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L18-L20" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### Size -Using the `getPageSize()` and `setPageSize()` methods, you can get/set the paper size to print --- e.g. "A0", "A6", "Legal", "Tabloid", etc. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L32-L35" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L32-L38" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L24-L26" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### Margins -Using the `getPageMargin()` and `setPageMargin()` methods, you can set the margin sizes of the page you wish to print --- i.e. top, bottom, left, and right margins. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L41-L48" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L51-L57" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L30-L35" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### Scale -Using `getScale()` and `setScale()` methods, you can get/set the scale of the page you wish to print --- e.g. 1.0 is 100% or default, 0.25 is 25%, etc. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L53-L57" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L61-L68" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L42-L45" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### Background -Using `getBackground()` and `setBackground()` methods, you can get/set whether background colors and images appear --- boolean `true` or `false`. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L63-L66" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L41-L48" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L49-L51" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### ShrinkToFit -Using `getShrinkToFit()` and `setShrinkToFit()` methods, you can get/set whether the page will shrink-to-fit content on the page --- boolean `true` or `false`. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L72-L75" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L71-L78" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L55-L57" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -## Printing - -Once you've configured your PrintOptions, you're ready to print the page. To do this, -you can invoke the print function, which generates a PDF representation of the web page. -The resulting PDF can be saved to your local storage for further use or distribution. -Using `PrintsPage()`, the print command will return the PDF data in base64-encoded format, which can be decoded -and written to a file in your desired location, and using `BrowsingContext()` will return a String. - -There may currently be multiple implementations depending on your language of choice. For example, with Java you -have the ability to print using either `BrowingContext()` or `PrintsPage()`. Both take `PrintOptions()` objects as a -parameter. - -Note: `BrowsingContext()` is part of Selenium's BiDi implementation. To enable BiDi see [Enabling Bidi]({{< ref "bidi/" >}}) - -{{< tabpane text=true >}} -{{% tab header="Java" %}} -**PrintsPage()** -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintsPageTest.java#L27-L31" >}} -**BrowsingContext()** -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintsPageTest.java#L37-L41" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L81-L88" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{% tab header="Python" %}} -**print_page()** -{{< gh-codeblock path="/examples/python/tests/interactions/test_prints_page.py#L12-L14" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md b/website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md deleted file mode 100644 index ecc25306614c..000000000000 --- a/website_and_docs/content/documentation/webdriver/interactions/print_page.pt-br.md +++ /dev/null @@ -1,220 +0,0 @@ ---- -title: "Print Page" -linkTitle: "Print Page" -weight: 7 ---- - -Printing a webpage is a common task, whether for sharing information or maintaining archives. -Selenium simplifies this process through its PrintOptions, PrintsPage, and browsingContext -classes, which provide a flexible and intuitive interface for automating the printing of web pages. -These classes enable you to configure printing preferences, such as page layout, margins, and scaling, -ensuring that the output meets your specific requirements. - -## Configuring - -### Orientation -Using the `getOrientation()` and `setOrientation()` methods, you can get/set the page orientation --- either `PORTRAIT` or `LANDSCAPE`. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L14-L17" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L12-L19" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L12-L14" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### Range -Using the `getPageRanges()` and `setPageRanges()` methods, you can get/set the range of pages to print --- e.g. "2-4". - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L23-L26" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L22-L29" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L18-L26" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### Size -Using the `getPageSize()` and `setPageSize()` methods, you can get/set the paper size to print --- e.g. "A0", "A6", "Legal", "Tabloid", etc. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L32-L35" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L32-L38" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L24-L27" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### Margins -Using the `getPageMargin()` and `setPageMargin()` methods, you can set the margin sizes of the page you wish to print --- i.e. top, bottom, left, and right margins. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#41-L48" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L51-L57" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L30-L35" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### Scale -Using `getScale()` and `setScale()` methods, you can get/set the scale of the page you wish to print --- e.g. 1.0 is 100% or default, 0.25 is 25%, etc. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L53-L57" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L61-L68" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L42-L45" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### Background -Using `getBackground()` and `setBackground()` methods, you can get/set whether background colors and images appear --- boolean `true` or `false`. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L63-L66" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L41-L48" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L49-L51" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### ShrinkToFit -Using `getShrinkToFit()` and `setShrinkToFit()` methods, you can get/set whether the page will shrink-to-fit content on the page --- boolean `true` or `false`. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L72-L75" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L71-L78" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L55-L57" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -## Printing - -Once you've configured your PrintOptions, you're ready to print the page. To do this, -you can invoke the print function, which generates a PDF representation of the web page. -The resulting PDF can be saved to your local storage for further use or distribution. -Using `PrintsPage()`, the print command will return the PDF data in base64-encoded format, which can be decoded -and written to a file in your desired location, and using `BrowsingContext()` will return a String. - -There may currently be multiple implementations depending on your language of choice. For example, with Java you -have the ability to print using either `BrowingContext()` or `PrintsPage()`. Both take `PrintOptions()` objects as a -parameter. - -Note: `BrowsingContext()` is part of Selenium's BiDi implementation. To enable BiDi see [Enabling Bidi]({{< ref "bidi/" >}}) - -{{< tabpane text=true >}} -{{% tab header="Java" %}} -**PrintsPage()** -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintsPageTest.java#L27-L31" >}} -**BrowsingContext()** -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintsPageTest.java#L37-L41" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L81-L88" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{% tab header="Python" %}} -**print_page()** -{{< gh-codeblock path="/examples/python/tests/interactions/test_prints_page.py#L12-L14" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/interactions/print_page.zh-cn.md b/website_and_docs/content/documentation/webdriver/interactions/print_page.zh-cn.md deleted file mode 100644 index d5d524354fce..000000000000 --- a/website_and_docs/content/documentation/webdriver/interactions/print_page.zh-cn.md +++ /dev/null @@ -1,216 +0,0 @@ ---- -title: "打印页面" -linkTitle: "打印页面" -weight: 7 ---- - -无论是共享信息还是维护档案,打印网页都是一项常见任务。 -Selenium 通过其 PrintOptions、PrintsPage 和 browsingContext 类简化了这一过程,这些类为网页自动打印提供了灵活直观的接口。 -这些类使得用户可以配置打印首选项,如页面布局、页边距和缩放比例,以确保输出满足特定要求。 - -## 配置 - -### 方向 -通过 `getOrientation()` 和 `setOrientation()` 方法,可以获取/设置页面方向(`PORTRAIT` 或 `LANDSCAPE`)。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L14-L17" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L12-L19" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L12-L14" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### 范围 -通过 `getPageRanges()` 和 `setPageRanges()` 方法,可以获取设置要打印页面的范围(如 "2-4")。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L23-L26" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L22-L29" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L18-L20" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### 尺寸 -通过 `getPageSize()` 和 `setPageSize()` 方法,可以获取/设置要打印页面的纸张尺寸(如"A0"、"A6"、"Legal"、"Tabloid" 等)。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L32-L35" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L32-L38" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L24-L26" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### 边距 -通过 `getPageMargin()` 和 `setPageMargin()` 方法,可以获取/设置要打印页面的边距大小(也就是上、下、左右边距)。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L41-L48" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L51-L57" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L30-L35" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### 缩放 -通过 `getScale()` 和 `setScale()` 方法,可以获取/设置要打印页面的缩放尺寸(如 1.0 为 100% 或默认缩放,0.25 为 25% 等)。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L53-L57" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L61-L68" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L42-L45" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### 背景 -通过 `getBackground()` 和 `setBackground()` 方法,可以获取/设置背景色和图片出现,其为布尔值 `true` 或 `false`。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L63-L66" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L41-L48" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L49-L51" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -### 缩放至合适大小 -通过 `getShrinkToFit()` 和 `setShrinkToFit()` 方法,可以获取/设置页面是否会根据页面内容缩小,其为布尔值 `true` 或 `false`。 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintOptionsTest.java#L72-L75" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L71-L78" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/interactions/test_print_options.py#L55-L57" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} - -## 打印 - -配置好打印选项后,就可以打印页面了。为此,您可以调用打印功能,生成网页的 PDF 表示形式。 -生成的 PDF 文件可以保存到本地存储器中,以便进一步使用或分发。 -使用 `PrintsPage()` 时,打印命令将以 base64 编码格式返回 PDF -数据,该格式可以解码并写入所需位置的文件,而使用 `BrowsingContext()` 时将返回字符串。 - -目前可能有多种实现方式,这取决于您所选择的语言。例如,Java 可以使用 `BrowingContext()` -或 `PrintsPage()` 进行打印。两者都将 `PrintOptions()` 对象作为一个参数。 - -注意:`BrowsingContext()` 是 Selenium BiDi 实现的一部分。为启用 BiDi,请参见[启用 Bidi]({{< ref "bidi/" >}}) - -{{< tabpane text=true >}} -{{% tab header="Java" %}} -**PrintsPage()** -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintsPageTest.java#L27-L31" >}} -**BrowsingContext()** -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/interactions/PrintsPageTest.java#L37-L41" >}} -{{< /tab >}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Interactions/PrintOptionsTest.cs#L81-L88" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{% tab header="Python" %}} -**print_page()** -{{< gh-codeblock path="/examples/python/tests/interactions/test_prints_page.py#L12-L14" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< badge-implementation >}} -{{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/support_features/_index.en.md b/website_and_docs/content/documentation/webdriver/support_features/_index.en.md index ca97a496d0d5..836d944f2934 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/_index.en.md +++ b/website_and_docs/content/documentation/webdriver/support_features/_index.en.md @@ -10,7 +10,16 @@ aliases: [ "/documentation/webdriver/additional_features/", "/documentation/ja/support_packages/", "/documentation/pt-br/support_packages/", -"/documentation/zh-cn/support_packages/" +"/documentation/zh-cn/support_packages/", +"/ja/documentation/support_packages/", +"/ja/documentation/webdriver/additional_features/", +"/ja/documentation/webdriver/support_features/", +"/pt-br/documentation/additional_features/", +"/pt-br/documentation/support_packages/", +"/pt-br/documentation/webdriver/support_features/", +"/zh-cn/documentation/additional_features/", +"/zh-cn/documentation/support_packages/", +"/zh-cn/documentation/webdriver/support_features/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/support_features/_index.ja.md b/website_and_docs/content/documentation/webdriver/support_features/_index.ja.md deleted file mode 100644 index 63c300badf0e..000000000000 --- a/website_and_docs/content/documentation/webdriver/support_features/_index.ja.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "サポート機能" -linkTitle: "サポート機能" -weight: 18 -description: > - サポートクラスは、オプションの高水準な機能を提供します。 -aliases: [ -"/documentation/support_packages/", -"/documentation/webdriver/additional_features/" -] ---- - -Selenium のコアライブラリは、低レベルで特定の方針に依存しない設計を目指しています。 -各言語のサポートクラスは、一般的な操作に対する方針を組み込んだラッパーを提供しており、 -一部の処理を簡素化するために使用できます。 diff --git a/website_and_docs/content/documentation/webdriver/support_features/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/support_features/_index.pt-br.md deleted file mode 100644 index 5bc40ea99e13..000000000000 --- a/website_and_docs/content/documentation/webdriver/support_features/_index.pt-br.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "Recursos de suporte" -linkTitle: "Recursos de suporte" -weight: 18 -description: > - As classes de suporte fornecem características opcionais de nível superior. -aliases: [ -"/documentation/support_packages/", -"/documentation/additional_features/" -] ---- - -As bibliotecas principais do Selenium tentam ser de baixo nível e não opinativas. -As classes de suporte em cada linguagem fornecem invólucros opinativos para interações comuns -que podem ser usadas para simplificar alguns comportamentos. diff --git a/website_and_docs/content/documentation/webdriver/support_features/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/support_features/_index.zh-cn.md deleted file mode 100644 index ddc6cf49ed16..000000000000 --- a/website_and_docs/content/documentation/webdriver/support_features/_index.zh-cn.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -title: "Support features" -linkTitle: "额外功能" -weight: 18 -description: > - 针对更高层面功能的额外支持类. -aliases: [ -"/documentation/support_packages/", -"/documentation/additional_features/" -] ---- - -Selenium的核心库试图提供底层以及普适的功能. -每种语言的支持类都为常见交互提供特定的包装器, -可用于简化某些行为. diff --git a/website_and_docs/content/documentation/webdriver/support_features/colors.en.md b/website_and_docs/content/documentation/webdriver/support_features/colors.en.md index ec6b8bf1ed7d..c77dcf490614 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/colors.en.md +++ b/website_and_docs/content/documentation/webdriver/support_features/colors.en.md @@ -8,7 +8,16 @@ aliases: [ "/documentation/webdriver/additional_features/working_with_colours/", "/documentation/ja/support_packages/working_with_colours/", "/documentation/pt-br/support_packages/working_with_colours/", -"/documentation/zh-cn/support_packages/working_with_colours/" +"/documentation/zh-cn/support_packages/working_with_colours/", +"/ja/documentation/support_packages/working_with_colours/", +"/ja/documentation/webdriver/additional_features/working_with_colours/", +"/ja/documentation/webdriver/support_features/colors/", +"/pt-br/documentation/support_packages/working_with_colours/", +"/pt-br/documentation/webdriver/additional_features/working_with_colours/", +"/pt-br/documentation/webdriver/support_features/colors/", +"/zh-cn/documentation/support_packages/working_with_colours/", +"/zh-cn/documentation/webdriver/additional_features/working_with_colours/", +"/zh-cn/documentation/webdriver/support_features/colors/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/support_features/colors.ja.md b/website_and_docs/content/documentation/webdriver/support_features/colors.ja.md deleted file mode 100644 index 0192e554d6ef..000000000000 --- a/website_and_docs/content/documentation/webdriver/support_features/colors.ja.md +++ /dev/null @@ -1,228 +0,0 @@ ---- -title: "色を扱う" -linkTitle: "色を扱う" -weight: 3 -aliases: [ -"/documentation/support_packages/working_with_colours/", -"/documentation/webdriver/additional_features/working_with_colours/" -] ---- - - -テストの一部として何かの色を検証したい場合があります。 -問題は、ウェブ上の色の定義が一定ではないことです。 -色のHEX表現を色のRGB表現と比較する簡単な方法、または色のRGBA表現を色のHSLA表現と比較する簡単な方法があったらいいのではないでしょうか? - -心配しないでください。解決策があります。: _Color_ クラスです! - -まず、クラスをインポートする必要があります。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -import org.openqa.selenium.support.Color; - {{< /tab >}} - {{< tab header="Python" >}} -from selenium.webdriver.support.color import Color - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -include Selenium::WebDriver::Support - {{< /tab >}} - {{< tab header="JavaScript" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Kotlin" >}}import org.openqa.selenium.support.Color{{< /tab >}} -{{< /tabpane >}} - -これで、カラーオブジェクトの作成を開始できます。 -すべての色オブジェクトは、色の文字列表現から作成する必要があります。 -サポートされている色表現は、以下のとおりです。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -private final Color HEX_COLOUR = Color.fromString("#2F7ED8"); -private final Color RGB_COLOUR = Color.fromString("rgb(255, 255, 255)"); -private final Color RGB_COLOUR = Color.fromString("rgb(40%, 20%, 40%)"); -private final Color RGBA_COLOUR = Color.fromString("rgba(255, 255, 255, 0.5)"); -private final Color RGBA_COLOUR = Color.fromString("rgba(40%, 20%, 40%, 0.5)"); -private final Color HSL_COLOUR = Color.fromString("hsl(100, 0%, 50%)"); -private final Color HSLA_COLOUR = Color.fromString("hsla(100, 0%, 50%, 0.5)"); - {{< /tab >}} - {{< tab header="Python" >}} -HEX_COLOUR = Color.from_string('#2F7ED8') -RGB_COLOUR = Color.from_string('rgb(255, 255, 255)') -RGB_COLOUR = Color.from_string('rgb(40%, 20%, 40%)') -RGBA_COLOUR = Color.from_string('rgba(255, 255, 255, 0.5)') -RGBA_COLOUR = Color.from_string('rgba(40%, 20%, 40%, 0.5)') -HSL_COLOUR = Color.from_string('hsl(100, 0%, 50%)') -HSLA_COLOUR = Color.from_string('hsla(100, 0%, 50%, 0.5)') - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -HEX_COLOUR = Color.from_string('#2F7ED8') -RGB_COLOUR = Color.from_string('rgb(255, 255, 255)') -RGB_COLOUR = Color.from_string('rgb(40%, 20%, 40%)') -RGBA_COLOUR = Color.from_string('rgba(255, 255, 255, 0.5)') -RGBA_COLOUR = Color.from_string('rgba(40%, 20%, 40%, 0.5)') -HSL_COLOUR = Color.from_string('hsl(100, 0%, 50%)') -HSLA_COLOUR = Color.from_string('hsla(100, 0%, 50%, 0.5)') - {{< /tab >}} - {{< tab header="JavaScript" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Kotlin" >}} -private val HEX_COLOUR = Color.fromString("#2F7ED8") -private val RGB_COLOUR = Color.fromString("rgb(255, 255, 255)") -private val RGB_COLOUR_PERCENT = Color.fromString("rgb(40%, 20%, 40%)") -private val RGBA_COLOUR = Color.fromString("rgba(255, 255, 255, 0.5)") -private val RGBA_COLOUR_PERCENT = Color.fromString("rgba(40%, 20%, 40%, 0.5)") -private val HSL_COLOUR = Color.fromString("hsl(100, 0%, 50%)") -private val HSLA_COLOUR = Color.fromString("hsla(100, 0%, 50%, 0.5)") - {{< /tab >}} -{{< /tabpane >}} - -Colorクラスは、 [http://www.w3.org/TR/css3-color/#html4](//www.w3.org/TR/css3-color/#html4) で指定されているすべての基本色定義もサポートしています。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -private final Color BLACK = Color.fromString("black"); -private final Color CHOCOLATE = Color.fromString("chocolate"); -private final Color HOTPINK = Color.fromString("hotpink"); - {{< /tab >}} - {{< tab header="Python" >}} -BLACK = Color.from_string('black') -CHOCOLATE = Color.from_string('chocolate') -HOTPINK = Color.from_string('hotpink') - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -BLACK = Color.from_string('black') -CHOCOLATE = Color.from_string('chocolate') -HOTPINK = Color.from_string('hotpink') - {{< /tab >}} - {{< tab header="JavaScript" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Kotlin" >}} -private val BLACK = Color.fromString("black") -private val CHOCOLATE = Color.fromString("chocolate") -private val HOTPINK = Color.fromString("hotpink") - {{< /tab >}} -{{< /tabpane >}} - -要素に色が設定されていない場合、ブラウザは "透明" の色の値を返すことがあります。 -Colorクラスもこれをサポートしています。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -private final Color TRANSPARENT = Color.fromString("transparent"); - {{< /tab >}} - {{< tab header="Python" >}} -TRANSPARENT = Color.from_string('transparent') - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -TRANSPARENT = Color.from_string('transparent') - {{< /tab >}} - {{< tab header="JavaScript" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Kotlin" >}} -private val TRANSPARENT = Color.fromString("transparent") - {{< /tab >}} -{{< /tabpane >}} - -レスポンスが正しく解析され、有効なColorオブジェクトに変換されることを認識して、要素を安全にクエリしてその色/背景色を取得できるようになりました。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -Color loginButtonColour = Color.fromString(driver.findElement(By.id("login")).getCssValue("color")); - -Color loginButtonBackgroundColour = Color.fromString(driver.findElement(By.id("login")).getCssValue("background-color")); - {{< /tab >}} - {{< tab header="Python" >}} -login_button_colour = Color.from_string(driver.find_element(By.ID,'login').value_of_css_property('color')) - -login_button_background_colour = Color.from_string(driver.find_element(By.ID,'login').value_of_css_property('background-color')) - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -login_button_colour = Color.from_string(driver.find_element(id: 'login').css_value('color')) - -login_button_background_colour = Color.from_string(driver.find_element(id: 'login').css_value('background-color')) - {{< /tab >}} - {{< tab header="JavaScript" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Kotlin" >}} -val loginButtonColour = Color.fromString(driver.findElement(By.id("login")).getCssValue("color")) - -val loginButtonBackgroundColour = Color.fromString(driver.findElement(By.id("login")).getCssValue("background-color")) - {{< /tab >}} -{{< /tabpane >}} - -そして、色オブジェクトを直接比較できます。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -assert loginButtonBackgroundColour.equals(HOTPINK); - {{< /tab >}} - {{< tab header="Python" >}} -assert login_button_background_colour == HOTPINK - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -assert(login_button_background_colour == HOTPINK) - {{< /tab >}} - {{< tab header="JavaScript" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Kotlin" >}} -assert(loginButtonBackgroundColour.equals(HOTPINK)) - {{< /tab >}} -{{< /tabpane >}} - -または、色を次の形式のいずれかに変換し、静的に検証することができます。 - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -assert loginButtonBackgroundColour.asHex().equals("#ff69b4"); -assert loginButtonBackgroundColour.asRgba().equals("rgba(255, 105, 180, 1)"); -assert loginButtonBackgroundColour.asRgb().equals("rgb(255, 105, 180)"); - {{< /tab >}} - {{< tab header="Python" >}} -assert login_button_background_colour.hex == '#ff69b4' -assert login_button_background_colour.rgba == 'rgba(255, 105, 180, 1)' -assert login_button_background_colour.rgb == 'rgb(255, 105, 180)' - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -assert(login_button_background_colour.hex == '#ff69b4') -assert(login_button_background_colour.rgba == 'rgba(255, 105, 180, 1)') -assert(login_button_background_colour.rgb == 'rgb(255, 105, 180)') - {{< /tab >}} - {{< tab header="JavaScript" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Kotlin" >}} -assert(loginButtonBackgroundColour.asHex().equals("#ff69b4")) -assert(loginButtonBackgroundColour.asRgba().equals("rgba(255, 105, 180, 1)")) -assert(loginButtonBackgroundColour.asRgb().equals("rgb(255, 105, 180)")) - {{< /tab >}} -{{< /tabpane >}} - -色はもはや問題ではありません。 diff --git a/website_and_docs/content/documentation/webdriver/support_features/colors.pt-br.md b/website_and_docs/content/documentation/webdriver/support_features/colors.pt-br.md deleted file mode 100644 index c2fdd7e93e4c..000000000000 --- a/website_and_docs/content/documentation/webdriver/support_features/colors.pt-br.md +++ /dev/null @@ -1,238 +0,0 @@ ---- -title: "Trabalhando com cores" -linkTitle: "Trabalhando com cores" -weight: 3 -aliases: [ -"/documentation/support_packages/working_with_colours/", -"/documentation/webdriver/additional_features/working_with_colours/" -] ---- - -Ocasionalmente, você desejará validar a cor de algo como parte de seus testes; -o problema é que as definições de cores na web não são constantes. -Não seria bom se houvesse uma maneira fácil de comparar -uma representação HEX de uma cor com uma representação RGB de uma cor, -ou uma representação RGBA de uma cor com uma representação HSLA de uma cor? - -Não se preocupe. Existe uma solução: a classe _Color_! - -Em primeiro lugar, você precisará importar a classe: - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -import org.openqa.selenium.support.Color; - {{< /tab >}} - {{< tab header="Python" >}} -from selenium.webdriver.support.color import Color - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -include Selenium::WebDriver::Support - {{< /tab >}} - {{< tab header="JavaScript" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Kotlin" >}}import org.openqa.selenium.support.Color{{< /tab >}} -{{< /tabpane >}} - -Agora você pode começar a criar objetos coloridos. -Cada objeto de cor precisará ser criado a partir de uma representação de string de -sua cor. -As representações de cores com suporte são: - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -private final Color HEX_COLOUR = Color.fromString("#2F7ED8"); -private final Color RGB_COLOUR = Color.fromString("rgb(255, 255, 255)"); -private final Color RGB_COLOUR = Color.fromString("rgb(40%, 20%, 40%)"); -private final Color RGBA_COLOUR = Color.fromString("rgba(255, 255, 255, 0.5)"); -private final Color RGBA_COLOUR = Color.fromString("rgba(40%, 20%, 40%, 0.5)"); -private final Color HSL_COLOUR = Color.fromString("hsl(100, 0%, 50%)"); -private final Color HSLA_COLOUR = Color.fromString("hsla(100, 0%, 50%, 0.5)"); - {{< /tab >}} - {{< tab header="Python" >}} -HEX_COLOUR = Color.from_string('#2F7ED8') -RGB_COLOUR = Color.from_string('rgb(255, 255, 255)') -RGB_COLOUR = Color.from_string('rgb(40%, 20%, 40%)') -RGBA_COLOUR = Color.from_string('rgba(255, 255, 255, 0.5)') -RGBA_COLOUR = Color.from_string('rgba(40%, 20%, 40%, 0.5)') -HSL_COLOUR = Color.from_string('hsl(100, 0%, 50%)') -HSLA_COLOUR = Color.from_string('hsla(100, 0%, 50%, 0.5)') - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -HEX_COLOUR = Color.from_string('#2F7ED8') -RGB_COLOUR = Color.from_string('rgb(255, 255, 255)') -RGB_COLOUR = Color.from_string('rgb(40%, 20%, 40%)') -RGBA_COLOUR = Color.from_string('rgba(255, 255, 255, 0.5)') -RGBA_COLOUR = Color.from_string('rgba(40%, 20%, 40%, 0.5)') -HSL_COLOUR = Color.from_string('hsl(100, 0%, 50%)') -HSLA_COLOUR = Color.from_string('hsla(100, 0%, 50%, 0.5)') - {{< /tab >}} - {{< tab header="JavaScript" >}} -// Essa funcionalidade não está implementada - Nos ajude enviando um PR implementando essa funcionalidade - {{< /tab >}} - {{< tab header="Kotlin" >}} -private val HEX_COLOUR = Color.fromString("#2F7ED8") -private val RGB_COLOUR = Color.fromString("rgb(255, 255, 255)") -private val RGB_COLOUR_PERCENT = Color.fromString("rgb(40%, 20%, 40%)") -private val RGBA_COLOUR = Color.fromString("rgba(255, 255, 255, 0.5)") -private val RGBA_COLOUR_PERCENT = Color.fromString("rgba(40%, 20%, 40%, 0.5)") -private val HSL_COLOUR = Color.fromString("hsl(100, 0%, 50%)") -private val HSLA_COLOUR = Color.fromString("hsla(100, 0%, 50%, 0.5)") - {{< /tab >}} -{{< /tabpane >}} - -A classe Color também suporta todas as definições de cores básicas -especificadas em -[http://www.w3.org/TR/css3-color/#html4](//www.w3.org/TR/css3-color/#html4). - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -private final Color BLACK = Color.fromString("black"); -private final Color CHOCOLATE = Color.fromString("chocolate"); -private final Color HOTPINK = Color.fromString("hotpink"); - {{< /tab >}} - {{< tab header="Python" >}} -BLACK = Color.from_string('black') -CHOCOLATE = Color.from_string('chocolate') -HOTPINK = Color.from_string('hotpink') - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -BLACK = Color.from_string('black') -CHOCOLATE = Color.from_string('chocolate') -HOTPINK = Color.from_string('hotpink') - {{< /tab >}} - {{< tab header="JavaScript" >}} -// Essa funcionalidade não está implementada - Nos ajude enviando um PR implementando essa funcionalidade - {{< /tab >}} - {{< tab header="Kotlin" >}} -private val BLACK = Color.fromString("black") -private val CHOCOLATE = Color.fromString("chocolate") -private val HOTPINK = Color.fromString("hotpink") - {{< /tab >}} -{{< /tabpane >}} - -Às vezes, os navegadores retornam um valor de cor "transparent" -se nenhuma cor foi definida em um elemento. -A classe Color também oferece suporte para isso: - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -private final Color TRANSPARENT = Color.fromString("transparent"); - {{< /tab >}} - {{< tab header="Python" >}} -TRANSPARENT = Color.from_string('transparent') - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -TRANSPARENT = Color.from_string('transparent') - {{< /tab >}} - {{< tab header="JavaScript" >}} -// Essa funcionalidade não está implementada - Nos ajude enviando um PR implementando essa funcionalidade - {{< /tab >}} - {{< tab header="Kotlin" >}} -private val TRANSPARENT = Color.fromString("transparent") - {{< /tab >}} -{{< /tabpane >}} - -Agora você pode consultar com segurança um elemento -para obter sua cor / cor de fundo sabendo que -qualquer resposta será analisada corretamente -e convertido em um objeto Color válido: - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -Color loginButtonColour = Color.fromString(driver.findElement(By.id("login")).getCssValue("color")); - -Color loginButtonBackgroundColour = Color.fromString(driver.findElement(By.id("login")).getCssValue("background-color")); - {{< /tab >}} - {{< tab header="Python" >}} -login_button_colour = Color.from_string(driver.find_element(By.ID,'login').value_of_css_property('color')) - -login_button_background_colour = Color.from_string(driver.find_element(By.ID,'login').value_of_css_property('background-color')) - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -login_button_colour = Color.from_string(driver.find_element(id: 'login').css_value('color')) - -login_button_background_colour = Color.from_string(driver.find_element(id: 'login').css_value('background-color')) - {{< /tab >}} - {{< tab header="JavaScript" >}} -// Essa funcionalidade não está implementada - Nos ajude enviando um PR implementando essa funcionalidade - {{< /tab >}} - {{< tab header="Kotlin" >}} -val loginButtonColour = Color.fromString(driver.findElement(By.id("login")).getCssValue("color")) - -val loginButtonBackgroundColour = Color.fromString(driver.findElement(By.id("login")).getCssValue("background-color")) - {{< /tab >}} -{{< /tabpane >}} - -Você pode então comparar diretamente os objetos coloridos: - - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -assert loginButtonBackgroundColour.equals(HOTPINK); - {{< /tab >}} - {{< tab header="Python" >}} -assert login_button_background_colour == HOTPINK - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -assert(login_button_background_colour == HOTPINK) - {{< /tab >}} - {{< tab header="JavaScript" >}} -// Essa funcionalidade não está implementada - Nos ajude enviando um PR implementando essa funcionalidade - {{< /tab >}} - {{< tab header="Kotlin" >}} -assert(loginButtonBackgroundColour.equals(HOTPINK)) - {{< /tab >}} -{{< /tabpane >}} - -Ou você pode converter a cor em um dos seguintes formatos -e realizar uma validação estática: - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -assert loginButtonBackgroundColour.asHex().equals("#ff69b4"); -assert loginButtonBackgroundColour.asRgba().equals("rgba(255, 105, 180, 1)"); -assert loginButtonBackgroundColour.asRgb().equals("rgb(255, 105, 180)"); - {{< /tab >}} - {{< tab header="Python" >}} -assert login_button_background_colour.hex == '#ff69b4' -assert login_button_background_colour.rgba == 'rgba(255, 105, 180, 1)' -assert login_button_background_colour.rgb == 'rgb(255, 105, 180)' - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -assert(login_button_background_colour.hex == '#ff69b4') -assert(login_button_background_colour.rgba == 'rgba(255, 105, 180, 1)') -assert(login_button_background_colour.rgb == 'rgb(255, 105, 180)') - {{< /tab >}} - {{< tab header="JavaScript" >}} -// Essa funcionalidade não está implementada - Nos ajude enviando um PR implementando essa funcionalidade - {{< /tab >}} - {{< tab header="Kotlin" >}} -assert(loginButtonBackgroundColour.asHex().equals("#ff69b4")) -assert(loginButtonBackgroundColour.asRgba().equals("rgba(255, 105, 180, 1)")) -assert(loginButtonBackgroundColour.asRgb().equals("rgb(255, 105, 180)")) - {{< /tab >}} -{{< /tabpane >}} - -As cores não são mais um problema. diff --git a/website_and_docs/content/documentation/webdriver/support_features/colors.zh-cn.md b/website_and_docs/content/documentation/webdriver/support_features/colors.zh-cn.md deleted file mode 100644 index 53e166a81f2b..000000000000 --- a/website_and_docs/content/documentation/webdriver/support_features/colors.zh-cn.md +++ /dev/null @@ -1,225 +0,0 @@ ---- -title: "同颜色一起工作" -linkTitle: "颜色" -weight: 3 -aliases: [ -"/documentation/support_packages/working_with_colours/", -"/documentation/webdriver/additional_features/working_with_colours/" -] ---- - -在测试中, 您偶尔会需要验证某事物的颜色;问题是网络上的颜色定义不是个常量. -如果有一种简单的方法可以比较颜色的十六进制与RGB呈现, 或者颜色的RGBA与HSLA呈现, 岂不美哉? - -不用担心有一个解决方案:_Color_ 类! - -首先, 您需要导入该类: - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -import org.openqa.selenium.support.Color; - {{< /tab >}} - {{< tab header="Python" >}} -from selenium.webdriver.support.color import Color - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -include Selenium::WebDriver::Support - {{< /tab >}} - {{< tab header="JavaScript" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Kotlin" >}}import org.openqa.selenium.support.Color{{< /tab >}} -{{< /tabpane >}} - -您现在可以开始创建颜色对象. 每个颜色对象都需要使用您颜色的字符串定义来创建. 支持的颜色定义如下: - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -private final Color HEX_COLOUR = Color.fromString("#2F7ED8"); -private final Color RGB_COLOUR = Color.fromString("rgb(255, 255, 255)"); -private final Color RGB_COLOUR = Color.fromString("rgb(40%, 20%, 40%)"); -private final Color RGBA_COLOUR = Color.fromString("rgba(255, 255, 255, 0.5)"); -private final Color RGBA_COLOUR = Color.fromString("rgba(40%, 20%, 40%, 0.5)"); -private final Color HSL_COLOUR = Color.fromString("hsl(100, 0%, 50%)"); -private final Color HSLA_COLOUR = Color.fromString("hsla(100, 0%, 50%, 0.5)"); - {{< /tab >}} - {{< tab header="Python" >}} -HEX_COLOUR = Color.from_string('#2F7ED8') -RGB_COLOUR = Color.from_string('rgb(255, 255, 255)') -RGB_COLOUR = Color.from_string('rgb(40%, 20%, 40%)') -RGBA_COLOUR = Color.from_string('rgba(255, 255, 255, 0.5)') -RGBA_COLOUR = Color.from_string('rgba(40%, 20%, 40%, 0.5)') -HSL_COLOUR = Color.from_string('hsl(100, 0%, 50%)') -HSLA_COLOUR = Color.from_string('hsla(100, 0%, 50%, 0.5)') - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -HEX_COLOUR = Color.from_string('#2F7ED8') -RGB_COLOUR = Color.from_string('rgb(255, 255, 255)') -RGB_COLOUR = Color.from_string('rgb(40%, 20%, 40%)') -RGBA_COLOUR = Color.from_string('rgba(255, 255, 255, 0.5)') -RGBA_COLOUR = Color.from_string('rgba(40%, 20%, 40%, 0.5)') -HSL_COLOUR = Color.from_string('hsl(100, 0%, 50%)') -HSLA_COLOUR = Color.from_string('hsla(100, 0%, 50%, 0.5)') - {{< /tab >}} - {{< tab header="JavaScript" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Kotlin" >}} -private val HEX_COLOUR = Color.fromString("#2F7ED8") -private val RGB_COLOUR = Color.fromString("rgb(255, 255, 255)") -private val RGB_COLOUR_PERCENT = Color.fromString("rgb(40%, 20%, 40%)") -private val RGBA_COLOUR = Color.fromString("rgba(255, 255, 255, 0.5)") -private val RGBA_COLOUR_PERCENT = Color.fromString("rgba(40%, 20%, 40%, 0.5)") -private val HSL_COLOUR = Color.fromString("hsl(100, 0%, 50%)") -private val HSLA_COLOUR = Color.fromString("hsla(100, 0%, 50%, 0.5)") - {{< /tab >}} -{{< /tabpane >}} - -Color类还支持在以下网址中指定的所有基本颜色定义 -[http://www.w3.org/TR/css3-color/#html4](//www.w3.org/TR/css3-color/#html4). - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -private final Color BLACK = Color.fromString("black"); -private final Color CHOCOLATE = Color.fromString("chocolate"); -private final Color HOTPINK = Color.fromString("hotpink"); - {{< /tab >}} - {{< tab header="Python" >}} -BLACK = Color.from_string('black') -CHOCOLATE = Color.from_string('chocolate') -HOTPINK = Color.from_string('hotpink') - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -BLACK = Color.from_string('black') -CHOCOLATE = Color.from_string('chocolate') -HOTPINK = Color.from_string('hotpink') - {{< /tab >}} - {{< tab header="JavaScript" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Kotlin" >}} -private val BLACK = Color.fromString("black") -private val CHOCOLATE = Color.fromString("chocolate") -private val HOTPINK = Color.fromString("hotpink") - {{< /tab >}} -{{< /tabpane >}} - -如果元素上未设置颜色, 则有时浏览器会返回“透明”的颜色值. Color类也支持此功能: - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -private final Color TRANSPARENT = Color.fromString("transparent"); - {{< /tab >}} - {{< tab header="Python" >}} -TRANSPARENT = Color.from_string('transparent') - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -TRANSPARENT = Color.from_string('transparent') - {{< /tab >}} - {{< tab header="JavaScript" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Kotlin" >}} -private val TRANSPARENT = Color.fromString("transparent") - {{< /tab >}} -{{< /tabpane >}} - -现在, 您可以安全地查询元素以获取其颜色/背景色, 任何响应都将被正确解析并转换为有效的Color对象: - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -Color loginButtonColour = Color.fromString(driver.findElement(By.id("login")).getCssValue("color")); - -Color loginButtonBackgroundColour = Color.fromString(driver.findElement(By.id("login")).getCssValue("background-color")); - {{< /tab >}} - {{< tab header="Python" >}} -login_button_colour = Color.from_string(driver.find_element(By.ID,'login').value_of_css_property('color')) - -login_button_background_colour = Color.from_string(driver.find_element(By.ID,'login').value_of_css_property('background-color')) - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -login_button_colour = Color.from_string(driver.find_element(id: 'login').css_value('color')) - -login_button_background_colour = Color.from_string(driver.find_element(id: 'login').css_value('background-color')) - {{< /tab >}} - {{< tab header="JavaScript" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Kotlin" >}} -val loginButtonColour = Color.fromString(driver.findElement(By.id("login")).getCssValue("color")) - -val loginButtonBackgroundColour = Color.fromString(driver.findElement(By.id("login")).getCssValue("background-color")) - {{< /tab >}} -{{< /tabpane >}} - -然后, 您可以直接比较颜色对象: - - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -assert loginButtonBackgroundColour.equals(HOTPINK); - {{< /tab >}} - {{< tab header="Python" >}} -assert login_button_background_colour == HOTPINK - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -assert(login_button_background_colour == HOTPINK) - {{< /tab >}} - {{< tab header="JavaScript" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Kotlin" >}} -assert(loginButtonBackgroundColour.equals(HOTPINK)) - {{< /tab >}} -{{< /tabpane >}} - -或者, 您可以将颜色转换为以下格式之一并执行静态验证: - -{{< tabpane langEqualsHeader=true >}} - {{< tab header="Java" >}} -assert loginButtonBackgroundColour.asHex().equals("#ff69b4"); -assert loginButtonBackgroundColour.asRgba().equals("rgba(255, 105, 180, 1)"); -assert loginButtonBackgroundColour.asRgb().equals("rgb(255, 105, 180)"); - {{< /tab >}} - {{< tab header="Python" >}} -assert login_button_background_colour.hex == '#ff69b4' -assert login_button_background_colour.rgba == 'rgba(255, 105, 180, 1)' -assert login_button_background_colour.rgb == 'rgb(255, 105, 180)' - {{< /tab >}} - {{< tab header="CSharp" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Ruby" >}} -assert(login_button_background_colour.hex == '#ff69b4') -assert(login_button_background_colour.rgba == 'rgba(255, 105, 180, 1)') -assert(login_button_background_colour.rgb == 'rgb(255, 105, 180)') - {{< /tab >}} - {{< tab header="JavaScript" >}} -// This feature is not implemented - Help us by sending a pr to implement this feature - {{< /tab >}} - {{< tab header="Kotlin" >}} -assert(loginButtonBackgroundColour.asHex().equals("#ff69b4")) -assert(loginButtonBackgroundColour.asRgba().equals("rgba(255, 105, 180, 1)")) -assert(loginButtonBackgroundColour.asRgb().equals("rgb(255, 105, 180)")) - {{< /tab >}} -{{< /tabpane >}} - -颜色不再是问题. diff --git a/website_and_docs/content/documentation/webdriver/support_features/expected_conditions.ja.md b/website_and_docs/content/documentation/webdriver/support_features/expected_conditions.ja.md index 2513b3eeb5df..d050cb6c82bb 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/expected_conditions.ja.md +++ b/website_and_docs/content/documentation/webdriver/support_features/expected_conditions.ja.md @@ -6,7 +6,7 @@ description: > These are classes used to describe what needs to be waited for. --- -Expected Conditions are used with [Explicit Waits]({{< ref "../waits#explicit-waits" >}}). +Expected Conditions are used with [Explicit Waits]({{< ref path="../waits#explicit-waits" lang="en" >}}). Instead of defining the block of code to be executed with a _lambda_, an expected conditions method can be created to represent common things that get waited on. Some methods take locators as arguments, others take elements as arguments. diff --git a/website_and_docs/content/documentation/webdriver/support_features/expected_conditions.pt-br.md b/website_and_docs/content/documentation/webdriver/support_features/expected_conditions.pt-br.md index 4fc55ec35984..2b684e5b28f1 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/expected_conditions.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/support_features/expected_conditions.pt-br.md @@ -6,7 +6,7 @@ description: > These are classes used to describe what needs to be waited for. --- -Expected Conditions are used with [Explicit Waits]({{< ref "../waits#explicit-waits" >}}). +Expected Conditions are used with [Explicit Waits]({{< ref path="../waits#explicit-waits" lang="en" >}}). Instead of defining the block of code to be executed with a _lambda_, an expected conditions method can be created to represent common things that get waited on. Some methods take locators as arguments, others take elements as arguments. diff --git a/website_and_docs/content/documentation/webdriver/support_features/expected_conditions.zh-cn.md b/website_and_docs/content/documentation/webdriver/support_features/expected_conditions.zh-cn.md index 9e1db265772b..a53675ac5c6b 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/expected_conditions.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/support_features/expected_conditions.zh-cn.md @@ -6,7 +6,7 @@ description: > 本文档描述了一系列类, 这些类用于明确指定在测试中需要等待的各种条件. --- -期望状态与 [显示等待]({{< ref "../waits#explicit-waits" >}}) 一起使用. +期望状态与 [显示等待]({{< ref path="../waits#explicit-waits" lang="en" >}}) 一起使用. 与其定义要使用 _lambda_ 执行的代码块, 不如使用 _lambda_ 执行可以创建 Conditions 方法来表示等待的常见事物. 有些方法将定位器作为参数, 有些方法将元素作为参数. diff --git a/website_and_docs/content/documentation/webdriver/support_features/select_lists.en.md b/website_and_docs/content/documentation/webdriver/support_features/select_lists.en.md index 745894d95a46..476ddca7156a 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/select_lists.en.md +++ b/website_and_docs/content/documentation/webdriver/support_features/select_lists.en.md @@ -9,7 +9,19 @@ aliases: [ "/documentation/webdriver/elements/select_list", "/documentation/ja/support_packages/working_with_select_elements/", "/documentation/pt-br/support_packages/working_with_select_elements/", -"/documentation/zh-cn/support_packages/working_with_select_elements/" +"/documentation/zh-cn/support_packages/working_with_select_elements/", +"/ja/documentation/support_packages/working_with_select_elements/", +"/ja/documentation/webdriver/elements/select_elements/", +"/ja/documentation/webdriver/elements/select_list", +"/ja/documentation/webdriver/support_features/select_lists/", +"/pt-br/documentation/support_packages/working_with_select_elements/", +"/pt-br/documentation/webdriver/elements/select_elements/", +"/pt-br/documentation/webdriver/elements/select_list", +"/pt-br/documentation/webdriver/support_features/select_lists/", +"/zh-cn/documentation/support_packages/working_with_select_elements/", +"/zh-cn/documentation/webdriver/elements/select_elements/", +"/zh-cn/documentation/webdriver/elements/select_list", +"/zh-cn/documentation/webdriver/support_features/select_lists/" ] description: > Select lists have special behaviors compared to other elements. diff --git a/website_and_docs/content/documentation/webdriver/support_features/select_lists.ja.md b/website_and_docs/content/documentation/webdriver/support_features/select_lists.ja.md deleted file mode 100644 index 1140dfbd7d59..000000000000 --- a/website_and_docs/content/documentation/webdriver/support_features/select_lists.ja.md +++ /dev/null @@ -1,276 +0,0 @@ ---- -title: "選択要素の操作" -linkTitle: "選択要素の操作" -weight: 5 -aliases: [ -"/documentation/support_packages/working_with_select_elements/", -"/documentation/webdriver/elements/select_elements/", -"/documentation/webdriver/elements/select_list" -] -description: > - 選択リストには、他の要素と比較して特別な動作があります。 ---- - -The Select object will now give you a series of commands -that allow you to interact with a `` element is being worked with. - -### Single select - -This is the standard drop-down object where one and only one option may be selected. - -```html - -``` - -### Multiple select - -This select list allows selecting and deselecting more than one option at a time. -This only applies to ` - - - - - -``` - -## Create class - -First locate a `` element is disabled. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L23-L24" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L9-L10" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L23-L24" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L13-L14" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L18-L19" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L20-L21" >}} -{{< /tab >}} -{{< /tabpane >}} - -## List options - -There are two lists that can be obtained: - -### All options - -Get a list of all options in the `` element. For a standard select list -this will only be a list with one element, for a multiple select list it can contain -zero or many elements. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L54" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L40" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L56" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L43" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L51" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L51" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Select option - -The Select class provides three ways to select an option. -Note that for multiple select type Select lists, you can repeat these methods -for each element you want to select. - -### Text - -Select the option based on its visible text - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L30" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L16" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L30" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L20" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L25" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L27" >}} -{{< /tab >}} -{{< /tabpane >}} - -### Value - -Select the option based on its value attribute - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L33" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L19" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L33" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L23" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L28" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L30" >}} -{{< /tab >}} -{{< /tabpane >}} - -### Index - -Select the option based on its position in the list - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L36" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L22" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L36" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L26" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L31" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L33" >}} -{{< /tab >}} -{{< /tabpane >}} - -### Disabled options - -{{< badge-version version="4.5" >}} - -Options with a `disabled` attribute may not be selected. - -```html - -``` - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L77-L79" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L60-L61" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L77" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L62-L64" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L73-L76" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L74-L76" >}} -{{< /tab >}} -{{< /tabpane >}} - -## De-select option - -Only multiple select type select lists can have options de-selected. -You can repeat these methods for each element you want to select. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L66" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L49" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L65" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L52" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L63" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L63" >}} -{{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/support_features/select_lists.pt-br.md b/website_and_docs/content/documentation/webdriver/support_features/select_lists.pt-br.md deleted file mode 100644 index 7c5f27b79611..000000000000 --- a/website_and_docs/content/documentation/webdriver/support_features/select_lists.pt-br.md +++ /dev/null @@ -1,277 +0,0 @@ ---- -title: "Trabalhando com elementos select" -linkTitle: "Trabalhando com elementos select" -weight: 10 -needsTranslation: true -aliases: [ -"/documentation/support_packages/working_with_select_elements/", -"/documentation/webdriver/elements/select_elements/", -"/documentation/webdriver/elements/select_list" -] -description: > - Select lists have special behaviors compared to other elements. ---- - -The Select object will now give you a series of commands -that allow you to interact with a `` element is being worked with. - -### Single select - -This is the standard drop-down object where one and only one option may be selected. - -```html - -``` - -### Multiple select - -This select list allows selecting and deselecting more than one option at a time. -This only applies to ` - - - - - -``` - -## Create class - -First locate a `` element is disabled. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L23-L24" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L9-L10" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L23-L24" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L13-L14" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L18-L19" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L20-L21" >}} -{{< /tab >}} -{{< /tabpane >}} - -## List options - -There are two lists that can be obtained: - -### All options - -Get a list of all options in the `` element. For a standard select list -this will only be a list with one element, for a multiple select list it can contain -zero or many elements. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L54" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L40" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L56" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L43" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L51" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L51" >}} -{{< /tab >}} -{{< /tabpane >}} - -## Select option - -The Select class provides three ways to select an option. -Note that for multiple select type Select lists, you can repeat these methods -for each element you want to select. - -### Text - -Select the option based on its visible text - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L30" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L16" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L30" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L20" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L25" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L27" >}} -{{< /tab >}} -{{< /tabpane >}} - -### Value - -Select the option based on its value attribute - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L33" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L19" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L33" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L23" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L28" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L30" >}} -{{< /tab >}} -{{< /tabpane >}} - -### Index - -Select the option based on its position in the list - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L36" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L22" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L36" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L26" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L31" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L33" >}} -{{< /tab >}} -{{< /tabpane >}} - -### Disabled options - -{{< badge-version version="4.5" >}} - -Options with a `disabled` attribute may not be selected. - -```html - -``` - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L77-L79" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L60-L61" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L77" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L62-L64" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L73-L76" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L74-L76" >}} -{{< /tab >}} -{{< /tabpane >}} - -## De-select option - -Only multiple select type select lists can have options de-selected. -You can repeat these methods for each element you want to select. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L66" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L49" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L65" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L52" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L63" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L63" >}} -{{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/support_features/select_lists.zh-cn.md b/website_and_docs/content/documentation/webdriver/support_features/select_lists.zh-cn.md deleted file mode 100644 index 0b1fbd975bed..000000000000 --- a/website_and_docs/content/documentation/webdriver/support_features/select_lists.zh-cn.md +++ /dev/null @@ -1,281 +0,0 @@ ---- -title: "使用选择列表元素" -linkTitle: "选择列表" -weight: 10 -aliases: [ -"/documentation/support_packages/working_with_select_elements/", -"/documentation/webdriver/elements/select_elements/", -"/documentation/webdriver/elements/select_list" -] -description: > - 与其他元素相比,选择列表具有特殊的行为. ---- - -Select对象现在将为您提供一系列命令, -用于允许您与 `` 元素的类型. - -### 单选 - -这是标准的下拉对象,其只能选定一个选项. - -```html - -``` - -### 复选 - -此选择列表允许同时选定和取消选择多个选项. -这仅适用于具有 `multiple` 属性的 ` - - - - - -``` - -## 构建类 - -首先定位一个 `` 元素构建 `Select` 对象. - - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L23-L24" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L9-L10" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L23-L24" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L13-L14" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L18-L19" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L20-L21" >}} -{{< /tab >}} -{{< /tabpane >}} - -## 选项列表 - -共有两种列表可以被获取: - -### 全部选项 - -获取 `` 元素中所选中的选项列表. -对于标准选择列表这将只是一个包含一个元素的列表, -对于复选列表则表示包含的零个或多个元素. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L54" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L40" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L56" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L43" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L51" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L51" >}} -{{< /tab >}} -{{< /tabpane >}} - -## 选项 - -Select类提供了三种选择选项的方法. -请注意, 对于复选类型的选择列, -对于要选择的每个元素可以重复使用这些方法. - -### 文本 - -根据其可见文本选择选项 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L30" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L16" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L30" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L20" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L25" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L27" >}} -{{< /tab >}} -{{< /tabpane >}} - -### 值 - -根据其值属性选择选项 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L33" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L19" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L33" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L23" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L28" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L30" >}} -{{< /tab >}} -{{< /tabpane >}} - -### 序号 - -根据其在列表中的位置选择选项 - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L36" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L22" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L36" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L26" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L31" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L33" >}} -{{< /tab >}} -{{< /tabpane >}} - -### 禁用的选项 - -{{< badge-version version="4.5" >}} - -具有 `disabled` 属性的选项可能无法被选择. - -```html - -``` - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L77-L79" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L60-L61" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L77" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L62-L64" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L73-L76" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L74-L76" >}} -{{< /tab >}} -{{< /tabpane >}} - -## 取消选择选项 - -只有复选类型的选择列表才能取消选择选项. -您可以对要选择的每个元素重复使用这些方法. - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/support/SelectListTest.java#L66" >}} -{{< /tab >}} -{{% tab header="Python" %}} -{{< gh-codeblock path="/examples/python/tests/support/test_select_list.py#L49" >}} -{{% /tab %}} -{{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Support/SelectListTest.cs#L65" >}} -{{< /tab >}} -{{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/support/select_list_spec.rb#L52" >}} -{{< /tab >}} -{{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/select/selectListTest.spec.js#L63" >}} -{{< /tab >}} -{{< tab header="Kotlin" >}} -{{< gh-codeblock path="/examples/kotlin/src/test/kotlin/dev/selenium/support/SelectListTest.kt#L63" >}} -{{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/support_features/thread_guard.en.md b/website_and_docs/content/documentation/webdriver/support_features/thread_guard.en.md index a194249f7ceb..80d082f1e4ae 100644 --- a/website_and_docs/content/documentation/webdriver/support_features/thread_guard.en.md +++ b/website_and_docs/content/documentation/webdriver/support_features/thread_guard.en.md @@ -8,7 +8,16 @@ aliases: [ "/documentation/webdriver/additional_features/thread_guard/", "/documentation/ja/support_classes/", "/documentation/pt-br/support_classes/", -"/documentation/zh-cn/support_classes/" +"/documentation/zh-cn/support_classes/", +"/ja/documentation/support_packages/thread_guard/", +"/ja/documentation/webdriver/additional_features/thread_guard/", +"/ja/documentation/webdriver/support_features/thread_guard/", +"/pt-br/documentation/support_packages/thread_guard/", +"/pt-br/documentation/webdriver/additional_features/thread_guard/", +"/pt-br/documentation/webdriver/support_features/thread_guard/", +"/zh-cn/documentation/support_packages/thread_guard/", +"/zh-cn/documentation/webdriver/additional_features/thread_guard/", +"/zh-cn/documentation/webdriver/support_features/thread_guard/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/support_features/thread_guard.ja.md b/website_and_docs/content/documentation/webdriver/support_features/thread_guard.ja.md deleted file mode 100644 index 22e8f12dc836..000000000000 --- a/website_and_docs/content/documentation/webdriver/support_features/thread_guard.ja.md +++ /dev/null @@ -1,62 +0,0 @@ ---- -title: "ThreadGuard" -linkTitle: "ThreadGuard" -weight: 6 -aliases: [ -"/documentation/support_packages/thread_guard/", -"/documentation/webdriver/additional_features/thread_guard/" -] ---- - -{{% pageinfo color="info" %}} -

- このクラスは、Javaバインディングでのみ使用可能です。 -

-{{% /pageinfo %}} - -ThreadGuardは、ドライバーが、それを作成した同じスレッドからのみ呼び出されることを確認します。 -特に並行してテストを実行する場合のスレッドの問題は、不可解でエラーの診断が難しい場合があります。 -このラッパーを使用すると、このカテゴリのエラーが防止され、発生時に例外が発生します。 - -次の例は、スレッドの衝突をシミュレートします。 -```java -public class DriverClash { - //thread main (id 1) created this driver - private WebDriver protectedDriver = ThreadGuard.protect(new ChromeDriver()); - - static { - System.setProperty("webdriver.chrome.driver", ""); - } - - //Thread-1 (id 24) is calling the same driver causing the clash to happen - Runnable r1 = () -> {protectedDriver.get("https://selenium.dev");}; - Thread thr1 = new Thread(r1); - - void runThreads(){ - thr1.start(); - } - - public static void main(String[] args) { - new DriverClash().runThreads(); - } -} -``` - -結果は以下のとおりです。 -```text -Exception in thread "Thread-1" org.openqa.selenium.WebDriverException: -Thread safety error; this instance of WebDriver was constructed -on thread main (id 1)and is being accessed by thread Thread-1 (id 24) -This is not permitted and *will* cause undefined behaviour - -``` -下記例を参照してください。 - - * `protectedDriver` はメインスレッドで作成されます - * Java `Runnable`を使用して新しいプロセスを起動し、新しい`スレッド`を使用してプロセスを実行します - * メインスレッドのメモリに`protectedDriver`がないため、両方の`スレッド`が衝突します。 - * `ThreadGuard.protect`は例外をスローします。 - -#### 注意: - -これは、並列実行時にドライバーを管理するために `ThreadLocal`を使用する必要性を置き換えるものではありません。 diff --git a/website_and_docs/content/documentation/webdriver/support_features/thread_guard.pt-br.md b/website_and_docs/content/documentation/webdriver/support_features/thread_guard.pt-br.md deleted file mode 100644 index a8a7988c567f..000000000000 --- a/website_and_docs/content/documentation/webdriver/support_features/thread_guard.pt-br.md +++ /dev/null @@ -1,64 +0,0 @@ ---- -title: "ThreadGuard" -linkTitle: "ThreadGuard" -weight: 6 -aliases: [ -"/documentation/support_packages/thread_guard/", -"/documentation/webdriver/additional_features/thread_guard/" -] ---- - -{{% pageinfo color="info" %}} -

- Esta classe está disponível apenas no Java Binding -

-{{% /pageinfo %}} - -ThreadGuard verifica se um driver é chamado apenas da mesma thread que o criou. -Problemas de threading, especialmente durante a execução de testes em paralelo, podem ter erros misteriosos -e difíceis de diagnosticar. Usar este wrapper evita esta categoria de erros -e gerará uma exceção quando isso acontecer. - -O exemplo a seguir simula um conflito de threads: - -```java -public class DriverClash { - //thread main (id 1) criou este driver - private WebDriver protectedDriver = ThreadGuard.protect(new ChromeDriver()); - - static { - System.setProperty("webdriver.chrome.driver", ""); - } - - //Thread-1 (id 24) está chamando o mesmo driver causando o conflito - Runnable r1 = () -> {protectedDriver.get("https://selenium.dev");}; - Thread thr1 = new Thread(r1); - - void runThreads(){ - thr1.start(); - } - - public static void main(String[] args) { - new DriverClash().runThreads(); - } -} -``` - -O resultado mostrado abaixo: -```text -Exception in thread "Thread-1" org.openqa.selenium.WebDriverException: -Thread safety error; this instance of WebDriver was constructed -on thread main (id 1)and is being accessed by thread Thread-1 (id 24) -This is not permitted and *will* cause undefined behaviour - -``` -Conforme visto no exemplo: - -* `protectedDriver` será criado no tópico principal -* Usamos Java `Runnable` para ativar um novo processo e uma nova `Thread` para executar o processo -* Ambas as `Thread`s entrarão em conflito porque a thread principal não tem `protectedDriver` em sua memória. -* `ThreadGuard.protect` lançará uma exceção. - -#### Nota: - -Isso não substitui a necessidade de usar `ThreadLocal` para gerenciar drivers durante a execução em paralelo. diff --git a/website_and_docs/content/documentation/webdriver/support_features/thread_guard.zh-cn.md b/website_and_docs/content/documentation/webdriver/support_features/thread_guard.zh-cn.md deleted file mode 100644 index 2d6c9f0681d6..000000000000 --- a/website_and_docs/content/documentation/webdriver/support_features/thread_guard.zh-cn.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -title: "线程守卫" -linkTitle: "线程守卫" -weight: 6 -aliases: [ -"/documentation/support_packages/thread_guard/", -"/documentation/webdriver/additional_features/thread_guard/" -] ---- - -{{% pageinfo color="info" %}} -

- 此类仅在Java中可用 -

-{{% /pageinfo %}} - -ThreadGuard检查是否仅从创建驱动程序的同一线程中调用了驱动程序. -线程问题 (尤其是在Parallel中运行测试时) -可能遇到神秘并且难以诊断错误. -使用此包装器可以防止此类错误, -并且在发生此类情况时会抛出异常. - -以下的示例模拟一种线程冲突的情况: - -```java -public class DriverClash { - //thread main (id 1) created this driver - private WebDriver protectedDriver = ThreadGuard.protect(new ChromeDriver()); - - static { - System.setProperty("webdriver.chrome.driver", ""); - } - - //Thread-1 (id 24) is calling the same driver causing the clash to happen - Runnable r1 = () -> {protectedDriver.get("https://selenium.dev");}; - Thread thr1 = new Thread(r1); - - void runThreads(){ - thr1.start(); - } - - public static void main(String[] args) { - new DriverClash().runThreads(); - } -} -``` - -结果如下所示: - -```text -Exception in thread "Thread-1" org.openqa.selenium.WebDriverException: -Thread safety error; this instance of WebDriver was constructed -on thread main (id 1)and is being accessed by thread Thread-1 (id 24) -This is not permitted and *will* cause undefined behaviour - -``` -正如示例所示: - - * `protectedDriver` 将在主线程中创建 - * 我们使用Java的 `Runnable` 启动一个新进程, 并使用一个新的 `Thread` 运行该进程 - * 这两个 `Thread` 都会发生冲突, 因为主线程的内存中没有 `protectedDriver` - * `ThreadGuard.protect` 会抛出异常 - -#### 注意: - -这不能代替并发运行时使用 `ThreadLocal` 管理驱动程序的需求. - diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/_index.ja.md b/website_and_docs/content/documentation/webdriver/troubleshooting/_index.ja.md index a0b388e8c0aa..6b68ea964357 100644 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/_index.ja.md +++ b/website_and_docs/content/documentation/webdriver/troubleshooting/_index.ja.md @@ -9,12 +9,12 @@ description: > Selenium のエラーの根本原因が、常に明らかであるとは限りません。 1. Selenium 関連で最もよくあるエラーは、不十分な同期が原因です。 -[待機戦略]({{< ref "../waits" >}})を参照してください。同期が原因かどうか確信が持てない場合は、 +[待機戦略]({{< ref path="../waits" lang="en" >}})を参照してください。同期が原因かどうか確信が持てない場合は、 問題が発生している箇所に *一時的に* 長い待機時間をハードコードしてみてください。 明示的な待機を追加することで解決できるかどうかを判断できます。 2. プロジェクトに報告されるエラーの多くは、実際には Selenium がコマンドを送信する基盤となる -ドライバーの問題によるものです。同じコマンドを複数の[ブラウザ]({{< ref "../browsers/" >}})で +ドライバーの問題によるものです。同じコマンドを複数の[ブラウザ]({{< ref path="../browsers/" lang="en" >}})で 実行することで、ドライバーに問題があるかどうかを切り分けられます。 3. 操作方法について質問がある場合は、支援を受ける方法として[サポートオプション](/support/)を diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/troubleshooting/_index.pt-br.md index 428fc3eaba6d..4f16e5b7e795 100644 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/_index.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/troubleshooting/_index.pt-br.md @@ -9,13 +9,13 @@ description: > It is not always obvious the root cause of errors in Selenium. 1. The most common Selenium-related error is a result of poor synchronization. -Read about [Waiting Strategies]({{< ref "../waits" >}}). If you aren't sure if it +Read about [Waiting Strategies]({{< ref path="../waits" lang="en" >}}). If you aren't sure if it is a synchronization strategy you can try *temporarily* hard coding a large sleep where you see the issue, and you'll know if adding an explicit wait can help. 2. Note that many errors that get reported to the project are actually caused by issues in the underlying drivers that Selenium sends the commands to. You can rule -out a driver problem by executing the command in multiple [browsers]({{< ref "../browsers/" >}}). +out a driver problem by executing the command in multiple [browsers]({{< ref path="../browsers/" lang="en" >}}). 3. If you have questions about how to do things, check out the [Support options](/support/) for ways get assistance. diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/troubleshooting/_index.zh-cn.md index 8d33a7c775fb..8e38865f453c 100644 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/_index.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/troubleshooting/_index.zh-cn.md @@ -9,14 +9,14 @@ description: > Selenium错误的根本原因并不总是很明显. 1. 最常见的Selenium相关错误, 是源自未及时同步的结果. - 请阅读 [等待策略]({{< ref "../waits" >}}). + 请阅读 [等待策略]({{< ref path="../waits" lang="en" >}}). 当遇到一个问题, 如果不确定是否因为同步策略, 您可以尝试*暂时*硬编码一个较大的休眠时间, 您将明确添加显式等待是否有帮助. 2. 请注意, 报告给项目的许多错误, 实际上是由Selenium向其发送命令的基础驱动程序所引起的. - 您可以通过执行 [浏览器]({{< ref "../browsers/" >}}) 中的 + 您可以通过执行 [浏览器]({{< ref path="../browsers/" lang="en" >}}) 中的 多个命令来解决驱动程序问题. 3. 如果您对如何执行有疑惑, diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.ja.md b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.ja.md index 30cea98f3d8e..bb202f311f7c 100644 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.ja.md +++ b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.ja.md @@ -38,7 +38,7 @@ The element can not be found at the exact moment you attempted to locate it. ### Possible Solutions * Make sure you are on the page you expect to be on, and that previous actions in your code completed correctly -* Make sure you are using a proper [Waiting Strategy]({{< ref "/documentation/webdriver/waits" >}}) +* Make sure you are using a proper [Waiting Strategy]({{< ref path="/documentation/webdriver/waits" lang="en" >}}) * Use an interactive [Selenium Wait Code Generator](https://99tools.net/selenium-wait-code-generator/) to create accurate explicit wait snippets for multiple supported languages including Java, Python, C#, JavaScript, and Ruby. * Update the locator with the browser's devtools console or use a browser extension like: * [SelectorsHub](https://selectorshub.com/selectorshub/) @@ -121,7 +121,7 @@ wait for animations to cease before attempting to click an element. **Use Explicit Waits** -[Explicit Waits]({{< ref "/documentation/webdriver/waits" >}}) will likely be your best friend in these instances. +[Explicit Waits]({{< ref path="/documentation/webdriver/waits" lang="en" >}}) will likely be your best friend in these instances. A great way is to use `ExpectedCondition.ToBeClickable()` with `WebDriverWait` to wait until the right moment. **Scroll the Element into View** diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.pt-br.md b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.pt-br.md index c3236615a066..65157cf74c90 100644 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.pt-br.md @@ -38,7 +38,7 @@ The element can not be found at the exact moment you attempted to locate it. ### Possible Solutions * Make sure you are on the page you expect to be on, and that previous actions in your code completed correctly -* Make sure you are using a proper [Waiting Strategy]({{< ref "/documentation/webdriver/waits" >}}) +* Make sure you are using a proper [Waiting Strategy]({{< ref path="/documentation/webdriver/waits" lang="en" >}}) * Use an interactive [Selenium Wait Code Generator](https://99tools.net/selenium-wait-code-generator/) to create accurate explicit wait snippets for multiple supported languages including Java, Python, C#, JavaScript, and Ruby. * Update the locator with the browser's devtools console or use a browser extension like: * [SelectorsHub](https://selectorshub.com/selectorshub/) @@ -121,7 +121,7 @@ to wait for animations to cease before attempting to click an element. **Use Explicit Waits** -[Explicit Waits]({{< ref "/documentation/webdriver/waits" >}}) will likely be your best friend in these instances. +[Explicit Waits]({{< ref path="/documentation/webdriver/waits" lang="en" >}}) will likely be your best friend in these instances. A great way is to use `ExpectedCondition.ToBeClickable()` with `WebDriverWait` to wait until the right moment. diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.zh-cn.md b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.zh-cn.md index 65b49b6bcc7a..2f6b0bb5b296 100644 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/_index.zh-cn.md @@ -38,7 +38,7 @@ description: > ### 可行方案 * 确保您位于期望的页面上,并且代码中的前置操作已正确完成 -* 确保您使用的是正确的 [等待策略]({{< ref "/documentation/webdriver/waits" >}}) +* 确保您使用的是正确的 [等待策略]({{< ref path="/documentation/webdriver/waits" lang="en" >}}) * Use an interactive [Selenium Wait Code Generator](https://99tools.net/selenium-wait-code-generator/) to create accurate explicit wait snippets for multiple supported languages including Java, Python, C#, JavaScript, and Ruby. * 使用浏览器的devtools控制台更新定位器或使用浏览器扩展程序,例如: * [SelectorsHub](https://selectorshub.com/selectorshub/) @@ -128,7 +128,7 @@ to wait for animations to cease before attempting to click an element. **Use Explicit Waits** -[Explicit Waits]({{< ref "/documentation/webdriver/waits" >}}) will likely be your best friend +[Explicit Waits]({{< ref path="/documentation/webdriver/waits" lang="en" >}}) will likely be your best friend in these instances. A great way is to use `ExpectedCondition.ToBeClickable()` with `WebDriverWait` to wait until the right moment. diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.en.md b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.en.md index ac9def894705..402e7a213294 100644 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.en.md +++ b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.en.md @@ -14,7 +14,16 @@ aliases: [ "/documentation/pt-br/selenium_installation/installing_webdriver_binaries/", "/documentation/pt-br/webdriver/driver_requirements/", "/documentation/zh-cn/selenium_installation/installing_webdriver_binaries/", -"/documentation/zh-cn/webdriver/driver_requirements/" +"/documentation/zh-cn/webdriver/driver_requirements/", +"/ja/documentation/getting_started/installing_browser_drivers/", +"/ja/documentation/webdriver/getting_started/install_drivers/", +"/ja/documentation/webdriver/troubleshooting/errors/driver_location/", +"/pt-br/documentation/getting_started/installing_browser_drivers/", +"/pt-br/documentation/webdriver/getting_started/install_drivers/", +"/pt-br/documentation/webdriver/troubleshooting/errors/driver_location/", +"/zh-cn/documentation/getting_started/installing_browser_drivers/", +"/zh-cn/documentation/webdriver/getting_started/install_drivers/", +"/zh-cn/documentation/webdriver/troubleshooting/errors/driver_location/" ] --- diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.ja.md b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.ja.md deleted file mode 100644 index dfc2c003701a..000000000000 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.ja.md +++ /dev/null @@ -1,158 +0,0 @@ ---- -title: "Unable to Locate Driver Error" -linkTitle: "Driver Location" -weight: 4 -needsTranslation: true -description: > - Troubleshooting missing path to driver executable. -aliases: [ -"/documentation/getting_started/installing_browser_drivers/", -"/documentation/webdriver/getting_started/install_drivers/" -] ---- - -Historically, this is the most common error beginning Selenium users get -when trying to run code for the first time: - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -The path to the driver executable must -be set by the webdriver.chrome.driver system property; -for more information, see https://chromedriver.chromium.org/. -The latest version can be downloaded from https://chromedriver.chromium.org/downloads -{{< /tab >}} -{{< tab header="Python" >}} -The executable chromedriver needs to be available in the path. -{{< /tab >}} -{{< tab header="CSharp" >}} -The file geckodriver does not exist. The driver can be downloaded at https://github.com/mozilla/geckodriver/releases" -{{< /tab >}} -{{< tab header="Ruby" >}} -Unable to locate the chromedriver executable; -{{< /tab >}} -{{< /tabpane >}} - -## Likely cause - -Through WebDriver, Selenium supports all major browsers. -In order to drive the requested browser, Selenium needs to -send commands to it via an executable driver. -This error means the necessary driver could not be -found by any of the means Selenium attempts to use. - -## Possible solutions - -There are several ways to ensure Selenium gets the driver it needs. - -### Use the latest version of Selenium - -As of Selenium 4.6, Selenium downloads the correct driver for you. -You shouldn't need to do anything. If you are using the latest version -of Selenium and you are getting an error, -please [turn on logging]({{< ref "../logging.md" >}}) -and [file a bug report](//github.com/seleniumhq/selenium/issues) with that information. - -If you want to read more information about how Selenium manages driver downloads for you, -you can read about the [Selenium Manager]({{< ref "/documentation/selenium_manager.md" >}}). - -### Use the `PATH` environment variable - -This option first requires manually [downloading the driver](#download-the-driver). - -This is a flexible option to change location of drivers without having to update your code, -and will work on multiple machines without requiring that each machine put the -drivers in the same place. - -You can either place the drivers in a directory that is already listed in `PATH`, -or you can place them in a directory and add it to `PATH`. - -{{< tabpane text=true persist=disabled >}} -{{% tab header="Bash" %}} -To see what directories are already on `PATH`, open a Terminal and execute: -```shell -echo $PATH -``` -If the location to your driver is not already in a directory listed, -you can add a new directory to PATH: -```shell -echo 'export PATH=$PATH:/path/to/driver' >> ~/.bash_profile -source ~/.bash_profile -``` -You can test if it has been added correctly by checking the version of the driver: -```shell -chromedriver --version -``` - {{% /tab %}} - {{% tab header="Zsh" %}} -To see what directories are already on `PATH`, open a Terminal and execute: -```shell -echo $PATH -``` -If the location to your driver is not already in a directory listed, -you can add a new directory to PATH: -```shell -echo 'export PATH=$PATH:/path/to/driver' >> ~/.zshenv -source ~/.zshenv -``` -You can test if it has been added correctly by checking the version of the driver: -```shell -chromedriver --version -``` - {{% /tab %}} - {{% tab header="Windows" %}} -To see what directories are already on `PATH`, open a Command Prompt and execute: -```shell -echo %PATH% -``` -If the location to your driver is not already in a directory listed, -you can add a new directory to PATH: -```shell -setx PATH "%PATH%;C:\WebDriver\bin" -``` -You can test if it has been added correctly by checking the version of the driver: -```shell -chromedriver.exe --version -``` - {{% /tab %}} - {{< /tabpane >}} - -### Specify the location of the driver - -If you cannot upgrade to the latest version of Selenium, you -do not want Selenium to download drivers for you, and you can't figure -out the environment variables, you can specify the location of the driver in the Service object. - -You first need to [download the desired driver](#download-the-driver), -then create an instance of the applicable `Service` class and -[set the path]({{< ref "../../drivers/service/#driver-location" >}}). - -Specifying the location in the code itself has the advantage of not needing -to figure out Environment Variables on your system, but has the drawback of -making the code less flexible. - -### Driver management libraries - -Before Selenium managed drivers itself, other projects were created to -do so for you. - -If you can't use Selenium Manager because you are using -an older version of Selenium (please upgrade), -or need an advanced feature not yet implemented by Selenium Manager, -you might try one of these tools to keep your drivers automatically updated: - -* [WebDriverManager](https://github.com/bonigarcia/webdrivermanager) (Java) -* [WebDriver Manager](https://github.com/SergeyPirogov/webdriver_manager) (Python) -* [WebDriver Manager Package](https://github.com/rosolko/WebDriverManager.Net) (.NET) -* [webdrivers gem](https://github.com/titusfortner/webdrivers) (Ruby) - -## Download the driver - -| ブラウザー | サポートするOS | 維持管理機関 | ダウンロード | イシュートラッカー | -| ------- | ------------ | ------------- | -------- | ------------- | -| Chromium/Chrome | Windows/macOS/Linux | Google | [Downloads](//chromedriver.chromium.org/downloads) | [Issues](//bugs.chromium.org/p/chromedriver/issues/list) | -| Firefox | Windows/macOS/Linux | Mozilla | [Downloads](//github.com/mozilla/geckodriver/releases) | [Issues](//github.com/mozilla/geckodriver/issues) | -| Edge | Windows/macOS/Linux | Microsoft | [Downloads](//developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/) | [Issues](https://github.com/MicrosoftDocs/edge-developer/issues) | -| Internet Explorer | Windows | Selenium Project | [Downloads](/downloads) | [Issues](//github.com/SeleniumHQ/selenium/labels/D-IE) | -| Safari | macOS High Sierra and newer | Apple | Built in | [Issues](//bugreport.apple.com/logon) | - -Note: The Opera driver no longer works with the latest functionality of Selenium and is currently officially unsupported. diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.pt-br.md b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.pt-br.md deleted file mode 100644 index a5e76eac8336..000000000000 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.pt-br.md +++ /dev/null @@ -1,158 +0,0 @@ ---- -title: "Unable to Locate Driver Error" -linkTitle: "Driver Location" -weight: 4 -needsTranslation: true -description: > - Troubleshooting missing path to driver executable. -aliases: [ -"/documentation/getting_started/installing_browser_drivers/", -"/documentation/webdriver/getting_started/install_drivers/" -] ---- - -Historically, this is the most common error beginning Selenium users get -when trying to run code for the first time: - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -The path to the driver executable must -be set by the webdriver.chrome.driver system property; -for more information, see https://chromedriver.chromium.org/. -The latest version can be downloaded from https://chromedriver.chromium.org/downloads -{{< /tab >}} -{{< tab header="Python" >}} -The executable chromedriver needs to be available in the path. -{{< /tab >}} -{{< tab header="CSharp" >}} -The file geckodriver does not exist. The driver can be downloaded at https://github.com/mozilla/geckodriver/releases" -{{< /tab >}} -{{< tab header="Ruby" >}} -Unable to locate the chromedriver executable; -{{< /tab >}} -{{< /tabpane >}} - -## Likely cause - -Through WebDriver, Selenium supports all major browsers. -In order to drive the requested browser, Selenium needs to -send commands to it via an executable driver. -This error means the necessary driver could not be -found by any of the means Selenium attempts to use. - -## Possible solutions - -There are several ways to ensure Selenium gets the driver it needs. - -### Use the latest version of Selenium - -As of Selenium 4.6, Selenium downloads the correct driver for you. -You shouldn't need to do anything. If you are using the latest version -of Selenium and you are getting an error, -please [turn on logging]({{< ref "../logging.md" >}}) -and [file a bug report](//github.com/seleniumhq/selenium/issues) with that information. - -If you want to read more information about how Selenium manages driver downloads for you, -you can read about the [Selenium Manager]({{< ref "/documentation/selenium_manager.md" >}}). - -### Use the `PATH` environment variable - -This option first requires manually [downloading the driver](#download-the-driver). - -This is a flexible option to change location of drivers without having to update your code, -and will work on multiple machines without requiring that each machine put the -drivers in the same place. - -You can either place the drivers in a directory that is already listed in `PATH`, -or you can place them in a directory and add it to `PATH`. - -{{< tabpane text=true persist=disabled >}} -{{% tab header="Bash" %}} -To see what directories are already on `PATH`, open a Terminal and execute: -```shell -echo $PATH -``` -If the location to your driver is not already in a directory listed, -you can add a new directory to PATH: -```shell -echo 'export PATH=$PATH:/path/to/driver' >> ~/.bash_profile -source ~/.bash_profile -``` -You can test if it has been added correctly by checking the version of the driver: -```shell -chromedriver --version -``` - {{% /tab %}} - {{% tab header="Zsh" %}} -To see what directories are already on `PATH`, open a Terminal and execute: -```shell -echo $PATH -``` -If the location to your driver is not already in a directory listed, -you can add a new directory to PATH: -```shell -echo 'export PATH=$PATH:/path/to/driver' >> ~/.zshenv -source ~/.zshenv -``` -You can test if it has been added correctly by checking the version of the driver: -```shell -chromedriver --version -``` - {{% /tab %}} - {{% tab header="Windows" %}} -To see what directories are already on `PATH`, open a Command Prompt and execute: -```shell -echo %PATH% -``` -If the location to your driver is not already in a directory listed, -you can add a new directory to PATH: -```shell -setx PATH "%PATH%;C:\WebDriver\bin" -``` -You can test if it has been added correctly by checking the version of the driver: -```shell -chromedriver.exe --version -``` - {{% /tab %}} - {{< /tabpane >}} - -### Specify the location of the driver - -If you cannot upgrade to the latest version of Selenium, you -do not want Selenium to download drivers for you, and you can't figure -out the environment variables, you can specify the location of the driver in the Service object. - -You first need to [download the desired driver](#download-the-driver), -then create an instance of the applicable `Service` class and -[set the path]({{< ref "../../drivers/service/#driver-location" >}}). - -Specifying the location in the code itself has the advantage of not needing -to figure out Environment Variables on your system, but has the drawback of -making the code less flexible. - -### Driver management libraries - -Before Selenium managed drivers itself, other projects were created to -do so for you. - -If you can't use Selenium Manager because you are using -an older version of Selenium (please upgrade), -or need an advanced feature not yet implemented by Selenium Manager, -you might try one of these tools to keep your drivers automatically updated: - -* [WebDriverManager](https://github.com/bonigarcia/webdrivermanager) (Java) -* [WebDriver Manager](https://github.com/SergeyPirogov/webdriver_manager) (Python) -* [WebDriver Manager Package](https://github.com/rosolko/WebDriverManager.Net) (.NET) -* [webdrivers gem](https://github.com/titusfortner/webdrivers) (Ruby) - -## Download the driver - -| Navegador | OS Suportado | Mantido por | Download | Rastreador de Problemas | -| ------- | ------------ | ------------- | -------- | ------------- | -| Chromium/Chrome | Windows/macOS/Linux | Google | [Downloads](//chromedriver.chromium.org/downloads) | [Problemas](//bugs.chromium.org/p/chromedriver/issues/list) | -| Firefox | Windows/macOS/Linux | Mozilla | [Downloads](//github.com/mozilla/geckodriver/releases) | [Problemas](//github.com/mozilla/geckodriver/issues) | -| Edge | Windows/macOS/Linux | Microsoft | [Downloads](//developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/) | [Problemas](https://github.com/MicrosoftDocs/edge-developer/issues) | -| Internet Explorer | Windows | Projeto Selenium | [Downloads](/downloads) | [Problemas](//github.com/SeleniumHQ/selenium/labels/D-IE) | -| Safari | macOS High Sierra e superiores | Apple | Integrado no Sistema | [Problemas](//bugreport.apple.com/logon) | - -Nota: O Opera driver já não inclui as funcionalidades mais recentes do Selenium e oficialmente deixou de ser suportado. diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.zh-cn.md b/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.zh-cn.md deleted file mode 100644 index 4fd4573d6a27..000000000000 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/errors/driver_location.zh-cn.md +++ /dev/null @@ -1,158 +0,0 @@ ---- -title: "Unable to Locate Driver Error" -linkTitle: "Driver Location" -weight: 4 -description: > - Troubleshooting missing path to driver executable. -aliases: [ -"/documentation/getting_started/installing_browser_drivers/", -"/documentation/webdriver/getting_started/install_drivers/" -] ---- - -Historically, this is the most common error beginning Selenium users get -when trying to run code for the first time: - -{{< tabpane text=true >}} -{{< tab header="Java" >}} -The path to the driver executable must -be set by the webdriver.chrome.driver system property; -for more information, see https://chromedriver.chromium.org/. -The latest version can be downloaded from https://chromedriver.chromium.org/downloads -{{< /tab >}} -{{< tab header="Python" >}} -The executable chromedriver needs to be available in the path. -{{< /tab >}} -{{< tab header="CSharp" >}} -The file geckodriver does not exist. The driver can be downloaded at https://github.com/mozilla/geckodriver/releases" -{{< /tab >}} -{{< tab header="Ruby" >}} -Unable to locate the chromedriver executable; -{{< /tab >}} -{{< /tabpane >}} - -## Likely cause - -Through WebDriver, Selenium supports all major browsers. -In order to drive the requested browser, Selenium needs to -send commands to it via an executable driver. -This error means the necessary driver could not be -found by any of the means Selenium attempts to use. - -## Possible solutions - -There are several ways to ensure Selenium gets the driver it needs. - -### Use the latest version of Selenium - -As of Selenium 4.6, Selenium downloads the correct driver for you. -You shouldn't need to do anything. If you are using the latest version -of Selenium and you are getting an error, -please [turn on logging]({{< ref "../logging.md" >}}) -and [file a bug report](//github.com/seleniumhq/selenium/issues) with that information. - -If you want to read more information about how Selenium manages driver downloads for you, -you can read about the [Selenium Manager]({{< ref "/documentation/selenium_manager.md" >}}). - -### Use the `PATH` environment variable - -This option first requires manually [downloading the driver](#download-the-driver). - -This is a flexible option to change location of drivers without having to update your code, -and will work on multiple machines without requiring that each machine put the -drivers in the same place. - -You can either place the drivers in a directory that is already listed in `PATH`, -or you can place them in a directory and add it to `PATH`. - -{{< tabpane text=true persist=disabled >}} -{{% tab header="Bash" %}} -To see what directories are already on `PATH`, open a Terminal and execute: -```shell -echo $PATH -``` -If the location to your driver is not already in a directory listed, -you can add a new directory to PATH: -```shell -echo 'export PATH=$PATH:/path/to/driver' >> ~/.bash_profile -source ~/.bash_profile -``` -You can test if it has been added correctly by checking the version of the driver: -```shell -chromedriver --version -``` - {{% /tab %}} - {{% tab header="Zsh" %}} -To see what directories are already on `PATH`, open a Terminal and execute: -```shell -echo $PATH -``` -If the location to your driver is not already in a directory listed, -you can add a new directory to PATH: -```shell -echo 'export PATH=$PATH:/path/to/driver' >> ~/.zshenv -source ~/.zshenv -``` -You can test if it has been added correctly by checking the version of the driver: -```shell -chromedriver --version -``` - {{% /tab %}} - {{% tab header="Windows" %}} -To see what directories are already on `PATH`, open a Command Prompt and execute: -```shell -echo %PATH% -``` -If the location to your driver is not already in a directory listed, -you can add a new directory to PATH: -```shell -setx PATH "%PATH%;C:\WebDriver\bin" -``` -You can test if it has been added correctly by checking the version of the driver: -```shell -chromedriver.exe --version -``` - {{% /tab %}} - {{< /tabpane >}} - -### Specify the location of the driver - -If you cannot upgrade to the latest version of Selenium, you -do not want Selenium to download drivers for you, and you can't figure -out the environment variables, you can specify the location of the driver in the Service object. - -You first need to [download the desired driver](#download-the-driver), -then create an instance of the applicable `Service` class and -[set the path]({{< ref "../../drivers/service/#driver-location" >}}). - -Specifying the location in the code itself has the advantage of not needing -to figure out Environment Variables on your system, but has the drawback of -making the code less flexible. - -### Driver management libraries - -Before Selenium managed drivers itself, other projects were created to -do so for you. - -If you can't use Selenium Manager because you are using -an older version of Selenium (please upgrade), -or need an advanced feature not yet implemented by Selenium Manager, -you might try one of these tools to keep your drivers automatically updated: - -* [WebDriverManager](https://github.com/bonigarcia/webdrivermanager) (Java) -* [WebDriver Manager](https://github.com/SergeyPirogov/webdriver_manager) (Python) -* [WebDriver Manager Package](https://github.com/rosolko/WebDriverManager.Net) (.NET) -* [webdrivers gem](https://github.com/titusfortner/webdrivers) (Ruby) - - -## Download the driver - -| 浏览器 | 支持的操作系统 | 维护者 | 下载 | 问题追溯 | -|-------------------|-----------------------------|------------------|-----------------------------------------------------------------------|------------------------------------------------------------------| -| Chromium/Chrome | Windows/macOS/Linux | Google | [下载](//chromedriver.chromium.org/downloads) | [Issues](//bugs.chromium.org/p/chromedriver/issues/list) | -| Firefox | Windows/macOS/Linux | Mozilla | [下载](//github.com/mozilla/geckodriver/releases) | [Issues](//github.com/mozilla/geckodriver/issues) | -| Edge | Windows/macOS/Linux | Microsoft | [下载](//developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/) | [Issues](https://github.com/MicrosoftDocs/edge-developer/issues) | -| Internet Explorer | Windows | Selenium Project | [下载](/downloads) | [Issues](//github.com/SeleniumHQ/selenium/labels/D-IE) | -| Safari | macOS High Sierra and newer | Apple | 内置 | [Issues](//bugreport.apple.com/logon) | - -备注:Opera驱动不再适用于Selenium的最新功能,目前官方不支持。 diff --git a/website_and_docs/content/documentation/webdriver/waits.en.md b/website_and_docs/content/documentation/webdriver/waits.en.md index 921c521d32ef..cd12f96126ef 100644 --- a/website_and_docs/content/documentation/webdriver/waits.en.md +++ b/website_and_docs/content/documentation/webdriver/waits.en.md @@ -2,7 +2,11 @@ title: "Waiting Strategies" linkTitle: "Waits" weight: 6 -aliases: ["/documentation/en/webdriver/waits/", "/documentation/ja/webdriver/waits/", "/documentation/pt-br/webdriver/waits/", "/documentation/zh-cn/webdriver/waits/"] +aliases: ["/documentation/en/webdriver/waits/", "/documentation/ja/webdriver/waits/", "/documentation/pt-br/webdriver/waits/", "/documentation/zh-cn/webdriver/waits/", +"/ja/documentation/webdriver/waits/", +"/pt-br/documentation/webdriver/waits/", +"/zh-cn/documentation/webdriver/waits/" +] --- Perhaps the most common challenge for browser automation is ensuring diff --git a/website_and_docs/content/documentation/webdriver/waits.ja.md b/website_and_docs/content/documentation/webdriver/waits.ja.md deleted file mode 100644 index 55bce1e806a3..000000000000 --- a/website_and_docs/content/documentation/webdriver/waits.ja.md +++ /dev/null @@ -1,158 +0,0 @@ ---- -title: "待機" -linkTitle: "待機" -weight: 6 ---- - -Perhaps the most common challenge for browser automation is ensuring -that the web application is in a state to execute a particular -Selenium command as desired. The processes often end up in -a _race condition_ where sometimes the browser gets into the right -state first (things work as intended) and sometimes the Selenium code -executes first (things do not work as intended). This is one of the -primary causes of _flaky tests_. - -All navigation commands wait for a specific `readyState` value -based on the [page load strategy]({{< ref "drivers/options#pageloadstrategy" >}}) (the -default value to wait for is `"complete"`) before the driver returns control to the code. -The `readyState` only concerns itself with loading assets defined in the HTML, -but loaded JavaScript assets often result in changes to the site, -and elements that need to be interacted with may not yet be on the page -when the code is ready to execute the next Selenium command. - -Similarly, in a lot of single page applications, elements get dynamically -added to a page or change visibility based on a click. -An element must be both present and -[displayed]({{< ref "elements/information/#is-displayed" >}}) on the page -in order for Selenium to interact with it. - -Take this page for example: https://www.selenium.dev/selenium/web/dynamic.html -When the "Add a box!" button is clicked, a "div" element that does not exist is created. -When the "Reveal a new input" button is clicked, a hidden text field element is displayed. -In both cases the transition takes a couple seconds. -If the Selenium code is to click one of these buttons and interact with the resulting element, -it will do so before that element is ready and fail. - -The first solution many people turn to is adding a sleep statement to -pause the code execution for a set period of time. -Because the code can't know exactly how long it needs to wait, this -can fail when it doesn't sleep long enough. Alternately, if the value is set too high -and a sleep statement is added in every place it is needed, the duration of -the session can become prohibitive. - -Selenium provides two different mechanisms for synchronization that are better. - - -## Implicit waits -Selenium has a built-in way to automatically wait for elements called an _implicit wait_. -An implicit wait value can be set either with the [timeouts]({{< ref "drivers/options#timeouts" >}}) -capability in the browser options, or with a driver method (as shown below). - -This is a global setting that applies to every element location call for the entire session. -The default value is `0`, which means that if the element is not found, it will -immediately return an error. If an implicit wait is set, the driver will wait for the -duration of the provided value before returning the error. Note that as soon as the -element is located, the driver will return the element reference and the code will continue executing, -so a larger implicit wait value won't necessarily increase the duration of the session. - -*Warning:* -Do not mix implicit and explicit waits. -Doing so can cause unpredictable wait times. -For example, setting an implicit wait of 10 seconds -and an explicit wait of 15 seconds -could cause a timeout to occur after 20 seconds. - -Solving our example with an implicit wait looks like this: - -{{< tabpane text=true >}} - {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/waits/WaitsTest.java#L50" >}} - {{< /tab >}} - {{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/waits/test_waits.py#L27" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Waits/WaitsTest.cs#L39" >}} - {{< /tab >}} - {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/waits/waits_spec.rb#L28" >}} - {{< /tab >}} - {{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/waits/waits.spec.js#L39" >}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/waits/WaitsTest.kt#L19" >}} - {{< /tab >}} -{{< /tabpane >}} - -## Explicit waits - -_Explicit waits_ are loops added to the code that poll the application -for a specific condition to evaluate as true before it exits the loop and -continues to the next command in the code. If the condition is not met before a designated timeout value, -the code will give a timeout error. Since there are many ways for the application not to be in the desired state, -explicit waits are a great choice to specify the exact condition to wait for -in each place it is needed. -Another nice feature is that, by default, the Selenium Wait class automatically waits for the designated element to exist. - -{{< tabpane text=true >}} - {{% tab header="Java" %}} -This example shows the condition being waited for as a _lambda_. Java also supports -[Expected Conditions]({{< ref "support_features/expected_conditions" >}}) -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/waits/WaitsTest.java#L67-L68" >}} - {{% /tab %}} - {{% tab header="Python" %}} -This example shows the condition being waited for as a _lambda_. Python also supports -[Expected Conditions]({{< ref "support_features/expected_conditions" >}}) -{{< gh-codeblock path="/examples/python/tests/waits/test_waits.py#L41-L42" >}} - {{% /tab %}} - {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Waits/WaitsTest.cs#L56-L57" >}} - {{< /tab >}} - {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/waits/waits_spec.rb#L42-L43" >}} - {{< /tab >}} - {{% tab header="JavaScript" %}} -JavaScript also supports [Expected Conditions]({{< ref "support_features/expected_conditions" >}}) -{{< gh-codeblock path="/examples/javascript/test/waits/waits.spec.js#L52" >}} - {{% /tab %}} - {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/waits/WaitsTest.kt#L36-L37" >}} - {{< /tab >}} -{{< /tabpane >}} - -### Customization - -The Wait class can be instantiated with various parameters that will change how the conditions are evaluated. - -This can include: -* Changing how often the code is evaluated (polling interval) -* Specifying which exceptions should be handled automatically -* Changing the total timeout length -* Customizing the timeout message - -For instance, if the _element not interactable_ error is retried by default, then we can -add an action on a method inside the code getting executed (we just need to -make sure that the code returns `true` when it is successful): - -{{< tabpane text=true >}} - {{% tab header="Java" %}} -The easiest way to customize Waits in Java is to use the `FluentWait` class: -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/waits/WaitsTest.java#L82-L92" >}} - {{% /tab %}} - {{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/waits/test_waits.py#L53-L55" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Waits/WaitsTest.cs#L70-L79" >}} - {{< /tab >}} - {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/waits/waits_spec.rb#L54-L60" >}} - {{< /tab >}} - {{< tab header="JavaScript" >}} -{{< badge-code >}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/waits/WaitsTest.kt#L51-L60" >}} - {{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/waits.pt-br.md b/website_and_docs/content/documentation/webdriver/waits.pt-br.md deleted file mode 100644 index d32b8ba20f28..000000000000 --- a/website_and_docs/content/documentation/webdriver/waits.pt-br.md +++ /dev/null @@ -1,158 +0,0 @@ ---- -title: "Esperas" -linkTitle: "Esperas" -weight: 6 ---- - -Perhaps the most common challenge for browser automation is ensuring -that the web application is in a state to execute a particular -Selenium command as desired. The processes often end up in -a _race condition_ where sometimes the browser gets into the right -state first (things work as intended) and sometimes the Selenium code -executes first (things do not work as intended). This is one of the -primary causes of _flaky tests_. - -All navigation commands wait for a specific `readyState` value -based on the [page load strategy]({{< ref "drivers/options#pageloadstrategy" >}}) (the -default value to wait for is `"complete"`) before the driver returns control to the code. -The `readyState` only concerns itself with loading assets defined in the HTML, -but loaded JavaScript assets often result in changes to the site, -and elements that need to be interacted with may not yet be on the page -when the code is ready to execute the next Selenium command. - -Similarly, in a lot of single page applications, elements get dynamically -added to a page or change visibility based on a click. -An element must be both present and -[displayed]({{< ref "elements/information/#is-displayed" >}}) on the page -in order for Selenium to interact with it. - -Take this page for example: https://www.selenium.dev/selenium/web/dynamic.html -When the "Add a box!" button is clicked, a "div" element that does not exist is created. -When the "Reveal a new input" button is clicked, a hidden text field element is displayed. -In both cases the transition takes a couple seconds. -If the Selenium code is to click one of these buttons and interact with the resulting element, -it will do so before that element is ready and fail. - -The first solution many people turn to is adding a sleep statement to -pause the code execution for a set period of time. -Because the code can't know exactly how long it needs to wait, this -can fail when it doesn't sleep long enough. Alternately, if the value is set too high -and a sleep statement is added in every place it is needed, the duration of -the session can become prohibitive. - -Selenium provides two different mechanisms for synchronization that are better. - - -## Implicit waits -Selenium has a built-in way to automatically wait for elements called an _implicit wait_. -An implicit wait value can be set either with the [timeouts]({{< ref "drivers/options#timeouts" >}}) -capability in the browser options, or with a driver method (as shown below). - -This is a global setting that applies to every element location call for the entire session. -The default value is `0`, which means that if the element is not found, it will -immediately return an error. If an implicit wait is set, the driver will wait for the -duration of the provided value before returning the error. Note that as soon as the -element is located, the driver will return the element reference and the code will continue executing, -so a larger implicit wait value won't necessarily increase the duration of the session. - -*Warning:* -Do not mix implicit and explicit waits. -Doing so can cause unpredictable wait times. -For example, setting an implicit wait of 10 seconds -and an explicit wait of 15 seconds -could cause a timeout to occur after 20 seconds. - -Solving our example with an implicit wait looks like this: - -{{< tabpane text=true >}} - {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/waits/WaitsTest.java#L50" >}} - {{< /tab >}} - {{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/waits/test_waits.py#L27" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Waits/WaitsTest.cs#L39" >}} - {{< /tab >}} - {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/waits/waits_spec.rb#L28" >}} - {{< /tab >}} - {{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/waits/waits.spec.js#L39" >}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/waits/WaitsTest.kt#L19" >}} - {{< /tab >}} -{{< /tabpane >}} - -## Explicit waits - -_Explicit waits_ are loops added to the code that poll the application -for a specific condition to evaluate as true before it exits the loop and -continues to the next command in the code. If the condition is not met before a designated timeout value, -the code will give a timeout error. Since there are many ways for the application not to be in the desired state, -explicit waits are a great choice to specify the exact condition to wait for -in each place it is needed. -Another nice feature is that, by default, the Selenium Wait class automatically waits for the designated element to exist. - -{{< tabpane text=true >}} - {{% tab header="Java" %}} -This example shows the condition being waited for as a _lambda_. Java also supports -[Expected Conditions]({{< ref "support_features/expected_conditions" >}}) -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/waits/WaitsTest.java#L67-L68" >}} - {{% /tab %}} - {{% tab header="Python" %}} -This example shows the condition being waited for as a _lambda_. Python also supports -[Expected Conditions]({{< ref "support_features/expected_conditions" >}}) -{{< gh-codeblock path="/examples/python/tests/waits/test_waits.py#L41-L42" >}} - {{% /tab %}} - {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Waits/WaitsTest.cs#L56-L57" >}} - {{< /tab >}} - {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/waits/waits_spec.rb#L42-L43" >}} - {{< /tab >}} - {{% tab header="JavaScript" %}} -JavaScript also supports [Expected Conditions]({{< ref "support_features/expected_conditions" >}}) -{{< gh-codeblock path="/examples/javascript/test/waits/waits.spec.js#L52" >}} - {{% /tab %}} - {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/waits/WaitsTest.kt#L36-L37" >}} - {{< /tab >}} -{{< /tabpane >}} - -### Customization - -The Wait class can be instantiated with various parameters that will change how the conditions are evaluated. - -This can include: -* Changing how often the code is evaluated (polling interval) -* Specifying which exceptions should be handled automatically -* Changing the total timeout length -* Customizing the timeout message - -For instance, if the _element not interactable_ error is retried by default, then we can -add an action on a method inside the code getting executed (we just need to -make sure that the code returns `true` when it is successful): - -{{< tabpane text=true >}} - {{% tab header="Java" %}} -The easiest way to customize Waits in Java is to use the `FluentWait` class: -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/waits/WaitsTest.java#L82-L92" >}} - {{% /tab %}} - {{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/waits/test_waits.py#L53-L55" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Waits/WaitsTest.cs#L70-L79" >}} - {{< /tab >}} - {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/waits/waits_spec.rb#L54-L60" >}} - {{< /tab >}} - {{< tab header="JavaScript" >}} -{{< badge-code >}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/waits/WaitsTest.kt#L51-L60" >}} - {{< /tab >}} -{{< /tabpane >}} diff --git a/website_and_docs/content/documentation/webdriver/waits.zh-cn.md b/website_and_docs/content/documentation/webdriver/waits.zh-cn.md deleted file mode 100644 index 0d2b3cf95894..000000000000 --- a/website_and_docs/content/documentation/webdriver/waits.zh-cn.md +++ /dev/null @@ -1,179 +0,0 @@ ---- -title: "等待策略" -linkTitle: "等待" -weight: 6 ---- - - -或许浏览器自动化面临的最常见挑战在于, -确保网络应用程序处于能够按预期执行特定 Selenium 命令的状态. -这些过程常常陷入一种 _竞态条件_ , -有时浏览器会先达到正确状态 (一切按预期运行) , -有时 Selenium 代码会先执行 (一切未按预期运行) . -这是导致 _不稳定测试_ 的主要原因之一. - - -所有导航命令都会等待特定基于 [页面加载策略]({{< ref "drivers/options#pageloadstrategy">}}) 的值 `readyState` - (默认等待的值为 `"complete"` ) , -然后驱动程序才会将控制权交还给代码. -`readyState` 仅关注 HTML 中定义的资源加载, -但加载的 JavaScript 资源常常会导致网站发生变化, -而当代码准备执行下一个 Selenium 命令时, -需要交互的元素可能尚未出现在页面上. - - -同样, 在许多单页应用程序中, -元素会根据点击操作动态添加到页面上或改变可见性. -对于 Selenium 能够与之交互, -该元素必须既存在于页面上又处于[displayed]({{< ref "elements/information/#is-displayed">}}) 状态. - - -以这个页面为例: https://www.selenium.dev/selenium/web/dynamic.html -当点击 "Add a box!" 按钮时, -会创建一个原本不存在的 "div" 元素. -当点击 "Reveal a new input" 按钮时, -一个隐藏的文本字段元素会被显示出来. -在这两种情况下, 过渡都需要几秒钟. -如果 Selenium 代码要点击其中一个按钮并与生成的元素进行交互, -它会在该元素准备好之前就执行操作, 从而导致失败. - - -许多人首先想到的解决办法是在代码中添加一个睡眠语句, -让代码暂停执行一段设定的时间. -由于代码无法确切知道需要等待多久, -如果设置的睡眠时间不够长, -这种方法可能会失败. -相反, 如果睡眠时间设置得过高, 并且在每个需要的地方都添加睡眠语句, -那么会话的持续时间可能会变得难以接受. - -Selenium 提供了更好的两种不同的同步机制, - - -## 隐式等待 -Selenium 内置了一种自动等待元素出现的方式, 称为 _隐式等待_ . -隐式等待的值可以通过浏览器选项中的 [timeouts]({{< ref "drivers/options#timeouts">}}) 设置来设定, -也可以通过驱动程序的方法来设定 (如下所示) . - -这是一个全局设置, 适用于整个会话期间的每个元素定位调用. -默认值为 `0` , -这意味着如果未找到元素, -将立即返回错误. -如果设置了隐式等待, -驱动程序将在返回错误之前等待所提供的时长. -请注意, 一旦定位到元素, -驱动程序将返回元素引用, -代码将继续执行, -因此较大的隐式等待值不一定增加会话的持续时间. - -*警告:* -请勿混合使用隐式等待和显式等待. -这样做可能会导致等待时间不可预测. -例如, 设置 10 秒的隐式等待和 15 秒的显式等待, -可能会导致在 20 秒后发生超时. - -使用隐式等待解决我们的示例代码如下: - - -{{< tabpane text=true >}} - {{< tab header="Java" >}} -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/waits/WaitsTest.java#L50" >}} - {{< /tab >}} - {{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/waits/test_waits.py#L27" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Waits/WaitsTest.cs#L39" >}} - {{< /tab >}} - {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/waits/waits_spec.rb#L28" >}} - {{< /tab >}} - {{< tab header="JavaScript" >}} -{{< gh-codeblock path="/examples/javascript/test/waits/waits.spec.js#L39" >}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/waits/WaitsTest.kt#L19" >}} - {{< /tab >}} -{{< /tabpane >}} - - - -## 显式等待 - -_显式等待_ 是在代码中添加的, 用于轮询应用程序的循环, -直到特定条件评估为真时, 才退出循环并继续执行代码中的下一个命令. -如果在指定的超时值之前条件未满足, -代码将给出超时错误. -由于应用程序未处于所需状态的方式有很多, -因此显式等待是为每个需要等待的地方指定确切等待条件的绝佳选择. -另一个不错的特性是, 默认情况下, -Selenium 等待类会自动等待指定的元素存在. - - - -{{< tabpane text=true >}} - {{% tab header="Java" %}} -This example shows the condition being waited for as a _lambda_. Java also supports -[Expected Conditions]({{< ref "support_features/expected_conditions" >}}) -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/waits/WaitsTest.java#L67-L68" >}} - {{% /tab %}} - {{% tab header="Python" %}} -This example shows the condition being waited for as a _lambda_. Python also supports -[Expected Conditions]({{< ref "support_features/expected_conditions" >}}) -{{< gh-codeblock path="/examples/python/tests/waits/test_waits.py#L41-L42" >}} - {{% /tab %}} - {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Waits/WaitsTest.cs#L56-L57" >}} - {{< /tab >}} - {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/waits/waits_spec.rb#L42-L43" >}} - {{< /tab >}} - {{% tab header="JavaScript" %}} -JavaScript also supports [Expected Conditions]({{< ref "support_features/expected_conditions" >}}) -{{< gh-codeblock path="/examples/javascript/test/waits/waits.spec.js#L52" >}} - {{% /tab %}} - {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/waits/WaitsTest.kt#L36-L37" >}} - {{< /tab >}} -{{< /tabpane >}} - - - -### 定制 - -Wait 类可以通过各种参数进行实例化, -这些参数会改变条件的评估方式. - -这可以包括: -* 更改代码的评估频率 (轮询间隔) -* 指定哪些异常应自动处理 -* 更改总超时时长 -* 自定义超时消息 - -例如, 如果默认情况下对 _元素不可交互_ 错误进行重试, -那么我们可以在执行中的代码里的某个方法内添加一个操作 - (我们只需要确保代码在成功时返回 `true` 即可): - - - -{{< tabpane text=true >}} - {{% tab header="Java" %}} -The easiest way to customize Waits in Java is to use the `FluentWait` class: -{{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/waits/WaitsTest.java#L82-L92" >}} - {{% /tab %}} - {{< tab header="Python" >}} -{{< gh-codeblock path="/examples/python/tests/waits/test_waits.py#L53-L55" >}} - {{< /tab >}} - {{< tab header="CSharp" >}} -{{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Waits/WaitsTest.cs#L70-L79" >}} - {{< /tab >}} - {{< tab header="Ruby" >}} -{{< gh-codeblock path="/examples/ruby/spec/waits/waits_spec.rb#L54-L60" >}} - {{< /tab >}} - {{< tab header="JavaScript" >}} -{{< badge-code >}} - {{< /tab >}} - {{< tab header="Kotlin" >}} -{{< gh-codeblock path="examples/kotlin/src/test/kotlin/dev/selenium/waits/WaitsTest.kt#L51-L60" >}} - {{< /tab >}} -{{< /tabpane >}} -