Test Automation - Basics
Test Automation - Basics
AUTOMATION
– BASICS
First Steps
Internal
AGENDA
TEST WHAT WE HAVE REQUIRED PYTHON TEST DESIGN AND REPORTING & TIPS & TRICKS
AUTOMATION IN SCHNEIDER SOFTWARE AND EXECUTION ANALYSIS
PROCESS ELECTRIC TOOLS
Internal
WHY AUTOMATE TESTING?
• Optimization of speed, efficiency, quality and
the decrease of costs.
• Increase of test coverage.
• Advance a tester´s motivation and efficiency.
Internal
PHASES OF AUTOMATION
PROCESS
Decision taken by management
to initiate test automation
1. Decision
Automated
lifecycle
testing
4. Design
Design and develop automation test
process
Internal
HOW IT WORKS?
• Install target app
• UI Spy – Interact with UI
• Python – Programming language
• PyCharm – IDE for code creation and
maintenance
• TortoiseHg – GUI for Mercurial revision
control for working with code repositories.
• SmartTest – Automated tests execution
Internal
UI SPY
•The UISpy tool enables user to view and interact with the UI elements of an application.
• There is no installation process for UISpy
• Just start UISpy.exe
Internal
Internal
Internal
Easy Extensible
FEATURES
Expressive Embeddable
Internal
PYCHARM
• Download and install PyCharm
Community Edition
https://www.jetbrains.com/pycharm/
• Modern IDE with:
• Code inspections
• VCS support
• Debugger
• Quick navigations
• Refactoring
Internal
• Configure PyCharm: File >> Settings
• Configure project interpreter to
1. C:\Program Files\ADMS ContinuousIntegration\
Python\bin\python.exe
2. C:\Program Files\SmartTest\bin\ipy.exe
Internal
• In Project tree find path Libs >> python.
• Mark python directory as source root.
• Now PyCharm sees folder python
as specified folder with source code.
Internal
TORTOISEHG
• Download TortoiseHg (with Mercurial) http://tortoisehg.bitbucket.io/
• Check out repository (clone on Desktop or similar)
• Pull incoming changes.
• Code update / merge.
• Code commit.
• Push outgoing changes.
Internal
Internal
REPOSITORY STRUCTURE
Internal
SMARTTEST/TEST RUNNER
Internal
SMARTTEST/TEST RUNNER
Internal
TEST
Header section
• Info – a short test description.
• Author – author’s name and email .
• Feature – Team that owns the test.
• Require – Test dependencies.
• TestTimeout – Maximum execution time.
Internal
TEST
Import section
• To be able to use any package in your code (test),
make it accessible by importing.
Body section
• Every action has reaction.
Internal
METHOD
Internal
CONFIGURATION FILE
Internal
COMMON LIBRARY
Internal
TESTING PLANS
• Sanity Check Test plan
• Regression
• EnterpriseRegression
• UUC
• Unknown number of local team’s plans
Internal
CONVENTIONS
•Conventions are used to standardize the structure and coding style of an application to:
• Enable everyone to easily read and understand the code.
• Facilitate changing and maintaining the code.
• Create a consistent look to the code, so
that readers can focus on content, not layout.
Internal
REPORTING
• Test Plan Summary
• On demand using Automated Test Runner.
• Typically opened by browser.
• All tests logs systematized in one report.
• QA Dashboard
• Link on landing page.
• Typically CI results in real time.
• Regular daily cycles.
• Including results of Automated Tests
Internal
REPORTING
Internal
THINGS TO BEAR IN MIND
•Functionalities invisible for Test runner (content of Network view: colors, section)
• Element must be on center of view
Internal
USEFUL TIPS
• Use recommended resolution Full HD (1920x1080) for automated tests that are testing
functionalities on network view.
• NOTE: No application or folder should be run or opened on the machine during execution of
automated tests.
Internal
HOW TO ANALYZE AT LOGS?
• Logs are stored in Logs folder
• Log is stored in folder name same as test name which is executed
• Log contains Debug, Info, Warn and Error messages and screenshots that are made
during test execution
• In the test log you can follow time stamps to see what action and when is executed.
• When test is failed, a few last actions should indicate what is the reason for failing
the test.
Internal
AUTOMATED TEST FAILED – EXAMPLE
Internal
• There are 5 different levels of logging:
LEVELS OF LOGGING
1. Log.info('Regular')
2. Log.debug('Debugging’)
This type of comment is used for debugging purpose, usually during development. It can be used to emphasize some problematic spot in test code.
3. Log.warning('Warning')
• This type of comment is used when we have an error that can be overcome, but it needs to be pointed out in a log.
4. Log.error('Errors')
• This type of comment is used for unexpected situations. All errors found during test execution are logged in this manner.
5. Log.screenshot('Screenshot is captured')
• Screenshot is used when it is needed to log screen shot of current situation on screen.
• It is vital not to use it too often because log can quickly become too large.
Internal
When adding a new test to central repository these steps should be followed:
1. Every automated test should be successfully executed on automated test developer
machine.
2. Code review must be done for every automated test.
3. Automated test should be successfully executed on QA machine.
4. Test on TFS must be marked as automated if automated test exists.
5. Automated test can now be pushed to central repository.
6. Business Analyst or a Product Owner decides which tests are SCT.
7. Adding test to test plan
Internal
DOCUMENTATION & LINKS
• More on python
• “Head First Python” – for elementary knowledge.
• Official python tutorial
https://docs.python.org/3/tutorial/index.html
Interactive python tutorial
http://www.learnpython.org/
Internal