51Testing软件测试网![F5e8K,NL!glK;Ei4ZWhen to use the global or a local data table?51Testing软件测试网9N-XAbtk
3i!pW/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"YnF051Testing软件测试网sGyc){qI%iScenario 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{9WThe 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软件测试网Qwe2|g
]/X.|
everything) or multiple actions (Login, booking and logout).51Testing软件测试网:l$z&fG]g
#ZnU%JY0`"??V%X;S051Testing软件测试网4z4k w3N a6WR5S%H
Scenario 251Testing软件测试网|j5fb|HP@r
z.~W KGY0R0A Local data table is better suited for this scenario. Here a good approach would be to split the test51Testing软件测试网j,C/kf u0X
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']6o Q0`c场景2:登录系统,订3张票,退出.51Testing软件测试网@p6eTV:U?U