about web End sum app For the interface test of the end , They are all through the request method ,url And delivered body Parameter for interface request , difference web and app The difference is that header Different requests . The difference is this header Medium User-Agent Parameters .
web frequently-used User-Agent Parameters :
Chrome:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.64 Safari/537.11
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.133 Safari/534.16
Firefox :
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0
Mozilla/5.0 (X11; U; Linux x86_64; zh-CN; rv:1.9.2.10) Gecko/20100922 Ubuntu/10.10 (maverick) Firefox/3.6.10
app frequently-used User-Agent Parameters :
IPhone:
Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5
Android
Mozilla/5.0 (Linux; U; Android 2.2.1; zh-cn; HTC_Wildfire_A3333 Build/FRG83D) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
Mozilla/5.0 (Linux; U; Android 2.3.7; en-us; Nexus One Build/FRF91) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1
One 、 How to proceed app Interface test with wechat applet
For interface testing, you can do interface testing in two ways , One is to test the interface of tools , One is to write your own scripts for interface testing .
Focus on using python+requests Script to carry on the mobile phone app Interface test with wechat applet
Two 、 Use python+requests Conduct app Interface test with wechat applet
Scripting and testing web It's the same , The only thing that changed is header In header request User-Agent The parameter needs to be changed to the mobile phone request .
This is the request to visit Baidu mobile phone terminal .
3、 ... and 、 Use interface testing tools to do app Interface test with wechat applet
Same change header In the header request user-agent Parameters , The two requests are simulated separately Android and iOS, You can choose from your own situation .
choice Android Request access
This is it. app And wechat applet interface test two methods