qileilove

blog已经转移至github,大家请访问 http://qaseven.github.io/

Selenium RC 环境搭建(eclipse)

 关于Selenium RC的原理,还是Selenium私房菜系列6比较详细。 虽然我只看懂了组成。
  按照上面的步骤,搭建后的工程:
  一个简单的Case,不完整,纯粹为了测试环境是否搭成功。
package com.dhy.selenium.test;
import java.net.URL;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
public class Case1 {
public static void main(String[] args) throws Exception{
//        WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"),
//                DesiredCapabilities.firefox());
WebDriver driver = new FirefoxDriver();
driver.get("http://2j.isurveylink.com/s/183/?test_mode=1");
WebElement element = driver.findElement(By.id("start_btn"));
element.click();
try {
Thread.sleep(3000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("Page title is : " + driver.getTitle());
driver.quit();
}
}
  这里的语法啊、类啊什么的,需要慢慢研究。

posted on 2014-10-30 11:05 顺其自然EVO 阅读(311) 评论(0)  编辑  收藏 所属分类: 测试学习专栏selenium and watir webdrivers 自动化测试学习


只有注册用户登录后才能发表评论。


网站导航:
 
<2014年10月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

导航

统计

常用链接

留言簿(55)

随笔分类

随笔档案

文章分类

文章档案

搜索

最新评论

阅读排行榜

评论排行榜