selenium安装及使用

一、selenium IDE

1、若Selenium IDE 工具中options下Format没有脚本转换,在option中有个选项叫:Enable experimental features。勾选下确定就OK; 

2、JUnit Format in WebDriver vs WebDriver Backed

You use "JUnit WebDriver" if you are using the Selenium 2/WebDriver API. You use "JUnit WebDriver Backed" if you are using the Selenium 1/RC API.

If you switch back and forth you can see the difference in the test method displayed in the IDE window.

More info on the Selenium website here.

3、脚本录制完就可以导出来了,在 Selenium IDE 的菜单栏上点击 File-> Export Test Case As..-> Java/ Junit4/WebDriver, 输入文件名并保存,注意后缀为 .java。到此就得到了 Case 执行过程中的 Java 脚本,接下来需要做的就是将其导入 Eclipse 修改和添加相关步骤。

4、修改脚本,实现多语言环境下截图

在 Eclipse 中新建一个 Java Project, 并将 Selenium-server-standalone-2.2.X.jar 包加入引用类库

posted @ 2014-07-25 08:22  锦华风才  阅读(272)  评论(0编辑  收藏  举报