19 Jun Convert Your Manual Test Plan Into an Automated One
One of the biggest fears people have about implementing automation testing is that you’re going to miss a test that a manual tester would include. But in reality, if you plan correctly, you’re including more testing.
The key is to fully document of manual test plan including a thorough report on each test case for each elements in your application Here are some important elements that often get left out, or don’t get detailed enough testing:
- Execution history dates: Certain tests can become obsolete as you upgrade your software. Knowing which tests were successful and performed valid failures can give the test manager clear information about whether to retain a certain test.
- Test priority: Assigning a priority to your tests allows the test manager to decide how urgently a fix is needed. Some test plans have the simple low, medium, or high associations, but we like to classify tests using a 0 to 10 scale. This allows the test manager to better categorize fixes and customize automation test runs, ensuring a more stable software release.
- Pre-conditions and dependencies: These are critical when coding your manual tests, as you may have to automate them before the actual test is run. Pre-conditions or dependencies may be included in previous automated tests, so you can order the flow to cut down on automation time.
- Test steps: Most test plans include steps, but many times they aren’t detailed enough or there is a user assumption from one step into another. Every keystroke and click is critical with automated testing, so this area must be as detailed as possible.
- Expected result: After an automated test is run, a validation test will be executed. The details of the validation test n.
When writing code for test cases, try to categorize similar examples. That way you can reuse classes and methods for common elements. You want to create test groups in order of your application’s functionality to correctly set the flow of automation. When you use Apache Maven to run your tests, it can be difficult to configure the flow. The default configuration in Maven is to perform them alphabetically. A short cut would to add a prefix to your test classes to configure the flow (see example below).
One of the first and most common automated test groups you would perform is user log in. Grouping your successful tests and your planned failed tests in order will speed up the automation process as you may not have to redirect to a starting point for each test.
Browser development tools are handy for automated web testing,, as they can identify exactly which element needs to be accessed in your test methods. In Google Chrome, launch Developer Tools (Ctrl-Shift-I) and you will see the Elements tab on the far left. Hover over the web page element you want to inspect and then press Ctrl-Shift-C. This will highlight the element and also open the HTML area in the element screen.
After you have identified the element, you’ll need to copy the Xpath to paste into your code. Right click on the element in the Elements window, then select Copy Xpath. From there, using the Selenium web driver library, you can paste that Xpath in the findElement(By.xpath()) function to return a WebElement that you can inspect for validation.
Converting your manual test plan to an automated one can be a long, rigorous process, but it’s worth it in the end. Hopefully the tips above will allow you to cut down the time it takes to create a fully automated test environment.