给Selenium做减法51Testing软件测试网4JBETH7cW$]K
---用Java语言调用Selenium API和Junit的教程指导51Testing软件测试网G/P!SHv
51Testing软件测试网G:nT{.h4e2ST.}
引言
6H"g*nsHItq0对于一些人而言,看一些web方面的Selenium-RC的Java代码,没有什么作用,因为他们不知道怎么样去使用它。他们不知道:
Wu-L
L/m0把代码放到哪里51Testing软件测试网OF;^9}_
包是什么东西51Testing软件测试网Ah*V*M
BCD
怎么运行代码51Testing软件测试网$f `+L5]` xlih
怎么样安装IDE
hQ5F0A&z1]%OqY0
G1n ^mKg0因此我现在指导大家,使用简单的步骤、目录热点、用Java语言实现Selenium测试程序的基本知识的支撑。
w|:dD(H7O`0一旦你有了这些基础,我们继续去探索Selenium API命令和自动化HTM页面、窗体以及用JavaScript实现web应用程序的自动化。51Testing软件测试网)x|SL["gPl5Ht
我假设大家以前没有Java、自动化测试方面的知识。
L4y.U3WO_Q$^0本书覆盖Selenium 1.0.3,是Selenium成熟和稳定性版本。Selenium 1.0.3版本很大程度上会保持稳定和不变。比较新的Selenium 2.0它版本依然处于大规模开发中,因此,我们在本书的最后一章节“Selenium的未来”会谈到Selenium 2..0。51Testing软件测试网g6m!U{3I
要明白Selenium 1.0.3不仅仅有使web应用程序自动化的能力。事实上Selenium 2.0支持Selenium 1.0.X的API。所以,你现在在本书学到的东西,在Selenium成熟的时候也可以用。
T/X2i!}sx#GID0我选择使用Java作为编程语言,因为Selenium是用Java语言实现的(因此,如果你了解Java的话,你可以更快的熟悉Selenium)。Java也是成熟的语言,IDEs(集成开发环境)可以很好的支持Java,IDEs可以使初学者编码更为容易。
+Ef&~{h#oeUJQ0 by 南柯一梦51Testing软件测试网9N2Ul;H&v!y9V
译于2012年3月19日夜51Testing软件测试网Yx&sJ5z$hI6a&E6ub
(~8@tq$R0原文
;a:?UOH j0Selenium Simplified
%?;O/y4F'H0A tutorial guide to using the Selenium API in Java with JUnit
$jh5c.vp5fz9L0Alan Richardson51Testing软件测试网o#}W1R.el
PO
r_ ^
WLkY-M'F
k0Introduction51Testing软件测试网uvnq:JSf)]w
For some people, seeing some Java code for Selenium-RC on the web, does not help as they don't
[ r8yPn}f pRYq~D0know how to use it. They don't know:51Testing软件测试网`,sm3Y5a2v
• where to put the code,51Testing软件测试网Q,?8a@&y9R4g
• what a package is,51Testing软件测试网4PgE^8\ qx5~/e
• how to run the code,
d"^-_?_,r0• how to install an IDE
PQ$Bn&\E5?k;F.T0So in this guide I present, in simple steps and supported by screens hots, the fundamental knowledge required to program Selenium tests in Java.
x
Rf1{c-D1U Ji0Once you have the basics, we move on to exploring common Selenium API commands and how to automate HTML pages, Forms and JavaScript. enabled web applications.51Testing软件测试网P*U4D@f2?
I assume no previous knowledge of Java, or Automated Testing.
a.u4Kdga,oI9}0This book covers Selenium 1.0.3 the mature and stable version of Selenium. The Selenium 1.0.3 branch is likely to remain stable and static. The newer version of Selenium – Selenium 2.0 is still undergoing heavy development, so we cover this in the “The Future of Selenium” Chapter towards the end of the book.51Testing软件测试网-H
A~,n q,q.p Qg
Be assured that Selenium 1.0.3 is more than capable of automating your web applications. Indeed Selenium 2.0 supports the API used in Selenium 1.0.x, so everything you learn here, you can use in Selenium 2.0 when it matures.51Testing软件测试网Z.Vj2Hl ~c?*Ep^
[
I have chosen Java as the programming language because it is the language that the Selenium Server is written in (so by understanding Java you can understand Selenium more readily). It is also mature and very well supported by IDEs (Integrated Development Environments) which make coding simple for a beginner.51Testing软件测试网^,y"}rTD*Ww