際際滷

際際滷Share a Scribd company logo
Automation
Testing
Hong Hi畛n KTCG - HCT
N畛i dung
1. Automation Testing v 畛ng d畛ng BDD (behavior
driven developmetn) trong automation
WebApp Automation
 C担ng c畛 畛 Automation test
cho WebApp
 C叩ch nh畉n di畛n v i畛u khi畛n
畛i t動畛ng tr棚n webApp
 C叩ch ki畛m tra k畉t qu畉 mong
畛i khi automation cho
webApp
Desktop Automation
 C担ng c畛 畛 Automation test
cho Desktop
 C叩ch nh畉n di畛n v i畛u khi畛n
畛i t動畛ng tr棚n Desktop
 C叩ch ki畛m tra k畉t qu畉 mong
畛i khi automation cho
Desktop
1.
Automation Testing
T畛ng quan v畛 Automation test v 畛ng d畛ng BDD
vo thi畉t k畉 test case Automation
N畛i dung
1. Automation testing and its benefits
2. When to do Automation Testing
3. BDD (Behavior driven development) in Automation
testing
1. Automation testing and its benefits
Manual Testing Automation Testing
A process that makes use of automation testing tools to excute
prescripted tests on aplications, then compares the test results
to the expected behavior and reports it to the tester
1. Save time and money
 They can be repeated again and again
 They can execute overnigh
2. Reusale: Automation testing toool allow to reuse the
scripts on different versions of the application
3. Increase test coverage
1. Automation testing and its benefits
2. When to do Automation Testing
1. Need to run the test cases a lot number of times
2. The number test cases is high, and these will be run
more than once
3. The test case wont be frequently updated
3. Behavior driven development
3.1. Kh叩i ni畛m BDD, l畛i 鱈ch khi s畛 d畛ng BDD
3.2. Ci 畉t, kh畛i t畉o project BDD
3.3. Vi畉t n畛i dung test case b畉ng BDD
Behavior driven development
Quy tr狸nh ph叩t tri畛n ph畉n m畛m theo 坦 K畛ch b畉n test 動畛c vi畉t tr動畛c d動畛i d畉ng
feature file b畉ng ng担n ng畛 t畛 nhi棚n
3.1. Kh叩i ni畛m BDD, l畛i 鱈ch khi s畛 d畛ng BDD
 Ti li畛u 動畛c vi畉t d動畛i d畉ng ng担n ng畛 t畛 nhi棚n, b畉t k畛
畛i t動畛ng no c滴ng c坦 th畛 hi畛u 動畛c.
 N但ng cao ch畉t l動畛ng ph畉n m畛m, t畉o ra s畉n ph畉m h畛u
鱈ch: V狸 ph叩t tri畛n ph畉n m畛m theo h動畛ng hnh vi n棚n
c坦 th畛 focus vo vi畛c t畉o ra s畉n ph畉m 炭ng v畛i y棚u c畉u
c畛a kh叩ch hng.
3.1. Kh叩i ni畛m BDD, l畛i 鱈ch khi s畛 d畛ng BDD
 Ci 畉t specflow 畛 vi畉t test case d畉ng BDD (B畛 ci:
hthienSETUPAuto)
 T畉o Project Test
 Add c叩c reference c畉n thi畉t (hthienSETUPAutoLib)
 TechTalk.SpecFlow.dll
 Setting config 畛 畉m b畉o n畛i dung file .cs t畛 sinh khi vi畉t
