Talk about from functional testing to automated testing, Ctrip Daniel summarizes some work experience sharing

Nowadays, there should be many testers who should have such doubts about how to do automated testing. Today, I will share some learning experiences with you. I hope it will be helpful to you. If there are some bad points, please give me more advice!

For testers, whether to perform functional testing, automated testing or performance testing, test cases need to be written, so we must first understand some characteristics of manual test cases and automated test cases in order to better carry out automated testing.

Insert picture description here

1. Manual testing and automated test cases

Manual test cases are for functional testers, while automated test cases are for automated test case frameworks or tools.

1) Features of manual test cases

Good exception handling capability, able to verify whether the current step is implemented correctly through human logic judgment;

Manual execution of use cases has a certain step jump;

Manual test step by step tracking, able to locate the problem in detail;

Mainly used to find functional defects;

2) Features of automated test cases

The execution object is a script, and any calculation requires coding definition;

Strong correlation between use case steps;

Mainly used to ensure the correct and complete functions of the main product, freeing testers from tedious and repetitive work;

The current automated testing phase is positioned in smoke testing and regression testing.

(Note: Through comparison, it is found that automated testing cannot completely replace manual testing. The purpose of automated testing is only to free testers from the tedious and repetitive testing process, and devote more time and energy to more valuable testing. For example, exploratory testing.)

3) Precautions for automated test cases

①Not all manual test cases need to be converted to automated test cases;

②Considering the cost of script development, do not choose use cases with too complicated processes. If necessary, consider splitting the process into multiple use cases to implement scripts;

③The selected use case is best to build a scenario. For example, a functional module is divided into multiple use cases, and multiple use cases use the same scenario. The advantage of this is that it is convenient to build a keyword test model;

④The use case can be selected with purpose. For example, this part of the use cases are used for smoke testing. Of course, there will be overlaps. If the current use cases do not meet the requirements, then the use cases must be modified to adapt to the scripts and requirements;

⑤The selected use case can be the main process, which is used for the smoke test (if you don’t understand the technical terminology, it will take time);

⑥The selected test case can be the part that you think is repetitive and trivial. For example, field verification, prompt message verification, etc., this part is suitable for regression testing;

⑦Automated test can also be used for configuration check and database check. These may exceed manual use cases, but they are also part of the use case expansion, and the project leader can selectively increase;

⑧ In normal manual testing, if you need to construct some complex data or repeat some simple mechanical actions, tell the script to let it help you, perhaps your efficiency will be improved.

Insert picture description here

If you want to exchange experience in software testing, interface testing, automated testing, and interviews. If you are interested, you can add software test communication: 313782132, and there will be technical exchanges with colleagues.

2. Types of automated testing

1) Test static content

Static content testing is the simplest test used to verify the existence of static and unchanging UI elements, for example:

①Each page has an expected page title, which can be used to verify that the link points to an expected page;

②The homepage of the application contains a picture that should be at the top of the page;

③Whether each page of the website contains a footer area to display the company's contact information, privacy policy, trademark information, etc.;

④Does the title text of each page use the h1 tag? Whether each page has the correct header text;

You may need (or may not need) automated testing of page content. If your web pages are not susceptible to impact, manually testing the content is sufficient. Assuming that the location of your application files has moved, content testing is very valuable.

2) Test link

A common mistake of a web site is an invalid link or a link pointing to an invalid page. Link testing involves each link and verifying the existence of the expected page. If the static link does not change frequently, manual testing is sufficient. However, if your web designer frequently changes links or files are redirected from time to time, link testing should be automated.

3) Functional test

In your application, you need to test specific functions of the application, require some types of user input, and return a certain type of result. Usually a function test involves multiple pages, a form-based input page, which contains several input fields , Submit and cancel operations, and one or more response pages. User input can be through text input fields, check boxes, drop-down lists, or any other browser supported input.

Functional testing is usually the most complex type of testing that requires automated testing, but it is usually the most important. Typical tests are login, registration of website account user account operations, account settings changes, complex data retrieval operations, and so on. Functional testing usually corresponds to your application’s description of application features or design usage scenarios.

Insert picture description here

4) Test dynamic elements

Usually webpage elements have unique identifiers, which are used to uniquely locate the elements of the webpage. Usually, the unique identifier is realized by the id attribute or the name attribute of the html tag.

5) Ajax test

Ajax is a technology that supports and dynamically changes user interface elements. Page elements can be changed dynamically, but the browser does not need to reload the page, such as animations, RSS feeds, and other real-time data updates.

Ajax has countless updates to enlarge the elements on the web page. The easiest way is in an Ajax-driven application. The data can be retrieved from the application server and then displayed on the page without reloading the entire page, only a small part of the page. , Or only the element itself is reloaded.

3. Principles of writing automated test cases

Finally, share with you the principles of writing automated test cases:

①A use case is a complete scenario, from the user logging in to the system to finally exiting and closing the browser

②A use case only verifies one function point, do not try to verify all functions after the user logs in to the system;

③ Write as few reverse logic use cases as possible. On the one hand, because the reverse logic is a lot of effort (for example, there are dozens of cases where the phone number is incorrectly entered), on the other hand, the automated script itself is relatively fragile, and complex reverse logic use cases are troublesome and error-prone to implement.

④ Try to avoid dependencies between use cases.

⑤After a use case is tested, the test scenario needs to be restored to avoid affecting the execution of other use cases.

The above content hopes to be helpful to you, friends who have been helped are welcome to like and comment.

Software testing is the easiest subject in IT-related industries to get started~ It does not require the logical thinking of developers, and operations and maintenance personnel are not required to be on call 24 hours a day. What is needed is a careful attitude and a broad understanding of IT-related knowledge. The growth path of each tester from entering the industry to becoming a professional expert can be divided into three stages: software testing, automated testing, and test development engineers.

Insert picture description here

Here are some information I have compiled. If you don’t want to experience the self-study again, you can’t find the information, no one answers the question, and you feel like giving up after a few days, you can add our software testing exchange group 313782132, which contains various software Test data and technical exchange

Guess you like

Origin blog.csdn.net/weixin_50271247/article/details/109311956