第10周4月26日;主题:Selenium 2自动化测试

Part I:回顾及提问

===========================

1.自动化测试的优势?

2.阅读以下代码,说出其功能。

       public static void StartFireFoxLoadPlugin(){
 2         System.out.println("start firefox browser...");
 3         System.setProperty("webdriver.firefox.bin", 
 4                 "D:/Program Files/Mozilla Firefox/firefox.exe");
 5         File file = new File("files/firebug-2.0.7-fx.xpi");
 6         FirefoxProfile profile = new FirefoxProfile();
 7         try {
 8             profile.addExtension(file);
 9         } catch (IOException e) {
10             e.printStackTrace();
11         }
12         profile.setPreference("extensions.firebug.currentVersion", "2.0.7");
13         //active firebug extensions
14         profile.setPreference("extensions.firebug.allPagesActivation", "on");    
15         WebDriver driver = new FirefoxDriver(profile);
16         driver.get("http://www.baidu.com");
17         System.out.println("start firefox browser succeed...");    
18     }

 

Part II:目标练习说明

===========================

实验7 Selenium元素定位练习

 

Part III:知识点学习

===========================

第5章 Selenium2自动化测试

学习目标:能够对B/S系统的模块功能进行自动化测试。

5.5 Selenium2中的元素定位

      5.5.1 定位方法汇总

      5.5.2 ID定位

      5.5.3 name定位

      5.5.4 全部链接文字定位

      5.5.5 部分链接文字定位

      5.5.6 标签定位

      5.5.7 Class定位

 

Part IV:完成目标练习

===========================

1.完成目标练习后,将类文件压缩打包,压缩包名为“学号+姓名+实验7”,提交到ftp服务器(ftp://192.168.42.254:22)上自己的文件夹内。

posted @ 2016-04-26 08:51  RunningYY  阅读(149)  评论(0)    收藏  举报