diff --git a/docs_source_files/content/legacy_docs/selenium_ide.ja.md b/docs_source_files/content/legacy_docs/selenium_ide.ja.md index 1fb3de892409..d5aa01a5f12c 100644 --- a/docs_source_files/content/legacy_docs/selenium_ide.ja.md +++ b/docs_source_files/content/legacy_docs/selenium_ide.ja.md @@ -1,278 +1,238 @@ --- -title: "Legacy Selenium IDE" +title: "レガシー Selenium IDE" weight: 4 --- -{{% notice info %}} - Page being translated from -English to Japanese. Do you speak Japanese? Help us to translate -it by sending us pull requests! -{{% /notice %}} +## 紹介 -## Introduction +Selenium-IDE (統合開発環境) は、Selenium テストケースを開発するためのツールです。 +Selenium-IDE は使いやすい Firefox プラグインで、一般にテストケースを開発するための最も効率的な方法です。 +Selenium-IDE ではコンテキストメニューも使用できます。 +コンテキストメニューを使うと、まず現在ブラウザに表示されているページ上の UI 要素を選択し、次に Selenium コマンドのリストから目的のコマンドを選択できます。 +コマンドのパラメータは、選択された UI 要素のコンテキストに従って、あらかじめ定義されたものが使われます。 +Selenium-IDE を使う方法は、時間の節約になるだけでなく、Selenium スクリプトの構文を学ぶ手段としても優れています。 -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. +この章では Selenium-IDE について詳しく取り上げ、Selenium-IDE を効果的に使う方法について説明します。 -This chapter is all about the Selenium IDE and how to use it effectively. +## IDEのインストール -## Installing the IDE +Firefoxを使用して、最初にSeleniumHQ[ダウンロードページ](https://selenium.dev/downloads)から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. +Firefoxは、不慣れな場所からアドオンをインストールしないように保護するため、次のスクリーンショットに示すように、インストールを続行するには'許可'をクリックする必要があります。  -When downloading from Firefox, you’ll be presented with the following window. +Firefoxからダウンロードすると、次のウィンドウが表示されます。  -Select Install Now. The Firefox Add-ons window pops up, first showing a progress bar, -and when the download is complete, displays the following. +「今すぐインストール」を選択します。 +Firefoxの「アドオン」ウィンドウがポップアップし、最初にプログレスバーが表示されます。 +ダウンロードが完了すると、次のような画面になります。  -Restart Firefox. After Firefox reboots you will find the Selenium-IDE listed under -the Firefox Tools menu. +Firefoxを再起動します。 +Firefoxの再起動後、Firefoxの「ツール」メニューには、「Selenium-IDE」が表示されます。  -## Opening the IDE +## 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を実行するには、Firefoxの「ツール」メニューから「Selenium-IDE」を選択するだけです。 +空のスクリプト編集ウィンドウと、テストケースを読み込んだり新規作成したりするメニューのある Selenium-IDE のウィンドウが表示されます。  -## IDE Features +## IDEの機能 -### 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. +「編集」メニューでは、テストケースのコマンドを編集するためのすべての操作をコピー、貼り付け、削除、元に戻す、選択できます。 +「オプション」メニューでは、さまざまな設定を変更できます。 +特定のコマンドのタイムアウト値を設定し、Seleniumコマンドの基本セットにユーザー定義のユーザー拡張機能を追加し、テストケースを保存するときに使用する形式(言語)を指定できます。 +「ヘルプ」メニューは Firefox 標準の「ヘルプ」メニューで、この中の 「UI-Element Documentation」 だけが 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. +ツールバーには、テストケースをデバッグするためのステップ実行機能をはじめ、テストケースの実行をコントロールするためのさまざまなボタンが並んでいます。 +右端の赤い丸のボタンは、「Record」(記録) ボタンです。   -Speed Control: controls how fast your test case runs. +「Speed Control」 (速度調節): テストケースの実行速度を調節します。  -Run All: Runs the entire test suite when a test suite with multiple test cases is loaded. +「Run All」 (すべて実行): 複数のテストケースを持つテストスイートが読み込まれているときにテストスイート全体を実行します。  -Run: Runs the currently selected test. When only a single test is loaded -this button and the Run All button have the same effect. +「Run」 (実行): 現在選択されているテストを実行します。 +テストが1つしか読み込まれていない場合、このボタンと「Run All」ボタンの動作は同じです。   -Pause/Resume: Allows stopping and re-starting of a running test case. +「Pause」 / 「Resume」 (一時停止/再開) : 実行中のテストを一時停止または再開します。  -Step: Allows you to “step” through a test case by running it one command at a time. -Use for debugging test cases. +「Step」(ステップ実行): コマンドを1つずつ実行し、テストケースの「1ステップ実行」を行います。 +テストケースをデバッグするときに使います。 +  -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. +「TestRunner Mode」 (TestRunner モード): テストケースを Selenium-Core TestRunner で読み込んでブラウザで実行することができます。 +TestRunner は今はあまり使われておらず、いずれ非推奨となるでしょう。 +このボタンは、テストケースを評価して、TestRunner との後方互換性があるかどうかを調べるために用意されています。 +ほとんどのユーザーは、このボタンを使う必要はないでしょう。 +  -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. +「Apply Rollup Rules」(ロールアップルールを適用): この高度な機能を利用すると、一連の Selenium コマンドの繰り返しを 1 つのアクションにまとめることができます。 +ロールアップルールの詳細については、「ヘルプ」 メニューの [UI-Element Documentation] を参照してください。  -### 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. +スクリプトは「テストケース」ペインに表示されます。 +ペインには2つのタブがあります。 +次に示すのは、コマンドとそのパラメータを読みやすい「テーブル」形式で表示するための [「テーブル」タブです。  -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. +もう 1 つの「ソース」タブには、テストケースがネイティブ形式で表示されます。 +ファイルはこのネイティブ形式で保存されます。 +デフォルトでは HTML ですが、Java や C# などのプログラミング言語、あるいは Python などのスクリプト言語に変更することもできます。 +詳細については、「オプション」 メニューを参照してください。 +「ソース」 タブでは、テストケースを生の形式で編集することができ、操作のコピー、切り取り、貼り付けが可能です。 -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. +「コマンド」、「対象」、および 「値」 入力フィールドには、現在選択されているコマンドとそのパラメータが表示されます。 +これらの入力フィールドでは、現在選択されているコマンドを修正できます。 +一番下のペインの 「リファレンス」 タブで、コマンドに対して指定されている 1 つ目のパラメータは、必ず 「対象」 フィールドに入力します。 +「リファレンス」 タブで 2 つ目のパラメータが指定されている場合、このパラメータは 「値」 フィールドに入力します。  -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 +### ログ/参照/UI要素/ロールアップペイン -The bottom pane is used for four different functions–Log, Reference, -UI-Element, and Rollup–depending on which tab is selected. +一番下のペインは、さまざまな機能で使われます。 +「ログ」、「リファレンス」、「UI-Element」、および 「Rollup」 の4つのタブがあります。 -#### 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. +テストケースを実行すると、「ログ」 タブを選択していなくても、エラーメッセージとテストの進行状況を示す情報メッセージが自動的にこのペインに表示されます。 +これらのメッセージは、しばしばテストケースのデバッグに役立ちます。 +ログを消去するには 「消去」 ボタンをクリックします。 +「情報」 ボタンをクリックすると、ドロップダウンリストが表示されます。 +リストで目的の項目を選択すれば、画面に表示する情報のレベルを指定できます。  -#### 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. +「リファレンス」 タブは、「テーブル」 タブで Selenese コマンドとパラメータを入力したり修正したりする場合にデフォルトで選択されるタブです。 +「テーブル」 タブが表示されている場合、「リファレンス」 ペインには現在のコマンドのリファレンスが表示されます。 +「テーブル」 タブの 「ソース」 タブのどちらで作業している場合も、コマンドを入力または修正するときは、「対象」 フィールドと 「値」 フィールドで指定するパラメータが、「リファレンス」 ペインのパラメータリストに指定されているものと一致していることを確認することが非常に重要です。 +指定するパラメータの数は、「リファレンス」 ペインで指定されている数と一致しなければならず、パラメータの順序も 「リファレンス」 ペインのそれと一致しなければなりません。 +さらに、指定するパラメータの型も、「リファレンス」 ペインで指定されている型と一致していなければなりません。 +これら 3つのうち、1つでも一致しないものがあれば、コマンドは正常に実行されません。  -While the Reference tab is invaluable as a quick reference, it is still often -necessary to consult the Selenium Reference document. +「リファレンス」 タブはクイックリファレンスとして大いに役立ちますが、Seleniumリファレンスを参照することもしばしば必要になります。 + +#### UI-ElementとRollup -#### UI-Element and Rollup +これらの2つのペイン (高度な機能を扱うためのペイン) については、Selenium-IDE の 「ヘルプ」 メニューの 「UI-Element Documentation」 を参照してください。 -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 +テストケースを開発するための主な方法は3つあります。 +多くの場合、テスト開発者はこれら 3 つのテクニックをすべて使う必要があります。 -There are three primary methods for developing test cases. Frequently, a test -developer will require all three techniques. +### 記録 -### Recording +Selenium を初めて使うユーザーは、Web サイトでの操作を記録してテストケースを作成することが多いようです。Selenium-IDE を最初に開いたとき、「Record」 ボタンはデフォルトでオンになっています。 -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.” +Selenium-IDEで自動的に記録を開始したくない場合は、Options > Options… に移動し、"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: +記録中は、ユーザーの操作に基づいて Selenium-IDE がテストケースにコマンドを自動的に挿入します。 +次に示すのは、典型的なユーザーの操作です。 -* 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 +* リンクをクリックする - click または clickAndWait コマンド +* 値を入力する - type コマンド +* ドロップダウンリストボックスからオプションを選択する - select コマンド +* チェックボックスまたはラジオボタンをクリックする - click コマンド -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. +* typeコマンドが記録されるようにするには、Web ページ上のどこか別の場所をクリックする操作が必要になる場合があります。 +* リンクをたどる操作は、通常は click コマンドとして記録されます。 + 多くの場合、 click コマンドは clickAndWait に変更して、新しいページが完全に読み込まれるまでテストケースを確実に停止させる必要があります。 + そうしないと、ページに含まれるすべての UI 要素が読み込まれる前にテストケースの実行が先に進み、予期しない形でテストケースが失敗することになります。 -### 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. +テストケースでは、Web ページのプロパティをチェックする必要もあるでしょう。 +それには、 assert コマンドと verify コマンドを使う必要があります。 +ここでは、これらのコマンドの細かな点には触れません。 +テストケースに追加する方法だけを説明します。 +コマンドの詳細については、 “Selenese” Selenium コマンド に関する章を参照してください。 -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. +Selenium-IDE の記録機能がオンの状態で、テスト対象のアプリケーションを表示しているブラウザを選択し、ページ上の任意の場所を右クリックします。 +すると、 verify コマンドや assert コマンドを含むコンテキストメニューが表示されます。 -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. +初めて Selenium を使う場合には、Selenium コマンドが1つしか表示されないかもしれません。 +しかし、IDE を使っていると、メニューに表示されるコマンドがどんどん増えていきます。 +Selenium-IDE は、現在の Web ページ上で選択されている UI 要素に応じて、必要なコマンドとパラメータの予測を試みます。 -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. +実際にこの機能をためしてみましょう。 +適当な Web ページを開き、ページ上のテキストを選択します。 +段落1つか、見出しがいいでしょう。 +次に、選択したテキストを右クリックします。 +コンテキストメニューが表示され、 verifyTextPresent コマンドと、このコマンドにふさわしいパラメータとして、選択されたテキスト自体が表示されるはずです。 -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. +また、「利用可能な全てのコマンド」 という項目があることに注目してください。 +この項目を選択すると、非常に多くのコマンドが、現在選択されている UI 要素のテストに適したパラメータ案とともに表示されます。 -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. +いくつかほかの UI 要素についても、同じようにためしてみてください。 +たとえば、画像を右クリックしたり、ボタンやチェックボックスなどのユーザーコントロールを右クリックしたりしてみてください。 +verifyTextPresent 以外のオプションを見るには、「利用可能な全てのコマンド」 を使う必要があるかもしれません。 +いったんほかのオプションを選択すると、よく使われるコマンドがトップレベルのコンテキストメニューに表示されるようになります。 +たとえば、画像に対して verifyElementPresent を選択すると、次に画像を選択して右クリックしたときに、トップレベルのコンテキストメニューにこのコマンドが表示されるようになります。 -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. +繰り返しになりますが、これらのコマンドの詳細については、Selenium のコマンドに関する章で説明します。 +とりあえずここでは、IDE を使ってさまざまなコマンドをテストケースに記録、選択し、テストケースを実行してみてください。IDE を使っていうちに、Selenium のコマンドについても自然に多くのことを学べるはずです。 -### 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: +テストケース内のコマンドを挿入する場所を選択し、3 列からなる行を 1 つ作成するのに必要な HTML タグを入力します。 +この行の 1 列目にはコマンドを、2 列目には最初のパラメータを (パラメータが必要な場合)、3 列目には 2 つ目のパラメータを (パラメータが必要な場合) 入力します。「テーブル」 タグに戻るときは、その前にテストケースを保存します。 ```html