|
I$z-Ii Ud-I01、目的:掌握Ajax TruClient Mobile协议开发及优化脚本。51Testing软件测试网+c0@6Se#\}
51Testing软件测试网%T2B
L8|+c@2、测试工具:lr11.5+firefox51Testing软件测试网!x2Q Pv8[6}
51Testing软件测试网r0o1j4EQw-{3、实例场景:使用Ajax TruClient Mobile协议来模拟SamsungGT-I9000手机访问phpwind论坛发帖的脚本。
IC+d]D8j0%fc!pf7AHEw6V0录制设置:
7[m)a`:l:sH'X'Y051Testing软件测试网;z&k#B.u EXr8U4[ r!G51Testing软件测试网"j4Wqe*oPrxo
Np5NqV0脚本:这个脚本是只读状态,想要edit,update只能在录制页面操作51Testing软件测试网3PWb*ZX
3Xy@2n&p3U.D
Z&c0Script_View_Action()51Testing软件测试网M^Pm-pC5e7Y3z
{
ys;Re;z3A0 truclient_step("Navigate to 'http://localhost/phpwind/index.php'", "snapshot=Action_1.inf");
p4C|5h\S [0 truclient_step("登录", "snapshot=Action_3.inf");51Testing软件测试网6h1Ik|1Px
{51Testing软件测试网6B `
p
M@c2K+BJ
truclient_step("Type 'admin' in 用户名 textbox", "snapshot=Action_3.2.inf");51Testing软件测试网\L+j)HfC.m,W
truclient_step("Type ******* in 密 码 passwordbox", "snapshot=Action_3.4.inf");51Testing软件测试网!h1|D G5^f9m+N[
truclient_step("Click on 登录 button", "snapshot=Action_3.5.inf");51Testing软件测试网+Pu%q;a_E)PDD
truclient_step("Verify 管理员 's 'Visible Text' contains '管理员'", "snapshot=Action_3.6.inf");
6hS_,G0a-rE
Wt8~0 }
OV'J|mffJ0 truclient_step("Click on Zoom测试 link", "snapshot=Action_4.inf");51Testing软件测试网Ok~&Oh}%QQ:w
truclient_step("For ( var i = 0 ; i < 2 ; i++ )", "snapshot=Action_5.inf");
_\omd;[ V0 {51Testing软件测试网*B%U(^wL'@-M`
truclient_step("Click on 发帖 link", "snapshot=Action_5.1.inf");51Testing软件测试网8K
_8T#sNW#?B5W
truclient_step("Evaluate JavaScript. code typestring=LR.getParam('myparam')", "snapshot=Action_5.2.inf");
WF'B Q-M)vHX0 truclient_step("Type 'Test_Title'+typestring in 请输入标题 textbox", "snapshot=Action_5.3.inf");51Testing软件测试网yxIT
F_] ^
truclient_step("Click on textbox (1) textbox", "snapshot=Action_5.4.inf");51Testing软件测试网@ G"~8Z7q8NlN^*w
truclient_step("Type '测试还没有开始,正在安装服务器' in textbox (1) textbox", "snapshot=Action_5.5.inf");51Testing软件测试网Ih7p3QQ1X(V{
truclient_step("Click on 发 布 button", "snapshot=Action_5.6.inf");
9i
fq%Yf*r0 truclient_step("Type '顶贴,抢沙发' in 进入高级模式 文字颜色 textbox", "snapshot=Action_5.7.inf");
m:u.u/S"e hE1b"v0 truclient_step("Click on Ctrl+Enter快速发布 button", "snapshot=Action_5.8.inf");51Testing软件测试网)f3s:V
T Q-@Nu m5^
truclient_step("Click on 返回列表 link", "snapshot=Action_5.9.inf");51Testing软件测试网x4?9o7bP*p.w
}51Testing软件测试网-d
Dz1ZKz/i
truclient_step("Click on 退出 link", "snapshot=Action_14.inf");
9mT|L1N G!O0}
1t6y4?G(V1d@0MZA3T@Vne9P0录制页面:
3K"`/@S]5L)l051Testing软件测试网6sM7n3f?y \51Testing软件测试网jQX-R[
51Testing软件测试网,T.b,_rbs)\这个页面才真正的脚本开发环境,用这个页面我就想起了QTP了,跟QTP模式一样,可以定位和替换组件对象,下面来说Toolbox组件的作用:51Testing软件测试网on7N%q9N]Ki5r
_
51Testing软件测试网O'AtF lUK:_ n
4`&^"u*GR
@,p)G_02j Z8\xY/\E0Function:进行检查点,thinktime,Action等。51Testing软件测试网J8v|2xn!Bv
51Testing软件测试网dR
~ r-z1f_+h7YFlowControl:流程控制,if ,Loop,Break,CatchError,Exit;51Testing软件测试网gZ*zs-PD,BaT
D4K,j,M\xC0Miscellaneous:51Testing软件测试网A+P0M8o+I${`&i8\
51Testing软件测试网9C2\;R6S3xNx]Evaluate JavaScript. code:进行参数化编写参数51Testing软件测试网F7} WH-V+W!dv@Q
"\fVI3I0Evaluate JavaScript:捕获对象51Testing软件测试网z;R
L2R)_bh2o
_*I'V1td0r0Evaluate C Function:一般是调用C函数获取值;51Testing软件测试网 wx~
n4C"b,eu @
51Testing软件测试网 Jrh([
x'L%UComment:注释51Testing软件测试网
lj/[.NE