csdn博客:http://blog.csdn.net/qwentest

When to use the global or a local data table?

上一篇 / 下一篇  2010-05-14 11:19:10 / 个人分类:Bug那些事儿

51Testing软件测试网![F5e8K,NL!glK;Ei4Z

When to use the global or a local data table?51Testing软件测试网9N-XAbtk

3i!p W/zb+e8P0It is important to understand in what situations the global or a local data table should be used.
/^2hKzz-{$J0Consider the following two scenarios

)vlt"Y nF051Testing软件测试网sGyc){qI%i

Scenario 1 - Log into the application, book 1 ticket, log out. Repeat the scenario for many users51Testing软件测试网#{r$x [kbE5n0s
Scenario 2 - Log into the application, book 3 tickets, and log out51Testing软件测试网b%UsS!o2Q/k

51Testing软件测试网p0k\:V]

Scenario 1

Dj7X-D6z.}4m051Testing软件测试网 A5L.r;B.pY{9W

The Global data table is better suited for this scenario where we have the user name, password51Testing软件测试网`Q g!{i,e*H
and tickets details as the parameters and we execute the scenario using a single action (which does51Testing软件测试网Q we2| g ]/X.|
everything) or multiple actions (Login, booking and logout).51Testing软件测试网:l$z&fG]g

#ZnU%J Y0`"??V%X;S051Testing软件测试网4z4k w3N a6WR5S%H
Scenario 251Testing软件测试网|j5fb|HP@r

z.~W K GY0R0A Local data table is better suited for this scenario. Here a good approach would be to split the test51Testing软件测试网j,C/kfu0X
into three actions: login, booking and logout. Login and logout can use the username and password51Testing软件测试网/?!Sih'Ei0_Q
parameters from the global data table and booking can use ticket detail parameters from its local data
l'd-S8e3h\0table and the action will be executed for all rows in its local data table.51Testing软件测试网 V7w7|;E5[&c

51Testing软件测试网x;KMm:y4t }C"K rt

什么时候用global数据表,什么时候用local数据表?51Testing软件测试网Ddr,A*\;`

e3eM pZ7v051Testing软件测试网*dI,Mv-A(F
理解什么时候用global数据表什么时候用local数据表是很重要的,我们认真考虑以下两种不同的场景51Testing软件测试网B5H~%S&?

51Testing软件测试网o&X_5V#_.TE#D&f"^

场景1:登录系统,订一张票,退出.不同的用户,多次重复这个场景.

"Oman.lu051Testing软件测试网j$z']6oQ0`c

场景2:登录系统,订3张票,退出.51Testing软件测试网@p6eTV:U?U

_chwZr3k(k0U0场景1:

*^!n*K\IMT1o YT c6E'q0

]T q'zS/l8E7A"WQI0在参数表里面有username,password,tickets的详细信息,并且我们执行这个场景是是单个action或多个actions (Login, booking and logout)时,使用global数据表更加适应于场景1

7V$VgJ1?s6x:R051Testing软件测试网c9}s5o"Z}st/L

我的理解:连贯动作,多用户单操作时适用global

H(qw8B:Y |&i%B1w7l0

zue!c"A ~3p0场景2;51Testing软件测试网 t~[L(@3X%v

51Testing软件测试网 izer\)I0ST

local数据表更加适合于这种场景. 测试action被划分为三个步骤,即login,booking and logout.login和logout可以使用global表中的参数,booking可以使用local表中详细的tickets数据,并且期望booking这个action可以执行local中所有的数据

7f4rBGk/j0

~9pT_MR aCgf0我的理解:单用户,多操作时适用local,重复执行主操作.与loadrunner中,init(),Action(),end()类似

9ZhR)sr Y D"Y0D051Testing软件测试网Jj1Y:{8E {,`t ug

摘自:<<QuickTest Professional Unplugged>>--By Tarun Lalwani51Testing软件测试网`)|%\vrS#ghpO7Y

"[7ZA cn5F8V6e02010-05-14 qwen

cY*i3K3P^np0

TAG:

 

评分:0

我来说两句

Open Toolbar