摘要: 1、什么情况下选用WebDriver?(1)Selenium-1.0不支持的浏览器功能。(2)multiple frames, multiple browser windows, popups, and alerts.(3)页面导航。(4)下拉。(5)基于AJAX的UI元素。2、WebDriver的几个实现:Name of driver Available on which OS? Class to instantiateHtmlUnit Driver All org.openqa.selenium.htmlunit.HtmlUnitDriverFirefox ... 阅读全文
posted @ 2011-12-28 09:11 布瓜 阅读(856) 评论(0) 推荐(0) 编辑
摘要: 本帖最后由 connect 于 2011-11-21 14:18 编辑selenium1.0中有fireevent来模拟js中得一些事件.在selenium2.0中有moveToElement()这个方法.这个方法在firfox中很常用。最好自己封装成一个方法。现在项目当中常常会碰到一些问题.在当前屏幕中能看到的element,使用click,sendKeys好使。如果当前屏幕看不到,则报点不到的异常.解决办法:public void MoveToElementAndClick(IWebElement webElement){ Actions t = new Actions(_dri... 阅读全文
posted @ 2011-12-28 09:04 布瓜 阅读(441) 评论(0) 推荐(0) 编辑
摘要: public void startFirfoxAndConfirmProfile() { FirefoxProfile f = new FirefoxProfile(); f.AddExtension(@"your xpi path"); IWebDriver d = new FirefoxDriver(f); } 阅读全文
posted @ 2011-12-28 09:04 布瓜 阅读(212) 评论(0) 推荐(0) 编辑
摘要: FirefoxProfile f = new FirefoxProfile(); f.AddExtension(@"your xpi path"); f.SetPreference("network.proxy.type",1); f.SetPreference("network.proxy.http", "proxy_url"); f.SetPreference("network.proxy.http_port", 3128); f.SetPreference("network.pr 阅读全文
posted @ 2011-12-28 09:02 布瓜 阅读(924) 评论(0) 推荐(0) 编辑