Automation 根据当前活动的测试用例设置变量

Automation 根据当前活动的测试用例设置变量,automation,robotframework,Automation,Robotframework,我有以下情况。机器人是我的机器人套件,有4个测试用例 ***Settings** Resource Python Resource files Suite Setup ${xyz} Suite Teardown ${xyz} Test Setup ${Xyz} ***Variables*** /*This is pointing to the folder with my data files*/ ${data} {CURDIR}/ *** Test Cases **

我有以下情况。机器人是我的机器人套件,有4个测试用例

***Settings**

Resource  Python Resource files


Suite Setup  ${xyz}
Suite Teardown  ${xyz} 

Test Setup  ${Xyz}

***Variables***

/*This is pointing to the folder with my data files*/
${data}  {CURDIR}/


*** Test Cases ***

Test_case1
Test_case2
Test_case3 
Test_case4
我有一个文件夹目录 1.测试案例1 2.测试用例2 3.测试用例3 4.测试用例4 test.robot(我的机器人套件)

上述4个文件夹中有我的测试(测试用例1、测试用例2、测试用例3、测试用例4)在运行时将访问的数据文件。我不知道如何设置变量,使其在运行test.robot套件时动态访问特定的测试文件夹

我的意思是,当我运行test.robot时,所有四个测试(test_case1、test_case2等)都将运行。我不确定如何设置变量${data},使其在特定测试用例运行时动态访问正确的测试用例文件夹

您可以使用
${test NAME}
检索当前活动测试用例的名称,并使用从该变量提取的数据设置您自己的变量