In software testing, test-automation is use of the special software to handle the execution of the tests & the comparison of real outcomes with the predicted outputs. Test automation can automates the few repetitive but the necessary task’s in the formalized the testing activity already in area, & add the additional-testing that would be difficult to perform the manually.
Tips for functional Testing Automation:
Exploit Discrete Locators Instead Of Indexes
Generally it’s desirable to make a test you’ve to do somewhat like this click on seventh element in list. For such-elements it’s worth the intentions to find and make the unique identifiers, in the place of manipulating the aspects acc. to index. Test will continue an unpredictable-path, if the order of list-varies and order of links modify. Maintains of such unexpected-tests is pretty-hard.
Check Aftermath, Don’t Make Just Stupid Clicking
In several automated test tools there’re the feature that allows for record automatically & then play-back a set of processes. Such the features are handy, when creating the tests, but the outcomes of these records and playback tactics will outcome in a low quality. Such the functions as selecting, typing, clicking & other, anyway the state of app will be changed. Proper outcomes will be checked in better tests after manipulating the elements in app. Have a test to verify that content of report is right, if test produces a report.
Don’t Make Pauses, Better Wait
Few periods of the time might be needed through app before outcomes are obtainable to the test for examine. Such condition is common specifically with the AJAX calls. Sometimes, it seems the nice for pause test and sleep to a few seconds until the checking an outcome, but it is a kind of definitely-bad practice. It keep’s in the mind, that-test will generate a mistaken failure, if the app takes a big period of the time for return. It’s better to have test wait to a particular aspects of the app to appear. It makes test less prone for mistaken failures & more-powerful, since test is really a waiting for or verifying the states of the app upon producing the aspects that the test expects for.
Avoid Using the Conditionals
This seems wise for use a conditional in the test for such the cases. But there’re a huge number of the problems with this method. The one problem is that the same as problem which appears after using the indexes in the place of specific locators; so if the app, which-is tested, exposed for changes, automated test might occur the completely unexpected or unbeknown-paths, causing the mistaken failures or making the maintenance very hard. It’s problem, when the one branch of the conditional-statement could vanish altogether.
Sort Order Must Be Examined With Regular Expressions
Correct order of the app’s appearing an aspect is often significant to user. Generally it’s significant that the automated tests check for correct order of things; whether it’s a text on page itself, columns in the tables and elements in a list.