Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Api 要在karateDSL方案中以相同路径传递多个URL吗_Api_Karate - Fatal编程技术网

Api 要在karateDSL方案中以相同路径传递多个URL吗

Api 要在karateDSL方案中以相同路径传递多个URL吗,api,karate,Api,Karate,我将在后台为每个URL路径传递的多个URL应该运行场景 背景: * header Authorization = call read('basic-auth.js') { username: 'admin', password: 'admin' } * header Authorization = call read('basic-auth.js') { username: 'admin', password: 'admin' } Scenario: Creates the w

我将在后台为每个URL路径传递的多个URL应该运行场景

背景:

 * header Authorization = call read('basic-auth.js') { username: 'admin', password: 'admin' }
  * header Authorization = call read('basic-auth.js') { username: 'admin', password: 'admin' }

    Scenario: Creates the webservices api page

    Given path 'rest/activescript/about'
    When method get
    Then status 200
    * def B = response
    * print B
背景:

 * header Authorization = call read('basic-auth.js') { username: 'admin', password: 'admin' }
  * header Authorization = call read('basic-auth.js') { username: 'admin', password: 'admin' }

    Scenario: Creates the webservices api page

    Given path 'rest/activescript/about'
    When method get
    Then status 200
    * def B = response
    * print B

<强>实际结果:背景中的最后一个URL会在场景中考虑执行< /P>


预期结果:后台的所有Url都应在不同的场景下运行

以下内容应能正常工作。虽然我不确定是否建议这样做。url通常在整个运行过程中在karate-config.js中定义

Scenario Outline: Scenario called multiple times
    * url '<newUrl>'
    * header Authorization = call read('basic-auth.js') { username: 'admin', password: 'admin' }
    Given path 'rest/activescript/about'
    When method get
    Then status 200
    * def B = response
    * print B

    Examples:
    |newUrl                                           |
    |URL1|
    |URL2 |
场景大纲:多次调用场景
*url“”
*header Authorization=call read('basic-auth.js'){username:'admin',password:'admin'}
给定路径“rest/activescript/about”
当方法得到
然后状态200
*def B=响应
*打印B
示例:
|新网址|
|URL1|
|URL2|

是的,它的工作方式几乎没有修改*url'',我将在karate-config.js中检查相同的内容