testcase
3.2. Ci 畉t, kh畛i t畉o project BDD
Auto
Auto
Auto
Auto
1. T畉o file test case
2. C叩c vi畉t n畛i dung test case
3. M担 t畉 c叩c thao t叩c c畛a t畛ng b動畛c trong test case
M畛t s畛 l動u 箪:
-M畛i m畛t file Feature n棚n g畉n v畛i 1 t鱈nh nng c畉n ki畛m tra
-N棚n chia nh畛 c叩c test case 畛 畉m b畉o c叩c case ch畉y 畛c l畉p nhau
-Kh担ng n棚n s畛 d畛ng k畉t qu畉 c畛a test case tr動畛c 畛 lm 畉u vo
cho test case sau
3.3. Vi畉t test case s畛 d畛ng BDD
M畛t s畛 l動u 箪: M畛i file test case l 1 t鱈nh nng c畉n ki畛m tra (trong 坦 s畉
ch畛a c叩c test case c畉n ki畛m tra c畛a t鱈nh nng 坦)  T動董ng 動董ng nh動
m畛t test suite
T畉o file Test case
Vi畉t n畛i dung Test case
Feature d湛ng 畛 m担 t畉 c叩i t鱈nh nng ch炭ng ta s畉 test
Scenario [m担 t畉 t坦m t畉t n畛i dung k畛ch b畉n test c畛a feature]
Given: M担 t畉 tr畉ng th叩i ban 畉u c畛a h畛 th畛ng
When: M担 t畉 c叩c b動畛c hay c叩c hnh vi th畛c hi畛n tr棚n h畛 th畛ng
Then: M担 t畉 b動畛c ki畛m tra
Background: B動畛c th畛c hi畛n tr動畛c khi ch畉y qua c叩c scenario
D畛 li畛u: D畛 li畛u s畛 d畛ng trong test case  c坦 th畛 l gi叩 tr畛 c畛 th畛 ho畉c l畉y t畛
Excel
M畛i scenario g畛m nhi畛u steps. C叩c steps 動畛c b畉t 畉u b畉ng Given, When,
Then. D湛ng # 畛 comment
Auto
M担 t畉 c叩c thao t叩c c畛a t畛ng b動畛c th畛c hi畛n
C叩c b動畛c ch動a c坦 n畛i dung m担 t畉
Generate n畉u ch動a c坦 file m担 t畉
Copy methods to clipboard v paste vo file Step trong tr動畛ng h畛p 達 c坦 file
m担 t畉 c叩c b動畛c
M担 t畉 c叩c thao t叩c c畛a t畛ng b動畛c th畛c hi畛n
M担 t畉 c叩c thao t叩c c畛a t畛ng b動畛c th畛c hi畛n
Ch畛nh s畛a c叩c b動畛c 達 c坦 n畛i dung
2.
WebApp Automation Testing
How to make script automation test for WebApp
N畛i dung
1. T畛ng quan v畛 Selenium
2. Nh畉n di畛n v i畛u khi畛n 畛i t動畛ng thao t叩c tr棚n
WebApp
3. Ki畛m tra k畉t qu畉 mong 畛i tr棚n WebApp
4. M畛t s畛 hm chung s畛 d畛ng trong Automation
WebApp Test cho c叩c s畉n ph畉m c畛a HCT
1. T畛ng quan v畛 Selenium
1. Selenium l: c担ng c畛 m達 ngu畛n m畛 gi炭p ki畛m th畛 t畛
畛ng c叩c 畛ng d畛ng web d畛a tr棚n vi畛c t叩i th畛c hi畛n c叩c
th叩c c畛a ng動畛i d湛ng v so s叩nh k畉t qu畉 theo k畛ch b畉n
動畛c 畛nh ngh挑a
2. Lm th畉 no 畛 畛ng d畛ng Selenium vo ho畉t 畛ng ki畛m
th畛?
 Add reference 畛 th畛c thi test Selenium (WebDriver.dll,
WebDriver.Support.dll)
 Add Driver vo project
 Add th棚m m畛t s畛 c叩c hm d湛ng chung 畛 h畛 tr畛 c担ng t叩c
3.
Desktop Automation Testing
How to make script automation test for Desktop Program
N畛i dung
1. Ci 畉t v thi畉t l畉p c担ng c畛 auto testing cho s畉n ph畉m
Desktop
2. Nh畉n di畛n v i畛u khi畛n 坦i t動畛ng thao t叩c tr棚n ph畉n
m畛m Desktop
3. Ki畛m tra k畉t qu畉 mong 畛i tr棚n ph畉n m畛m Desktop
Auto

More Related Content

