When I first got into the line do QA, as long as heard the “automation” three characters, small make up immediately began to imagine a sci-fi movies, in an abandoned factory, thousands of robot cooperation, through the signal transmission, automatic production, automatic packaging, automatic transportation, vending, automatically finish any work, and people’s hands are no longer bound, hands are free, The sight of people sleeping in the break room outside the factory… Every fantasy to here, looking at at hand to measure the endless functional use cases, the implementation of the endless test modules, the heart is always unclear to “automated testing” to maintain a god like worship and yearning, as well as unreachable distance. I’m always wondering what automated testing looks like and how I can learn it. I always fantasize about how great it would be to automate and not have to test again and again every day.
Automated testing tips: From fantasy to earth
So with questions, quietly in the testing industry, until in an interview, broke my beautiful fantasy of automated testing:
Interviewer: “Why are you changing your job?”
Me: “Because I have been doing manual testing, I want to switch to automatic testing, so that I can realize my grand testing dream, reach the peak of testing level in my life, and realize the highest standard of life planning.”
After I finished, I was rebuked by the interviewer within 3 seconds: “Then we still do the manual test, I think our job is not suitable for you, so today’s interview is done.”
Frustrated, I picked up Baidu and browsed through several hours of articles on “automated testing”. I realized that automated testing can’t completely replace manual testing. It seems that I have too deep a fantasy about automation and automation is not that mysterious and powerful.
With this understanding, I gradually learned and thought about every specific place where automation could be applied in the testing work, and started to study suitable automated testing methods and tools from these points.
01
In fact, there are many kinds of automated testing, when we want to quickly regression interface function, regularly monitor the interface function is abnormal, so this is the application of interface automation. Of course, interface automation is based on a variety of testing tools, including UI tools such as Postman, Jmeter, and even IE360 Firefox Chrome, which we use every day. Or we can do it in a more efficient, non-UI way by scripting Python’s UnitTest framework and using the third-party Requests library to send every request we need to test. We can even use the Flask library Restful module to write an interface we are testing or Mockserver to write a dummy interface, allowing us to write each interface test case in advance.
02
In addition to interface automation, UI automation testing is the most used for our Web project with UI interface, so I believe everyone is using Python /Java language +Selenium library to control our browser to do UI automation testing, of course, for Web pages, learn the method of element positioning is very important. XPath and CSS locating methods are frequently used. In fact, these only realize the automation of what we usually call “point page”. If you want these automatic scripts to be automatically executed every minute and every second every day every year/every day of a certain year, every minute and every second, of course, Jenkins can execute task scripts regularly.
03
But it is not enough to learn for automated test scripts, learning also requires synchronization of database, just as we before executing a automation scripts, all need data, or when we go to any a Restful style of request, the change of our resource pool resources, are all rely on the knowledge of the database.
However, the real testing work is not only automated testing, because only manual testing and automatic testing combined, combined with database, middleware, operating system knowledge, all these knowledge interlocking, mutual use, can play the most efficient power of the machine. Maybe we stepped on a lot of pits in the automatic test environment construction, tool download, environment configuration, met a lot of obstacles, resulting in our inability, do not want to continue to learn the pace of lofty knowledge, this time we still need to calm down, through a variety of ways to eliminate it! Not only the sense of achievement will multiply, but also the sense of happiness will explode! Ha, ha, ha. Speaking of this, as if a bit exaggerated, but the process of learning is also happy pain, xiaobian also hope to work with you to adhere to this is “torture” and happy habit, continue to test the industry in this tank of knowledge travel!