For those who have a code foundation but still don’t know how to learn automated testing


I often encounter situations like this: Teacher, I have a basic knowledge of python or java, but I still don’t know how to write code? Teacher, I have a code foundation, simple ones don’t need to be learned, I want to learn advanced ones. Teacher, I have a programming foundation, but I can't understand the code. . . . . . For questions like this, I think everyone must also have these inner OSs

Faced with such a scene and such a question, I also asked a lot of children's shoes, and the answers I got actually sounded sad. Nothing is more difficult than to say that some code is too difficult to understand; the code is not written in detail so I can't understand it; I have a programming foundation, but the code you wrote is too bad. . . . . And so on, all the problems are attributed to him. . . The tragedy should be understood by reasonable people. . . .

Okay, let’s get back to the subject, just like this kind of question, let me talk about my ideas and learning skills in a unified way. Please forgive me if there is something wrong, I am also a low force person, so it is inevitable that there are also some wrong things. , Like to praise it, turn it, don't like to laugh, just discard it.

1. Learn automated testing, or some code. The core is to learn ideas and implement a framework or function. Without this idea, even 77 programming languages ​​will be useless. What is the idea here? For example, if you want to complete a case of reading the user name and password from excel and logging in, how do you design it? This is the idea.

Most of the children's shoes I saw, including the students I brought, started to write code. In fact, this is the most taboo. Conceptual logic and code structure are the first step, and the last step is to write code. Put the cart before the horse. You can write. come out?

2. The so-called I have a coding foundation, most of the people I meet, can be interpreted as I learn programming, but now forgot, I can hello world, this is not a foundation, it is only a concept of coding. This is the most fundamental reason why you can't write it out and don't understand it.

Everyone’s problems are pointed out above, so let’s take a look at how to deal with it. Here I would like to say one more thing: People who can sincerely point out problems to you are worthy of gratitude (albeit harsh). To improve yourself more and less complain about others is the quickest way to make you a great god.

The basic path to learn automated testing or programming:

Article 1: Cognition (including concepts, meanings, etc.)>Familiar with a certain programming language (python or java)>Start with simple and fixed examples and continue to practice (the most important thing to run, the least important to understand)>Cultivate yourself in practice Problem-solving ideas (process of understanding)>Organize a more complex framework>Continuously summarize

Article 2: Imitate>Run>Understand>Convert to your own

1. I won’t say much about the cognition of automated testing. I have already explained it in detail in my new book "Xiaoqiang Software Testing Crazy Lectures"

2. Familiar with a programming language, note that my words are familiar, not knowing, not understanding, not hello world, but you can write a simple demo proficiently, and master the general programming and debugging methods. As for whether everyone is entangled in learning python or java, it doesn't matter, it doesn't matter. You can learn whichever you like. If you have a java foundation, you can learn java. If you don't have a basic knowledge of java, you will learn more quickly. The essence of programming language is the same, but the syntax is different, and the ideas are all figured out.

3. Don't look down on simple examples. How many people say that I have a code foundation, but I learned it in a mess. . . . Use a word to describe: the eyes are high and the hands are low. To learn the code, you must imitate it first, let the code run, and then understand it. Many children’s shoes have to be understood as soon as they come up, why

Why, the code did not run to understand each yarn, why is it p (sorry, can't help but swear, haha, forgive my waywardness)

This is the same as you learn to drive, imitate, practice, and slowly understand the principles of the car, what fuel to add, and why there is a bump in the middle of the rear seat. I often tell my students that the most taboo thing about learning is to fall into the details at the beginning and blindly pursue understanding. Because a lot of so-called understanding requires you to have enough knowledge, experience and experience precipitation to do it!

4. Going back to the login question asked above, let's talk about the core ideas. To get this problem is not to realize writing code, but to realize his ideas and composition. This process does not involve specific details, and does not consider whether it can be realized. Let's look at this process:

a. Split the problem. This question can be divided into python to read excel (also consider how excel is designed to be more convenient to read), how to store the read data, and how to put the stored data on the corresponding user name and password

b. Realize step by step. Take selenium as an example, first identify the user name and password elements and write the data hard to at least ensure that the code can run. Don't come up and think about how to realize my username if there are several. You didn’t even run with a hard-coded user name. The code is so dry.

c. Implement python to read excel data and save

d. Use the saved data to replace the corresponding user name and password

e. Improve the code and add exception handling mechanism. Don't start thinking about what to do if you report an error, what to do if your username and password are wrong, how the basic idea of ​​the test is to lose the key time. . . We all know how to do functional testing first and then reverse, how come we forget when we write the code.

f. After running well and understanding, you can gradually optimize, such as adding unittest, htmlreport, etc.

Throughout the above process, many codes are fixed. For example, the usage format of unittest is fixed. Remember how to use it first, and then talk about it. Many people always learn from others to look at the source code, and you have a certain foundation. Otherwise, looking at the source code will make things worse.

Finally, learning is a process and a step. Just like building a car, don’t jump and learn. After all, there are few children's shoes that can jump. At that time, what we thought we thought was really not what we thought it was. . . . . . Just drive with you. You can only think about how to change lanes safely, how to overtake safely, and how to stop sideways. . . .

PS: Some things are difficult to express in words, and it depends on everyone's understanding. . . . . . . Fortunately everyone


Finally: a wave of software testing data sharing!

In the technology industry, you must improve your technical skills and enrich your practical experience in automation projects. This will be very helpful for your career planning in the next few years and the depth of your test technology mastery.

In the interview season of the Golden 9th and the Silver 10th, the season of job-hopping, organizing interview questions has become my habit for many years! The following is my collection and sorting in recent years, the whole is organized around [software testing], the main content includes: python automation test exclusive video, Python automation details, a full set of interview questions and other knowledge content.

May you and I meet and you will find something! If you want to exchange experience in software testing, interface testing, automated testing, and interviews. Follow WeChat public account:[Sad Spicy Strips]Receive a 216-page software test engineer interview book for free. And the corresponding video learning tutorials are free to share! Communication learning skirt:313782132

Recommend good articles:

Packaged as a test engineer with 1 year of work experience, my advice before the interview is as follows

What exactly should I learn in automated testing?

Why not consider Tencent for job-hopping? Talk about a little bit of the past between me and the goose factory

Which is more advanced, automated testing or manual testing?

Novice must see: How to write a qualified test case?

Python login interface test problem record and solution (dry goods)

Guess you like

Origin blog.csdn.net/weixin_50829653/article/details/114025101