Faster Regression Testing With In-Sprint Automation
Sauce AI for Test Authoring: Move from purpose to execution in minutes.|xBack to ResourcesBlogPosted
Sauce AI for Test Authoring: Move from purpose to execution in minutes.
|
x
Blog
Faster Regression Testing With In-Sprint Automation
Uncover some important aspects of automated website testing and how automation fits into a software development strategy.
Searching for User Interface test automation on Google will generate a lot of answer for tools, but not lots in the way of good practice. Search for experience with GUI test automation and you may get some code (in the wrong programming language) or you get some … advice. The advice is recently to include a handful of UI automation stereotypes -- UI automation is unstable, UI mechanization is dumb, record/playback is brittle, squad will pass more time on maintaining test code than they will really testing. There is a hint of truth to those, people actually do have problems building UI mechanization, but they don & # x27; t have to.
This clause continue some important aspects of automated website testing -- forcefulness and impuissance, building tests, framework selection, and how automation fits into a software development scheme.
Automation Strategy
The first footstep, before taking a look at the many options for tools and before build proofs of concept, is to ask the interrogative & # x27; why & # x27;.
Arguably the well-nigh common ground companies start a UI automation project is because “ regression testing takes too long. ” Each release, they have a hebdomad of development on new features, so new code is handed off to examiner, and so there is a week of testing and bug fixes on that new employment. When everything is done, someone still has to do some investigation hoping to discover whether or not all the late code churn introduced any surprising problems. This last part, theregression quiz, either takes too long or is crunched for time. This is where person gets an idea that all that hands-on fixation examination could be automate and do immediately.
The end result of this is ordinarily a halfway build suite of test that don & # x27; t really return much information. And, still less clip because that group of people that was doing fixation testing is now performing regression examination and building mechanisation at the same time. The truth is that regression testing is lead too much time because thedevelopment flowing is bad.
That is the trouble to fix.
Here is an alternate strategy for UI automation; use it to propel features forward into production quicker.
UI mechanization is typically developed on a lag of at least one sprint. The test codification be written right now might be for a code modification that has be in production for weeks or months. At good, this will only recite you when something on the page changes. Why not construct automation in-sprint?
In-sprint automation looks something like this. Developers write their new features sprinkling in unit and API testing where appropriate. Once the UI is near to done, they should be act more closely with a tester. That tester can begin building the bones of an machine-controlled UI tryout. They might write a duet of lines of code to navigate to a page, and start populating some text fields and have to stop to inquire a battleground that isn & # x27; t consent an stimulation 20 characters long. The developer would take a look at that point, fix a bug, and resume their local server. Then the tester would get back to building the examination in that same write a line or two, stop to investigate something interesting and then start again.
By the clip the important coverage for that characteristic is built, the new codification modification has been explored and had rounds of bug fixing. When the change is ready to be committed, there are unit tests, API tests, and a fistful of automated UI tests. The feature is basically ready for product. This also has the side impression of preventing too much UI automation. At some point, the pair can decide that they have explored enough and have but enough automated coverage that it is time to move on to the next task. As the consultant, Matthew Heusser excellently quip “ The story is not done until the machine-controlled tests[for it] run.”
Once the process in place, regression testing really is faster and maturation flow is a little more smooth. Instead of having to have a hand-off between groups, code comes to regression tested already testing, with check that are passing in selenium for that feature. Add a slight exploration and a green bar in the Continuous Integration system dashboard and the team can ship code for the sprint. The coverage problem also gets much easier. Instead of a person performing alike tests in 5 different web browser, a book can run in all of the browsers in parallel while a individual look for far more significant problems.
This strategy and coming are important for teams that want to deliver package in a metre that approaches Continuous Delivery.
Framework Selection
There are a number of APIs and tools available to help people build UI automation. One easy way to categorize them is whether the person edifice tests records steps they execute in a browser and after adds assertions, or if they are writing codification.
Record and Playback
Pro tip: Tools like SUSA can handle this autonomously — upload your app and get results without writing a single test script.
Telerik Test Studio and HP Unified Functional Testing (UFT) are popular record and playback tools. Using tools like these, a non-technical can act generally on their own to create tests. They can make object libraries to refer to page elements, reclaimable functions to call when some series of measure experience to be performed repeatedly. These are usually extensible with either a proprietary programming language, or something like C #. It can be difficult to create stable examination expend disk and play back tools.
Code
Watir and Selenium WebDriverare popular for testers that are willing to write some code. WebDriver is overwhelmingly popular in price of usage. Programming tools like these allow testers to create completely custom UI automation frameworks. APIs likewise allow test developer to conduct advantage of plan patterns like thePage Object. The Page Object allows people to design reusable part of code based on pages in the software they are prove. This create a scenario where code can be made more stable. Tests using Page Objects usually check less code and are lots easygoing to hold.
Any of the tool mentioned above are fine, a team can end up with useful test automation regardless of whether they choose the record and playback tool, or the programming API. Which you choose will depend on the staff available. Record and playback tools act well with non-technical testers. Though, it is important to remember that no affair how lots a tool claim to be code-free, some programing will finally be required. Also, feature a deep understanding of both testing, and mechanisation is nevertheless required.
The coded API options, such as Selenium WebDriver, volunteer far more flexibility and are generally easier to hook into Uninterrupted Integration system, or delivery process like Continuous Delivery, but they require tester that are not afraid of learning some measure of canonical programming attainment.
Building Tests
The first step to build a test for a user administration page habituate WebDriver would be to build the Page Object. This class should control methods such as enterFirstName (), enterLastName (), setBirthDate, deleteFirstName (), clickSubmitBtn () and so on. Each of these methods is completely self-contained. for example, enterFirstName () would check that the element exists, that it is visible and ready to be manipulated, and so enter schoolbook.
The first test for that user administration page might look like this:enterFirstName (& quot; Justin & quot;)enterLastName (& quot; Rohrman & quot;)setBirthDate (03/02/1981)clickSubmitBtn ()
Those steps would be followed by assertions free-base on what you are anticipate the page to return.
There is a fine line in automated UI testing between a shallow test cortege that doesn & # x27; t help you learn about quality in the important component of your product, and suites that are overkill and cross that threshold of requiring constant tending and alimentation. (The more checking you do, the more maintenance the test will need.) One single user creation test for an administration page probably isn & # x27; t enough. Automating every trial idea that enters your head is probably too much. An approach in the middle, Create Update, Delete (CRUD), might get more sense.
This trial would do something like the chase:
Create a new exploiter
Assert that the new user persists and values are as expected
Update each updatable battlefield on that exploiter profile
Assert that new value persist
Delete the user record
Assert that that user can not be base in search
This sounds like a complex scenario for web testing, and it potentially is. Good architecture and the use of design design like the Page Object can make this both useful and reliable.
If there be a fall to the Page Object, it would be that a lot of examination will fail when an element on the page changes. That problem is true regardless of which development design is employ. The forcefulness of the Page Object shape is that the fix only needs to go in only one spot -- the page object -- rather of every test. The combination of the right design design, and a full API mean you only have to change codification in one property to get things go again. This is important considering it is in the nature of software to change.
There are as many ways to get UI automation flop as there are ways to mess it up. Start by understanding the squad ’ s goals: what problems is the growth team having and how can UI automation smooth those. Next, build a scheme to fit those goals: how much UI automation is needed, what position need coverage, and where should the team start first. Then, select the right tool, a design pattern that work with instrument, and start building tryout. After that, the game is coming up with good trial ideas, convert those to code, knowing when to change the scheme ... and when to stop create new tests.
Share this post
Automate This With SUSA
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.
Try SUSA FreeTest Your App Autonomously
Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.
Try SUSA Free