Selenium IDE 基础使用教程

时间:2023-03-10 02:02:13
Selenium IDE 基础使用教程

Selenium IDE 基础使用教程

  

  简介及安装

    Selenium IDE 是一个易于使用的Firefox插件。它提供了一个图形用户界面,可进行脚本录制及导出。其记录的脚本可以被转换成多种编程语言(HTML、Ruby、Python、Java、C#)。Selenium IDE + Firebug 是写 UI 自动化脚本的两大利器。

      Selenium IDE下载:http://seleniumhq.org/download/

      Firebug下载:https://addons.mozilla.org/en-US/firefox/addon/firebug/

    

    若无法下载,分享网盘下载:http://pan.baidu.com/s/1o65g08U

    安装插件后,可通过菜单 开发者 - Selenium IDE 选择(FireFox前期版本是在Tools里面),也可使用快捷键 Selenium IDE 基础使用教程

      Selenium IDE 基础使用教程

  界面简介

    Selenium IDE 界面还是比较好理解并实用的,多使用几次,就差不多熟悉了。面板介绍参见如下:

        Selenium IDE 基础使用教程

  创建简单的测试用例

    以百度首页搜索为例,举一个很简单例子,如下:

     1. 打开百度首页,点击 Selenium IDE 按钮

            Selenium IDE 基础使用教程

    2.  可以看到打开默认开始录制了,BaseURL 为当前URL;操作光标移入搜索框,Selenium IDE 会录制为测试步骤 Selenium IDE 基础使用教程

        Selenium IDE 基础使用教程

    3. 继续操作,在百度搜索框中输入,如:selenium,点击搜索按钮 

        Selenium IDE 基础使用教程

    4. 操作录制完成,点击Selenium IDE 基础使用教程

      Selenium IDE 基础使用教程

        Selenium IDE 基础使用教程

      Selenium IDE 的 Command 处理很方便,可直接在面板中,对其进行增、删、改,以及改变先后的顺序。

    5. 浏览器中新建一个Tab,点击 Selenium IDE 基础使用教程

      这边失败是由于网络响应来还没来得急,就已经开始验证元素了,这边可调整运行的速度 Selenium IDE 基础使用教程

Selenium IDE 基础使用教程