Selenium IDE introduces installation and use

Selenium IDE :

 Selenium IDE is a plug-in embedded in the Firefox browser, which realizes the recording and playback functions of simple browser operations.

Similar to QTP 's automatic recording function. You know! I won't say much more here.

So when is it used?

Quickly create a bug reproduction script. During the testing process of the tester, after a bug is found, the reproduction steps can be recorded through the IDE

Made it easier for developers to reproduce bugs.

The scripts recorded by the IDE can be converted into multiple languages ​​to help us develop scripts quickly.

More details.

 

method one:

Let's first install selenium IDE...

Open the firefox  browser and enter the official website: http://seleniumhq.org/download/

Find the download link of selenium IDE , firefox will prompt to install the plug-in, click install.

 

Method Two:

Of course, you can also do it another way.

In the menu bar of firefox , select tools  (tools) ---> add-ons Manager (add components) and then search for selenium IDE and click to download, install and restart.   

Selenium IDE uses :

Open the plugin

All right! tell you what to do. (Open a new tab in the browser - enter the Baidu URL - enter " " selenium  " in the search bar and click the search button) It's such a simple process.  

After the recording is complete, click the red button to end the recording.

The recorded script can be played back by clicking the green triangle button. Like my screenshot, playback is no problem.

I won't say much about selenium IDE . For details on the modification, addition, etc. of the recording script, please refer to other materials. If I learn more I will share it with you. Whee!

For the sake of convenience and brevity, we will introduce it according to the number marks in the above figure:

1 . File : Create, open and save test cases and test case sets. Edit : Copy, paste, delete, undo and select all commands in a test case. Options  : Used to set seleniunm IDE.

2 . Used to fill in the address of the website under test.

3 . Speed ​​Control: Control how fast the case runs.

4 . Run All: Runs all cases in a test case set.

5 . Run: Run the currently selected test case.

6 . Pause/Resume: Pause and resume test case execution.

7 . Single Step: Can run a single line of commands in a case.

8 . Record: Click to start recording your actions on the browser.

9 . List of case sets.

10。测试脚本;table标签:用表格形式展现命令及参数。source标签:用原始方式展现,默认是HTML语言格式,也可以用其他语言展示。

11。查看脚本运行通过/失败的个数。

12。当选中前命令对应参数。

13。日志/参考/UI元素/Rollup

日志:当你运行测试时,错误和信息将会自定显示。

参考:当在表格中输入和编辑selenese命令时,面板中会显示对应的参考文档。

UI元素/Rollup:参考帮助菜单中的,UI-Element Documentation。

 

----//编辑命令

selenium为我们录制的脚本不是100%符合我们的需求的,所以,编辑录制的脚本是必不可少的工作。

1.  编辑一行命令或注释。

 在Table标签下选中某一行命令,命令由command、Target、value三部分组成。可以对这三部分内容那进行编辑。

 2.  插入命令。

  在某一条命令上右击,选择“insert new command”命令,就可以插入一个空白,然后对空白行进程编辑。

  3. 插入注解

   以上面同样的方式右击选择“insert new comment”命令插入注解空白行,本行内容不被执行,可以帮助我们更好的理解脚本,插入的内容以紫色字体显示。

 4. 移动命令或注解

  有时我们需要移动某行命令的顺序,我们只需要左击鼠标拖动到相应的位置即可。

 

----//录制我们的第一个脚本

我们的录制流程:

用火狐浏览器,打开一个新的标签-----输入谷歌网址(http://www.google.com.hk/)----在搜索框输入:selenium----点击“google搜索”按钮。 

注:注意开启和关闭selenium IDE面板上的红色圆形的录制按钮。

录制的脚本:

 

----//调试脚本

1. 设置断点。

  要设置断点,先选择一行命令,点击鼠标右键,在下拉菜单中选择“Toggle Breakpoint”命令,点击“运行”按钮,脚本会运行到断点处停止。用过myecilpse的debug功能来调试脚本的同学懂的!

2. 通过页面源代码来调试脚本

  很多情况下,调试自动化测试案例都离不开查看页面源代码,我们可以借助firefox的firebug工具,关于firebug的安装(浏览器菜单栏---工具---查看组件---搜索firebug---安装并重启浏览器即可)。

如:我们不确定或想获得谷歌搜索按钮的属性。在按钮上右击---查看元素

在浏览器下方打开的firebug工具里面,就可以查看按钮代码了。

 

3. 定位辅助

  当selenium IDE录制脚本时,它会存储额外的信息,支持用户挑选其他格式的定位器来代替默认格式的定位器,这种特殊性对于学习定位器很有用。

我们可以选择其他的命令来代替“name=btnG” 命令,当然,脚本依然是可以运行的。

关于 selenium IDE一些基础的东西就将这些。下一篇内容在准备中。

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326118480&siteId=291194637