In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Resource recommendations:
Video resources: series of videos related to software testing
Community Resources: automated Test Communication Group
Introduction to Selenium IDE
Selenium IDE (Integrated Development Environment) is the simplest tool in the Selenium tool suite. It can quickly create test scripts through recording and playback. This feature is similar to QTP, and it is very easy to install and use.
Because of its simple function and limited scope of application, Selenium IDE is used as a prototype tool in many cases, rather than as a solution for developing and maintaining complex test scenarios.
Although learning Selenium IDE does not require any other knowledge base, at least you need to be familiar with HTML,Javascript, and DOM (Document Object Model), through which you can give full play to the potential of the tool (Selenium IDE). For example, when we enter the "runScript" phase of the Selenese command, we need to use javascript knowledge.
When creating test scripts using Selenium IDE, Selenium IDE supports command completion mode, which is mainly for two purposes:
Help testers complete command input faster
Restrict users from entering invalid Selenese commands
Selenium IDE characteristics
Menu bar
The menu bar is located at the top of IDE, and the most commonly used menus include: File,Edit and Options menus.
File menu
The file menu contains options for creating, opening, saving, and closing tests.
Tests is saved in HTML format
Here is the most useful option, "Export", which allows you to save Selenese scripts as test scripts that support Selenium RC and Selenium WebDriver support.
"Export Test Case As..." can be found everywhere in the current script.
"Export Test Suite As...", the current test suite of all scripts.
It should be noted that since Selenium IDE V1.9.1, the test script can only be saved to a file in the following format.
. CS (C # source code)
.java (Java source code)
.py (Python source code)
.rb (Ruby source code)
Edit menu options
It contains commonly used options: Undo, Redo, Cut, Copy, Paste, Delete, and Select All.
There are two most important options: "Insert New Command" and "Insert New Comment".
The newly inserted command or comment is placed above the currently selected command line
The command is marked with a black font
Comments are marked with purple fonts
Options menu
Options provides users with an extended interface, as well as a variety of Selenium IDE-related configurations.
Let's first look at the Options and "Clipboard Format" options:
The Clipboard Format option allows you to copy a command from the IDE command line editor and paste it into a specified code snippet
Paste into the target code snippet format depends on the format selected here
HTML is the default format
For example, when you choose a code format of "Java/JUnit 4/WebDriver", each command line copied from Selenium IDE will be pasted as java code.
Selenium IDE Options dialog box
Click "Options > Options..." on the menu bar Launch the Options dialog box, Options contains a lot of configuration information, we will choose the more important to explain.
Default Timeout Value. This time refers to the waiting time for an element to appear on the page or for an element to become accessible. After the timeout, a corresponding error message is thrown. Here, the default timeout is 30000ms.
Selenium IDE extensions. You can extend the Selenium IDE feature here by visiting "http://addons.mozilla.org/en-US/firefox/"" and searching for related extensions using the keyword "Selenium".
Remember base URL. Here you can set so that Selenium IDE remembers the last Base Url used each time it starts, and if this option is checked, IDE will leave Base Url blank each time it starts.
Autostart record. Select this option to enable the recording state by default every time you restart Selenium IDE.
Locator builders. Here you can specify the order in which locators is used when recording scripts. Locators is the element positioning selector. In the following configuration, when you click on an element with ID, IDE will first use id locator as the selector for positioning elements. If there is no ID in the target element, Selenium will look for the name attribute as the second choice, and so on until an available element positioning selector is found.
Base URL column
Base URL has a drop-down menu list that records the history of all previous visits.
With the Selenese command "open", you can navigate the browser to the page that the specified url refers to.
In this tutorial, we will use "http://newtours.demoaut.com" as Base URL, a web system that HP maintains for testing purposes, and this web system contains all the page elements that will be used in this tutorial.
When using Base URL, it is very useful when visiting pages based on relative paths. For example, if you specify the value of Base URL as "http://newtours.demoaut.com"" here, you can use the Selenese "open" command and specify the Target value as "sign-up". Selenium IDE will directly navigate the browser to the "sign-up" page, as follows:
Toolbar controls the playback speed of the script through this control
Start / end the recording session, and when opened, all operations with the browser will be recorded as Selenese commands and written to the Editor panel. Execute the entire test suite and all test cases in the test panel will be executed sequentially. Executing the current test case executes only the selected test scripts in the current test panel. Pause / resume the test script that is currently being played back. Step by step debugging, you can step by step to execute the commands of the test script for debugging.
Apply a summary policy to merge multiple commands into one through the rollup keyword, requiring user-defined extensions.
Test case panel
Multiple test scripts can be opened in the test panel at the same time.
When the target is a test suite, the test panel loads a list of all test scripts under the current test suite.
The test case name is marked in bold for the currently selected test script.
After playback, each test script name is colored with a font background to indicate success or failure, with green for success and red for failure.
The bottom of the test cases panel shows the total number of tests run and the number of failures.
Editor
Editor contains two view windows: Table View and Source View.
Table
The Table view is the most frequently used in most cases.
You can create and modify Selenese commands here.
After the script is played back, each execution step is colored.
To create a test step, you can enter a command name in the Command text box
As you type a command, the text box drop-down list displays all the sets of commands that can be matched.
The Target parameter is usually an element locator, or as a parameter value, etc., while Value is usually the parameter variable name, input data, and so on.
Source view
The source view shows the test steps in HTML format.
You can create and edit Selenese commands in this view.
Log panel
The log panel displays test execution messages in real time, updates the log in real time, and informs Selenium of what is being done.
Logs is classified into 4 categories
Debug-by default, debug messages are not displayed, and the debug information is mainly related to the technology used by the Selenium runtime, such as loading a specific module, a specific function has been called, loading an external js file, and so on.
The Info-info message tells the consumer which Selenese commands are executed by Selenium IDE.
Warn-in some special cases, the Warn message is prompted for reasons such as improper use of Selenese or the environment.
Error-when the execution of the Selenese command fails, there will be error messages, such as Error messages when the conditions of the "verify" or "assert" related commands are not met.
Log information can be filtered by type, for example, when the "Error" option is selected, only error-related information is displayed in the log panel.
Reference window (gray is often useful)
The Reference window shows an introduction to the currently selected Selenese command, as well as a description of the locator and value of the current command.
UI-Element window
UI-Element is a more advanced topic for selenium users. It uses JSON (Javascript Object Notation) to define the mapping structure of pages and page elements. We can find "UI Element Documentation" under the "Help" option in Selenium IDE, where UI-Element contains more details.
The following is an example of using UI-Element.
Rollup window
Rollup allows you to combine a set of Selenese commands into one step, and a set of selenese commands called "rollup", which relies heavily on javascrip and "UI-Element" concepts, similar to function in a programming language.
Rollup can be reused, a "rollup" can be used many times in test scripts, and because "rollup" is a collection of commands, it can reduce the length of test scripts.
The contents of the "rollup" window are shown below
Summary
Selenium IDE is the simplest in the whole suite.
Is only used as a prototype tool
Knowledge of JS and HTML is required. Rollup is a collection of reusable commands. Locators is the description that you tell IDE how to find the element.
Firebug is a tool for getting locator values.
The menu bar is used to create, modify, and export test cases in a format recognized by RC,WebDriver.
The default format of the Selense command is HTML.
The options menu provides more configuration about IDE.
Base URL base addresses are useful for accessing relative addresses.
The test cases panel displays the open case and a summary of the test results.
The Editor editor provides an entrance to modify the script
The form attempts to wait for you to type Command,target,value in tabular form. Code view uses HTML to display your script.
The log and reference pages provide some information that you might need to perform a case.
UI-Element and Rollup are intended for users who are more familiar with Selenium tools. Considerable experience in JS programming is required.
UI-Element allows us to use json to match UI elements.
Click the link to join the group [Yue sharing testing Alliance]: https://jq.qq.com/?_wv=1027&k=5DiePik
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.