Selenium 简明教程
Selenium IDE - Features
Selenium Integrated Development Environment 是一款当前可用于 Chrome 和 Firefox 浏览器的插件。它被用作基于 web 的应用程序的自动化测试工具。Selenium Integrated Development Environment 便于使用和安装。可以使用 Selenium Integrated Development Environment 快速设计和执行测试用例。
Selenium Integrated Development Environment is a plugin available currently for Chrome and Firefox browsers. It is used as a tool for automation testing on web based applications. Selenium Integrated Development Environment is convenient to use, and install. The test cases can be quickly designed and executed using the Selenium Integrated Development Environment.
Selenium Integrated Development Environment 基本上提供了图形界面,使用户能够记录对正在测试的应用程序执行的所有操作。Selenium Integrated Development Environment 可以很好地用于调试脚本,方法是在测试步骤中和周围设置断点,以解决测试用例中的错误。
Selenium Integrated Development Environment basically provides a Graphical Interface which enables the user to record all the actions that are performed on the application under test. Selenium Integrated Development Environment can be used very well for the purpose of debugging scripts by setting up breakpoints in and around any test steps for troubleshooting errors in test cases.
Key Features of Selenium IDE
Selenium Integrated Development Environment 具有很多特性,其中一些如下列出:
Selenium Integrated Development Environment has a lot of features out of which some of them are listed below −
Record and Playback
Selenium Integrated Development Environment 具有允许记录对正在测试的应用程序执行的用户操作的功能。这些用户操作的记录可以重播并用作测试。如果没有需要,可能不会使用记录和重放功能,并且可以从头开始开发测试脚本。此外,通过录制创建的测试可以根据需求进行修改。
Selenium Integrated Development Environment has the feature which allows recording of the user actions performed on the application under test. The recording of these user actions can be replayed and used as a test. If not required, the record and playback feature may not be used, and test scripts can be developed from scratch. Also, the test created by recording, can be modified as per the requirement.
Validations
通过添加各种断言和验证命令,Selenium Integrated Development Environment 测试可以更有效地使用。它们默认情况下可在 Selenium Integrated Development Environment 中获得,并有助于增加测试覆盖率。
The Selenium Integrated Development Environment test can be used more effectively by adding various assert and verify commands. They are available in the Selenium Integrated Development Environment by default and help to increase the test coverage.
Selenese Commands
Selenium Integrated Development Environment 中使用的每个命令被称为 Selenese 命令。使用 Selenese 命令,我们在 web 应用程序上执行所有测试活动。Selenese 命令有三种类型:
Every command used in Selenium Integrated Development Environment is known as the Selenese commands. Using the Selenese commands we perform all the testing activities on a web application. Selenese commands are of three types −
-
Actions − The action commands are used to manipulate the state of the application under test. For example, click, type, open, close, and so on.
-
Accessors − The accessor commands are used to assess the state of the application under test and store it in variables. For example, store title, store text, and store value.
-
Assertions − The assertion commands are used to check the state of the application under test. It has three sub-types namely, assert, verify, and waitfor.
Third Party Plugins
可以在 Selenium Integrated Development Environment 中安装许多第三方插件来执行其他操作。
Many Third Party Plugins can be installed within the Selenium Integrated Development Environment to perform additional actions.
CI/CD Support
Selenium 集成开发环境测试可以使用 Selenium 集成开发环境测试的 .side 文件从辅助运行器(即从命令行)运行。这样,它很容易与诸如 Jenkins、CircleCI 之类的 CI/CD 工具配合使用。
The Selenium Integrated Development Environment tests can run from the side-runner (i.e from the command line) using the .side file of Selenium Integrated Development Environment test. This makes it easily configurable with the CI/CD tools like Jenkins, CircleCI, and so on.
Cross Browser Testing
Selenium 集成开发环境测试可以在 Chrome、Firefox、Safari、Edge 等多个浏览器中执行,以确认所测试的应用程序与所有浏览器兼容。
The Selenium Integrated Development Environment tests can be executed across multiple browsers like Chrome, Firefox, Safari, Edge, and so on to confirm that the application under test is compatible with all the browsers.
Components of Selenium IDE
Selenium IDE 具有以下组件,如下所示−
Selenium IDE has the below components as listed below −
Menu Bar
菜单栏包含项目名称、创建新项目或打开现有项目、保存项目以及三个点以更改一些 Selenium 集成开发环境设置的选项。Selenium 集成开发环境菜单栏部分在以下图像中突出显示。
The Menu Bar comprises the project name, option to create a new project or to open an existing project, to save a project, and three dots to change some Selenium Integrated Development Environment settings. The Selenium Integrated Development Environment Menu Bar section is highlighted in the below image.
Tool Bar
工具栏包含控制测试执行速度的测试执行速度选项、用于逐步执行测试的跳过当前命令选项、执行当前选定测试的运行当前测试选项以及运行测试套件中每个测试的运行所有测试选项。Selenium 集成开发环境工具栏部分在以下图像中突出显示。
The Tool Bar comprises of the Test execution speed option which controls the speed of the test execution, the Step over current command option that is used to step through the tests, the Run current test option to execute the presently selected test, and the Run all tests option to run every test in the test suite. The Selenium Integrated Development Environment Tool Bar section is highlighted in the below image.
Address Bar
地址栏具有一个下拉菜单,该菜单保存基本 url 的每个先前值。Selenium 集成开发环境地址栏部分在以下图像中突出显示。
The Address Bar has a dropdown menu which saves every previous value for the base url. The Selenium Integrated Development Environment Address Bar section is highlighted in the below image.
Test Case Pane
测试用例面板包含 Selenium IDE 记录的每个测试。Selenium 集成开发环境测试用例面板部分在以下图像中突出显示。
The Test Case Pane contains every test that the Selenium IDE has recorded. The Selenium Integrated Development Environment Test Case Pane section is highlighted in the below image.
Test Script Editor Box
测试脚本编辑器框包含实际测试步骤、用户操作、验证等,这些步骤在 Selenium 集成开发环境中记录或设计。
The Test Script Editor Box contains the actual test steps, user actions, validations, and so on either recorded or designed in the Selenium Integrated Development Environment.
测试脚本编辑器框具有以下组件,即负责对所测试应用程序的 Web 元素执行操作的命令、确切指向将在其上执行操作的 Web 元素的目标(可选字段),通过指定元素的属性名称和值,值(可选字段)用于传递值或参数、注释(可选字段)用于向测试步骤添加注释、启用/禁用命令、添加新的窗口配置、选择页面中的目标和在页面中查找目标。
The Test Script Editor Box has the components, namely the Command which takes care of the action to be performed on the web element for the application under test, the Target (optional field) which pinpoints to a web element on which an action is to be performed by mentioning an element’s attribute name and value, the Value (optional field) is used to pass value or parameter, the Comment (optional field) to add comment to a test step, the Enable/Disable command, the Add new window configuration, select Target in page, and the Find target in page.
Selenium 集成开发环境测试脚本编辑器部分在以下图像中突出显示。
The Selenium Integrated Development Environment Test Script Editor section is highlighted in the below image.
Recording Button
录制按钮用于在 Selenium 集成开发环境中启动和停止测试录制。Selenium 集成开发环境录制部分在以下图像中突出显示。
The Recording button is used to start and stop recording of tests in Selenium Integrated Development Environment. The Selenium Integrated Development Environment Recording section is highlighted in the below image.
Log
日志部分捕获执行消息、信息、警告(如果有)和错误。它表示特定步骤是否通过或失败,以绿色 OK 或红色失败指示和测试用例的最终结果(通过或失败)。Selenium 集成开发环境日志部分在以下图像中突出显示。
The Log section captures the execution messages, information, warnings (if any), and errors. It denotes if a particular step passed or failed with a green OK or a red Failed indication and final outcome of the test case (passed or failed). The Selenium Integrated Development Environment Log section is highlighted in the below image.
Reference
参考部分显示测试脚本编辑器中测试步骤中当前选定命令的每条信息、要传递的参数、定位器、值等。Selenium 集成开发环境参考部分在以下图像中突出显示。
The Reference section displays every information of the currently selected command in the test step within the Test Script Editor, the arguments to be passed, locator, value, and so on. The Selenium Integrated Development Environment the Reference section is highlighted in the below image.
Conclusion
这总结了我们对 Selenium IDE 特性教程的全面理解。我们从描述 Selenium IDE 的关键特性和 Selenium IDE 的组件开始。这使你具备了对 Selenium IDE 特性的深入了解。明智的做法是继续练习你所学到的知识,并探索与 Selenium 相关的其他知识,以加深理解并拓宽视野。
This concludes our comprehensive take on the tutorial on Selenium IDE Features. We’ve started with describing key features of Selenium IDE, and components of Selenium IDE. This equips you with in-depth knowledge of the features in Selenium IDE. It is wise to keep practicing what you’ve learned and exploring others relevant to Selenium to deepen your understanding and expand your horizons.