Tags: MD5 ASC Register technology to complete automated HTTPS ORM Additions
As a developer, it is sometimes necessary to assist the marketing department in the development, for example, in marketing, often by giving users a coupon to improve the rate of re-purchase. This article will show you how to build this business logic using the automated test [UI mode] of the interface management tool Eolinker.
Marketing, timing tasks, data correlation
Next, we give the user a coupon as an example to build the process. Once you've built the entire process, you'll find that you don't need to write complex code anymore, just a few simple steps to complete.
1. Process Design
2. Process Commissioning
3. Scheduled Tasks
4. Using Tips
Let's first determine which interface is needed to complete the business logic:
Interface 1 Login : The most basic login interface, marketing personnel login to their own account.
Interface 2 Get a list of users : Before issuing coupons, determine the user list first.
Interface 3 Get a list of coupons: Get all kinds of coupons.
Interface 4 give the user a coupon: The return result of interface 2 and interface 3 as the request parameter.
Interface 5 Sign out : After the orchestration is complete, log out.
In accordance with the above process design, I created a new 5 interfaces, while adjusting the correct test sequence.
The return parameter of interface 1 statusCode , I set 4 status code, just corresponds to 4 possible cases, if there are more possibilities, you can continue to add.
If the API documentation has established the relevant interface, you can add the existing interfaces in bulk in the automated normal UI mode.
When we edit the interface and complete the settings associated with the data, just go back to the Automated test page and click " Test All " to complete the test. The contents of how the data is associated will be described below.
As you can see, after we have completed the correct setup, we get a successful test result.
In a process test, the return parameter of the previous interface may be the request parameter of the next interface. This is when you need to use the associated data . For example, to send a coupon to the user, you need to pass the coupon returned on the previous interface Couponid. The following is a two-step data association:
Click on the "association" button, the following box will appear, select the data to be associated, such as Couponid selected.
Generates a binding value. Both the UserID and the Couponid generate a binding value.
The format of the <response.userList.userID> parameter value is the Eolinker-defined association parameter form, using the return value of the single-title package response The [Interface's association ID (which can be viewed in a singleton list)]. Sub-parameters.
If the sub-parameter of the return value is an array, you need to add the element ordinal, the first element is 0, and so on. such as Couponlist.
The association parameters can be used in the request header, the request body (Form-data, raw), and rest parameters.
In debugging, test reports are also very important.
With the normal UI Automation mode, after testing, a detailed test report is generated, and the complete test report can be seen by viewing the details. If the test fails, the test report can be corrected in time.
In the business process of this article, we can automate the entire process by testing tasks on a timed basis.
The task is added first in the two-level menu of the automated test-the timed test task. You need to add a group before adding a task, such as a new group of "Free user coupons".
Here you need to fill in the name: " give the user a coupon", the time set " permanent ", the period is " one week ", the date Select " Monday to Friday of the early 10 o'clock and six o'clock in the evening ", according to the rules to send coupons.
Select a previously set use case in the Use cases list : Coupons
Confirm the test environment, fill in my mailbox, and then select the notification type. Once this is set up, we can get all the conditions of the interface test by looking at the message and make sure the interface is working properly.
For example, each test history can be downloaded in the test task list, which is very convenient.4. Request parameter processing using tips
Some parameters need to be encrypted before they are sent, such as passwords. In Eolinker, the parameter userpassword can be encrypted through the code injection function, for example
For interface 1, I use the Eolinker built-in encryption method to MD5 and SHA1 the request parameter UserPassword.
In addition to processing the request parameters, the parameters returned need to be verified, in this business, we only select specific users to send the corresponding coupons, which need to be verified to match the returned parameters.
For interface 2, I need to judge the return value before deciding whether the automated test process will continue, and eolinker the test by default when the validation fails. If you do not want to stop here, you can tick the " This use case check bit failed, still execute the next use case ". This will continue to test even if it fails.
Here's a check rule.
StatusCode to String 000000
The Couponid in the list is 1,couponname to 100 minus 10.
Eolinker fill in the validation rules:
In the process of filling out the matching rules, the key is to select the correct type (string, int, etc.) and the hierarchical relationship for the parameters. For example, here the parameters couponlist and Couponid are different types, and Couponid is the subfield of couponlist.
Finally, complete the task and log out, so that a complete business process is complete. By automating test UI patterns for business process testing, you do not have to write code and can correct errors in a timely manner through test reports, which greatly improves productivity compared to traditional test methods.
Eolinker, efficient, professional, standardized, so that interface management more simple!
For more updates, please visit the Eolinker public number, which is transferred from the Eolinker public number.
Experience Now: https://www.eolinker.com
No need to write code, with interface management tools Eolinker efficiently complete the API testing process related business