`
kootest
  • 浏览: 8986 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

WebDriver 运行模式下使用rc 代码

阅读更多
selenium2 对之前的rc 代码提供了兼容性接口,如果你之前的code 都是用rc 写,而现在又想摆脱要每次启动server,你只需要 略做修改即可。代码如下:

public class TestWb extends SeleneseTestCase {
@Before
public void setUp() throws Exception {
WebDriver driver = new FirefoxDriver();
String baseUrl = "http://www.baidu.com/";
selenium = new WebDriverBackedSelenium(driver, baseUrl);
}
@Test
public void testWb() throws Exception {
selenium.open(baseUrl);
selenium.type("id=kw", "hello");
selenium.click("id=su");
selenium.waitForPageToLoad("30000");
}
@After
public void tearDown() throws Exception {
selenium.stop();
}
 


更多资料关注:www.kootest.com ;技术交流群:182526995
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics