8 years of experience, 5 minutes to show you web automation testing

1. What is automated testing?

The concept of automated testing: Software automated testing is to use testing tools or other means to automate testing of software products according to the tester's predetermined plan. It is an important part of software testing and can accomplish many things that cannot be done or difficult to achieve by manual testing. Testing work, the correct and reasonable implementation of automated testing can quickly and comprehensively test the software, thereby improving software quality, saving money, and shortening the software release cycle.

2.. Why automate testing?

Benefits of automated testing:

1) shorten the test cycle

The computer industry updates and iterates rapidly, and a large number of frequent regression tests consume time. Automated testing can hand over repeated execution to computers to speed up testing.

2) Avoid human errors. It is impossible for testers to continue to be highly concentrated, and human beings are susceptible to external influences (headaches, brain fever, and lack of energy), which may cause human errors 3) Test information storage. Automated testing stores test information and data in files, and the thinking is clear Clear and easy to hand over

4) Easy to obtain coverage Automated testing can liberate testers, so that testers can have more energy to do those non-repetitive tasks.

5) Other automated tests can be implemented automatically or regularly

3. Classification of automated testing

1. Overall classification:

1) Automated functional testing

2) Automated performance testing

2. Classification of automated functional testing:

1) Unit testing: Programmers do it

  2) Interface test

3) Function test

3. Performance testing mainly uses testing tools

  Loadrunner, Jmeter, etc., perform stress testing, load testing, etc. on the software, because these cannot be replaced manually, so they must be automated.

  In order to test the service capability of a web site, it is necessary to simulate thousands of requests (such as opening a browser to visit a site), and the human speed is far from reaching such an operation

Large and medium-sized projects or long-term projects can adopt automated testing

现在我也找了很多测试的朋友,做了一个分享技术的交流群,共享了很多我们收集的技术文档和视频教程。
如果你不想再体验自学时找不到资源,没人解答问题,坚持几天便放弃的感受
可以加入我们一起交流。而且还有很多在自动化,性能,安全,测试开发等等方面有一定建树的技术大牛
分享他们的经验,还会分享很多直播讲座和技术沙龙
可以免费学习!划重点!开源的!!!
qq群号:110685036

4. Web automation conditions and scope of use

1. Prerequisites for using automation

1) Manual testing has been completed, and automation will be gradually realized in the later stage without affecting the progress

2) The project cycle is long, and the repetitive work is handed over to the machine to achieve

3) The demand is stable and the project changes little

4) The complexity of automated test scripts is relatively low

5) Reusable

2. Scenarios for using automated testing

1) Frequent regression testing

2) Smoke test

3) The demand of traditional industries does not change much, and the application is frequent

4) Performance testing

5. Commonly used tools for web automation

1. Common automated web testing tools:

1) QTP (charged)

QTP is the abbreviation of Mercury's Quick Test Professional, which is an automatic testing tool.

2) Selenium (open source)

ThroughtWorks is a powerful browser-based open source automated testing tool, usually used to write automated tests for web applications

3) RFT (charge)

The abbreviation of IBM Rational Test Professional is an advanced automated functional and regression testing tool, used by testers and GUI developers, based on object counting for Java, .NET and recording and playback functions based on web applications

2. Xpath positioning element

1. Introduction to xpath

Xpath is an expression language (a language for finding information in XML documents). It is an XML-based tree structure that can search for specified nodes in the entire tree. Its return value may be a node or a collection of nodes. Because HTML The document itself is a standard XML page, so we can use the syntax of XPath to locate page elements, which is a powerful tool for crawlers.

2. Why learn XPath?

For web automation, it is to simulate various elements on the operation page; before operating elements, you need to find elements, that is, locate elements; usually, element positioning uses id, name, class, text, etc. to meet most of the daily needs positioning needs. However, with the deepening of automation and the requirements of different front-end frameworks, it will be found that the above positioning method cannot solve the positioning of some elements. Especially for some elements like this:

1) No id, name, class and other attributes;

2) id or class is dynamic;

3) The attributes or text information features of the label are absent or not obvious;

4) The label nesting is complicated, there are too many layers, etc.

3. XML to HTML

4. The concept of nodes

Each XML/HTML tag is called a node

5. Element positioning

6. Path expression of xpath

Absolute path: /html/body/div/div[7]/div[3]/div[1]/div[2]/form/url/li[2] is easily affected by page changes and is generally not used

Relative path: //*[@id="Header1_HeaderTitle"] is recommended, with flexible and diverse expressions

Three, css selector

1. What are CSS selectors?

In CSS, a selector is a pattern used to select elements that need to be styled. Computers can locate corresponding elements through css selectors, and we often find css selectors constantly when writing automated test scripts.

2. css selector syntax

1) Positioning by pseudo class name, id, tag name

2) Through the nesting relationship before the element

3) By attribute

4) Through the parent-child relationship

The following are supporting learning materials. For friends who do [software testing], it should be the most comprehensive and complete preparation warehouse. This warehouse also accompanied me through the most difficult journey. I hope it can help you too!

Software testing interview applet

The software test question bank maxed out by millions of people! ! ! Who is who knows! ! ! The most comprehensive quiz mini program on the whole network, you can use your mobile phone to do the quizzes, on the subway or on the bus, roll it up!

The following interview question sections are covered:

1. Basic theory of software testing, 2. web, app, interface function testing, 3. network, 4. database, 5. linux

6. web, app, interface automation, 7. performance testing, 8. programming basics, 9. hr interview questions, 10. open test questions, 11. security testing, 12. computer basics

Information acquisition method:

Guess you like

Origin blog.csdn.net/myh919/article/details/132024588