More Related Content Similar to Keywords-driven testing vs Scripted automation (20) Keywords-driven testing vs Scripted automation1. © 2021 Maveryx srl.
All rights reserved.
Keywords-driven testing
VS
test automation Scripts
Alfonso Nocella
2. © 2021 Maveryx srl.
All rights reserved.
Summary
• Benefits of test automation;
• A test Script Example;
• A Keywords-driven test Example;
• Scripts VS Codeless;
• A mixed approach.
3. © 2021 Maveryx srl.
All rights reserved.
Saving Time: less time to execute tests and improved
communication with other departments
Reducing Costs: fewer resources are spent on testing
Improving Functional Coverage: using saved time to
improve test coverage
Faster Time to Market
Benefits (1)
4. © 2021 Maveryx srl.
All rights reserved.
Reusability of Test Suite: once you have defined your
suite, it’s very straightforward to reuse tests
Improved Accuracy: automated tests produce the same
result every time
Faster Feedback Cycle: without automation, feedback
for newly developed features can take a while
Less Stress on QA Team
Benefits (2)
5. © 2021 Maveryx srl.
All rights reserved.
Create and run a test script
1. Create a new Maveryx Test Project
2. Write the test case
3. Run the test
6. © 2021 Maveryx srl.
All rights reserved.
1. Select File → New → Maveryx Test Project
In the Maveryx Test Project window
1. enter the Project name (e.g.
"PasswordDemoTest")
2. in the JRE section make sure that
Java/JRE 8 or higher is selected
2. Click Finish
Create New Test Project
7. © 2021 Maveryx srl.
All rights reserved.
1. Select File → New → Maveryx Test
Class
In the Maveryx Test Class window
1. enter a name for the Package (e.g.
"com.maveryx.demo")
2. enter a Name for the test class /
script (e.g. “PasswordDemoTest”)
2. Click Finish
Create New Test Script
8. © 2021 Maveryx srl.
All rights reserved.
Set the full path (pathName) to
the AUT launch file.
e.g. private final String pathName =
"C:/Maveryx/demo/AUT/PasswordDemo.xml";
The static method
startApplication(pathName)
in class Bootstrap launches the AUT
The static method stop() in class
Bootstrap closes the AUT.
Test Script "stub"
9. © 2021 Maveryx srl.
All rights reserved.
1. Create a new Maveryx Test Project
2. Write the test case
3. Run the test
Create and run a test script
10. © 2021 Maveryx srl.
All rights reserved.
Test Case #001
1. Launch the application-
under-test
2. Check that the password text
field is editable
3. Enter a valid password
4. Check that the "OK" button is
enabled
5. Press the "OK" button to
confirm the password
6. Check that a successful
authentication message is
returned
7. Close the application-under-
test
Test Case #002
1. Launch the application-
under-test
2. Check that the password text
field is editable
3. Enter a invalid password
4. Check that the "OK" button is
enabled
5. Press the "OK" button to
confirm the password
6. Check that an authentication
error message is returned
7. Close the application-under-
test
The Test Cases
11. © 2021 Maveryx srl.
All rights reserved.
Test Case #001
1. Launch the application-under-test
2. Check that the password text field is editable
3. Enter a valid password
4. Check that the "OK" button is enabled
5. Press the "OK" button to confirm the password
6. Check that a successful authentication
message is returned
7. Close the application-under-test
Launch the Application
12. © 2021 Maveryx srl.
All rights reserved.
Test Case #001
1. Launch the application-under-test
2. Check that the password text field is
editable
3. Enter a valid password
4. Check that the "OK" button is enabled
5. Press the "OK" button to confirm the
password
6. Check that a successful authentication
message is returned
7. Close the application-under-test
Working with Text Fields
13. © 2021 Maveryx srl.
All rights reserved.
1. Create a new GuiPasswordText
object specifying the label
2. Verification Point : check that the
password text field is editable
3. Enter the password
Working with Text Fields
14. © 2021 Maveryx srl.
All rights reserved.
Test Case #001
1. Launch the application-under-test
2. Check that the password text field is
editable
3. Enter a valid password
4. Check that the "OK" button is enabled
5. Press the "OK" button to confirm the
password
6. Check that a successful authentication
message is returned
7. Close the application-under-test
Working with Buttons
15. © 2021 Maveryx srl.
All rights reserved.
Test Case #001
1. Launch the application-under-test
2. Check that the password text field is
editable
3. Enter a valid password
4. Check that the "OK" button is enabled
5. Press the "OK" button to confirm the
password
6. Check that a successful authentication
message is returned
7. Close the application-under-test
Working with Dialogs
16. © 2021 Maveryx srl.
All rights reserved.
Test Case #001
1. Launch the application-under-test
2. Check that the password text field is
editable
3. Enter a valid password
4. Check that the "OK" button is enabled
5. Press the "OK" button to confirm the
password
6. Check that a successful authentication
message is returned
7. Close the application-under-test
Working with Frames
19. © 2021 Maveryx srl.
All rights reserved.
1. Create a new Maveryx Test Project
2. Write the test case
3. Run the test
Create and run a test script
20. © 2021 Maveryx srl.
All rights reserved.
1. Select File → Run As → JUnit Test
Run the Test Script
21. © 2021 Maveryx srl.
All rights reserved.
1. Create a new Maveryx Test Project
2. Write the test case
3. Run the test
Create and run a keyword-driven test
22. © 2021 Maveryx srl.
All rights reserved.
Just lauch Excel
…or create a csv or xml file…
23. © 2021 Maveryx srl.
All rights reserved.
Create and run a keyword-driven test
1. Create a new Maveryx Test Project
2. Write the test case
3. Run the test
25. © 2021 Maveryx srl.
All rights reserved.
Test Case : TC_01
1. Start the Application
2. Enter valid username
3. Enter valid Password
4. Click “Login” button
5. Check the results: Hi "username”
6. Click “OK" button
7. Close the Application
Test Case #001
26. © 2021 Maveryx srl.
All rights reserved.
7. Close the AUT
6. Click “OK" button
5. Check the results
4. Click "Login" button
3. Enter Password
2. Enter username
1. Start the AUT
Close
Has_Text
Click
Set_Text
Start
Keywords
Test Case
Identify Keywords
27. © 2021 Maveryx srl.
All rights reserved.
Test Case : TC_01
1. Start the Application
2. Enter valid username
3. Enter valid Password
4. Click “Login” button
5. Check the results: “Hi
alfonso”
6. Click “OK" button
7. Close the Application
Keyword Data / Input Description
START AUT lauch file path Launch the AUT
Design Test step 1
28. © 2021 Maveryx srl.
All rights reserved.
Test Case : TC_01
1. Start the Application
2. Enter valid username
3. Enter valid Password
4. Click “Login” button
5. Check the results: “Hi
alfonso”
6. Click “OK" button
7. Close the Application
Keyword Data /
Input
Description
SET_TEXT Text Set the text into a text field
Design Test step 2 & 3
29. © 2021 Maveryx srl.
All rights reserved.
Test Case : TC_01
1. Start the Application
2. Enter valid username
3. Enter valid Password
4. Click “Login” button
5. Check the results: “Hi
alfonso”
6. Click “OK" button
7. Close the Application
Keyword Data /
Input
Description
CLICK Click the button
Design Test step 4
30. © 2021 Maveryx srl.
All rights reserved.
Test Case : TC_01
1. Start the Application
2. Enter valid username
3. Enter valid Password
4. Click “Login” button
5. Check the results: “Hi
alfonso”
6. Click “OK" button
7. Close the Application Keyword Data /
Input
Description
HAS_TEXT Text Check whether the given
LABEL has the actual Text
Design Test step 5
31. © 2021 Maveryx srl.
All rights reserved.
Test Case : TC_01
1. Start the Application
2. Enter valid username
3. Enter valid Password
4. Click “Login” button
5. Check the results:
“logged in”
6. Click “OK" button
7. Close the Application
Keyword Data /
Input
Description
CLICK Click the button
Design Test step 6
32. © 2021 Maveryx srl.
All rights reserved.
Test Case : TC_01
1. Start the Application
2. Enter valid username
3. Enter valid Password
4. Click “Login” button
5. Check the results:
“logged in”
6. Click “OK" button
7. Close the Application
Keyword Data / Input Description
CLOSE Close the AUT
Design Test step 7
33. © 2021 Maveryx srl.
All rights reserved.
Create and run a keyword-driven test
1. Create a new Maveryx Test Project
2. Write the test case
3. Run the test
34. © 2021 Maveryx srl.
All rights reserved.
a. Create a new object
KeywordDrivenTestManager
b. Call the method run()
specifying the path of the
Excel file
Create the Driver Script
35. © 2021 Maveryx srl.
All rights reserved.
1. Click on the test class or package you
want to run
2. Select File → Run As → JUnit Test
Run a Test Script
36. © 2021 Maveryx srl.
All rights reserved.
Alternatively
By command line KeywordDrivenTestingCLI with the following arguments:
For example:
KeywordDrivenTestingCLI –o "C:Report" "C:Testtest001.xls"
The test script C:Testtest001.xls is executed and the test report is stored
in C:Report
Or:
KeywordDrivenTestingCLI –o "C:Report" –e
"C:Testtest001.xls " "C:Test"
All test scripts in C:Test (including subfolders) are executed except
C:Testtest001.xls and the test report is stored in C:Report
37. © 2021 Maveryx srl.
All rights reserved.
• Taking advantage of the coding skills;
• Using constructs, statements, etc…
• Using the OOP features (e.g. inheritance,
polymorphism, recursion, etc… );
• Using design patterns;
Test Scripting
38. © 2021 Maveryx srl.
All rights reserved.
Scriptless Testing
• No programming skills are needed;
• Easy to learn and use;
• Promotes an improved functional coverage;
• Uses the skills of your team members at their best;
• Favours the participation of all the stakeholders;
39. © 2021 Maveryx srl.
All rights reserved.
A Mixed Approach (1)
• Taking advantage of the coding skills,
constructs, statements and the OOP features;
• Taking advantage of an improved functional
coverage and the participation of all the
stakeholders and team members;
40. © 2021 Maveryx srl.
All rights reserved.
A Mixed Approach (2)
Using the coding skills to:
• write custom keywords for custom needs or
improvements and expand the keywords'set;
• write tests too complicated to be created with
keywords;
• integrate different tools, API, etc… in the same
tests', scripts or keywords based;
41. © 2021 Maveryx srl.
All rights reserved.
A Mixed Approach (3)
…and using the keywords to:
• start earlier in time the tests' development;
• create more tests in less time taking advantage of an
improved functional coverage;
• favour the participation of all the stakeholders;
• use the skills of your team members at their best;
• introduce automated tools to handle tests' files, like
document DB, etc…
42. © 2021 Maveryx srl.
All rights reserved.
Thank you
alfonso.nocella@maveryx.com