我们一直非常强调建立以底层为核心的分层自动化测试体系,虽然webui自动化在破页、美感方面不值得投入,但是由于目前大量业务逻辑在web ui,所以合适的web ui测试自动比率也是非常关键的。51Testing软件测试网:i$YS#Iw
K watir设计理念和selenium有很大差异。watir便于测试工程师快速上手,对ie支持非常好;而selenium擅长浏览器兼容性。51Testing软件测试网3BH;\m[|7{*Z
51Testing软件测试网}__8rLh:Ji
参考:51Testing软件测试网E.P| A
Pa&wr
http://code.google.com/p/meimei/wiki/SeleniumUsage51Testing软件测试网&T$Us_8O9P
http://blog.csdn.net/shendl/archive/2009/03/08/3969750.aspx
A2WA)zpIR0http://blog.csdn.net/shendl/archive/2009/03/08/3969750.aspx
A@Gk(JF)\&?0http://www.ibm.com/developerworks/cn/java/j-lo-selenium/51Testing软件测试网6[6T)v,e,}.Wg5jR
http://www.onlymarshall.com/tag/selenium/51Testing软件测试网X|o*R&|0\
扩展http://xace.javaeye.com/blog/57972251Testing软件测试网 U
z9zamlC+jL s
E*~B!eT\a0从http://code.google.com/p/selenium/downloads/list下载selenium-server-standalone-2.0a2.jar,selenium-server-standalone-2.0a2.jar51Testing软件测试网VwDO%k jX'k*z
J-L
51Testing软件测试网cX(|'|r Uv_
Webdriver是对selenium的一个封装,更加友好。Selenium2.0已经把webdriver合并进去。51Testing软件测试网+sF\2N.PyX-c8IUi
执行http://code.google.com/p/selenium/wiki/GettingStarted代码出错。
1`e;V|vD"`L3N01 webdriver错误:51Testing软件测试网
XWn
{/bxGQKc1X y
Exception in thread "main"org.openqa.selenium.WebDriverException: Cannot find firefox binary in PATH. Make sure
firefox is installed.51Testing软件测试网 G3JH"\!R^,Q:E b"X
解决办法:指定firefox执行文件入系统属性。51Testing软件测试网w5A"Xi
Y3ZlOa
System.setProperty("webdriver.firefox.bin","D:/Program Files/Mozilla
Firefox/firefox.exe");51Testing软件测试网a iQV8n c.O4c]
WebDriver driver =newFirefoxDriver();
SWq`Dv.h0 51Testing软件测试网V
?\DX
i.d dRZ0x:mN9]02 解决selenium错误:
7sQ8zGl7g5`0 51Testing软件测试网.]&QJ3e8CF By
下载样例代码http://www.ibm.com/developerworks/cn/java/j-lo-selenium/。
P1u:z E#S4vt0Selenium server需要在java1.5+环境下执行。
6}%@;DP?0启动selenium server
+B`|;c}nj)v0java-jar
selenium-server-standalone-2.0a2.jar。运行java selenium rc有错51Testing软件测试网
q:r9?$]9YQQU;b(@
51Testing软件测试网Qy%[3L!`0RA
java.lang.RuntimeException: Could not
start Selenium session: Failed to start new browser session:
java.lang.RuntimeException: Firefox 3 could not be found in the path!51Testing软件测试网;MxR5~L3e3{
Please add the directory containing
''firefox.exe'' to your PATH environment51Testing软件测试网0~5sM;|7Z R*d
variable, or explicitly specify a
path to Firefox 3 like this:51Testing软件测试网Iu0`X Rr
fZYn
*firefox3c:\blah\firefox.exe51Testing软件测试网^3Y5B5`+Gj%KF9m
|`4r _I'm9{P6{ G0 解决办法:指定firefox执行文件路径。
'r'WQ*WI8Q]0 selenium=newDefaultSelenium("localhost", 4444,"*firefox3 D:/Program Files/Mozilla
Firefox/firefox.exe",
O"Gv c'i_3ww n0 "http://www.baidu.com");51Testing软件测试网E1M{&{|L;Ao-I;?
转自:http://www.51testing.com/?1399751Testing软件测试网,_
Z8?%}R
:[c7Z6T3i0