Now the company has a project that uses a webpage developed by WeChat. There is a problem with this webpage that it cannot be opened in an ordinary browser (the WeChat interface is used to obtain basic user information). It must be opened through the WeChat browser. OK, then how to stress test this web page?
The way I think of now is to capture packets and try to see if I can send http requests by imitating the WeChat browser. It is also said on the Internet that the WeChat server uses user-agent to judge Whether it was opened by WeChat browser.
Packet capture tool:fiddler:
Screenshot:
Now that the user-agent has been obtained, just add this user-agent directly to the request header field of the target URL: https:open.qq.com/xxx.
But in the end I found that it still failed. , using Firefox's developer tools to add UA: Picture:
I really don’t understand why. Is my understanding wrong or is there a problem with the operation steps?
By the way, I would like to ask all the experts to give me some advice on the stress testing methods and recommended tools. Thank you~!
I understand that stress testing mainly tests business interfaces. It can be separated from the test, and the relationship with the page can be separated. In normal stress testing, the data returned by the interface is also the most central.
WeChat Browser is not just a problem of WeChat UA, but also the entire browser operating environment.
But for your stress test, just test the situation after logging in to the web page. After all, the pressure for web page authorization lies with WeChat
Let me share a case I am working on. The company has a WeChat red envelope activity. Basically, every time it is sent out, tens of thousands of users will come to grab the red envelope. Direct stress testing helped us do it.
When we were doing stress testing, we added a parameter to the back-end logic, such as uid = random number, to simulate WeChat login. If the uid exists, it will not jump to WeChat login, but go to the database. Find the corresponding fake user to log in. Of course, there are some problems that may not be detected. For example, the business system needs to store user data after WeChat authorized login. This is more difficult during simulation testing, and some can only be randomly generated.
The special thing about this kind of website is to use the login function provided by WeChat browser to log in.
As long as you can simulate and log in, other tests are no different from ordinary tests.