0

我正在尝试将令牌和 cookie 传递给我的脚本。当我尝试使用 Taurus 运行它时,出现以下错误:

错误:配置错误:您必须指定 JMX 文件或请求列表才能运行 JMeter

如何在我的脚本中传递令牌和 cookie?

这是脚本:


execution:
- concurrency: 100
  ramp-up: 1m
  hold-for: 2m
  scenario: sample

scenarios:
  sample :
    headers:
      Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp'
      Cookie: 'yourAuthCookie=48DEDbhjbhj08F4A918C1813ADDD9A9C603E4AE1F6648CEA7025CAA676839B72FCE955512C03B86348285307C53385D9C5746BBB8A8F00C6DCCB42A8DAA77DF474F2115B81EEFB3C340B5299A8EF147FC2B9DDE9D488DF96DE3672977D2573A5BCD02C1FDB0A535BBA37FAFF3E4666D'
      token: 'SHIvSkp1TQWswT0Z5WjMwM nvhjvjh1F2NHJWODRUZ3ZPVjcyUGhZQ2ljQ3cyNnFpTFlDaG9UbnRycEE5dDVsd1JmNkdubklISXJhWHgyZkJFS3FUSWtBalE9PQ=='
      requests:
        -'https://www.ericsson.com/umbraco/api/snip/GetUserSessions'
      method: GET

4

1 回答 1

0

正确的语法是:

execution:
  - concurrency: 100
    ramp-up: 1m
    hold-for: 2m
    scenario: sample

scenarios:
  sample:
    requests:
      - url: 'https://www.ericsson.com/umbraco/api/snip/GetUserSessions'
        method: GET
        headers:
          Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp'
          Cookie: 'yourAuthCookie=48DEDbhjbhj08F4A918C1813ADDD9A9C603E4AE1F6648CEA7025CAA676839B72FCE955512C03B86348285307C53385D9C5746BBB8A8F00C6DCCB42A8DAA77DF474F2115B81EEFB3C340B5299A8EF147FC2B9DDE9D488DF96DE3672977D2573A5BCD02C1FDB0A535BBA37FAFF3E4666D'
          token: 'SHIvSkp1TQWswT0Z5WjMwM nvhjvjh1F2NHJWODRUZ3ZPVjcyUGhZQ2ljQ3cyNnFpTFlDaG9UbnRycEE5dDVsd1JmNkdubklISXJhWHgyZkJFS3FUSWtBalE9PQ=='

当您运行bzt test.yaml -gui它时,它将进入以下 JMeter测试计划

在此处输入图像描述

更多信息:

于 2019-09-27T08:57:46.420 回答