Auto

  • 2. N畛i dung 1. Automation Testing v 畛ng d畛ng BDD (behavior driven developmetn) trong automation WebApp Automation C担ng c畛 畛 Automation test cho WebApp C叩ch nh畉n di畛n v i畛u khi畛n 畛i t動畛ng tr棚n webApp C叩ch ki畛m tra k畉t qu畉 mong 畛i khi automation cho webApp Desktop Automation C担ng c畛 畛 Automation test cho Desktop C叩ch nh畉n di畛n v i畛u khi畛n 畛i t動畛ng tr棚n Desktop C叩ch ki畛m tra k畉t qu畉 mong 畛i khi automation cho Desktop
  • 3. 1. Automation Testing T畛ng quan v畛 Automation test v 畛ng d畛ng BDD vo thi畉t k畉 test case Automation
  • 4. N畛i dung 1. Automation testing and its benefits 2. When to do Automation Testing 3. BDD (Behavior driven development) in Automation testing
  • 5. 1. Automation testing and its benefits Manual Testing Automation Testing A process that makes use of automation testing tools to excute prescripted tests on aplications, then compares the test results to the expected behavior and reports it to the tester
  • 6. 1. Save time and money They can be repeated again and again They can execute overnigh 2. Reusale: Automation testing toool allow to reuse the scripts on different versions of the application 3. Increase test coverage 1. Automation testing and its benefits
  • 7. 2. When to do Automation Testing 1. Need to run the test cases a lot number of times 2. The number test cases is high, and these will be run more than once 3. The test case wont be frequently updated
  • 8. 3. Behavior driven development 3.1. Kh叩i ni畛m BDD, l畛i 鱈ch khi s畛 d畛ng BDD 3.2. Ci 畉t, kh畛i t畉o project BDD 3.3. Vi畉t n畛i dung test case b畉ng BDD
  • 9. Behavior driven development Quy tr狸nh ph叩t tri畛n ph畉n m畛m theo 坦 K畛ch b畉n test 動畛c vi畉t tr動畛c d動畛i d畉ng feature file b畉ng ng担n ng畛 t畛 nhi棚n 3.1. Kh叩i ni畛m BDD, l畛i 鱈ch khi s畛 d畛ng BDD
  • 10. Ti li畛u 動畛c vi畉t d動畛i d畉ng ng担n ng畛 t畛 nhi棚n, b畉t k畛 畛i t動畛ng no c滴ng c坦 th畛 hi畛u 動畛c. N但ng cao ch畉t l動畛ng ph畉n m畛m, t畉o ra s畉n ph畉m h畛u 鱈ch: V狸 ph叩t tri畛n ph畉n m畛m theo h動畛ng hnh vi n棚n c坦 th畛 focus vo vi畛c t畉o ra s畉n ph畉m 炭ng v畛i y棚u c畉u c畛a kh叩ch hng. 3.1. Kh叩i ni畛m BDD, l畛i 鱈ch khi s畛 d畛ng BDD
  • 11. Ci 畉t specflow 畛 vi畉t test case d畉ng BDD (B畛 ci: hthienSETUPAuto) T畉o Project Test Add c叩c reference c畉n thi畉t (hthienSETUPAutoLib) TechTalk.SpecFlow.dll Setting config 畛 畉m b畉o n畛i dung file .cs t畛 sinh khi vi畉t testcase 3.2. Ci 畉t, kh畛i t畉o project BDD
  • 16. 1. T畉o file test case 2. C叩c vi畉t n畛i dung test case 3. M担 t畉 c叩c thao t叩c c畛a t畛ng b動畛c trong test case M畛t s畛 l動u 箪: -M畛i m畛t file Feature n棚n g畉n v畛i 1 t鱈nh nng c畉n ki畛m tra -N棚n chia nh畛 c叩c test case 畛 畉m b畉o c叩c case ch畉y 畛c l畉p nhau -Kh担ng n棚n s畛 d畛ng k畉t qu畉 c畛a test case tr動畛c 畛 lm 畉u vo cho test case sau 3.3. Vi畉t test case s畛 d畛ng BDD
  • 17. M畛t s畛 l動u 箪: M畛i file test case l 1 t鱈nh nng c畉n ki畛m tra (trong 坦 s畉 ch畛a c叩c test case c畉n ki畛m tra c畛a t鱈nh nng 坦) T動董ng 動董ng nh動 m畛t test suite T畉o file Test case
  • 18. Vi畉t n畛i dung Test case Feature d湛ng 畛 m担 t畉 c叩i t鱈nh nng ch炭ng ta s畉 test Scenario [m担 t畉 t坦m t畉t n畛i dung k畛ch b畉n test c畛a feature] Given: M担 t畉 tr畉ng th叩i ban 畉u c畛a h畛 th畛ng When: M担 t畉 c叩c b動畛c hay c叩c hnh vi th畛c hi畛n tr棚n h畛 th畛ng Then: M担 t畉 b動畛c ki畛m tra Background: B動畛c th畛c hi畛n tr動畛c khi ch畉y qua c叩c scenario D畛 li畛u: D畛 li畛u s畛 d畛ng trong test case c坦 th畛 l gi叩 tr畛 c畛 th畛 ho畉c l畉y t畛 Excel M畛i scenario g畛m nhi畛u steps. C叩c steps 動畛c b畉t 畉u b畉ng Given, When, Then. D湛ng # 畛 comment
  • 20. M担 t畉 c叩c thao t叩c c畛a t畛ng b動畛c th畛c hi畛n C叩c b動畛c ch動a c坦 n畛i dung m担 t畉
  • 21. Generate n畉u ch動a c坦 file m担 t畉 Copy methods to clipboard v paste vo file Step trong tr動畛ng h畛p 達 c坦 file m担 t畉 c叩c b動畛c M担 t畉 c叩c thao t叩c c畛a t畛ng b動畛c th畛c hi畛n
  • 22. M担 t畉 c叩c thao t叩c c畛a t畛ng b動畛c th畛c hi畛n Ch畛nh s畛a c叩c b動畛c 達 c坦 n畛i dung
  • 23. 2. WebApp Automation Testing How to make script automation test for WebApp
  • 24. N畛i dung 1. T畛ng quan v畛 Selenium 2. Nh畉n di畛n v i畛u khi畛n 畛i t動畛ng thao t叩c tr棚n WebApp 3. Ki畛m tra k畉t qu畉 mong 畛i tr棚n WebApp 4. M畛t s畛 hm chung s畛 d畛ng trong Automation WebApp Test cho c叩c s畉n ph畉m c畛a HCT
  • 25. 1. T畛ng quan v畛 Selenium 1. Selenium l: c担ng c畛 m達 ngu畛n m畛 gi炭p ki畛m th畛 t畛 畛ng c叩c 畛ng d畛ng web d畛a tr棚n vi畛c t叩i th畛c hi畛n c叩c th叩c c畛a ng動畛i d湛ng v so s叩nh k畉t qu畉 theo k畛ch b畉n 動畛c 畛nh ngh挑a 2. Lm th畉 no 畛 畛ng d畛ng Selenium vo ho畉t 畛ng ki畛m th畛? Add reference 畛 th畛c thi test Selenium (WebDriver.dll, WebDriver.Support.dll) Add Driver vo project Add th棚m m畛t s畛 c叩c hm d湛ng chung 畛 h畛 tr畛 c担ng t叩c
  • 26. 3. Desktop Automation Testing How to make script automation test for Desktop Program
  • 27. N畛i dung 1. Ci 畉t v thi畉t l畉p c担ng c畛 auto testing cho s畉n ph畉m Desktop 2. Nh畉n di畛n v i畛u khi畛n 坦i t動畛ng thao t叩c tr棚n ph畉n m畛m Desktop 3. Ki畛m tra k畉t qu畉 mong 畛i tr棚n ph畉n m畛m Desktop

Editor's Notes

  1. <configSections> <section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow" /> </configSections> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> </startup> <specFlow> <unitTestProvider name="mstest" /> <!-- For additional details on SpecFlow configuration options see http://go.specflow.org/doc-config --> </specFlow>