Web automated testing 01

This blog

1 Recognizing web automated testing

1.1 What is the automated testing
1.2 Why automated testing
1.3 Classification Automated Testing
1.4 web automation and conditions of use range
1.5 web automation commonly used tools
 

2 positioning element (emphasis)

Installation and use 2.1 tools
Why learning elements targeting 2.2
2.3 css selector
2.4 xpath selector
  The relationship between nodes 2.4.1
  2.4.2 xpath path expression

 

1 Recognizing web automated testing

1.1 What is the automated testing

Software test automation:

Is through testing tools or other means, according to the schedule testers are software products automate testing , he is an important part of software testing, we can do a lot of manual testing can not complete or test work hard to achieve, correct and reasonable implementation of automated test, can fast , comprehensive of software testing to improve software quality, save money, shorten release cycles of software

 

1.2 Why automated testing

1) shorten the test cycle
computer industry quickly update iteration, a large number of frequently time-consuming regression testing, automated test can be repeated to implement a computer to do it, speed testing.

2) to avoid human error
testers can not be sustained highly concentrated, and humans susceptible to external influence (Toutengnaore, lack of energy), can cause human error

3) test information storage
test automation test information and data stored in a file, clear thinking clear and easy transfer

4) easy to obtain coverage of
automated testing can liberate testers, the testers can have more energy to do those non-repetitive work.

5) Other
automated testing may be performed automatically or Timer

1.3 Classification Automated Testing

1. Overall classification:

  1) automated functional testing

  2) Automated Performance Testing

 

2. Classification automated functional testing of:
1) unit test (programmer get)

2) Functional Test (functional testing mainly by the testers that the majority of applications to web-based)

3) interface test (mainly for interface testing by the test personnel, associated tools)

and medium-sized projects or long-term projects may test automation

The main automated functional testing: The main is to write code, scripts, so that the software automatically runs, find defects, replace manual testing section. But generally only large projects only need to be automated, small and medium sized project does not recommend the use of automated testing.

Performance tests are conducted using the test tool, Loadrunner, Jmeter etc., the software stress testing, load testing, strength testing, etc., because they can not be in place by hand, it is necessary automation

 

1.4 web automation and conditions of use range

1. The use of automated prerequisite

  1) Manual testing has been completed, the latter do not affect the gradual progress of automation premise
  2) project cycle is long, repetitive work to the machines to achieve
  3) stable demand, the project was little changed
     4) comparing the complexity of automated test scripts low
     5) can be reused

 

2. The use of automated test scenarios

  1) frequent regression testing
  2) Test smoke
    3) Frequent Internet iteration
  4) small changes in demand in traditional industries, applications frequently
  5) performance test

1.5 web automation commonly used tools

1) QTP (surcharge) 
QTP is referred to Mercury's Quick Test Professional is an automated testing tool.

2) Selenium (open source)
ThroughtWorks a powerful open-source automated testing tool for browser-based, usually used to write automated web application testing

3) RFT (surcharge)
  IBM the Rational abbreviation of the Test Professional is an advanced automated functional and regression testing tool for testers and GUI using the developer, is the basis for Java, .NET object count and web-based applications recording and playback functions.

4) Watir (open source)
  open source web automated testing framework implemented in Ruby, the compact and flexible

5) Sahi (open source)
  an Indian company to develop a web automated testing tool, easy to use, support for Ajax and web2.0

 

QTP Vs Selenium

 

 

 

 

2 positioning element (emphasis)

Installation and use 2.1 tools

To get the computer to locate the elements, it is necessary to use a computer can read the css selector or xpath path expression, then we need to use the next few plug-ins

(The following plugins are Firefox browser plug-in, we need to install the Firefox browser, Firefox browser installation configuration refer to Section 3.1.3 Part III describes the installation of the Firefox browser)

 

Material:
. 1) firefox35

2) firebug plug-in

3) firepath plug

 

1. Install the plug-firebug

1. Open firefox browser, click on the upper right corner of the menu 1. Open firefox browser, click on the upper right corner of the menu

 

 

2. Enter the firebug in the top right corner of the search bar and press Enter

 

 

 3. After installing firebug found in the search structure, and click on the search results

 

 

 4. After the installation is complete, click on the extension to see if there firebug list on the right

 

 

 5. Open the firebug plugin

 

 

 6. Check the plug is not installed firepath

 

 

 

2. Install the plug firepath

1. Search firepath widget to operate according to the above steps, the installation 

 

 

 2. After the installation is complete prompted to restart your browser, click Restart

 

 

Open firebug 3. After restart the browser, in the position shown in FIG. Firepath appears, it indicates that the plugin is installed 

 

 

 

Why learning elements targeting 2.2

1) to the extent that the computer is not smart people.

2) The computer can not be the same as the manual tester by seeing, hand-operated mouse clicks, keyboard inputs.

3) computer means found through a series of counting elements (buttons, input boxes, simulated keyboard, etc.)

 

Element positioning tools or means what?

1) css selector

2)xpath

 

2.3 css selector

1. What is the css selectors?

 CSS, the selector is a mode for selecting a style element needs to be added. The computer can navigate to the corresponding elements by css selector, we often find is constantly css selector when writing automated test scripts.

 

2.css selector syntax

1) pseudo class name, id, name tag positioning

 

2) preceding an element nested relationship

3) through the property

 

 

 

 

 

 

4) through the parent-child relationship

 

 

 5) Element Status

 

 

 

2.4 xpath selector

1.XPath is the XML Path Language, it is a method used (a subset of the Standard Generalized Markup Language) language to find information in the HTML \ XML document

 

2. What is XML?

XML refers to extensible markup language (EXtensible Markup Language)
XML is a markup language, much like HTML
XML is designed to transmit data rather than displaying data

 

3.XML given HTML

 

 

 

The relationship between nodes 2.4.1

The concept of nodes: Each XML / HTML tags we call node

 

 

 

 

 

 

2.4.2 xpath path expression

XPath uses path expressions to select nodes in an XML document or set of nodes. These path expressions and expressions we see in conventional computer file systems are very similar.

Find a specific node or a node that contains a specified value

 

 

Select the unknown node

 

 

Select several paths

 

 

 

 

Guess you like

Origin www.cnblogs.com/zhangyangcheng/p/12465809.html