From a0eba92a4974659f039c5e0946b14154269c101c Mon Sep 17 00:00:00 2001 From: titusfortner Date: Fri, 24 Nov 2023 11:37:41 -0600 Subject: [PATCH 1/5] add versions and move legacy into separate directory; english only --- .../content/documentation/legacy/_index.ja.md | 20 - .../documentation/legacy/_index.pt-br.md | 22 - .../documentation/legacy/_index.zh-cn.md | 11 - .../documentation/legacy/selenium_1.ja.md | 1510 -------------- .../documentation/legacy/selenium_1.pt-br.md | 1702 --------------- .../documentation/legacy/selenium_1.zh-cn.md | 1826 ----------------- .../legacy/selenium_2/_index.ja.md | 7 - .../legacy/selenium_2/_index.pt-br.md | 7 - .../legacy/selenium_2/_index.zh-cn.md | 7 - .../legacy/selenium_2/remote_server.ja.md | 88 - .../legacy/selenium_2/remote_server.pt-br.md | 105 - .../legacy/selenium_2/remote_server.zh-cn.md | 105 - .../legacy/selenium_2/upgrading.ja.md | 226 -- .../legacy/selenium_2/upgrading.pt-br.md | 251 --- .../legacy/selenium_2/upgrading.zh-cn.md | 262 --- .../legacy/selenium_3/_index.ja.md | 9 - .../legacy/selenium_3/_index.pt-br.md | 8 - .../legacy/selenium_3/_index.zh-cn.md | 8 - .../legacy/selenium_3/grid_3.ja.md | 26 - .../legacy/selenium_3/grid_3.pt-br.md | 35 - .../legacy/selenium_3/grid_3.zh-cn.md | 39 - .../legacy/selenium_3/grid_components.ja.md | 32 - .../selenium_3/grid_components.pt-br.md | 38 - .../selenium_3/grid_components.zh-cn.md | 32 - .../legacy/selenium_3/grid_setup.ja.md | 204 -- .../legacy/selenium_3/grid_setup.pt-br.md | 257 --- .../legacy/selenium_3/grid_setup.zh-cn.md | 207 -- .../legacy/selenium_ide/_index.ja.md | 1468 ------------- .../legacy/selenium_ide/_index.pt-br.md | 1727 ---------------- .../legacy/selenium_ide/_index.zh-cn.md | 1750 ---------------- .../legacy/selenium_ide/html_runner.ja.md | 96 - .../legacy/selenium_ide/html_runner.pt-br.md | 100 - .../legacy/selenium_ide/html_runner.zh-cn.md | 95 - .../{documentation => }/legacy/_index.en.md | 9 +- .../legacy/desired_capabilities.en.md | 3 +- .../legacy/developers/_index.en.md | 5 +- .../legacy/developers/buck.en.md | 3 + .../legacy/developers/ci_tool.en.md | 3 + .../legacy/developers/crazy_fun_build.en.md | 3 + .../legacy/developers/drivers.en.md | 3 + .../legacy/developers/roadmap.en.md | 3 + .../legacy/developers/summer_of_code.en.md | 3 + .../legacy/developers/tips.en.md | 3 + .../legacy/json_wire_protocol.en.md | 3 + .../legacy/selenium_1.en.md | 3 +- .../legacy/selenium_2/_index.en.md | 3 + .../legacy/selenium_2/emulation.en.md | 3 + .../legacy/selenium_2/faq.en.md | 3 + .../legacy/selenium_2/firefox_driver.en.md | 4 +- .../legacy/selenium_2/focus_stealing.en.md | 3 + .../legacy/selenium_2/grid_2.en.md | 3 +- .../legacy/selenium_2/grid_platforms.en.md | 3 + .../legacy/selenium_2/mobile.en.md | 3 + .../selenium_2/parallel_execution.en.md | 3 + .../legacy/selenium_2/remote_server.en.md | 3 +- .../legacy/selenium_2/ssl_certs.en.md | 3 + .../legacy/selenium_2/team.en.md | 3 +- .../legacy/selenium_2/upgrading.en.md | 3 +- .../legacy/selenium_3/_index.en.md | 3 + .../legacy/selenium_3/grid_3.en.md | 3 +- .../legacy/selenium_3/grid_components.en.md | 3 +- .../legacy/selenium_3/grid_setup.en.md | 3 +- .../legacy/selenium_ide/_index.en.md | 5 +- .../legacy/selenium_ide/html_runner.en.md | 3 +- .../legacy/selenium_ide/releases.en.md | 3 + website_and_docs/hugo.toml | 9 +- .../layouts/partials/breadcrumb.html | 8 - 67 files changed, 100 insertions(+), 12304 deletions(-) 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/_index.ja.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_2/_index.pt-br.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_2/_index.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/_index.ja.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_3/_index.pt-br.md delete mode 100644 website_and_docs/content/documentation/legacy/selenium_3/_index.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 rename website_and_docs/content/{documentation => }/legacy/_index.en.md (62%) rename website_and_docs/content/{documentation => }/legacy/desired_capabilities.en.md (99%) rename website_and_docs/content/{documentation => }/legacy/developers/_index.en.md (64%) rename website_and_docs/content/{documentation => }/legacy/developers/buck.en.md (97%) rename website_and_docs/content/{documentation => }/legacy/developers/ci_tool.en.md (98%) rename website_and_docs/content/{documentation => }/legacy/developers/crazy_fun_build.en.md (99%) rename website_and_docs/content/{documentation => }/legacy/developers/drivers.en.md (98%) rename website_and_docs/content/{documentation => }/legacy/developers/roadmap.en.md (98%) rename website_and_docs/content/{documentation => }/legacy/developers/summer_of_code.en.md (99%) rename website_and_docs/content/{documentation => }/legacy/developers/tips.en.md (99%) rename website_and_docs/content/{documentation => }/legacy/json_wire_protocol.en.md (99%) rename website_and_docs/content/{documentation => }/legacy/selenium_1.en.md (99%) rename website_and_docs/content/{documentation => }/legacy/selenium_2/_index.en.md (75%) rename website_and_docs/content/{documentation => }/legacy/selenium_2/emulation.en.md (98%) rename website_and_docs/content/{documentation => }/legacy/selenium_2/faq.en.md (99%) rename website_and_docs/content/{documentation => }/legacy/selenium_2/firefox_driver.en.md (97%) rename website_and_docs/content/{documentation => }/legacy/selenium_2/focus_stealing.en.md (98%) rename website_and_docs/content/{documentation => }/legacy/selenium_2/grid_2.en.md (99%) rename website_and_docs/content/{documentation => }/legacy/selenium_2/grid_platforms.en.md (98%) rename website_and_docs/content/{documentation => }/legacy/selenium_2/mobile.en.md (97%) rename website_and_docs/content/{documentation => }/legacy/selenium_2/parallel_execution.en.md (98%) rename website_and_docs/content/{documentation => }/legacy/selenium_2/remote_server.en.md (97%) rename website_and_docs/content/{documentation => }/legacy/selenium_2/ssl_certs.en.md (98%) rename website_and_docs/content/{documentation => }/legacy/selenium_2/team.en.md (97%) rename website_and_docs/content/{documentation => }/legacy/selenium_2/upgrading.en.md (98%) rename website_and_docs/content/{documentation => }/legacy/selenium_3/_index.en.md (83%) rename website_and_docs/content/{documentation => }/legacy/selenium_3/grid_3.en.md (94%) rename website_and_docs/content/{documentation => }/legacy/selenium_3/grid_components.en.md (92%) rename website_and_docs/content/{documentation => }/legacy/selenium_3/grid_setup.en.md (98%) rename website_and_docs/content/{documentation => }/legacy/selenium_ide/_index.en.md (99%) rename website_and_docs/content/{documentation => }/legacy/selenium_ide/html_runner.en.md (97%) rename website_and_docs/content/{documentation => }/legacy/selenium_ide/releases.en.md (99%) 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 6c08b22a957e..000000000000 --- a/website_and_docs/content/documentation/legacy/_index.ja.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -title: "レガシー" -linkTitle: "レガシー" -weight: 14 -description: > - このセクションでは、Seleniumのレガシーコンポーネントに関連するすべてのドキュメントを見つけることができます。 - これは、非推奨コンポーネントを使用する動機としてではなく、純粋に歴史的な理由で保持されることを意図しています。 -aliases: ["/documentation/ja/legacy_docs/"] ---- - -{{% 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 d738c2b2f8f1..000000000000 --- a/website_and_docs/content/documentation/legacy/_index.pt-br.md +++ /dev/null @@ -1,22 +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. -aliases: ["/documentation/pt-br/legacy_docs/"] ---- - -{{% 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 b90d8aab8026..000000000000 --- a/website_and_docs/content/documentation/legacy/_index.zh-cn.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: "Legacy" -linkTitle: "Legacy" -weight: 14 -description: > - 在此部分,您可以找到与Selenium的旧组件有关的所有文档. - 这样做纯粹是出于历史原因,而不是鼓励使用已废弃的组件. -aliases: ["/documentation/zh-cn/legacy_docs/"] ---- - - 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 2e968dc51f65..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_1.ja.md +++ /dev/null @@ -1,1510 +0,0 @@ ---- -title: "Selenium RC (Selenium 1)" -linkTitle: "Selenium 1" -weight: 2 -description: > - The original version of Selenium -aliases: [ -"/documentation/ja/legacy_docs/selenium_rc/", -"/ja/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 5492000d265c..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_1.pt-br.md +++ /dev/null @@ -1,1702 +0,0 @@ ---- -title: "Selenium RC (Selenium 1)" -linkTitle: "Selenium 1" -weight: 2 -description: > - The original version of Selenium -aliases: [ -"/documentation/pt-br/legacy_docs/selenium_rc/", -"/pt-br/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 8ad612de7109..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_1.zh-cn.md +++ /dev/null @@ -1,1826 +0,0 @@ ---- -title: "Selenium RC (Selenium 1)" -linkTitle: "Selenium 1" -weight: 2 -description: > - 原始版本的Selenium -aliases: [ -"/documentation/zh-cn/legacy_docs/selenium_rc/", -"/zh-cn/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/_index.ja.md b/website_and_docs/content/documentation/legacy/selenium_2/_index.ja.md deleted file mode 100644 index 0d8c03f7d6f9..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_2/_index.ja.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: "Selenium 2" -linkTitle: "Selenium 2" -weight: 4 -description: > - Selenium 2 was a rewrite of Selenium 1 that was implemented with WebDriver code. ---- diff --git a/website_and_docs/content/documentation/legacy/selenium_2/_index.pt-br.md b/website_and_docs/content/documentation/legacy/selenium_2/_index.pt-br.md deleted file mode 100644 index 0d8c03f7d6f9..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_2/_index.pt-br.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: "Selenium 2" -linkTitle: "Selenium 2" -weight: 4 -description: > - Selenium 2 was a rewrite of Selenium 1 that was implemented with WebDriver code. ---- diff --git a/website_and_docs/content/documentation/legacy/selenium_2/_index.zh-cn.md b/website_and_docs/content/documentation/legacy/selenium_2/_index.zh-cn.md deleted file mode 100644 index 58b214c64020..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_2/_index.zh-cn.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -title: "Selenium 2" -linkTitle: "Selenium 2" -weight: 4 -description: > - Selenium 2 是以实现了WebDriver代码重写的Selenium 1. ---- 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 14c44a6c6b28..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.ja.md +++ /dev/null @@ -1,88 +0,0 @@ ---- -title: "リモートWebDriverサーバー" -linkTitle: "リモートWebDriverサーバー" -weight: 6 -aliases: [ -"/documentation/ja/legacy_docs/remote_webdriver_server/", -"/ja/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 92d93c69760b..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.pt-br.md +++ /dev/null @@ -1,105 +0,0 @@ ---- -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/" -] ---- - -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 869a1daf33ae..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.zh-cn.md +++ /dev/null @@ -1,105 +0,0 @@ ---- -title: "远程WebDriver服务器" -linkTitle: "远程WebDriver服务器" -weight: 6 -aliases: [ -"/documentation/zh-cn/legacy_docs/remote_webdriver_server/", -"/zh-cn/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.ja.md b/website_and_docs/content/documentation/legacy/selenium_2/upgrading.ja.md deleted file mode 100644 index 4ea029957e3b..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.ja.md +++ /dev/null @@ -1,226 +0,0 @@ ---- -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/" -] - -aliases: [] ---- - - -## 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 866f468860f5..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.pt-br.md +++ /dev/null @@ -1,251 +0,0 @@ ---- -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/" -] ---- - - -## 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 30e3f2afa563..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.zh-cn.md +++ /dev/null @@ -1,262 +0,0 @@ ---- -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/" -] ---- - - -## 如何迁移到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/_index.ja.md b/website_and_docs/content/documentation/legacy/selenium_3/_index.ja.md deleted file mode 100644 index cb9431bde504..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/_index.ja.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "Selenium 3" -linkTitle: "Selenium 3" -weight: 6 -description: > -description: > - Selenium 3 was the implementation of WebDriver without the Selenium RC Code. - It has since been replaced with Selenium 4, which implements the W3C WebDriver specification. ---- diff --git a/website_and_docs/content/documentation/legacy/selenium_3/_index.pt-br.md b/website_and_docs/content/documentation/legacy/selenium_3/_index.pt-br.md deleted file mode 100644 index f26fa95ec98d..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/_index.pt-br.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: "Selenium 3" -linkTitle: "Selenium 3" -weight: 6 -description: > - Selenium 3 was the implementation of WebDriver without the Selenium RC Code. - It has since been replaced with Selenium 4, which implements the W3C WebDriver specification. ---- diff --git a/website_and_docs/content/documentation/legacy/selenium_3/_index.zh-cn.md b/website_and_docs/content/documentation/legacy/selenium_3/_index.zh-cn.md deleted file mode 100644 index bdd409530527..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/_index.zh-cn.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -title: "Selenium 3" -linkTitle: "Selenium 3" -weight: 6 -description: > - Selenium 3是摒除了Selenium RC代码的WebDriver实现. - 其已被实现了W3C WebDriver规范的Selenium 4所替代. ---- 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 2bd2955fbb97..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.ja.md +++ /dev/null @@ -1,26 +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/ja/grid/grid_3/", -"/ja/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 a85ae007ffee..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.pt-br.md +++ /dev/null @@ -1,35 +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/pt-br/grid/grid_3/", -"/pt-br/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 d73930ad04a7..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.zh-cn.md +++ /dev/null @@ -1,39 +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/zh-cn/grid/grid_3/", -"/zh-cn/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.ja.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_components.ja.md deleted file mode 100644 index bb349c1c69f2..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.ja.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: "グリッドのコンポーネント" -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">}} - -## ハブ -* 仲介者およびマネージャー -* テストを実行する要求を受け入れます -* クライアントから命令を受け取り、ノード上でリモートで実行します -* スレッドを管理します - -_ハブ_ は、すべてのテストが送信される中心点です。 -各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 c1629c710fd0..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.pt-br.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: "Componentes" -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">}} - -## 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 ad7d080ad8e7..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.zh-cn.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: "服务网格的组件" -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">}} - -## 转发器(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.ja.md b/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.ja.md deleted file mode 100644 index 42829b9d27fa..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.ja.md +++ /dev/null @@ -1,204 +0,0 @@ ---- -title: "独自のグリッドを設定する" -linkTitle: "独自のグリッドを設定する" -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/" -] ---- - - -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 2f22f674ec26..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.pt-br.md +++ /dev/null @@ -1,257 +0,0 @@ ---- -title: "Configurando a sua" -linkTitle: "Configurando a sua" -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/" -] ---- - -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 e33f55973040..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.zh-cn.md +++ /dev/null @@ -1,207 +0,0 @@ ---- -title: "配置自己的服务网格" -linkTitle: "配置自己的服务网格" -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/" -] ---- - -使用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.ja.md b/website_and_docs/content/documentation/legacy/selenium_ide/_index.ja.md deleted file mode 100644 index 387fad87d05f..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_ide/_index.ja.md +++ /dev/null @@ -1,1468 +0,0 @@ ---- -title: "レガシー Selenium IDE" -linkTitle: "Selenium IDE" -weight: 8 -aliases: ["/documentation/ja/legacy_docs/selenium_ide/"] ---- - -## 紹介 - -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 f613eae76e6e..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_ide/_index.zh-cn.md +++ /dev/null @@ -1,1750 +0,0 @@ ---- -title: "Legacy Selenium IDE" -linkTitle: "Selenium IDE" -weight: 8 -aliases: ["/documentation/zh-cn/legacy_docs/selenium_ide/"] ---- - -{{% 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.ja.md b/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.ja.md deleted file mode 100644 index 196fac53a116..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.ja.md +++ /dev/null @@ -1,96 +0,0 @@ ---- -title: "HTMLランナー" -linkTitle: "HTMLランナー" -weight: 2 -description: > - Execute HTML Selenium IDE exports from command line -aliases: [ -"/documentation/ja/legacy_docs/html-runner/", -"/ja/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 8194adea48a8..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.pt-br.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: "HTML runner" -linkTitle: "HTML runner" -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/" -] ---- - -_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 6e9754aad27a..000000000000 --- a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.zh-cn.md +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: "HTML runner" -linkTitle: "HTML runner" -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/" -] ---- - -_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/legacy/_index.en.md b/website_and_docs/content/legacy/_index.en.md similarity index 62% rename from website_and_docs/content/documentation/legacy/_index.en.md rename to website_and_docs/content/legacy/_index.en.md index e908539139e9..e842dd1079b5 100644 --- a/website_and_docs/content/documentation/legacy/_index.en.md +++ b/website_and_docs/content/legacy/_index.en.md @@ -1,9 +1,14 @@ --- -title: "Legacy" +title: "Legacy Documentation" linkTitle: "Legacy" weight: 14 +cascade: + - type: docs 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/legacy/" +] --- diff --git a/website_and_docs/content/documentation/legacy/desired_capabilities.en.md b/website_and_docs/content/legacy/desired_capabilities.en.md similarity index 99% rename from website_and_docs/content/documentation/legacy/desired_capabilities.en.md rename to website_and_docs/content/legacy/desired_capabilities.en.md index 322157dd5d79..e77bb89682cb 100644 --- a/website_and_docs/content/documentation/legacy/desired_capabilities.en.md +++ b/website_and_docs/content/legacy/desired_capabilities.en.md @@ -5,7 +5,8 @@ description: > These capabilities worked with the legacy JSON Wire Protocol weight: 12 aliases: [ -"/documentation/legacy/capabilities/" +"/documentation/legacy/capabilities/", +"/documentation/legacy/desired_capabilities" ] --- This documentation previously located [on the wiki](https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities) \ diff --git a/website_and_docs/content/documentation/legacy/developers/_index.en.md b/website_and_docs/content/legacy/developers/_index.en.md similarity index 64% rename from website_and_docs/content/documentation/legacy/developers/_index.en.md rename to website_and_docs/content/legacy/developers/_index.en.md index df7c335fc484..f784d0f2e10c 100644 --- a/website_and_docs/content/documentation/legacy/developers/_index.en.md +++ b/website_and_docs/content/legacy/developers/_index.en.md @@ -4,6 +4,9 @@ linkTitle: "Developers" weight: 16 description: > Information of interest to developers of Selenium -aliases: ["/documentation/en/legacy_docs/"] +aliases: [ +"/documentation/en/legacy_docs/", +"/documentation/legacy/developers/" +] --- diff --git a/website_and_docs/content/documentation/legacy/developers/buck.en.md b/website_and_docs/content/legacy/developers/buck.en.md similarity index 97% rename from website_and_docs/content/documentation/legacy/developers/buck.en.md rename to website_and_docs/content/legacy/developers/buck.en.md index ff9fbb1fb33e..ccb1b4095450 100644 --- a/website_and_docs/content/documentation/legacy/developers/buck.en.md +++ b/website_and_docs/content/legacy/developers/buck.en.md @@ -5,6 +5,9 @@ weight: 4 description: > Buck is a build tool from Facebook that we were working with to replace Crazy fun. We have since replaced it with [Bazel](https://bazel.build/). +aliases: [ + "/documentation/legacy/developers/buck" +] --- This documentation previously located [on the wiki](https://github.com/SeleniumHQ/selenium/wiki/Buck) \ You can read the documentation for the legacy [Crazy Fun Build tool]({{< ref "crazy_fun_build.md" >}}). diff --git a/website_and_docs/content/documentation/legacy/developers/ci_tool.en.md b/website_and_docs/content/legacy/developers/ci_tool.en.md similarity index 98% rename from website_and_docs/content/documentation/legacy/developers/ci_tool.en.md rename to website_and_docs/content/legacy/developers/ci_tool.en.md index 36d44ad5e20e..1fb21caff4d4 100644 --- a/website_and_docs/content/documentation/legacy/developers/ci_tool.en.md +++ b/website_and_docs/content/legacy/developers/ci_tool.en.md @@ -5,6 +5,9 @@ weight: 6 description: > We used to have a Jenkins CI tool that executed unit tests and ran integration tests on Sauce Labs. We moved all of the tests to Travis, and now execute everything with Github Actions. +aliases: [ + "/documentation/legacy/developers/ci_tool" +] --- This documentation previously located [on the wiki](https://github.com/SeleniumHQ/selenium/wiki/Continuous-Integration) diff --git a/website_and_docs/content/documentation/legacy/developers/crazy_fun_build.en.md b/website_and_docs/content/legacy/developers/crazy_fun_build.en.md similarity index 99% rename from website_and_docs/content/documentation/legacy/developers/crazy_fun_build.en.md rename to website_and_docs/content/legacy/developers/crazy_fun_build.en.md index 2300c136d16d..fd8dee17079d 100644 --- a/website_and_docs/content/documentation/legacy/developers/crazy_fun_build.en.md +++ b/website_and_docs/content/legacy/developers/crazy_fun_build.en.md @@ -5,6 +5,9 @@ weight: 2 description: > The original Selenium Build Tool that grew from nothing to be extremely unwieldy, making it both crazy and "fun" to work with. +aliases: [ + "/documentation/legacy/developers/crazy_fun_build" +] --- This documentation previously located [on the wiki](https://github.com/SeleniumHQ/selenium/wiki/Crazy-Fun-Build) diff --git a/website_and_docs/content/documentation/legacy/developers/drivers.en.md b/website_and_docs/content/legacy/developers/drivers.en.md similarity index 98% rename from website_and_docs/content/documentation/legacy/developers/drivers.en.md rename to website_and_docs/content/legacy/developers/drivers.en.md index b6fcc9229a89..ecf3652057d7 100644 --- a/website_and_docs/content/documentation/legacy/developers/drivers.en.md +++ b/website_and_docs/content/legacy/developers/drivers.en.md @@ -4,6 +4,9 @@ linkTitle: "Drivers" weight: 4 description: > Instructions for how to create tests for new drivers for Selenium 2. +aliases: [ + "/documentation/legacy/developers/drivers" +] --- This documentation previously located [on the wiki](https://github.com/SeleniumHQ/selenium/wiki/Writing-New-Drivers) \ diff --git a/website_and_docs/content/documentation/legacy/developers/roadmap.en.md b/website_and_docs/content/legacy/developers/roadmap.en.md similarity index 98% rename from website_and_docs/content/documentation/legacy/developers/roadmap.en.md rename to website_and_docs/content/legacy/developers/roadmap.en.md index 9b660b460b37..c78d3b68ec9f 100644 --- a/website_and_docs/content/documentation/legacy/developers/roadmap.en.md +++ b/website_and_docs/content/legacy/developers/roadmap.en.md @@ -4,6 +4,9 @@ linkTitle: "Roadmap" weight: 15 description: > The list of plans and things to accomplish before a release +aliases: [ + "/documentation/legacy/developers/roadmap" +] --- ## Preparation for Selenium 2 diff --git a/website_and_docs/content/documentation/legacy/developers/summer_of_code.en.md b/website_and_docs/content/legacy/developers/summer_of_code.en.md similarity index 99% rename from website_and_docs/content/documentation/legacy/developers/summer_of_code.en.md rename to website_and_docs/content/legacy/developers/summer_of_code.en.md index 2b0c7c754c84..380f6c411ede 100644 --- a/website_and_docs/content/documentation/legacy/developers/summer_of_code.en.md +++ b/website_and_docs/content/legacy/developers/summer_of_code.en.md @@ -4,6 +4,9 @@ linkTitle: "Summer of Code" weight: 8 description: > Selenium encouraged users to take advantage of this program. +aliases: [ + "/documentation/legacy/developers/summer_of_code" +] --- This documentation previously located [on the wiki](https://github.com/SeleniumHQ/selenium/wiki/Google-Summer-Of-Code) diff --git a/website_and_docs/content/documentation/legacy/developers/tips.en.md b/website_and_docs/content/legacy/developers/tips.en.md similarity index 99% rename from website_and_docs/content/documentation/legacy/developers/tips.en.md rename to website_and_docs/content/legacy/developers/tips.en.md index 1b6626bcddea..37cd07807bc9 100644 --- a/website_and_docs/content/documentation/legacy/developers/tips.en.md +++ b/website_and_docs/content/legacy/developers/tips.en.md @@ -4,6 +4,9 @@ linkTitle: "Tips" weight: 10 description: > Details on how to execute Selenium Test Suite with Crazy Fun. +aliases: [ + "/documentation/legacy/developers/tips" +] --- This documentation previously located [on the wiki](https://github.com/SeleniumHQ/selenium/wiki/Developer-Tips) diff --git a/website_and_docs/content/documentation/legacy/json_wire_protocol.en.md b/website_and_docs/content/legacy/json_wire_protocol.en.md similarity index 99% rename from website_and_docs/content/documentation/legacy/json_wire_protocol.en.md rename to website_and_docs/content/legacy/json_wire_protocol.en.md index 6e58c7c6626c..995d61cacdd8 100644 --- a/website_and_docs/content/documentation/legacy/json_wire_protocol.en.md +++ b/website_and_docs/content/legacy/json_wire_protocol.en.md @@ -5,6 +5,9 @@ weight: 10 description: > The endpoints and payloads for the now-obsolete open source protocol that was the precursor to the [W3C specification](https://w3c.github.io/webdriver/). +aliases: [ + "/documentation/legacy/json_wire_protocol" +] --- This documentation previously located [on the wiki](https://github.com/SeleniumHQ/selenium/wiki/JsonWireProtocol) diff --git a/website_and_docs/content/documentation/legacy/selenium_1.en.md b/website_and_docs/content/legacy/selenium_1.en.md similarity index 99% rename from website_and_docs/content/documentation/legacy/selenium_1.en.md rename to website_and_docs/content/legacy/selenium_1.en.md index cec94b17dd14..b8b3675fd573 100644 --- a/website_and_docs/content/documentation/legacy/selenium_1.en.md +++ b/website_and_docs/content/legacy/selenium_1.en.md @@ -6,7 +6,8 @@ description: > The original version of Selenium aliases: [ "/documentation/en/legacy_docs/selenium_rc/", -"/documentation/legacy/selenium_rc/" +"/documentation/legacy/selenium_rc/", +"/documentation/legacy/selenium_1" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_2/_index.en.md b/website_and_docs/content/legacy/selenium_2/_index.en.md similarity index 75% rename from website_and_docs/content/documentation/legacy/selenium_2/_index.en.md rename to website_and_docs/content/legacy/selenium_2/_index.en.md index 0d8c03f7d6f9..408aca51d4da 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/_index.en.md +++ b/website_and_docs/content/legacy/selenium_2/_index.en.md @@ -4,4 +4,7 @@ linkTitle: "Selenium 2" weight: 4 description: > Selenium 2 was a rewrite of Selenium 1 that was implemented with WebDriver code. +aliases: [ + "/documentation/legacy/selenium_2/" +] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_2/emulation.en.md b/website_and_docs/content/legacy/selenium_2/emulation.en.md similarity index 98% rename from website_and_docs/content/documentation/legacy/selenium_2/emulation.en.md rename to website_and_docs/content/legacy/selenium_2/emulation.en.md index 1cf43c995b24..659a56b38dd2 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/emulation.en.md +++ b/website_and_docs/content/legacy/selenium_2/emulation.en.md @@ -4,6 +4,9 @@ linkTitle: "Emulations" weight: 3 description: > The Java and .NET versions of Selenium 2 provided implementations of the original Selenium API +aliases: [ +"/documentation/legacy/selenium_2/emulation" +] --- (Previously located: https://github.com/SeleniumHQ/selenium/wiki/Selenium-Emulation) diff --git a/website_and_docs/content/documentation/legacy/selenium_2/faq.en.md b/website_and_docs/content/legacy/selenium_2/faq.en.md similarity index 99% rename from website_and_docs/content/documentation/legacy/selenium_2/faq.en.md rename to website_and_docs/content/legacy/selenium_2/faq.en.md index e44c997762a0..0c17f3011972 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/faq.en.md +++ b/website_and_docs/content/legacy/selenium_2/faq.en.md @@ -4,6 +4,9 @@ linkTitle: "FAQ" weight: 14 description: > Items of interest for moving from Selenium 1 to Selenium 2 +aliases: [ +"/documentation/legacy/selenium_2/faq" +] --- This documentation previously located [on the wiki](https://github.com/SeleniumHQ/selenium/wiki/Frequently-Asked-Questions) \ diff --git a/website_and_docs/content/documentation/legacy/selenium_2/firefox_driver.en.md b/website_and_docs/content/legacy/selenium_2/firefox_driver.en.md similarity index 97% rename from website_and_docs/content/documentation/legacy/selenium_2/firefox_driver.en.md rename to website_and_docs/content/legacy/selenium_2/firefox_driver.en.md index ff152c07e692..1d7048a77f57 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/firefox_driver.en.md +++ b/website_and_docs/content/legacy/selenium_2/firefox_driver.en.md @@ -6,10 +6,12 @@ description: > The legacy Firefox Driver was developed as a browser extension by the Selenium Developers. Firefox updated their security model, so it no longer works. You now need to use geckodriver. aliases: [ -"/documentation/legacy/firefox_driver/" + "/documentation/legacy/firefox_driver/", + "/documentation/legacy/selenium_2/firefox_driver" ] --- + This documentation previously located [on the wiki](https://github.com/SeleniumHQ/selenium/wiki/FirefoxDriver) \ You can read more about [geckodriver](https://firefox-source-docs.mozilla.org/testing/geckodriver/). diff --git a/website_and_docs/content/documentation/legacy/selenium_2/focus_stealing.en.md b/website_and_docs/content/legacy/selenium_2/focus_stealing.en.md similarity index 98% rename from website_and_docs/content/documentation/legacy/selenium_2/focus_stealing.en.md rename to website_and_docs/content/legacy/selenium_2/focus_stealing.en.md index ee0722505a02..d384b1f60410 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/focus_stealing.en.md +++ b/website_and_docs/content/legacy/selenium_2/focus_stealing.en.md @@ -4,6 +4,9 @@ linkTitle: "Focus Stealing" weight: 12 description: > How to work with Native Events in the Legacy Firefox extension. +aliases: [ + "/documentation/legacy/selenium_2/focus_stealing" +] --- This documentation previously located [on the wiki](https://github.com/SeleniumHQ/selenium/wiki/Focus-Stealing-On-Linux) diff --git a/website_and_docs/content/documentation/legacy/selenium_2/grid_2.en.md b/website_and_docs/content/legacy/selenium_2/grid_2.en.md similarity index 99% rename from website_and_docs/content/documentation/legacy/selenium_2/grid_2.en.md rename to website_and_docs/content/legacy/selenium_2/grid_2.en.md index ab1129df8555..ba4c219e910e 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/grid_2.en.md +++ b/website_and_docs/content/legacy/selenium_2/grid_2.en.md @@ -7,7 +7,8 @@ description: > It was replaced by Grid 3 which removed RC code. Grid 3 was completely rewritten for the new Grid 4. aliases: [ -"/documentation/legacy/grid2/" +"/documentation/legacy/grid2/", +"/documentation/legacy/selenium_2/grid_2" ] --- This documentation previously located [on the wiki](https://github.com/SeleniumHQ/selenium/wiki/Grid2) \ diff --git a/website_and_docs/content/documentation/legacy/selenium_2/grid_platforms.en.md b/website_and_docs/content/legacy/selenium_2/grid_platforms.en.md similarity index 98% rename from website_and_docs/content/documentation/legacy/selenium_2/grid_platforms.en.md rename to website_and_docs/content/legacy/selenium_2/grid_platforms.en.md index 71d3ed90c15a..e2b2a38dd475 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/grid_platforms.en.md +++ b/website_and_docs/content/legacy/selenium_2/grid_platforms.en.md @@ -4,6 +4,9 @@ linkTitle: "Grid Platforms" weight: 10 description: > Information for working with platform names in Grid 2. +aliases: [ + "/documentation/legacy/selenium_2/grid_platforms" +] --- This documentation previously located [on the wiki](https://github.com/SeleniumHQ/selenium/wiki/Grid-Platforms) \ You can read more about [Grid 2]({{< ref "grid_2.md" >}}) diff --git a/website_and_docs/content/documentation/legacy/selenium_2/mobile.en.md b/website_and_docs/content/legacy/selenium_2/mobile.en.md similarity index 97% rename from website_and_docs/content/documentation/legacy/selenium_2/mobile.en.md rename to website_and_docs/content/legacy/selenium_2/mobile.en.md index 35a0321608be..8e696dbe386e 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/mobile.en.md +++ b/website_and_docs/content/legacy/selenium_2/mobile.en.md @@ -4,6 +4,9 @@ linkTitle: "Mobile" weight: 13 description: > Describes how Selenium 2 supported Android and iOS before Appium was created +aliases: [ + "/documentation/legacy/selenium_2/mobile" +] --- This documentation previously located [on the wiki](https://github.com/SeleniumHQ/selenium/wiki/Untrusted-SSL-Certificates) diff --git a/website_and_docs/content/documentation/legacy/selenium_2/parallel_execution.en.md b/website_and_docs/content/legacy/selenium_2/parallel_execution.en.md similarity index 98% rename from website_and_docs/content/documentation/legacy/selenium_2/parallel_execution.en.md rename to website_and_docs/content/legacy/selenium_2/parallel_execution.en.md index 59991bada3ee..22638d5ea8e6 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/parallel_execution.en.md +++ b/website_and_docs/content/legacy/selenium_2/parallel_execution.en.md @@ -4,6 +4,9 @@ linkTitle: "Parallel Execution" weight: 11 description: > Summary of additional constraints that arise when running Selenium2 in parallel. +aliases: [ + "/documentation/legacy/selenium_2/parallel_execution" +] --- This documentation previously located [on the wiki](https://github.com/SeleniumHQ/selenium/wiki/Scaling-WebDriver) diff --git a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.en.md b/website_and_docs/content/legacy/selenium_2/remote_server.en.md similarity index 97% rename from website_and_docs/content/documentation/legacy/selenium_2/remote_server.en.md rename to website_and_docs/content/legacy/selenium_2/remote_server.en.md index d2476ff4f1ab..1d6d7aabb6f5 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/remote_server.en.md +++ b/website_and_docs/content/legacy/selenium_2/remote_server.en.md @@ -6,7 +6,8 @@ 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/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/ssl_certs.en.md b/website_and_docs/content/legacy/selenium_2/ssl_certs.en.md similarity index 98% rename from website_and_docs/content/documentation/legacy/selenium_2/ssl_certs.en.md rename to website_and_docs/content/legacy/selenium_2/ssl_certs.en.md index 165d3cdea10f..4f31fa01239d 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/ssl_certs.en.md +++ b/website_and_docs/content/legacy/selenium_2/ssl_certs.en.md @@ -4,6 +4,9 @@ linkTitle: "SSL Certs" weight: 12 description: > Details on how Selenium 2 accepted untrusted SSL certificates +aliases: [ + "/documentation/legacy/selenium_2/ssl_certs" +] --- This documentation previously located [on the wiki](https://github.com/SeleniumHQ/selenium/wiki/Untrusted-SSL-Certificates) diff --git a/website_and_docs/content/documentation/legacy/selenium_2/team.en.md b/website_and_docs/content/legacy/selenium_2/team.en.md similarity index 97% rename from website_and_docs/content/documentation/legacy/selenium_2/team.en.md rename to website_and_docs/content/legacy/selenium_2/team.en.md index 70955b45dc14..5f89c1e1cac0 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/team.en.md +++ b/website_and_docs/content/legacy/selenium_2/team.en.md @@ -5,7 +5,8 @@ weight: 16 description: > This is who you can blame for the Selenium 2 release. aliases: [ -"/documentation/legacy/developers/team/" +"/documentation/legacy/developers/team/", +"/documentation/legacy/selenium_2/team" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.en.md b/website_and_docs/content/legacy/selenium_2/upgrading.en.md similarity index 98% rename from website_and_docs/content/documentation/legacy/selenium_2/upgrading.en.md rename to website_and_docs/content/legacy/selenium_2/upgrading.en.md index ec5b1b8b9f2d..9b894ef4f127 100644 --- a/website_and_docs/content/documentation/legacy/selenium_2/upgrading.en.md +++ b/website_and_docs/content/legacy/selenium_2/upgrading.en.md @@ -6,7 +6,8 @@ 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/legacy/selenium_2/upgrading" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_3/_index.en.md b/website_and_docs/content/legacy/selenium_3/_index.en.md similarity index 83% rename from website_and_docs/content/documentation/legacy/selenium_3/_index.en.md rename to website_and_docs/content/legacy/selenium_3/_index.en.md index f26fa95ec98d..b66daf7cf712 100644 --- a/website_and_docs/content/documentation/legacy/selenium_3/_index.en.md +++ b/website_and_docs/content/legacy/selenium_3/_index.en.md @@ -5,4 +5,7 @@ weight: 6 description: > Selenium 3 was the implementation of WebDriver without the Selenium RC Code. It has since been replaced with Selenium 4, which implements the W3C WebDriver specification. +aliases: [ + "/documentation/legacy/selenium_3/" +] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.en.md b/website_and_docs/content/legacy/selenium_3/grid_3.en.md similarity index 94% rename from website_and_docs/content/documentation/legacy/selenium_3/grid_3.en.md rename to website_and_docs/content/legacy/selenium_3/grid_3.en.md index 3bb070123028..902a2fafe506 100644 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_3.en.md +++ b/website_and_docs/content/legacy/selenium_3/grid_3.en.md @@ -7,7 +7,8 @@ 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/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_components.en.md b/website_and_docs/content/legacy/selenium_3/grid_components.en.md similarity index 92% rename from website_and_docs/content/documentation/legacy/selenium_3/grid_components.en.md rename to website_and_docs/content/legacy/selenium_3/grid_components.en.md index 06b3ccc63759..db3c7ffcb964 100644 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_components.en.md +++ b/website_and_docs/content/legacy/selenium_3/grid_components.en.md @@ -6,7 +6,8 @@ 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/legacy/selenium_3/grid_components" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.en.md b/website_and_docs/content/legacy/selenium_3/grid_setup.en.md similarity index 98% rename from website_and_docs/content/documentation/legacy/selenium_3/grid_setup.en.md rename to website_and_docs/content/legacy/selenium_3/grid_setup.en.md index d68d7af7ab56..6053123995eb 100644 --- a/website_and_docs/content/documentation/legacy/selenium_3/grid_setup.en.md +++ b/website_and_docs/content/legacy/selenium_3/grid_setup.en.md @@ -6,7 +6,8 @@ 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/legacy/selenium_3/grid_setup" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_ide/_index.en.md b/website_and_docs/content/legacy/selenium_ide/_index.en.md similarity index 99% rename from website_and_docs/content/documentation/legacy/selenium_ide/_index.en.md rename to website_and_docs/content/legacy/selenium_ide/_index.en.md index 0e937358da24..f2c3f951cb73 100644 --- a/website_and_docs/content/documentation/legacy/selenium_ide/_index.en.md +++ b/website_and_docs/content/legacy/selenium_ide/_index.en.md @@ -4,7 +4,10 @@ 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/legacy/selenium_ide/" +] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.en.md b/website_and_docs/content/legacy/selenium_ide/html_runner.en.md similarity index 97% rename from website_and_docs/content/documentation/legacy/selenium_ide/html_runner.en.md rename to website_and_docs/content/legacy/selenium_ide/html_runner.en.md index bd40067671e2..c0a8b0931299 100644 --- a/website_and_docs/content/documentation/legacy/selenium_ide/html_runner.en.md +++ b/website_and_docs/content/legacy/selenium_ide/html_runner.en.md @@ -6,7 +6,8 @@ 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/legacy/selenium_ide/html_runner" ] --- diff --git a/website_and_docs/content/documentation/legacy/selenium_ide/releases.en.md b/website_and_docs/content/legacy/selenium_ide/releases.en.md similarity index 99% rename from website_and_docs/content/documentation/legacy/selenium_ide/releases.en.md rename to website_and_docs/content/legacy/selenium_ide/releases.en.md index 860d89e062a6..1f0046f1d397 100644 --- a/website_and_docs/content/documentation/legacy/selenium_ide/releases.en.md +++ b/website_and_docs/content/legacy/selenium_ide/releases.en.md @@ -5,6 +5,9 @@ weight: 4 description: > Selenium IDE was the original Firefox extension for Record and Playback. Version 2.x was updated to support WebDriver. +aliases: [ + "/documentation/legacy/selenium_ide/releases" +] --- This documentation previously located [on the wiki](https://github.com/SeleniumHQ/selenium/wiki/SeIDE-Release-Notes) diff --git a/website_and_docs/hugo.toml b/website_and_docs/hugo.toml index a9c406c43063..77f007317455 100644 --- a/website_and_docs/hugo.toml +++ b/website_and_docs/hugo.toml @@ -118,7 +118,7 @@ social_image_path = ["images/selenium_logo_square_green.png"] # Menu title if your navbar has a versions selector to access old versions of your site. # This menu appears only if you have at least one [params.versions] set. -version_menu = "Releases" +version_menu = "v4.0" # Flag used in the "version-banner" partial to decide whether to display a # banner on every page indicating that this is an archived version of the docs. @@ -343,3 +343,10 @@ year = "year" methods = ['(?i)GET|POST'] urls = ['.*'] +[[params.versions]] + version = "v4.0" + url = "/documentation" + +[[params.versions]] + version = "Legacy" + url = "/legacy/" diff --git a/website_and_docs/layouts/partials/breadcrumb.html b/website_and_docs/layouts/partials/breadcrumb.html index a1e4fbb9ec80..832b7848f1b9 100644 --- a/website_and_docs/layouts/partials/breadcrumb.html +++ b/website_and_docs/layouts/partials/breadcrumb.html @@ -6,14 +6,6 @@ {{- if $isSingle }} td-breadcrumbs__single {{- end }}"> From cd7da0ed8e7579e989e2c2997c0a8ed8ade83549 Mon Sep 17 00:00:00 2001 From: titusfortner Date: Fri, 24 Nov 2023 11:47:00 -0600 Subject: [PATCH 2/5] remove badge-version in documentation --- website_and_docs/assets/scss/_badges.scss | 7 ------- .../documentation/grid/getting_started.en.md | 2 +- .../documentation/grid/getting_started.ja.md | 2 +- .../documentation/grid/getting_started.pt-br.md | 2 +- .../documentation/grid/getting_started.zh-cn.md | 2 +- .../webdriver/actions_api/_index.en.md | 2 -- .../webdriver/actions_api/_index.ja.md | 2 -- .../webdriver/actions_api/_index.pt-br.md | 2 -- .../webdriver/actions_api/_index.zh-cn.md | 2 -- .../webdriver/actions_api/keyboard.en.md | 1 - .../webdriver/actions_api/keyboard.ja.md | 1 - .../webdriver/actions_api/keyboard.pt-br.md | 1 - .../webdriver/actions_api/keyboard.zh-cn.md | 1 - .../webdriver/actions_api/mouse.en.md | 8 -------- .../webdriver/actions_api/mouse.ja.md | 8 -------- .../webdriver/actions_api/mouse.pt-br.md | 8 -------- .../webdriver/actions_api/mouse.zh-cn.md | 8 -------- .../webdriver/actions_api/pen.en.md | 5 ----- .../webdriver/actions_api/pen.ja.md | 4 ---- .../webdriver/actions_api/pen.pt-br.md | 4 ---- .../webdriver/actions_api/pen.zh-cn.md | 4 ---- .../webdriver/actions_api/wheel.en.md | 1 - .../webdriver/actions_api/wheel.ja.md | 1 - .../webdriver/actions_api/wheel.pt-br.md | 1 - .../webdriver/actions_api/wheel.zh-cn.md | 1 - .../webdriver_bidi/browsing_context.en.md | 11 ----------- .../webdriver_bidi/browsing_context.ja.md | 11 ----------- .../webdriver_bidi/browsing_context.pt-br.md | 11 ----------- .../webdriver_bidi/browsing_context.zh-cn.md | 11 ----------- .../bidirectional/webdriver_bidi/log.en.md | 2 -- .../bidirectional/webdriver_bidi/log.ja.md | 2 -- .../bidirectional/webdriver_bidi/log.pt-br.md | 2 -- .../bidirectional/webdriver_bidi/log.zh-cn.md | 2 -- .../webdriver/browsers/chrome.en.md | 13 ------------- .../webdriver/browsers/chrome.ja.md | 13 ------------- .../webdriver/browsers/chrome.pt-br.md | 13 ------------- .../webdriver/browsers/chrome.zh-cn.md | 13 ------------- .../documentation/webdriver/browsers/edge.en.md | 10 ---------- .../documentation/webdriver/browsers/edge.ja.md | 10 ---------- .../webdriver/browsers/edge.pt-br.md | 10 ---------- .../webdriver/browsers/edge.zh-cn.md | 10 ---------- .../webdriver/browsers/firefox.en.md | 16 ---------------- .../webdriver/browsers/firefox.ja.md | 16 ---------------- .../webdriver/browsers/firefox.pt-br.md | 16 ---------------- .../webdriver/browsers/firefox.zh-cn.md | 16 ---------------- .../webdriver/browsers/internet_explorer.en.md | 8 -------- .../webdriver/browsers/internet_explorer.ja.md | 8 -------- .../browsers/internet_explorer.pt-br.md | 8 -------- .../browsers/internet_explorer.zh-cn.md | 8 -------- .../webdriver/browsers/safari.en.md | 2 -- .../webdriver/browsers/safari.ja.md | 2 -- .../webdriver/browsers/safari.pt-br.md | 2 -- .../webdriver/browsers/safari.zh-cn.md | 2 -- .../webdriver/drivers/service.en.md | 6 ------ .../webdriver/drivers/service.ja.md | 6 ------ .../webdriver/drivers/service.pt-br.md | 6 ------ .../webdriver/drivers/service.zh-cn.md | 6 ------ .../support_features/select_lists.en.md | 1 - .../support_features/select_lists.ja.md | 1 - .../support_features/select_lists.pt-br.md | 1 - .../support_features/select_lists.zh-cn.md | 1 - .../webdriver/troubleshooting/logging.en.md | 5 ----- website_and_docs/hugo.toml | 4 ++-- .../layouts/shortcodes/badge-version.html | 6 ------ 64 files changed, 6 insertions(+), 365 deletions(-) delete mode 100644 website_and_docs/layouts/shortcodes/badge-version.html diff --git a/website_and_docs/assets/scss/_badges.scss b/website_and_docs/assets/scss/_badges.scss index b25483ac221f..56c8d207097c 100644 --- a/website_and_docs/assets/scss/_badges.scss +++ b/website_and_docs/assets/scss/_badges.scss @@ -1,11 +1,4 @@ -.selenium-badge-version { - background:green; - color:white; - padding:.2rem; - font-weight:750; -} - .selenium-badge-browser { background:blue; color:white; 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 c5d956a88883..333a428a21d4 100644 --- a/website_and_docs/content/documentation/grid/getting_started.en.md +++ b/website_and_docs/content/documentation/grid/getting_started.en.md @@ -219,7 +219,7 @@ locally. More detailed examples and usages can be found in the [Configuring Components]({{< ref "/configuration" >}}) section. {{% /pageinfo %}} -## Using the Java 11 HTTP Client {{% badge-version version="4.5" %}} +## Using the Java 11 HTTP Client By default, Grid will use [AsyncHttpClient](https://github.com/AsyncHttpClient/async-http-client). AsyncHttpClient is an open-source library built on top of Netty. It allows the execution of HTTP 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 869519d2b1a7..9c4aa34a73fc 100644 --- a/website_and_docs/content/documentation/grid/getting_started.ja.md +++ b/website_and_docs/content/documentation/grid/getting_started.ja.md @@ -229,7 +229,7 @@ API 呼び出しは[http://localhost:4444/status](http://localhost:4444/status) より詳細な例と使用方法は[コンポーネント]({{< ref "components.md" >}})の章を参照してください。 {{% /pageinfo %}} -## Java 11 の HTTP クライアントを利用する {{% badge-version version="4.5" %}} +## Java 11 の HTTP クライアントを利用する デフォルトでは Grid は[AsyncHttpClient](https://github.com/AsyncHttpClient/async-http-client)を使用します。 AsyncHttpClient は Netty を使ったオープンソースのライブラリで、非同期での HTTP リクエストを実現します。 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 ab919c0ded6d..4f6d2f060bdc 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 @@ -214,7 +214,7 @@ Para simplificar, todos os exemplos apresentados assumem que os componentes est 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" %}} +## Usando o cliente HTTP nativo Java 11 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 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 b799eb48847f..b84d6da43bff 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 @@ -212,7 +212,7 @@ driver.quit(); 为简单起见,本页中显示的所有命令示例均假定组件正在运行在本地。更详细的示例和用法可以在[配置组件]({{< ref "/configuration" >}}) 部分。 {{% /pageinfo %}} -## 使用 Java 11 中的 HTTP Client {{% badge-version version="4.5" %}} +## 使用 Java 11 中的 HTTP Client 默认情况下,Grid 将使用 [AsyncHttpClient](https://github.com/AsyncHttpClient/async-http-client)。 AsyncHttpClient 是一个建立在 Netty 之上的开源库。 它允许异步执行 HTTP 请求和响应。 此外,它还提供 WebSocket 支持。 因此它很合适。 diff --git a/website_and_docs/content/documentation/webdriver/actions_api/_index.en.md b/website_and_docs/content/documentation/webdriver/actions_api/_index.en.md index f601c5b7ef2e..9a2f97721886 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/_index.en.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/_index.en.md @@ -39,11 +39,9 @@ to wait a beat between actions for things to work correctly. {{< gh-codeblock path="examples/python/tests/actions_api/test_actions.py#L13-L20" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/ActionsAPI/ActionsTest.cs#L18-L25" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/ruby/spec/actions_api/actions_spec.rb#L12-L19" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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 f601c5b7ef2e..9a2f97721886 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 @@ -39,11 +39,9 @@ to wait a beat between actions for things to work correctly. {{< gh-codeblock path="examples/python/tests/actions_api/test_actions.py#L13-L20" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/ActionsAPI/ActionsTest.cs#L18-L25" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/ruby/spec/actions_api/actions_spec.rb#L12-L19" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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 3c984391cb73..32f1986612a5 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 @@ -25,11 +25,9 @@ Movimentos de ponteiro e rolagem da roda permitem que o usuário defina uma dura {{< gh-codeblock path="examples/python/tests/actions_api/test_actions.py#L13-L20" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/ActionsAPI/ActionsTest.cs#L18-L25" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/ruby/spec/actions_api/actions_spec.rb#L12-L19" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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 07ad565bc65f..d15ebe8885a0 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 @@ -52,11 +52,9 @@ Selenium允许您构建分配给特定输入的独立操作命令, {{< gh-codeblock path="examples/python/tests/actions_api/test_actions.py#L13-L20" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/ActionsAPI/ActionsTest.cs#L18-L25" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/ruby/spec/actions_api/actions_spec.rb#L12-L19" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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 eae8d20c87f3..4a719b239609 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 @@ -134,7 +134,6 @@ primarily this gets used when needing to type multiple characters in the middle {{< 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" >}} 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 e9bf2ad9d3a6..7c71db5d2124 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 @@ -134,7 +134,6 @@ primarily this gets used when needing to type multiple characters in the middle {{< 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" >}} 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 b09e78d854fb..70f4b269cf1e 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 @@ -129,7 +129,6 @@ primarily this gets used when needing to type multiple characters in the middle {{< 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" >}} 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 7e904a884e18..01530d244042 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 @@ -136,7 +136,6 @@ Use the [Java Keys enum](https://github.com/SeleniumHQ/selenium/blob/selenium-4. {{< 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" >}} 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 5e9f5c33407d..53dbe3ad8d6c 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 @@ -111,19 +111,15 @@ There is no convenience method for this, it is just pressing and releasing mouse {{< 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#L49-L52" >}} {{< /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#L21-L22" >}} {{< /tab >}} {{< tab header="Kotlin" >}} @@ -140,19 +136,15 @@ There is no convenience method for this, it is just pressing and releasing mouse {{< 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#L63-L66" >}} {{< /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#L34-L35" >}} {{< /tab >}} {{< tab header="Kotlin" >}} 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 c560084de5a2..f199ecd36495 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 @@ -111,19 +111,15 @@ There is no convenience method for this, it is just pressing and releasing mouse {{< 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#L49-L52" >}} {{< /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#L21-L22" >}} {{< /tab >}} {{< tab header="Kotlin" >}} @@ -140,19 +136,15 @@ There is no convenience method for this, it is just pressing and releasing mouse {{< 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#L63-L66" >}} {{< /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#L34-L35" >}} {{< /tab >}} {{< tab header="Kotlin" >}} 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 9259b152daae..fdbe36f3587f 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 @@ -108,19 +108,15 @@ Este termo pode se referir a um clique com o botão X1 (botão de voltar) do mou {{< 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#L49-L52" >}} {{< /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#L21-L22" >}} {{< /tab >}} {{< tab header="Kotlin" >}} @@ -137,19 +133,15 @@ Este termo se refere a um clique com o botão X2 (botão de avançar) do mouse. {{< 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#L63-L66" >}} {{< /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#L34-L35" >}} {{< /tab >}} {{< tab header="Kotlin" >}} 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 fe0d58dc58c7..edbb8c676ef9 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 @@ -111,19 +111,15 @@ There is no convenience method for this, it is just pressing and releasing mouse {{< 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#L49-L52" >}} {{< /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#L21-L22" >}} {{< /tab >}} {{< tab header="Kotlin" >}} @@ -140,19 +136,15 @@ There is no convenience method for this, it is just pressing and releasing mouse {{< 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#L63-L66" >}} {{< /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#L34-L35" >}} {{< /tab >}} {{< tab header="Kotlin" >}} diff --git a/website_and_docs/content/documentation/webdriver/actions_api/pen.en.md b/website_and_docs/content/documentation/webdriver/actions_api/pen.en.md index b979c7b6f541..d370a19b94a4 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/pen.en.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/pen.en.md @@ -20,18 +20,15 @@ has 5 buttons, a pen has 3 equivalent button states: {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/actions_api/PenTest.java#L26-L33" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/python/tests/actions_api/test_pen.py#L12-L20" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/ActionsAPI/PenTest.cs#L19-L28" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/ruby/spec/actions_api/pen_spec.rb#L11-L17" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -44,8 +41,6 @@ has 5 buttons, a pen has 3 equivalent button states: ## Adding Pointer Event Attributes -{{< badge-version version="4.2" >}} - {{< tabpane text=true >}} {{< tab header="Java" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/actions_api/PenTest.java#L67-L81" >}} diff --git a/website_and_docs/content/documentation/webdriver/actions_api/pen.ja.md b/website_and_docs/content/documentation/webdriver/actions_api/pen.ja.md index b979c7b6f541..a1da3c51ed27 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/pen.ja.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/pen.ja.md @@ -20,18 +20,15 @@ has 5 buttons, a pen has 3 equivalent button states: {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/actions_api/PenTest.java#L26-L33" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/python/tests/actions_api/test_pen.py#L12-L20" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/ActionsAPI/PenTest.cs#L19-L28" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/ruby/spec/actions_api/pen_spec.rb#L11-L17" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -44,7 +41,6 @@ has 5 buttons, a pen has 3 equivalent button states: ## Adding Pointer Event Attributes -{{< badge-version version="4.2" >}} {{< tabpane text=true >}} {{< tab header="Java" >}} diff --git a/website_and_docs/content/documentation/webdriver/actions_api/pen.pt-br.md b/website_and_docs/content/documentation/webdriver/actions_api/pen.pt-br.md index d112c2c30cc1..5db53ef43abb 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/pen.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/pen.pt-br.md @@ -18,18 +18,15 @@ Uma caneta é um tipo de entrada de ponteiro que possui a maior parte do mesmo c {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/actions_api/PenTest.java#L26-L33" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/python/tests/actions_api/test_pen.py#L12-L20" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/ActionsAPI/PenTest.cs#L19-L28" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/ruby/spec/actions_api/pen_spec.rb#L11-L17" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -42,7 +39,6 @@ Uma caneta é um tipo de entrada de ponteiro que possui a maior parte do mesmo c ## Adicionando Atributos de Evento de Ponteiro -{{< badge-version version="4.2" >}} {{< tabpane text=true >}} {{< tab header="Java" >}} diff --git a/website_and_docs/content/documentation/webdriver/actions_api/pen.zh-cn.md b/website_and_docs/content/documentation/webdriver/actions_api/pen.zh-cn.md index b979c7b6f541..a1da3c51ed27 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/pen.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/pen.zh-cn.md @@ -20,18 +20,15 @@ has 5 buttons, a pen has 3 equivalent button states: {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/actions_api/PenTest.java#L26-L33" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/python/tests/actions_api/test_pen.py#L12-L20" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/ActionsAPI/PenTest.cs#L19-L28" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.2" >}} {{< gh-codeblock path="examples/ruby/spec/actions_api/pen_spec.rb#L11-L17" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -44,7 +41,6 @@ has 5 buttons, a pen has 3 equivalent button states: ## Adding Pointer Event Attributes -{{< badge-version version="4.2" >}} {{< tabpane text=true >}} {{< tab header="Java" >}} diff --git a/website_and_docs/content/documentation/webdriver/actions_api/wheel.en.md b/website_and_docs/content/documentation/webdriver/actions_api/wheel.en.md index 8cb6e6f78986..af7b6f06dcf1 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/wheel.en.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/wheel.en.md @@ -6,7 +6,6 @@ description: > A representation of a scroll wheel input device for interacting with a web page. --- -{{< badge-version version="4.2" >}} {{< badge-browser browser=Chromium wpt="perform_actions/wheel.py" >}} There are 5 scenarios for scrolling on a page. diff --git a/website_and_docs/content/documentation/webdriver/actions_api/wheel.ja.md b/website_and_docs/content/documentation/webdriver/actions_api/wheel.ja.md index 8cb6e6f78986..af7b6f06dcf1 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/wheel.ja.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/wheel.ja.md @@ -6,7 +6,6 @@ description: > A representation of a scroll wheel input device for interacting with a web page. --- -{{< badge-version version="4.2" >}} {{< badge-browser browser=Chromium wpt="perform_actions/wheel.py" >}} There are 5 scenarios for scrolling on a page. diff --git a/website_and_docs/content/documentation/webdriver/actions_api/wheel.pt-br.md b/website_and_docs/content/documentation/webdriver/actions_api/wheel.pt-br.md index 134ac01f73f6..5d3a118a6ba6 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/wheel.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/wheel.pt-br.md @@ -6,7 +6,6 @@ description: > "Uma representação de um dispositivo de entrada de roda de rolagem para interagir com uma página da web." --- -{{< badge-version version="4.2" >}} {{< badge-browser browser=Chromium wpt="perform_actions/wheel.py" >}} Existem 5 cenários para rolagem em uma página. diff --git a/website_and_docs/content/documentation/webdriver/actions_api/wheel.zh-cn.md b/website_and_docs/content/documentation/webdriver/actions_api/wheel.zh-cn.md index 8cb6e6f78986..af7b6f06dcf1 100644 --- a/website_and_docs/content/documentation/webdriver/actions_api/wheel.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/actions_api/wheel.zh-cn.md @@ -6,7 +6,6 @@ description: > A representation of a scroll wheel input device for interacting with a web page. --- -{{< badge-version version="4.2" >}} {{< badge-browser browser=Chromium wpt="perform_actions/wheel.py" >}} There are 5 scenarios for scrolling on a page. diff --git a/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/browsing_context.en.md b/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/browsing_context.en.md index f2f0523e2fd7..b00ee990af91 100644 --- a/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/browsing_context.en.md +++ b/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/browsing_context.en.md @@ -15,7 +15,6 @@ Creates a new browsing context in a new window. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L35" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -35,7 +34,6 @@ Creates a new browsing context in a new tab. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L49" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -55,7 +53,6 @@ Creates a browsing context for the existing tab/window to run commands. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L28-L29" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -76,7 +73,6 @@ The API allows to pass the reference browsing context, which is used to create a {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L41-L43" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -96,7 +92,6 @@ The API allows to pass the reference browsing context, which is used to create a {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L55-L57" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -114,7 +109,6 @@ The API allows to pass the reference browsing context, which is used to create a {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L63-L65" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -132,7 +126,6 @@ The API allows to pass the reference browsing context, which is used to create a {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L74-L77" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -152,7 +145,6 @@ Provides a tree of all browsing contexts descending from the parent browsing con {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L86-L91" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -172,7 +164,6 @@ Provides a tree of all browsing contexts descending from the parent browsing con {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L102-L105" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -190,7 +181,6 @@ Provides a tree of all browsing contexts descending from the parent browsing con {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L117-L120" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -208,7 +198,6 @@ Provides a tree of all browsing contexts descending from the parent browsing con {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L127-L130" >}} {{< /tab >}} {{< tab header="Ruby" >}} diff --git a/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/browsing_context.ja.md b/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/browsing_context.ja.md index a56c12c24198..b2a8c80b4539 100644 --- a/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/browsing_context.ja.md +++ b/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/browsing_context.ja.md @@ -21,7 +21,6 @@ Creates a new browsing context in a new window. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L35" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -41,7 +40,6 @@ Creates a new browsing context in a new tab. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L49" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -61,7 +59,6 @@ Creates a browsing context for the existing tab/window to run commands. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L28-L29" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -82,7 +79,6 @@ The API allows to pass the reference browsing context, which is used to create a {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L41-L43" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -102,7 +98,6 @@ The API allows to pass the reference browsing context, which is used to create a {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L55-L57" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -120,7 +115,6 @@ The API allows to pass the reference browsing context, which is used to create a {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L63-L65" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -138,7 +132,6 @@ The API allows to pass the reference browsing context, which is used to create a {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L74-L77" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -158,7 +151,6 @@ Provides a tree of all browsing contexts descending from the parent browsing con {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L86-L91" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -178,7 +170,6 @@ Provides a tree of all browsing contexts descending from the parent browsing con {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L102-L105" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -196,7 +187,6 @@ Provides a tree of all browsing contexts descending from the parent browsing con {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L117-L120" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -214,7 +204,6 @@ Provides a tree of all browsing contexts descending from the parent browsing con {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L127-L130" >}} {{< /tab >}} {{< tab header="Ruby" >}} diff --git a/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/browsing_context.pt-br.md b/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/browsing_context.pt-br.md index fe0a59287f07..2a128d7f39c8 100644 --- a/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/browsing_context.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/browsing_context.pt-br.md @@ -21,7 +21,6 @@ Creates a new browsing context in a new window. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L35" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -41,7 +40,6 @@ Creates a new browsing context in a new tab. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L49" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -61,7 +59,6 @@ Creates a browsing context for the existing tab/window to run commands. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L28-L29" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -82,7 +79,6 @@ The API allows to pass the reference browsing context, which is used to create a {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L41-L43" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -102,7 +98,6 @@ The API allows to pass the reference browsing context, which is used to create a {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L55-L57" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -120,7 +115,6 @@ The API allows to pass the reference browsing context, which is used to create a {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L63-L65" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -138,7 +132,6 @@ The API allows to pass the reference browsing context, which is used to create a {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L74-L77" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -158,7 +151,6 @@ Provides a tree of all browsing contexts descending from the parent browsing con {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L86-L91" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -178,7 +170,6 @@ Provides a tree of all browsing contexts descending from the parent browsing con {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L102-L105" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -196,7 +187,6 @@ Provides a tree of all browsing contexts descending from the parent browsing con {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L117-L120" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -214,7 +204,6 @@ Provides a tree of all browsing contexts descending from the parent browsing con {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L127-L130" >}} {{< /tab >}} {{< tab header="Ruby" >}} diff --git a/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/browsing_context.zh-cn.md b/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/browsing_context.zh-cn.md index fa2c6d9773bb..a41a4fb7d156 100644 --- a/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/browsing_context.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/browsing_context.zh-cn.md @@ -21,7 +21,6 @@ Creates a new browsing context in a new window. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L35" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -41,7 +40,6 @@ Creates a new browsing context in a new tab. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L49" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -61,7 +59,6 @@ Creates a browsing context for the existing tab/window to run commands. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L28-L29" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -82,7 +79,6 @@ The API allows to pass the reference browsing context, which is used to create a {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L41-L43" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -102,7 +98,6 @@ The API allows to pass the reference browsing context, which is used to create a {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L55-L57" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -120,7 +115,6 @@ The API allows to pass the reference browsing context, which is used to create a {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L63-L65" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -138,7 +132,6 @@ The API allows to pass the reference browsing context, which is used to create a {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L74-L77" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -158,7 +151,6 @@ Provides a tree of all browsing contexts descending from the parent browsing con {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L86-L91" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -178,7 +170,6 @@ Provides a tree of all browsing contexts descending from the parent browsing con {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L102-L105" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -196,7 +187,6 @@ Provides a tree of all browsing contexts descending from the parent browsing con {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L117-L120" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -214,7 +204,6 @@ Provides a tree of all browsing contexts descending from the parent browsing con {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/BrowsingContextTest.java#L127-L130" >}} {{< /tab >}} {{< tab header="Ruby" >}} diff --git a/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/log.en.md b/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/log.en.md index 8ae3eb9e6d02..8cbfebe4c9b9 100644 --- a/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/log.en.md +++ b/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/log.en.md @@ -15,7 +15,6 @@ Listen to the `console.log` events and register callbacks to process the event. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/LogTest.java#L31-L38" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -55,7 +54,6 @@ Listen to all JS logs at all levels and register callbacks to process the log. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/LogTest.java#L52-L59" >}} {{< /tab >}} {{< tab header="Ruby" >}} diff --git a/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/log.ja.md b/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/log.ja.md index 7b94be6de2f8..da570f59e5d4 100644 --- a/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/log.ja.md +++ b/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/log.ja.md @@ -21,7 +21,6 @@ Listen to the `console.log` events and register callbacks to process the event. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/LogTest.java#L31-L38" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -61,7 +60,6 @@ Listen to all JS logs at all levels and register callbacks to process the log. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/LogTest.java#L52-L59" >}} {{< /tab >}} {{< tab header="Ruby" >}} diff --git a/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/log.pt-br.md b/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/log.pt-br.md index be0814eaa07a..72478b9ea60f 100644 --- a/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/log.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/log.pt-br.md @@ -21,7 +21,6 @@ Listen to the `console.log` events and register callbacks to process the event. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/LogTest.java#L31-L38" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -61,7 +60,6 @@ Listen to all JS logs at all levels and register callbacks to process the log. {{< tabpane text=true >}} {{< tab header="Java" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/java/src/test/java/dev/selenium/bidirectional/webdriver_bidi/LogTest.java#L52-L59" >}} {{< /tab >}} {{< tab header="Ruby" >}} diff --git a/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/log.zh-cn.md b/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/log.zh-cn.md index 240ac370a900..a15d8d6894b3 100644 --- a/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/log.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/bidirectional/webdriver_bidi/log.zh-cn.md @@ -28,7 +28,6 @@ Listen to the `console.log` events and register callbacks to process the event. {{< badge-code >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/javascript/test/bidirectional/logInspector.spec.js#L23-37" >}} {{< /tab >}} {{< tab header="Kotlin" >}} @@ -49,7 +48,6 @@ and register callbacks to process the exception details. {{< badge-code >}} {{< /tab >}} {{< tab header="JavaScript" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="/examples/javascript/test/bidirectional/logInspector.spec.js#L44-54" >}} {{< /tab >}} {{< tab header="Kotlin" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md b/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md index 84b3e1b3877b..58be59030b47 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.en.md @@ -211,14 +211,12 @@ Property key: `ChromeDriverService.CHROME_DRIVER_LOG_PROPERTY`\ Property value: String representing path to log file {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L71" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L86" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L67" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -235,14 +233,12 @@ To change the logging output to display in the console as STDOUT: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L114-L115" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `ChromeDriverService.CHROME_DRIVER_LOG_PROPERTY`\ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L82" >}} {{< /tab >}} {{< tab header="CSharp" >}} @@ -250,7 +246,6 @@ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{< /tab >}} {{% tab header="Ruby" %}} `$stdout` and `$stderr` are both valid values -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L76" >}} {{% /tab %}} {{< tab header="JavaScript" >}} @@ -268,21 +263,18 @@ so this example is just setting the log level generically: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L129-L130" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `ChromeDriverService.CHROME_DRIVER_LOG_LEVEL_PROPERTY`\ Property value: String representation of `ChromiumDriverLogLevel` enum {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L93" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L87" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -303,7 +295,6 @@ The log output will be managed by the driver, not the process, so minor differen {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L147-L148" >}} **Note**: Java also allows toggling these features by System Property:\ Property keys: `ChromeDriverService.CHROME_DRIVER_APPEND_LOG_PROPERTY` and `ChromeDriverService.CHROME_DRIVER_READABLE_TIMESTAMP`\ @@ -316,7 +307,6 @@ Property value: `"true"` or `"false"` {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L97-L98" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -335,21 +325,18 @@ Note that this is an unsupported feature, and bugs will not be investigated. {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L166-L167" >}} **Note**: Java also allows disabling build checks by System Property:\ Property key: `ChromeDriverService.CHROME_DRIVER_DISABLE_BUILD_CHECK`\ Property value: `"true"` or `"false"` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L115" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L155" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L108" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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 0199e6ca2605..7ddca30f69ce 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md @@ -215,14 +215,12 @@ Property key: `ChromeDriverService.CHROME_DRIVER_LOG_PROPERTY`\ Property value: String representing path to log file {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L71" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L86" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L67" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -239,14 +237,12 @@ To change the logging output to display in the console as STDOUT: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L114-L115" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `ChromeDriverService.CHROME_DRIVER_LOG_PROPERTY`\ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L82" >}} {{< /tab >}} {{< tab header="CSharp" >}} @@ -254,7 +250,6 @@ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{< /tab >}} {{% tab header="Ruby" %}} `$stdout` and `$stderr` are both valid values -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L76" >}} {{% /tab %}} {{< tab header="JavaScript" >}} @@ -272,21 +267,18 @@ so this example is just setting the log level generically: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L129-L130" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `ChromeDriverService.CHROME_DRIVER_LOG_LEVEL_PROPERTY`\ Property value: String representation of `ChromiumDriverLogLevel` enum {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L93" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L87" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -307,7 +299,6 @@ The log output will be managed by the driver, not the process, so minor differen {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L147-L148" >}} **Note**: Java also allows toggling these features by System Property:\ Property keys: `ChromeDriverService.CHROME_DRIVER_APPEND_LOG_PROPERTY` and `ChromeDriverService.CHROME_DRIVER_READABLE_TIMESTAMP`\ @@ -320,7 +311,6 @@ Property value: `"true"` or `"false"` {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L97-L98" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -339,21 +329,18 @@ Note that this is an unsupported feature, and bugs will not be investigated. {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L166-L167" >}} **Note**: Java also allows disabling build checks by System Property:\ Property key: `ChromeDriverService.CHROME_DRIVER_DISABLE_BUILD_CHECK`\ Property value: `"true"` or `"false"` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L115" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L155" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L108" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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 22c396d89995..51ac6ff7bf52 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 @@ -212,14 +212,12 @@ Property key: `ChromeDriverService.CHROME_DRIVER_LOG_PROPERTY`\ Property value: String representing path to log file {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L71" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L86" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L67" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -236,14 +234,12 @@ To change the logging output to display in the console as STDOUT: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L114-L115" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `ChromeDriverService.CHROME_DRIVER_LOG_PROPERTY`\ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L82" >}} {{< /tab >}} {{< tab header="CSharp" >}} @@ -251,7 +247,6 @@ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{< /tab >}} {{% tab header="Ruby" %}} `$stdout` and `$stderr` are both valid values -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L76" >}} {{% /tab %}} {{< tab header="JavaScript" >}} @@ -269,21 +264,18 @@ so this example is just setting the log level generically: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L129-L130" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `ChromeDriverService.CHROME_DRIVER_LOG_LEVEL_PROPERTY`\ Property value: String representation of `ChromiumDriverLogLevel` enum {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L93" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L87" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -304,7 +296,6 @@ The log output will be managed by the driver, not the process, so minor differen {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L147-L148" >}} **Note**: Java also allows toggling these features by System Property:\ Property keys: `ChromeDriverService.CHROME_DRIVER_APPEND_LOG_PROPERTY` and `ChromeDriverService.CHROME_DRIVER_READABLE_TIMESTAMP`\ @@ -317,7 +308,6 @@ Property value: `"true"` or `"false"` {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L97-L98" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -336,21 +326,18 @@ Note that this is an unsupported feature, and bugs will not be investigated. {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L166-L167" >}} **Note**: Java also allows disabling build checks by System Property:\ Property key: `ChromeDriverService.CHROME_DRIVER_DISABLE_BUILD_CHECK`\ Property value: `"true"` or `"false"` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L115" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L155" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L108" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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 f246d9956cd4..b16544b404fb 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 @@ -211,14 +211,12 @@ Property key: `ChromeDriverService.CHROME_DRIVER_LOG_PROPERTY`\ Property value: String representing path to log file {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L71" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L86" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L67" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -235,14 +233,12 @@ To change the logging output to display in the console as STDOUT: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L114-L115" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `ChromeDriverService.CHROME_DRIVER_LOG_PROPERTY`\ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L82" >}} {{< /tab >}} {{< tab header="CSharp" >}} @@ -250,7 +246,6 @@ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{< /tab >}} {{% tab header="Ruby" %}} `$stdout` and `$stderr` are both valid values -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L76" >}} {{% /tab %}} {{< tab header="JavaScript" >}} @@ -268,21 +263,18 @@ so this example is just setting the log level generically: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L129-L130" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `ChromeDriverService.CHROME_DRIVER_LOG_LEVEL_PROPERTY`\ Property value: String representation of `ChromiumDriverLogLevel` enum {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L93" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L87" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -303,7 +295,6 @@ The log output will be managed by the driver, not the process, so minor differen {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L147-L148" >}} **Note**: Java also allows toggling these features by System Property:\ Property keys: `ChromeDriverService.CHROME_DRIVER_APPEND_LOG_PROPERTY` and `ChromeDriverService.CHROME_DRIVER_READABLE_TIMESTAMP`\ @@ -316,7 +307,6 @@ Property value: `"true"` or `"false"` {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L97-L98" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -335,21 +325,18 @@ Note that this is an unsupported feature, and bugs will not be investigated. {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/ChromeTest.java#L166-L167" >}} **Note**: Java also allows disabling build checks by System Property:\ Property key: `ChromeDriverService.CHROME_DRIVER_DISABLE_BUILD_CHECK`\ Property value: `"true"` or `"false"` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_chrome.py#L115" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/ChromeTest.cs#L155" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/chrome_spec.rb#L108" >}} {{< /tab >}} {{< tab header="JavaScript" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md index 2e5679a74e6b..ff23d58c348c 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.en.md @@ -202,7 +202,6 @@ To change the logging output to save to a specific file: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L100" >}} **Note**: Java also allows setting file output by System Property:\ Property key: `EdgeDriverService.EDGE_DRIVER_LOG_PROPERTY`\ @@ -215,7 +214,6 @@ Property value: String representing path to log file {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/EdgeTest.cs#L86" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L67" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -232,7 +230,6 @@ To change the logging output to display in the console as STDOUT: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L113" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `EdgeDriverService.EDGE_DRIVER_LOG_PROPERTY`\ @@ -246,7 +243,6 @@ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{< /tab >}} {{% tab header="Ruby" %}} `$stdout` and `$stderr` are both valid values -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L76" >}} {{% /tab %}} {{< tab header="JavaScript" >}} @@ -264,7 +260,6 @@ so this example is just setting the log level generically: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L126-L127" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `EdgeDriverService.EDGE_DRIVER_LOG_LEVEL_PROPERTY`\ @@ -277,7 +272,6 @@ Property value: String representation of `ChromiumDriverLogLevel` enum {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L87" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -298,7 +292,6 @@ The log output will be managed by the driver, not the process, so minor differen {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L142-L143" >}} **Note**: Java also allows toggling these features by System Property:\ Property keys: `EdgeDriverService.EDGE_DRIVER_APPEND_LOG_PROPERTY` and `EdgeDriverService.EDGE_DRIVER_READABLE_TIMESTAMP`\ @@ -311,7 +304,6 @@ Property value: `"true"` or `"false"` {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L97-L98" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -330,7 +322,6 @@ Note that this is an unsupported feature, and bugs will not be investigated. {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L160-L161" >}} **Note**: Java also allows disabling build checks by System Property:\ Property key: `EdgeDriverService.EDGE_DRIVER_DISABLE_BUILD_CHECK`\ @@ -343,7 +334,6 @@ Property value: `"true"` or `"false"` {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/EdgeTest.cs#L155" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L108" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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 0d56efb251c8..2f99d08175a3 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/edge.ja.md @@ -204,7 +204,6 @@ To change the logging output to save to a specific file: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L100" >}} **Note**: Java also allows setting file output by System Property:\ Property key: `EdgeDriverService.EDGE_DRIVER_LOG_PROPERTY`\ @@ -217,7 +216,6 @@ Property value: String representing path to log file {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/EdgeTest.cs#L86" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L67" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -234,7 +232,6 @@ To change the logging output to display in the console as STDOUT: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L113" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `EdgeDriverService.EDGE_DRIVER_LOG_PROPERTY`\ @@ -248,7 +245,6 @@ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{< /tab >}} {{% tab header="Ruby" %}} `$stdout` and `$stderr` are both valid values -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L76" >}} {{% /tab %}} {{< tab header="JavaScript" >}} @@ -266,7 +262,6 @@ so this example is just setting the log level generically: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L126-L127" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `EdgeDriverService.EDGE_DRIVER_LOG_LEVEL_PROPERTY`\ @@ -279,7 +274,6 @@ Property value: String representation of `ChromiumDriverLogLevel` enum {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L87" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -300,7 +294,6 @@ The log output will be managed by the driver, not the process, so minor differen {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L142-L143" >}} **Note**: Java also allows toggling these features by System Property:\ Property keys: `EdgeDriverService.EDGE_DRIVER_APPEND_LOG_PROPERTY` and `EdgeDriverService.EDGE_DRIVER_READABLE_TIMESTAMP`\ @@ -313,7 +306,6 @@ Property value: `"true"` or `"false"` {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L97-L98" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -332,7 +324,6 @@ Note that this is an unsupported feature, and bugs will not be investigated. {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L160-L161" >}} **Note**: Java also allows disabling build checks by System Property:\ Property key: `EdgeDriverService.EDGE_DRIVER_DISABLE_BUILD_CHECK`\ @@ -345,7 +336,6 @@ Property value: `"true"` or `"false"` {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/EdgeTest.cs#L155" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L108" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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 7c4b11adf00a..e04ef1f657d2 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 @@ -204,7 +204,6 @@ To change the logging output to save to a specific file: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L100" >}} **Note**: Java also allows setting file output by System Property:\ Property key: `EdgeDriverService.EDGE_DRIVER_LOG_PROPERTY`\ @@ -217,7 +216,6 @@ Property value: String representing path to log file {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/EdgeTest.cs#L86" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L67" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -234,7 +232,6 @@ To change the logging output to display in the console as STDOUT: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L113" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `EdgeDriverService.EDGE_DRIVER_LOG_PROPERTY`\ @@ -248,7 +245,6 @@ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{< /tab >}} {{% tab header="Ruby" %}} `$stdout` and `$stderr` are both valid values -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L76" >}} {{% /tab %}} {{< tab header="JavaScript" >}} @@ -266,7 +262,6 @@ so this example is just setting the log level generically: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L126-L127" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `EdgeDriverService.EDGE_DRIVER_LOG_LEVEL_PROPERTY`\ @@ -279,7 +274,6 @@ Property value: String representation of `ChromiumDriverLogLevel` enum {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L87" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -300,7 +294,6 @@ The log output will be managed by the driver, not the process, so minor differen {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L142-L143" >}} **Note**: Java also allows toggling these features by System Property:\ Property keys: `EdgeDriverService.EDGE_DRIVER_APPEND_LOG_PROPERTY` and `EdgeDriverService.EDGE_DRIVER_READABLE_TIMESTAMP`\ @@ -313,7 +306,6 @@ Property value: `"true"` or `"false"` {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L97-L98" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -332,7 +324,6 @@ Note that this is an unsupported feature, and bugs will not be investigated. {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L160-L161" >}} **Note**: Java also allows disabling build checks by System Property:\ Property key: `EdgeDriverService.EDGE_DRIVER_DISABLE_BUILD_CHECK`\ @@ -345,7 +336,6 @@ Property value: `"true"` or `"false"` {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/EdgeTest.cs#L155" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L108" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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 bbaa39595323..c4646eb86f71 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 @@ -204,7 +204,6 @@ To change the logging output to save to a specific file: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L100" >}} **Note**: Java also allows setting file output by System Property:\ Property key: `EdgeDriverService.EDGE_DRIVER_LOG_PROPERTY`\ @@ -217,7 +216,6 @@ Property value: String representing path to log file {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/EdgeTest.cs#L86" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L67" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -234,7 +232,6 @@ To change the logging output to display in the console as STDOUT: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L113" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `EdgeDriverService.EDGE_DRIVER_LOG_PROPERTY`\ @@ -248,7 +245,6 @@ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{< /tab >}} {{% tab header="Ruby" %}} `$stdout` and `$stderr` are both valid values -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L76" >}} {{% /tab %}} {{< tab header="JavaScript" >}} @@ -266,7 +262,6 @@ so this example is just setting the log level generically: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L126-L127" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `EdgeDriverService.EDGE_DRIVER_LOG_LEVEL_PROPERTY`\ @@ -279,7 +274,6 @@ Property value: String representation of `ChromiumDriverLogLevel` enum {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L87" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -300,7 +294,6 @@ The log output will be managed by the driver, not the process, so minor differen {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L142-L143" >}} **Note**: Java also allows toggling these features by System Property:\ Property keys: `EdgeDriverService.EDGE_DRIVER_APPEND_LOG_PROPERTY` and `EdgeDriverService.EDGE_DRIVER_READABLE_TIMESTAMP`\ @@ -313,7 +306,6 @@ Property value: `"true"` or `"false"` {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L97-L98" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -332,7 +324,6 @@ Note that this is an unsupported feature, and bugs will not be investigated. {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/EdgeTest.java#L160-L161" >}} **Note**: Java also allows disabling build checks by System Property:\ Property key: `EdgeDriverService.EDGE_DRIVER_DISABLE_BUILD_CHECK`\ @@ -345,7 +336,6 @@ Property value: `"true"` or `"false"` {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/EdgeTest.cs#L155" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/edge_spec.rb#L108" >}} {{< /tab >}} {{< tab header="JavaScript" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md b/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md index 5e9fc7b21587..e100b3dcc1b3 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.en.md @@ -169,14 +169,12 @@ Property key: `GeckoDriverService.GECKO_DRIVER_LOG_PROPERTY`\ Property value: String representing path to log file {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L36" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L43" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -193,21 +191,18 @@ To change the logging output to display in the console: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L76-L77" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `GeckoDriverService.GECKO_DRIVER_LOG_PROPERTY`\ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L48" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L52" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -227,21 +222,18 @@ so this examples is just for setting the log level generically: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L90-L91" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `GeckoDriverService.GECKO_DRIVER_LOG_LEVEL_PROPERTY`\ Property value: String representation of `FirefoxDriverLogLevel` enum {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L59" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L63" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -259,21 +251,18 @@ Firefox truncates lines by default. To turn off truncation: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L106-L107" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `GeckoDriverService.GECKO_DRIVER_LOG_NO_TRUNCATE`\ Property value: `"true"` or `"false"` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L70" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L72" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -291,7 +280,6 @@ or want profiles to be created some place specific, you can change the profile r {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L118-L119" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `GeckoDriverService.GECKO_DRIVER_PROFILE_ROOT`\ @@ -304,7 +292,6 @@ Property value: String representing path to profile root directory {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L81" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -366,7 +353,6 @@ Uninstalling an addon requires knowing its id. The id can be obtained from the r {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L106" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-version version="4.5" >}} {{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs#L152" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -394,11 +380,9 @@ example with a directory: {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L115" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-version version="4.5" >}} {{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs#L165" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.5" >}} {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L115" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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 7f0d1b997994..30d75f998b25 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/firefox.ja.md @@ -174,14 +174,12 @@ Property key: `GeckoDriverService.GECKO_DRIVER_LOG_PROPERTY`\ Property value: String representing path to log file {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L36" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L43" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -198,21 +196,18 @@ To change the logging output to display in the console: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L76-L77" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `GeckoDriverService.GECKO_DRIVER_LOG_PROPERTY`\ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L48" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L52" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -232,21 +227,18 @@ so this examples is just for setting the log level generically: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L90-L91" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `GeckoDriverService.GECKO_DRIVER_LOG_LEVEL_PROPERTY`\ Property value: String representation of `FirefoxDriverLogLevel` enum {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L59" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L63" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -264,21 +256,18 @@ Firefox truncates lines by default. To turn off truncation: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L106-L107" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `GeckoDriverService.GECKO_DRIVER_LOG_NO_TRUNCATE`\ Property value: `"true"` or `"false"` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L70" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L72" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -296,7 +285,6 @@ or want profiles to be created some place specific, you can change the profile r {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L118-L119" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `GeckoDriverService.GECKO_DRIVER_PROFILE_ROOT`\ @@ -309,7 +297,6 @@ Property value: String representing path to profile root directory {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L81" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -373,7 +360,6 @@ IDはアドオンインストール時の戻り値から取得できます。 {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L106" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-version version="4.5" >}} {{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs#L152" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -401,11 +387,9 @@ IDはアドオンインストール時の戻り値から取得できます。 {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L115" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-version version="4.5" >}} {{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs#L165" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.5" >}} {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L115" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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 96c58326ec53..252afbe4d2c0 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 @@ -173,14 +173,12 @@ Property key: `GeckoDriverService.GECKO_DRIVER_LOG_PROPERTY`\ Property value: String representing path to log file {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L36" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L43" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -197,21 +195,18 @@ To change the logging output to display in the console: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L76-L77" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `GeckoDriverService.GECKO_DRIVER_LOG_PROPERTY`\ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L48" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L52" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -231,21 +226,18 @@ so this examples is just for setting the log level generically: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L90-L91" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `GeckoDriverService.GECKO_DRIVER_LOG_LEVEL_PROPERTY`\ Property value: String representation of `FirefoxDriverLogLevel` enum {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L59" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L63" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -263,21 +255,18 @@ Firefox truncates lines by default. To turn off truncation: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L106-L107" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `GeckoDriverService.GECKO_DRIVER_LOG_NO_TRUNCATE`\ Property value: `"true"` or `"false"` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L70" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L72" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -295,7 +284,6 @@ or want profiles to be created some place specific, you can change the profile r {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L118-L119" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `GeckoDriverService.GECKO_DRIVER_PROFILE_ROOT`\ @@ -308,7 +296,6 @@ Property value: String representing path to profile root directory {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L81" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -371,7 +358,6 @@ Desinstalar uma extensão implica saber o seu id que pode ser obtido como valor {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L106" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-version version="4.5" >}} {{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs#L152" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -399,11 +385,9 @@ uma pasta, este é um exemplo com uma pasta: {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L115" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-version version="4.5" >}} {{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs#L165" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.5" >}} {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L115" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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 e99b3c7a49a9..1b5f692865dc 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 @@ -172,14 +172,12 @@ Property key: `GeckoDriverService.GECKO_DRIVER_LOG_PROPERTY`\ Property value: String representing path to log file {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L36" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L43" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -196,21 +194,18 @@ To change the logging output to display in the console: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L76-L77" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `GeckoDriverService.GECKO_DRIVER_LOG_PROPERTY`\ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L48" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L52" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -230,21 +225,18 @@ so this examples is just for setting the log level generically: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L90-L91" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `GeckoDriverService.GECKO_DRIVER_LOG_LEVEL_PROPERTY`\ Property value: String representation of `FirefoxDriverLogLevel` enum {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L59" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L63" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -262,21 +254,18 @@ Firefox truncates lines by default. To turn off truncation: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L106-L107" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `GeckoDriverService.GECKO_DRIVER_LOG_NO_TRUNCATE`\ Property value: `"true"` or `"false"` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L70" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L72" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -294,7 +283,6 @@ or want profiles to be created some place specific, you can change the profile r {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/FirefoxTest.java#L118-L119" >}} **Note**: Java also allows setting log level by System Property:\ Property key: `GeckoDriverService.GECKO_DRIVER_PROFILE_ROOT`\ @@ -307,7 +295,6 @@ Property value: String representing path to profile root directory {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/firefox_spec.rb#L81" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -368,7 +355,6 @@ Uninstalling an addon requires knowing its id. The id can be obtained from the r {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L106" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-version version="4.5" >}} {{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs#L152" >}} {{< /tab >}} {{< tab header="Ruby" >}} @@ -396,11 +382,9 @@ example with a directory: {{< gh-codeblock path="/examples/python/tests/browsers/test_firefox.py#L115" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-version version="4.5" >}} {{< gh-codeblock path="/examples/dotnet/SeleniumDocs/Browsers/FirefoxTest.cs#L165" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.5" >}} {{< gh-codeblock path="/examples/ruby/spec/browsers/firefox_spec.rb#L115" >}} {{< /tab >}} {{< tab header="JavaScript" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.en.md b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.en.md index ed5ec54df34e..fe9aa4a1ac84 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/internet_explorer.en.md @@ -598,7 +598,6 @@ To change the logging output to save to a specific file: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#L53" >}} **Note**: Java also allows setting file output by System Property:\ Property key: `InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY`\ @@ -611,7 +610,6 @@ Property value: String representing path to log file {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/internet_explorer_spec.rb#L34" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -628,21 +626,18 @@ To change the logging output to display in the console as STDOUT: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#L67" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY`\ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L41" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/internet_explorer_spec.rb#L43" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -671,7 +666,6 @@ Property value: String representation of `InternetExplorerDriverLogLevel.DEBUG.t {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L85" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/internet_explorer_spec.rb#L54" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -692,14 +686,12 @@ Property key: `InternetExplorerDriverService.IE_DRIVER_EXTRACT_PATH_PROPERTY`\ Property value: String representing path to supporting files directory {{< /tab >}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L65" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L98" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/internet_explorer_spec.rb#L64" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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 e7d30dca1f96..0b133b3a7988 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 @@ -586,7 +586,6 @@ To change the logging output to save to a specific file: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#L53" >}} **Note**: Java also allows setting file output by System Property:\ Property key: `InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY`\ @@ -599,7 +598,6 @@ Property value: String representing path to log file {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/internet_explorer_spec.rb#L34" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -616,21 +614,18 @@ To change the logging output to display in the console as STDOUT: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#L67" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY`\ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L41" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/internet_explorer_spec.rb#L43" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -659,7 +654,6 @@ Property value: String representation of `InternetExplorerDriverLogLevel.DEBUG.t {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L85" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/internet_explorer_spec.rb#L54" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -680,14 +674,12 @@ Property key: `InternetExplorerDriverService.IE_DRIVER_EXTRACT_PATH_PROPERTY`\ Property value: String representing path to supporting files directory {{< /tab >}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L65" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L98" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/internet_explorer_spec.rb#L64" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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 b877e65ae56b..3d1c3bc56817 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 @@ -603,7 +603,6 @@ To change the logging output to save to a specific file: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#L53" >}} **Note**: Java also allows setting file output by System Property:\ Property key: `InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY`\ @@ -616,7 +615,6 @@ Property value: String representing path to log file {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/internet_explorer_spec.rb#L34" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -633,21 +631,18 @@ To change the logging output to display in the console as STDOUT: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#L67" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY`\ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L41" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/internet_explorer_spec.rb#L43" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -676,7 +671,6 @@ Property value: String representation of `InternetExplorerDriverLogLevel.DEBUG.t {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L85" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/internet_explorer_spec.rb#L54" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -697,14 +691,12 @@ Property key: `InternetExplorerDriverService.IE_DRIVER_EXTRACT_PATH_PROPERTY`\ Property value: String representing path to supporting files directory {{< /tab >}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L65" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L98" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/internet_explorer_spec.rb#L64" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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 7a038cb2579d..9f2cfad684f5 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 @@ -596,7 +596,6 @@ To change the logging output to save to a specific file: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#L53" >}} **Note**: Java also allows setting file output by System Property:\ Property key: `InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY`\ @@ -609,7 +608,6 @@ Property value: String representing path to log file {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/internet_explorer_spec.rb#L34" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -626,21 +624,18 @@ To change the logging output to display in the console as STDOUT: {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/InternetExplorerTest.java#L67" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `InternetExplorerDriverService.IE_DRIVER_LOGFILE_PROPERTY`\ Property value: `DriverService.LOG_STDOUT` or `DriverService.LOG_STDERR` {{% /tab %}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L41" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/internet_explorer_spec.rb#L43" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -669,7 +664,6 @@ Property value: String representation of `InternetExplorerDriverLogLevel.DEBUG.t {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L85" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/internet_explorer_spec.rb#L54" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -690,14 +684,12 @@ Property key: `InternetExplorerDriverService.IE_DRIVER_EXTRACT_PATH_PROPERTY`\ Property value: String representing path to supporting files directory {{< /tab >}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/browsers/test_internet_explorer.py#L65" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs#L98" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/internet_explorer_spec.rb#L64" >}} {{< /tab >}} {{< tab header="JavaScript" >}} diff --git a/website_and_docs/content/documentation/webdriver/browsers/safari.en.md b/website_and_docs/content/documentation/webdriver/browsers/safari.en.md index bf207b439d16..44106fc4d1e5 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.en.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.en.md @@ -62,7 +62,6 @@ available is to turn logs off or on. If logs are toggled on, they can be found a {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/SafariTest.java#L31" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `SafariDriverService.SAFARI_DRIVER_LOGGING`\ @@ -75,7 +74,6 @@ Property value: `"true"` or `"false"` {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/safari_spec.rb#L20" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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 4fa03c6696ff..bc611393af00 100644 --- a/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md +++ b/website_and_docs/content/documentation/webdriver/browsers/safari.ja.md @@ -61,7 +61,6 @@ available is to turn logs off or on. If logs are toggled on, they can be found a {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/SafariTest.java#L31" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `SafariDriverService.SAFARI_DRIVER_LOGGING`\ @@ -74,7 +73,6 @@ Property value: `"true"` or `"false"` {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/safari_spec.rb#L20" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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 995a880ea7f1..33706cd2414e 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 @@ -61,7 +61,6 @@ available is to turn logs off or on. If logs are toggled on, they can be found a {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/SafariTest.java#L31" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `SafariDriverService.SAFARI_DRIVER_LOGGING`\ @@ -74,7 +73,6 @@ Property value: `"true"` or `"false"` {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/safari_spec.rb#L20" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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 20674cad24dc..734c3b097017 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 @@ -61,7 +61,6 @@ available is to turn logs off or on. If logs are toggled on, they can be found a {{< tabpane text=true >}} {{% tab header="Java" %}} -{{< badge-version version="4.10" >}} {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/browsers/SafariTest.java#L31" >}} **Note**: Java also allows setting console output by System Property;\ Property key: `SafariDriverService.SAFARI_DRIVER_LOGGING`\ @@ -74,7 +73,6 @@ Property value: `"true"` or `"false"` {{< badge-implementation >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/browsers/safari_spec.rb#L20" >}} {{< /tab >}} {{< tab header="JavaScript" >}} diff --git a/website_and_docs/content/documentation/webdriver/drivers/service.en.md b/website_and_docs/content/documentation/webdriver/drivers/service.en.md index 158ef3665c75..7e9256b9c351 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/service.en.md +++ b/website_and_docs/content/documentation/webdriver/drivers/service.en.md @@ -22,7 +22,6 @@ To start a driver with a default service instance: **Note**: Java Service classes only allow values to be set during construction with a Builder pattern. {{% /tab %}} {{% tab header="Python" %}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/drivers/test_service.py#L5-L6" >}} **Note**: Python Service classes only allow values to be set as arguments to the constructor. {{% /tab %}} @@ -52,15 +51,12 @@ If you cannot update Selenium or have an advanced use case, here is how to speci {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/ServiceTest.java#L25-L26" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/drivers/test_service.py#L15" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-version version="4.9" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/ServiceTest.cs#L25" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/drivers/service_spec.rb#L22" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -80,14 +76,12 @@ If you want the driver to run on a specific port, you may specify it as follows: {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/ServiceTest.java#L33" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/drivers/test_service.py#L23" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/ServiceTest.cs#L34" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/drivers/service_spec.rb#L29" >}} {{< /tab >}} {{< tab header="JavaScript" >}} diff --git a/website_and_docs/content/documentation/webdriver/drivers/service.ja.md b/website_and_docs/content/documentation/webdriver/drivers/service.ja.md index d7a1a546c5aa..45cdf2865d50 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/service.ja.md +++ b/website_and_docs/content/documentation/webdriver/drivers/service.ja.md @@ -21,7 +21,6 @@ To start a driver with a default service instance: {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/ServiceTest.java#L15-L16" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/drivers/test_service.py#L5-L6" >}} {{< /tab >}} {{< tab header="CSharp" >}} @@ -48,15 +47,12 @@ If you can not update Selenium or have an advanced use case here is how to speci {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/ServiceTest.java#L25-L26" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/drivers/test_service.py#L15" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-version version="4.9" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/ServiceTest.cs#L25" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/drivers/service_spec.rb#L22" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -76,14 +72,12 @@ If you want the driver to run on a specific port, you may specify it as follows: {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/ServiceTest.java#L33" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/drivers/test_service.py#L23" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/ServiceTest.cs#L34" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/drivers/service_spec.rb#L29" >}} {{< /tab >}} {{< tab header="JavaScript" >}} diff --git a/website_and_docs/content/documentation/webdriver/drivers/service.pt-br.md b/website_and_docs/content/documentation/webdriver/drivers/service.pt-br.md index d7a1a546c5aa..45cdf2865d50 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/service.pt-br.md +++ b/website_and_docs/content/documentation/webdriver/drivers/service.pt-br.md @@ -21,7 +21,6 @@ To start a driver with a default service instance: {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/ServiceTest.java#L15-L16" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/drivers/test_service.py#L5-L6" >}} {{< /tab >}} {{< tab header="CSharp" >}} @@ -48,15 +47,12 @@ If you can not update Selenium or have an advanced use case here is how to speci {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/ServiceTest.java#L25-L26" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/drivers/test_service.py#L15" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-version version="4.9" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/ServiceTest.cs#L25" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/drivers/service_spec.rb#L22" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -76,14 +72,12 @@ If you want the driver to run on a specific port, you may specify it as follows: {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/ServiceTest.java#L33" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/drivers/test_service.py#L23" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/ServiceTest.cs#L34" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/drivers/service_spec.rb#L29" >}} {{< /tab >}} {{< tab header="JavaScript" >}} diff --git a/website_and_docs/content/documentation/webdriver/drivers/service.zh-cn.md b/website_and_docs/content/documentation/webdriver/drivers/service.zh-cn.md index 7f1df68bf385..19034b88292a 100644 --- a/website_and_docs/content/documentation/webdriver/drivers/service.zh-cn.md +++ b/website_and_docs/content/documentation/webdriver/drivers/service.zh-cn.md @@ -21,7 +21,6 @@ To start a driver with a default service instance: {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/ServiceTest.java#L15-L16" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/drivers/test_service.py#L5-L6" >}} {{< /tab >}} {{< tab header="CSharp" >}} @@ -48,15 +47,12 @@ If you can not update Selenium or have an advanced use case here is how to speci {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/ServiceTest.java#L25-L26" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/drivers/test_service.py#L15" >}} {{< /tab >}} {{< tab header="CSharp" >}} -{{< badge-version version="4.9" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/ServiceTest.cs#L25" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/drivers/service_spec.rb#L22" >}} {{< /tab >}} {{< tab header="JavaScript" >}} @@ -76,14 +72,12 @@ If you want the driver to run on a specific port, you may specify it as follows: {{< gh-codeblock path="examples/java/src/test/java/dev/selenium/drivers/ServiceTest.java#L33" >}} {{< /tab >}} {{< tab header="Python" >}} -{{< badge-version version="4.11" >}} {{< gh-codeblock path="examples/python/tests/drivers/test_service.py#L23" >}} {{< /tab >}} {{< tab header="CSharp" >}} {{< gh-codeblock path="examples/dotnet/SeleniumDocs/Drivers/ServiceTest.cs#L34" >}} {{< /tab >}} {{< tab header="Ruby" >}} -{{< badge-version version="4.8" >}} {{< gh-codeblock path="examples/ruby/spec/drivers/service_spec.rb#L29" >}} {{< /tab >}} {{< tab header="JavaScript" >}} 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..1ecfdab6cefe 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 @@ -218,7 +218,6 @@ Select the option based on its position in the list ### Disabled options -{{< badge-version version="4.5" >}} Options with a `disabled` attribute may not be selected. 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..a76c6f1f83d6 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 @@ -218,7 +218,6 @@ Select the option based on its position in the list ### Disabled options -{{< badge-version version="4.5" >}} Options with a `disabled` attribute may not be selected. 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..5a566c902079 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 @@ -219,7 +219,6 @@ Select the option based on its position in the list ### Disabled options -{{< badge-version version="4.5" >}} Options with a `disabled` attribute may not be selected. 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..68c7cd8d605e 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 @@ -223,7 +223,6 @@ Select类提供了三种选择选项的方法. ### 禁用的选项 -{{< badge-version version="4.5" >}} 具有 `disabled` 属性的选项可能无法被选择. diff --git a/website_and_docs/content/documentation/webdriver/troubleshooting/logging.en.md b/website_and_docs/content/documentation/webdriver/troubleshooting/logging.en.md index a95ab0b12abb..c43581edfcd6 100644 --- a/website_and_docs/content/documentation/webdriver/troubleshooting/logging.en.md +++ b/website_and_docs/content/documentation/webdriver/troubleshooting/logging.en.md @@ -41,7 +41,6 @@ For more fine-tuned control, Ruby Selenium created its own Logger class to wrap This implementation provides some interesting additional features. Obtain the logger directly from the `#logger`class method on the `Selenium::WebDriver` module: -{{< badge-version version="4.10" >}} {{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L11" >}} {{% /tab %}} {{% tab header="JavaScript" %}} @@ -102,7 +101,6 @@ logging.basicConfig(level=logging.WARN) The default is `:info`. To change the level of the logger: -{{< badge-version version="4.10" >}} {{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L13" >}} {{% /tab %}} {{% tab header="JavaScript" %}} @@ -281,7 +279,6 @@ handler with either a `StreamHandler` or a `FileHandler`: By default, logs are sent to the console in `stdout`. To store the logs in a file: -{{< badge-version version="4.10" >}} {{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L15" >}} {{% /tab %}} {{% tab header="JavaScript" %}} @@ -322,10 +319,8 @@ Everything that Selenium logs includes an ID. You can also turn on or off all de using `:deprecations`. These methods accept one or more symbols or an array of symbols: -{{< badge-version version="4.10" >}} {{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#17" >}} or -{{< badge-version version="4.10" >}} {{< gh-codeblock path="/examples/ruby/spec/troubleshooting/logging_spec.rb#L18" >}} {{% /tab %}} {{< tab header="JavaScript" >}} diff --git a/website_and_docs/hugo.toml b/website_and_docs/hugo.toml index 77f007317455..cf674bf73173 100644 --- a/website_and_docs/hugo.toml +++ b/website_and_docs/hugo.toml @@ -118,7 +118,7 @@ social_image_path = ["images/selenium_logo_square_green.png"] # Menu title if your navbar has a versions selector to access old versions of your site. # This menu appears only if you have at least one [params.versions] set. -version_menu = "v4.0" +version_menu = "v4.15" # Flag used in the "version-banner" partial to decide whether to display a # banner on every page indicating that this is an archived version of the docs. @@ -344,7 +344,7 @@ year = "year" urls = ['.*'] [[params.versions]] - version = "v4.0" + version = "v4.15" url = "/documentation" [[params.versions]] diff --git a/website_and_docs/layouts/shortcodes/badge-version.html b/website_and_docs/layouts/shortcodes/badge-version.html deleted file mode 100644 index c1a01b27fff4..000000000000 --- a/website_and_docs/layouts/shortcodes/badge-version.html +++ /dev/null @@ -1,6 +0,0 @@ -{{ $version := .Get "version" }} - -{{ $href := printf "https://github.com/SeleniumHQ/selenium/releases/tag/selenium-%s.0" $version }} -{{ $title := printf "This code requires Selenium v%s or greater" $version }} -{{ $text := printf "Selenium v%s" $version }} -{{ partial "badge.html" (dict "type" "version" "title" $title "text" $text "href" $href) }} From 991fee158bc4143d864ef4109e51169000281ece Mon Sep 17 00:00:00 2001 From: titusfortner Date: Fri, 24 Nov 2023 23:29:57 -0600 Subject: [PATCH 3/5] move version toggle from nav bar to above breadcrumbs --- .../assets/scss/_main-container.scss | 7 +++++++ .../assets/scss/_styles_project.scss | 1 + .../assets/scss/_version_selector.scss | 10 ++++++++++ website_and_docs/content/legacy/_index.en.md | 2 +- website_and_docs/layouts/docs/baseof.html | 7 ++++++- .../partials/navbar-version-selector.html | 20 +++++++++++++++++++ website_and_docs/layouts/partials/navbar.html | 5 ----- 7 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 website_and_docs/assets/scss/_main-container.scss create mode 100644 website_and_docs/assets/scss/_version_selector.scss create mode 100644 website_and_docs/layouts/partials/navbar-version-selector.html diff --git a/website_and_docs/assets/scss/_main-container.scss b/website_and_docs/assets/scss/_main-container.scss new file mode 100644 index 000000000000..1e4619f0de47 --- /dev/null +++ b/website_and_docs/assets/scss/_main-container.scss @@ -0,0 +1,7 @@ +.td-main main { + padding-top: 1.5rem; + padding-bottom: 2rem; + @include media-breakpoint-up(md) { + padding-top: 1.5rem; + } +} \ No newline at end of file diff --git a/website_and_docs/assets/scss/_styles_project.scss b/website_and_docs/assets/scss/_styles_project.scss index 884e084ab1c4..6d234437db2e 100644 --- a/website_and_docs/assets/scss/_styles_project.scss +++ b/website_and_docs/assets/scss/_styles_project.scss @@ -10,3 +10,4 @@ @import "logo"; @import "screen"; @import "tabs"; +@import "version_selector" diff --git a/website_and_docs/assets/scss/_version_selector.scss b/website_and_docs/assets/scss/_version_selector.scss new file mode 100644 index 000000000000..b2ab8e1ba40b --- /dev/null +++ b/website_and_docs/assets/scss/_version_selector.scss @@ -0,0 +1,10 @@ +.version-selector a { + border-bottom: 0px; + text-align: right; + font-size: 1.5rem; +} + +.version-selector ul { + right: 0 !important; + left: auto !important; +} diff --git a/website_and_docs/content/legacy/_index.en.md b/website_and_docs/content/legacy/_index.en.md index e842dd1079b5..bf685ea77795 100644 --- a/website_and_docs/content/legacy/_index.en.md +++ b/website_and_docs/content/legacy/_index.en.md @@ -1,6 +1,6 @@ --- title: "Legacy Documentation" -linkTitle: "Legacy" +linkTitle: "Legacy Documentation" weight: 14 cascade: - type: docs diff --git a/website_and_docs/layouts/docs/baseof.html b/website_and_docs/layouts/docs/baseof.html index 1a2426db634a..d6a2dc297e78 100644 --- a/website_and_docs/layouts/docs/baseof.html +++ b/website_and_docs/layouts/docs/baseof.html @@ -21,7 +21,12 @@
{{ partial "version-banner.html" . }} - {{ if not .Site.Params.ui.breadcrumb_disable }}{{ partial "breadcrumb.html" . }}{{ end }} + {{ if not .Site.Params.ui.breadcrumb_disable }} + {{ if .Site.Params.versions }} + {{ partial "navbar-version-selector.html" . }} + {{ end }} + {{ partial "breadcrumb.html" . }} + {{ end }} {{ block "main" . }}{{ end }}
diff --git a/website_and_docs/layouts/partials/navbar-version-selector.html b/website_and_docs/layouts/partials/navbar-version-selector.html new file mode 100644 index 000000000000..439190b0d48d --- /dev/null +++ b/website_and_docs/layouts/partials/navbar-version-selector.html @@ -0,0 +1,20 @@ +
+ +
\ No newline at end of file diff --git a/website_and_docs/layouts/partials/navbar.html b/website_and_docs/layouts/partials/navbar.html index ead45cfe4972..1dfd7b6a7b38 100644 --- a/website_and_docs/layouts/partials/navbar.html +++ b/website_and_docs/layouts/partials/navbar.html @@ -36,11 +36,6 @@ {{ end }} {{ end }} - {{ if .Site.Params.versions }} - - {{ end }} {{ if (gt (len .Site.Home.Translations) 0) }} {{ end }} - {{ if (gt (len .Site.Home.Translations) 0) }} - - {{ end }}
From 99f936d6218c6076f73a0273fe9370728b360a4b Mon Sep 17 00:00:00 2001 From: titusfortner Date: Sat, 25 Nov 2023 00:10:41 -0600 Subject: [PATCH 5/5] can't have translations outside of docs if the toggle is only in docs --- website_and_docs/content/_index.ja.html | 39 ------------------- website_and_docs/content/_index.other.html | 45 ---------------------- website_and_docs/content/_index.pt-br.html | 41 -------------------- website_and_docs/content/_index.zh-cn.html | 41 -------------------- 4 files changed, 166 deletions(-) delete mode 100644 website_and_docs/content/_index.ja.html delete mode 100644 website_and_docs/content/_index.other.html delete mode 100644 website_and_docs/content/_index.pt-br.html delete mode 100644 website_and_docs/content/_index.zh-cn.html diff --git a/website_and_docs/content/_index.ja.html b/website_and_docs/content/_index.ja.html deleted file mode 100644 index 88c0dba5691b..000000000000 --- a/website_and_docs/content/_index.ja.html +++ /dev/null @@ -1,39 +0,0 @@ -+++ -title = "Selenium" -linkTitle = "Selenium" -+++ - -{{< blocks/section color="selenium-green" height="min" >}} -
-

Seleniumはブラウザを自動化します。そうです!

-

その力で何をするかは完全にあなた次第です。

-

- 主にテスト目的でWebアプリケーションを自動化するためのものですが、それに限定されるものではありません。 -

-

- 退屈なWebベースの管理タスクも自動化できます(自動化する必要があります)。 -

-
-{{< /blocks/section >}} - -{{< translation-alert >}} - -{{< getting-started color="100" height="auto" title="入門" >}} - -{{% getting-started-item icon="icons/webdriver.svg" title="Selenium WebDriver" color="selenium-webdriver" url="/ja/documentation/webdriver/" url_text="Read more" %}} -堅牢なブラウザーベースの回帰自動化スイートとテストを作成し、スクリプトをスケーリングして多くの環境に分散する場合は、 -言語固有のバインディングのコレクションであるSeleniumWebDriverを使用して意図した操作でブラウザーを駆動します。 -{{% /getting-started-item %}} - -{{% getting-started-item icon="icons/ide.svg" title="Selenium IDE" color="selenium-ide" url="https://selenium.dev/selenium-ide/" url_text="Read more" %}} -迅速なバグ再現スクリプトを作成したい場合、自動化支援の探索的テストを支援するスクリプトを作成したい場合は、SeleniumIDEを使用します。 -Chrome、Firefox、Edgeのアドオンがブラウザとの対話の簡単な記録と再生を行います。 -{{% /getting-started-item %}} - -{{% getting-started-item icon="icons/grid.svg" title="Selenium Grid" color="selenium-grid" url="/ja/documentation/grid/" url_text="Read more" %}} -複数のマシンでテストを分散して実行し、複数の環境を中央から管理して、 -ブラウザーとOSの膨大な組み合わせに対してテストを簡単に実行できるようにすることでスケーリングしたい場合は、 -SeleniumGridを使用します。 -{{% /getting-started-item %}} - -{{< /getting-started >}} diff --git a/website_and_docs/content/_index.other.html b/website_and_docs/content/_index.other.html deleted file mode 100644 index 5865a6a7dc37..000000000000 --- a/website_and_docs/content/_index.other.html +++ /dev/null @@ -1,45 +0,0 @@ -+++ -title = "Selenium" -linkTitle = "Selenium" -+++ - -{{< blocks/section color="selenium-green" height="min" >}} -
-

Selenium automates browsers. That's it!

-

What you do with that power is entirely up to you.

-

- Primarily it is for automating web applications for testing purposes, but is certainly not limited to just that. -

-

- Boring web-based administration tasks can (and should) also be automated as well. -

-
-{{< /blocks/section >}} - -{{< dismissible-banner title="Welcome!" alert="note" color="blue" background="selenium-cyan-20" >}} -Only [documentation](/documentation) gets translated into other languages. The rest of the website will remain in English.

-Is there another translation you'd like to see? We're only supporting translations for which we have a dedicated translator. -If you'd like to volunteer to be a translator, read how [you can help](https://www.selenium.dev/getinvolved/#translating_site). -{{< /dismissible-banner >}} - -{{< getting-started color="100" height="auto" title="Getting Started" >}} - -{{% getting-started-item icon="icons/webdriver.svg" title="Selenium WebDriver" color="selenium-webdriver" url="/documentation/webdriver/" url_text="Read more" %}} -If you want to create robust, browser-based regression automation suites and tests, scale and -distribute scripts across many environments, then you want to use Selenium WebDriver, a -collection of language specific bindings to drive a browser - the way it is meant to be driven. -{{% /getting-started-item %}} - -{{% getting-started-item icon="icons/ide.svg" title="Selenium IDE" color="selenium-ide" url="https://selenium.dev/selenium-ide/" url_text="Read more" %}} -If you want to create quick bug reproduction scripts, create scripts to aid in automation-aided -exploratory testing, then you want to use Selenium IDE; a Chrome, Firefox and Edge add-on that -will do simple record-and-playback of interactions with the browser. -{{% /getting-started-item %}} - -{{% getting-started-item icon="icons/grid.svg" title="Selenium Grid" color="selenium-grid" url="/documentation/grid/" url_text="Read more" %}} -If you want to scale by distributing and running tests on several machines and manage multiple -environments from a central point, making it easy to run the tests against a vast combination of -browsers/OS, then you want to use Selenium Grid. -{{% /getting-started-item %}} - -{{< /getting-started >}} diff --git a/website_and_docs/content/_index.pt-br.html b/website_and_docs/content/_index.pt-br.html deleted file mode 100644 index bb06b7ed87ab..000000000000 --- a/website_and_docs/content/_index.pt-br.html +++ /dev/null @@ -1,41 +0,0 @@ -+++ -title = "Selenium" -linkTitle = "Selenium" -+++ - -{{< blocks/section color="selenium-green" height="min" >}} -
-

Selenium automatiza navegadores. É isso!

-

O que você fará com esse poder é inteiramente consigo.

-

- O uso mais normal é automatizar testes para aplicativos web, mas não está limitado a apenas isso. -

-

- Tarefas aborrecidas de administração baseadas em web também podem (e devem) ser automatizadas. -

-
-{{< /blocks/section >}} - -{{< translation-alert >}} - -{{< getting-started color="100" height="auto" title="Getting Started" >}} - -{{% getting-started-item icon="icons/webdriver.svg" title="Selenium WebDriver" color="selenium-webdriver" url="/documentation/webdriver/" url_text="Read more" %}} -Se pretende criar um conjunto de testes de automação para regressão, testes, distribuir scripts por muitos ambientes, -então quererá usar Selenium WebDriver, um conjunto de 'bindings' específicos para várias linguagens para 'conduzir' -um navegador web, da forma que foi concebido. -{{% /getting-started-item %}} - -{{% getting-started-item icon="icons/ide.svg" title="Selenium IDE" color="selenium-ide" url="https://selenium.dev/selenium-ide/" url_text="Read more" %}} -Caso queira criar scripts rápidos para reproduzir bugs, ajudar na automação de testes exploratórios, então quererá usar -Selenium IDE, um extra para os navegadores Firefox, Chrome e Edge. -Com Selenium IDE irá conseguir gravar e reproduzir interacções com o navegador. -{{% /getting-started-item %}} - -{{% getting-started-item icon="icons/grid.svg" title="Selenium Grid" color="selenium-grid" url="/documentation/grid/" url_text="Read more" %}} -Se pretende escalar, distribuir e correr testes em várias máquinas e gerir vários ambientes a partir de uma -localização central, simplificando a gestão dos testes com várias combinações de sistemas operativos e navegadores, -então quererá usar a Selenium Grid. -{{% /getting-started-item %}} - -{{< /getting-started >}} diff --git a/website_and_docs/content/_index.zh-cn.html b/website_and_docs/content/_index.zh-cn.html deleted file mode 100644 index 38c073939bc6..000000000000 --- a/website_and_docs/content/_index.zh-cn.html +++ /dev/null @@ -1,41 +0,0 @@ -+++ -title = "Selenium" -linkTitle = "Selenium" -+++ - -{{< blocks/section color="selenium-green" height="min" >}} -
-

Selenium automates browsers. That's it!

-

What you do with that power is entirely up to you.

-

- Primarily it is for automating web applications for testing purposes, but is certainly not limited to just that. -

-

- Boring web-based administration tasks can (and should) also be automated as well. -

-
-{{< /blocks/section >}} - -{{< translation-alert >}} - -{{< getting-started color="100" height="auto" title="Getting Started" >}} - -{{% getting-started-item icon="icons/webdriver.svg" title="Selenium WebDriver" color="selenium-webdriver" url="/documentation/webdriver/" url_text="Read more" %}} -If you want to create robust, browser-based regression automation suites and tests, scale and -distribute scripts across many environments, then you want to use Selenium WebDriver, a -collection of language specific bindings to drive a browser - the way it is meant to be driven. -{{% /getting-started-item %}} - -{{% getting-started-item icon="icons/ide.svg" title="Selenium IDE" color="selenium-ide" url="https://selenium.dev/selenium-ide/" url_text="Read more" %}} -If you want to create quick bug reproduction scripts, create scripts to aid in automation-aided -exploratory testing, then you want to use Selenium IDE; a Chrome, Firefox and Edge add-on that -will do simple record-and-playback of interactions with the browser. -{{% /getting-started-item %}} - -{{% getting-started-item icon="icons/grid.svg" title="Selenium Grid" color="selenium-grid" url="/documentation/grid/" url_text="Read more" %}} -If you want to scale by distributing and running tests on several machines and manage multiple -environments from a central point, making it easy to run the tests against a vast combination of -browsers/OS, then you want to use Selenium Grid. -{{% /getting-started-item %}} - -{{< /getting-started >}}