Learn the whole idea of qtp-stick to it

Source: Internet
Author: User
I feel like I have written a good job. Thank you .. 1. Getting Started AutomationI believe that many of my friends, including myself, are the same. TestYou can't wait to download a tool and start using it. Then, you are dumb-eyed. In the face of such powerful qtp functions, I don't know how to start it. At the same time, it will seriously dispel our enthusiasm. Here, I suggest that LearningAutomation friends should first understand some automation concepts. At this stage, you must first understand these questions: What is automated testing? What can automation do? What knowledge is required to learn automated testing? Limitations of automated testing? Is your project suitable for automated testing? Why? Why do we need to understand these questions first? After learning about these problems, you will be able to eliminate your fear of automated testing and learning. There will also be a preliminary idea that you will not feel at a loss. In addition, you can learn with questions, can better understand and remember and then form your own thinking. 2. Download and install qtp. Do you know something about automated testing? Now download an automated testing tool, install and crack it, or use a trial version. start learning about automated tools. Here I want to talk about my personal experience: Which tool should I learn? For this question, I would like to say that this is the same as learning programming languages. I am looking for information everywhere to view people's experience. People say that VB is easy to use and I will study VB immediately, when people say that dephi is good, they will learn dephi. When people say that Java is good, they will learn Java ......., even a few changes in a day. After several months, I have never learned anything. Finally, let's settle down and start from C. The same is true for automated testing. Don't always ask others what they want to learn. Choose one, after learning a tool, you can use another tool, that is, one or two weeks to use it. So, start with qtp, its IDE is intuitive and suitable for beginners. Download a user manual to learn about each function. simple and automated qtp installation is complete. Now we will start our first automated experience: Recording flight automated scripts. This process is relatively simple. There are three parts for recording: login, ticketing, query and deletion of ticketing, I will not talk about the specific business process and recording process, there are a lot of information online, this article is not an experiment guide, it only provides a clear automated learning route. Of course, after recording these scripts, the playback is successful, and the first automation is complete. 4. the script enhancement function is mainly used to learn some basic qtp functions. here you need to enhance your script, parameterized login username and password, parameterized flight selection, and ticket booking number, add amount check. It mainly involves learning parameterization and checkpoint, and there will be some difficulties: that is, selecting a flight here, you can use random numbers and other methods to parameterize the flight amount check will require some simple programming, total amount = number of sheets * unit price. the getroproperty ("") method of the object will be used to query the order number. this learning process may also encounter debugging difficulties, but you don't have to worry about it. The success is based on failure. Remember that during debugging, you can follow F11 to create your output, for example, msgbox, to output the desired information in real time. 5. the data driver has gone through the above stage. Here we are going to get into touch with some data-driven ideas. In fact, it is very simple to take out your parameterized place and put it in an external Excel file, then, read the data in Excel to control the number of cycles. The approximate steps are as follows: create an Excel object to read Excel Data cyclically and assign a value to the variable to reference the variable in the script. I will not elaborate on the implementation of each step. 6. function-based functions at this stage mainly write reusable functions into functions, and the main control script is mainly used to call these function functions for reuse and clear structure, this stage can be divided into the following sub-stages: write a single function as an action, and the main script calls these actions. A problem occurs here, that is, the setting of the called action, this is an article in my blog. ArticleFor more information, see How to Write a single function into an action. The script calls these functions at the bottom to write a single function into one. if you call these functions in the vbs file or script, you will also encounter a problem here, that is, qtp call. vbs file. This is also detailed in an article in my blog. Here we will not repeat this process to complete it, and there will be a basic framework. Next we will go to the next stage 7. at this stage, we believe that many of our friends have read the lightweight automated testing framework of a friend on the internet, and I am too lazy to create another example, here you need to create your own report, LogsFiles, function files, data driver files, and script files are all placed in a separate folder to facilitate management and standardize the creation and definition of functions, for details, see lightweight automated testing framework 8. clarifying the framework idea is mainly used to think about and improve your framework idea at this stage. At this time, you should have a clear idea and understand all stages of automated script development, and know what it will look like at the end. Now the important thing is to learn to do analysis and planning. A project is in your hands, first, you need to evaluate whether this project is suitable for automation and automation, which functions can be encapsulated into functions, and where data needs to be controlled, finally, evaluate the time consumption, required resources, and outputs (documents, scripts, etc.) of each stage. So far, you have completed a complete automated test and learning process, now you can calculate it as a qualified automation testing engineer. There will be a lot of technical details among them. I didn't write them one by one, if you have any questions, you can contact me by searching for information on the Internet. If you leave a message in my blog, I will reply that night. Remember the last two sentences, principles of automated framework design: Framework and script separation, script and data separation.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.