It is required to check the work of several applications, but first you need to pass authorization. The tape with cartridges is as follows:

  • GET (cookie)
  • POST (cookie)
  • Get

For authorization, for now, we take one user, but there was a desire to take it from an external file or database (I suppose you need to re-read the TANK API). As I understand it, ammo type requests are required, but I constantly receive a lot of errors, and the instruction does not answer the questions posed.

/admin/login 238 [User-Agent: Yandex-tank] [Connection: close] [Accept-Encoding:gzip,deflate] POST /admin/login Content-Type: application/x-www-form-urlencoded utf8=%E2%9C%93&authenticity_token=TiWu%2BOVx%2FQ53QSha9ecFv31bfncvPndp0b1gT7zKuHJeS7sndEyyN%2B3Pp6EzXp4PwTQyeSu3guDgCIAAx%2FIhwg%3D%3D&admin_user%5Bemail%5D=XXX@XXX\r\n 

The question is how to create cartridges for the GET / POST sequence and work with cookies?

    1 answer 1

    To get a cookie, we usually go in advance for authorization to the service received by the cookie in the cartridges in the Cookie header. This can be done using curl or viewed in the browser in the console developer.

    If you shoot a phantom - the tank itself will not be able to log in. it is impossible to generate a subsequent request based on the response to the previous one, the entire cartridge belt is generated in advance before shooting.

    If you need scripts to generate queries on the fly, use JMeter or BFG .

    I did not understand what kind of cartridge format you are trying to use. If this is the request style , then the tape should look like ordinary HTTP requests written to a file sequentially with the size of each:

     73 good GET / HTTP/1.0 Host: xxx.tanks.example.com Cookie: <authorization cookie> User-Agent: xxx (shell 1) 77 bad GET /abra HTTP/1.0 Host: xxx.tanks.example.com Cookie: <authorization cookie> User-Agent: xxx (shell 1) 78 unknown GET /ab ra HTTP/1.0 Host: xxx.tanks.example.com Cookie: <authorization cookie> User-Agent: xxx (shell 1)