How does apifox test API? Have you learned it?

background

Projects made by other teams are configured in a new environment. Since the project needs to be connected to projects of other companies, it is necessary to create a public API interface and use apifox for testing (both postman and jmeter are acceptable). This time, apifox was used to create a test for testing the API interface.

1. Download the apifox tool from the official website

Download address and usage document URL: https://www.apifox.cn/help/

After downloading, you need to register and log in to your account.

2. Create a test interface for a simple API

Documentation can be used to operate 

3. Pre-operation and post-operation

When testing the API, you first need to obtain a token. When obtaining the token, you also need [SHA256] encryption processing, so you need to create a pre-operation.

4. Extract global variables

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

 

5. The result value of the preceding operation

6 Utilizing global variables in another API

7. Create a test API interface when the API interface has pictures.

  • file: upload pictures
  • token: Credentials for api authentication
  • per: The value of additional items that need to be passed can be json, string, and other items.


Methods and examples of MD5/SHA256/BASE64/AES encryption and decryption using CryptoJS in JS
  • MD5
    encryptionCryptoJS.MD5('String to be encrypted').toString()
  • SHA256 encryption
    CryptoJS.SHA256('String to be encrypted').toString()
  • base64 encryption
    CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse('String to be encrypted'))
  • base64 decryptionCryptoJS.enc.Base64.parse
    ("String to be decrypted").toString(CryptoJS.enc.Utf8)
  • AES simple
    encryptionCryptoJS.AES.encrypt('String to be encrypted', 'Secret key').toString()
  • AES simple decryptionCryptoJS.AES.decrypt
    ('String to be decrypted', 'Secret key').toString(CryptoJS.enc.Utf8)
  • Custom AES encryption and decryption functions

The above examples are two simple AES encryption and decryption schemes. In most cases, we need to customize more parameters of AES encryption and decryption, such as encryption mode, padding, etc.

Finally, I would like to thank everyone who read my article carefully. Looking at the increase in fans and attention, there is always some courtesy. Although it is not a very valuable thing, if you can use it, you can take it directly!

Software Testing Interview Document

We must study to find a high-paying job. The following interview questions are from the latest interview materials from first-tier Internet companies such as Alibaba, Tencent, Byte, etc., and some Byte bosses have given authoritative answers. After finishing this set I believe everyone can find a satisfactory job based on the interview information.
 

Insert image description here

Guess you like

Origin blog.csdn.net/jiangjunsss/article/details/133310252