This article is for the exchange of learning, no commercial use, no profit.
It is completely my own to urge myself to study and translate. The translation is not good, forgive me. From: http://www.guru99.com/introduction-selenuim-ide.html
It's very long! When am I going to finish translating it? Damn it! I mean it!
Introducing the Selenium IDE
The Selenium IDE is the simplest in a tool suite! You can quickly create test cases by recording and replaying the feature. This is similar to the corresponding part in QTP. You can learn without any difficulty.
Because it is simple, the IDE can only be used to analyze the prototype of an element, rather than creating a complete set of complex test cases.
Although you can learn without programming knowledge, you must also be familiar with HTML, JavaScript, and Dom in order to use this tool well. JavaScript knowledge is used when we learn to command "RunScript".
Selenium IDE supports auto-complete commands when creating tests. This feature has two purposes:
- Help testers quickly enter commands
- Restricted User Input Invalid command
Features of the Selenium IDE
Menu bar
At the top of the IDE. Where the file Edit and Options buttons are more commonly used
File menu
- Includes create, open, save, and close tests.
- Tests are saved in HTML format
- The most useful option is exporting export. You can save the case created by the IDE in the form of RC and Webdriver.
. Export the test case and export only the currently open case.
. Export your test suite and export the case from your recently opened test suite
Edit Menu
- Includes general options, Undo, Redo, Cut, copy, paste, delete and select all functions.
- The two most important options are "insert new command" and "Insert new comment".
- The newly added commands and comments will be inserted above the currently selected line.
- The command is expressed in black.
- Comments are expressed in purple.
Options Menu
It provides an interface for configuring different settings.
Options and Clipboard format (clipboard format) will be discussed as a focus.
Clipboard format
- The Clipboard format allows you to copy a Selenese command from the editor and paste it into your code.
- The format of the code can be selected from the list.
- HTML is the default option.
For example, when you choose C#/nunit/webdriver as the Clipboard format, each time you copy a command from the editor, the paste is in C # format and can be pasted into the code.
Driver. Findelement (By.name ("username")). Clear ();
Driver. Findelement (By.name ("username")). SendKeys ("test");
Selenium IDE Options Dialog box
Click Options > Options in the menu bar ... (Options ...) You can open the Selenium IDE Options dialog box. There are a lot of setup options, we only introduce important.
- The default time-out value. refers to selenium waiting for an element to appear up to such a long time. After such a long time not to come out, the error.
- IDE extensions . In this choose the plug-in that extends IDE functionality. You can search for selenium related extensions in http://addons.mozilla.org/en-US/firefox/.
- remember the base address . Tick this option, the IDE remembers the base URL when it opens, otherwise the Selenium IDE will load the empty base URL.
- start recording automatically . When selected, the Selenium IDE immediately starts recording browser actions whenever you start
- Locator Locator Construction . Select the element that is the primary consideration for the generated locator. The locator tells selenium which UI element the IDE action occurs on. If you order an element with UI properties, the UI will act as a locator
Base URL Bar
- The drop-down menu in the Base URL remembers the input values you have entered several times before.
- The Selenese command "open" opens the Web page you entered in the base URL.
- The Base URL is useful when accessing relative addresses. Assuming your base URL is set to Http://newtours.demoaut.com, the Selenium IDE directly accesses the login page when Open,target is set to signup.
Tool bar
|
Playback speed setting. Controls the speed at which test scripts are executed. |
|
Recording. Start/End your recording session. Each browser's behavior you have to be in the editor with selenese command input. |
|
Perform all the tests. All the test cases in this test suite collection will be executed in turn. |
|
Executes the current test. |
|
Pause/Resume. Will pause or resume your playback operation. |
|
Steps. You can step into your script. |
|
Collection steps. Executes a set of commands as an action action. |
Test Case Panel
- Inside the Selenium IDE, you can open multiple case at the same time.
- The case panel shows the test case you are currently opening.
- When you open a test set, the test case panel automatically lists the cases contained within it.
- The case marked in bold is the one you selected now.
- After you run the case, the case is displayed on a red background. The green is through the case.
- The bottom section is a summary of the case scenario.
Editor
The editor records all the action processes. Can be viewed in tabular or code form.
Table View
- Most of the time, we work in tabular view.
- We create and modify the Selenese command in the table.
- After running, each step is color-coded to pass.
Enter the command in the text box next to command. Commands are accompanied by some hints. Target is a parameter that can be passed in for the command. Value, enter the corresponding values
Code view
- All steps are shown here in HTML format
- You can also modify the script directly in this area.
Log panel
The log Panel logs the message at run time. is automatically updated. The logs are divided into four categories.
- debug-debugging By default, the debug level information is not displayed. You have to look, you have to filter yourself. They explain some of the underlying implementation. It may be just the information that a module is loading, or a function is called.
- info-information Displays the command selenium the IDE is calling
- warn-warning warnings encountered in special situations
- error-Errors Selenium errors encountered by the IDE during execution, such as a result that does not match expectations.
The log can be filtered to see a category by filter.
Reference panel
Tell you what the currently selected command is, how to use it, and what value to pass.
Interface Element Panel
This interface is for users who are more familiar with selenium. JSON was used to define element matching. These documents and resources can be found in Help.
The information for the UI element is shown below.
Merge panel
Combine several commands into a group and then count as a command to execute. A set of commands is called a rollup. As if a function inside a programming language contains multiple statements.
Rollup can be reused. If you compress some of the commands into a rollup a, you can invoke these commands the next time you use rollup a.
Rollup will generate a tab to display
Summarize
Can be considered to be finished, I have been crazy ... Drunk, drunk.
- The Selenium IDE is the simplest of the entire suite.
- Can only be a prototype tool
- Need the knowledge of JS and HTML. Rollup is a collection of reusable commands. Locators is a description of how you tell the IDE how to find the element.
- Firebug is the tool that gets the locator value.
- The menu bar is used to create, modify, and export test cases in a format that rc,webdriver can recognize.
- The default format for the Selense command is HTML.
- The Options menu provides more configuration about the IDE.
- Base URL Base Address is more useful for accessing relative addresses.
- The Test Cases panel displays the open case and a summary of the test results.
- Editor provides a portal to modify scripts
- The table tries to type Command,target,value in tabular form. The code view uses HTML to display your script.
- The log and reference pages provide some information that may be required to execute a case.
- Ui-element and rollup are used by users who are more familiar with selenium tools. Requires considerable experience in JS programming.
- Ui-element allows us to use JSON to match UI elements.
"Selenium" 3. Introducing the Selenium IDE