How To Set Up Automation Framework From Scratch
1. Construction, Organize, & Fix Source Command
Starting time past setting up and organizing a folder structure for your test avails. Y'all'll desire to go along different assets divide from each other, such as tests, proper name mapping criteria, and scripts, and create the files you know y'all'll need within each one. For example, within your 'Scripts' binder, you'll desire to create files for each type of script –event scripts, actions, utilities, and verifications. Also make sure to create a file for your information.
Structuring your assets in this fashion volition permit for them to exist quickly referenced by members of your team and will ensure your tests are stable when updates are made. When structuring your assets in this fashion, you lot can revisit the projection at whatever time without the pain of needing to sort through a lot of data. This will also templatize your test folders, enabling you to clone them beyond a project.
When walking through these first steps, ensure you're using a source command direction system (SCM) similar Git or Mercurial to store your work. In the issue a mistake is made, you won't want to lose that work or time spent. Tools similar the will allow you to backtrack if needed.
What are Automated Testing Frameworks?
Testing frameworks are a set of guidelines, or rules, used to create and design examination cases. They provide a standardized examination linguistic communication and reporting structure for applications nether test and can reduce test maintenance costs. Frameworks will link tests back to other parts of the software evolution lifecycle (SDLC), such equally requirements and defects, enabling teams to find and set up bugs quicker.
Not all testing frameworks however, are automation frameworks – something vital to go on in heed when developing the latter. A testing framework is comprised of all of the tools and practices intended for application evolution, from requirements outlined for your application, testing activities including both transmission and automated tests, to environments to run your tests on, and so much more than.
Automated testing frameworks focus specifically on optimizing automated processes. They facilitate faster cycles through test reusability and through speeding up exam cosmos and maintenance by separating exam information from logic. There are many types of automated testing frameworks, so it'due south crucial yous prefer one that is correct for you. Utilizing one that is well-structured nevertheless, can increase your team's efficiency by improving test accuracy, maximizing test coverage, and lowering costs and maintenance – ultimately giving you a higher render on investment (ROI) for your efforts.
Follow the next seven steps we lay out in this white paper to build yourself a robust automated testing framework and set yous and your team up for long-term success.
2. Familiarize Yourself with the Awarding
Pace two is to get-go familiarizing yourself with the application – beyond what the requirements tin can tell you. Reading documents that outline what the app should and shouldn't exercise will but get y'all so far. In this step, you desire to go your hands dirty.
Conduct exploratory testing to give yourself an idea of how the internal workflows of the system are ready up. This practice will ensure you know how the application works. Once you've done this, you'll need to create a system for, or update, how you're finding your UI objects. Depending on the tool you lot're using, this could mean you need to create basic name mapping backdrop, or write scripts for the actions needed to identify objects.
The primal to this stride is to record your actions. Take notes on what your requirements volition be and how your automation assets will test them.
3. Determine Your Testing Environments & Get together Information
Adjacent, gather the data you plan to utilize for the tests and set up your environments. Information technology'southward vital to your success that you set configurations that can be run in more than 1 environs. It'due south time to accept that event handlers are your new all-time friend.
An event handler is a function comprised of code, that acts every bit a listener, waiting for an result to happen to trigger a script, or a series of scripts. Imagine your average cyberbanking application. Later on a certain number of minutes of idle fourth dimension, a notification will pop up asking if y'all need more time. If you don't answer, it will automatically log you lot out for security reasons.
Your outcome handler here is the function that triggers the scripts for the idle notification and the logging out process. Regardless of which environment you're on, possibly Windows x or Windows 7, you'll desire this workflow to happen, and your end user would expect it too.
Event handlers will enable you to complete deportment that reply to an event, without the need for a carve up set of tests for each environment. They are the instructions for how a system should run, without the specifics, and volition allow y'all to add sophistication to your tests without having to manually handle them. For case, you lot'd be able to change whatsoever dynamic object identification properties, such equally URLs or file names.
If you change the proper name of your application and need to point it to a different path, or update how information technology's installed, your framework volition exist able to accost this with the aid of result handlers. Tests are used to ensure pieces of the application behave as expected, and framework provides the tools do so.
At present onto your examination data. Your framework should house the data separately from the tests. Utilize your repositories to store data and keep your properties and references generic – non test specific. This will permit your data objects to be shared between scripts and your data to be used across all of the utilities you have saving y'all fourth dimension and endeavor in the future.
four. Set Up a Smoke Exam Project
Earlier you create your utilities and verifications, it'southward crucial you get a smoke exam project gear up upwards. They will become the most important fix of tests yous will utilize to verify your utilities.
Smoke tests, or build verification tests, validate that the most vital functions of an application work as intended and make up one's mind whether additional testing is needed. If a smoke test passes, it means the vital pieces of your application are working, then you lot can become ahead with more in-depth testing. If information technology fails, it means the basic functionality your application that needs to work is already broken. When this happens, you're ameliorate off asking for this to be fixed first. Farther testing at this betoken would simply be wasting precious time.
As your software matures, or expands capabilities-wise, your smoke exam suite volition too need to abound. Information technology takes only one bug to cripple an application and diminish a company'southward reputation.
5. Create Utilities for On Screen Actions
After familiarizing yourself with the application, gathering information, and setting up your environments, you'll need to create shared utilities for common user interface (UI) actions such as carte navigation and text input fields. These are the basic building blocks of your tests, which you can then piece together to form the exam logic.
Depending on the tool you're using, this could be as unproblematic as dragging and dropping pieces into a keyword test. This volition allow your framework to bulldoze your test menses and verifications so that minimal maintenance to individual tests is required.
A play a trick on hither is to utilize JavaScript classes within your framework, especially for navigation. This way, if you update how you lot're logging your actions, or your expected test results, you will only have to practise this from one location – ultimately keeping your logging consistent.
This will enable team members who aren't automation engineers or developers to look at your test logs and understand what's going on. They volition be able to make up one's mind if failures are an nugget, problem, or an actual defect in the application, which is why information technology's important to abstract your framework data from the actual test data.
half-dozen. Build and Manage Verifications
In the side by side step, you'll want to set up your verifications -applying the same logic from how yous structured your data, meaning they should be shareable. Let's say y'all're testing the functionality of your application and the requirements change on a text field. If you're verifying that the text field but accepts numeric characters and not text, your tests volition need to be updated.
In instances such as this, you don't want to get stuck updating every single examination, especially if you are all the same doing this manually. Ideally, yous update the verify portion of your text field in one spot so that you could take fifty tests that test several different scenarios even so work. Any UI verifications you build into your actions should be optional, then that in the outcome a field accepts an input properly and the test passes, there is no need to verify that action every single time.
Your verification data should also be shared. Different input utilities should be able to accept data objects created in previous steps then you can chain items together. This will also enable you to brand updates in one expanse when needed, which can then be propagated across all the different areas of your framework –highlighting again, the importance of separating framework data from the bodily test data.
7. Ready Your Logging & Reporting Mechanism
The final piece of your UI automation framework is your logging and reporting machinery. Throughout the entire build process, you should be recording and taking notes on all your exploratory actions, information grooming, and environment and verification building.
Log messages before verifications, stating what information technology is you're verifying and what the expected result is. You'll desire to make these messages homo readable so that the not-technical users can expect at your log and know exactly where and why a failure occurred. Errors should not exist ambiguous and no i should have to approximate why they happened.
The goal of this step is to assistance you standardize your process - what your logging, when you're logging, and the errors.
Reporting should also be automatic. Automating reporting will cut down on the time yous spend pulling reports and enable you lot to focus on analyzing the data. If y'all desire to consign your exam logs to share across your network or on a web server, with the right tool, you lot can automate the electronic mail sending process. If a test fails, y'all'll desire to know immediately. Why wait to pull the reports manually?
Tests are for validating application logic. Frameworks are for easily creating and building tests. Post-obit these seven steps, you'll be able to build a robust UI automation framework that will lay the foundation for enduring success.
Building Your UI Framework & TestComplete
Building an automated UI testing framework tin can exist a painful process. Information technology'south complex and fourth dimension-consuming. As the general guide book for your testing process, your framework should outline everything from the standard language you plan to write lawmaking and scripts in, to which practices you're implementing, and the tools you aim to utilize. When choosing a tool, you should adopt 1 that is flexible and comes with out-of-the-box support for a variety of languages.
TestComplete, an automated UI functional testing tool, enables teams to build and run UI tests across desktop, mobile, and web applications. It supports a wide variety of scripting languages, such equally Python and JavaScript, comes with an extensive object library with over fifty thousand object backdrop, and has robust record-and-playback feature. With these capabilities, whatsoever team tin can easily build a stiff UI framework.
Carson Underwood, a Quality Assurance Engineer at O'Reilly Machine Parts and an expert in examination automation, congenital his UI testing framework from scratch. Check out his step-by-step process and picket as he walks through how he used TestComplete to accomplish each piece.
Source: https://smartbear.com/resources/ebooks/steps-for-building-a-successful-ui-automated-test/

0 Response to "How To Set Up Automation Framework From Scratch"
Post a Comment