web自动化测试

1、自动化测试的本质html

  本质:用程序测试程序。一般。在设计了测试用例并经过评审以后,由测试人员根据测试用例中描述的规程一步步执行测试,获得实际结果与指望结果 比较。为了提升测试效率,便引入了自动化测试的概念。web

  web自动化测试用的工具是selenium.ide

  selenium是一套完整的web应用程序测试系统,它包含了测试录制(selenium Ide )、编写及运行(selenium remote control)和测试的并行处理(selenium grid).工具

2、selenium的主要功能包括学习

  一、测试与游览器的兼容性:测试应用程序可否兼容工做在不一样游览器和操做系统之中;测试

  二、测试体统功能:录制用例自动生成测试脚本,用于回归功能测试或者系统用例说明。简而言之,Selenium 就是一款能够录制用户操做,帮助 Web 测试人员简化重复劳动的工具。网站

3、selenium的版本url

  一、selenium-core 是使用html的方式来编写测试脚本spa

  二、selenium-rc是selenium  remote control的缩写,支持多种语言。操作系统

4、xpath的学习

  xpath是在xml文档中查找信息的语言。

5、部分selenium-rc的使用技巧

  使用selenium-rc必须首先要启动selenium服务,在安装目录中的server目录下,运行selenium-server.jar,启动完毕后咱们就能够编写测试类。

  selenium是模仿游览器的行为的,下面的代码做用是初始化一个selenium对象

public class TestPage2 extends TestCase {  
   private Selenium selenium;  
   protected void setUp() throws Exception {  
   String url = “http://xxx.xxx.xxx.xxx/yyy”;  
      selenium = new DefaultSelenium("localhost", SeleniumServer.getDefaultPort(),
      "*iexplore", url);  
      selenium.start();  
      super.setUp();                               
   }  
   protected void tearDown() throws Exception {         
      selenium.stop();  
      super.tearDown();  
   }  
} 

  rul:测试网站的地址

  localhost:能够不是localhost,但必须是selenium server的启动地址

  *iexplore:其余游览器类型,在网站上能够看都支持那些网站类型  

6、selenium-ide使用

  使用selenium-ide,要在火狐游览器中安装selenium的插件,只支持火狐游览器

相关文章
相关标签/搜索