标签:
格式有问题想占个标题,后面会修正后详细介绍
<?xml version="1.0" encoding="utf-8"?> <VaneLife_V1><!-- 基本规则,节点名首字母大写,属性首字母小写 --> <ScriptRunTime> <RunTimeParameter> <!-- 该项的内容可以被case结果修改或新增 并与【RunTimeStaticData】里的内容 一起被用做参数化操作,要使用初始化必须指定isHaveParameters="true" 使用格式如
XXXXX*#name*#XXXXXX ,脚本中的*#name*#将被替换为相应的数据--> <NewParameter name="appid1">appid1</NewParameter><!-- name值务必不要使用=,+,-这3个字符结尾开头(该值开头的参数被工具保留) --> <NewParameter name="appid2">appid2</NewParameter> </RunTimeParameter> <RunTimeActuator> <NewActuator name="httpApi" protocol="vanelife_http"><!-- 必须含有name及protocol属性 --><!-- 不填 将默认为空 --> <dev_key>405E6D199E33596E4CE04B6417B8A267</dev_key> <dev_secret>405E6D199E33596E4CE04B6417B8A267</dev_secret> <default_url>http://api.vanelife.com/v1/</default_url> </NewActuator> <NewActuator name="httpApi2" protocol="vanelife_http"> <dev_key></dev_key> <dev_secret></dev_secret> <default_url></default_url> </NewActuator> <NewActuator name="http" protocol="http"> <default_url>http://www.baidu.com/</default_url> </NewActuator> <NewActuator name="telnet1" protocol="telnet"> <login>admin</login> <password>admin</password> <default_ip>192.168.1.101</default_ip> <default_port>23</default_port> </NewActuator> <NewActuator name="telnet2" protocol="telnet"> <login>admin</login> <password>admin</password> <default_ip>192.168.1.102</default_ip> <default_port>23</default_port> </NewActuator> <NewActuator name="COM1" protocol="comm"> <portName>COM1</portName> <encoding>GB2312</encoding> <baudRate>9600</baudRate> </NewActuator> </RunTimeActuator> <RunTimeStaticData><!-- type当前支持index / random / time 如果参数错误不会被抛弃将被强行修正为默认值 (name请勿与RunTimeParameter同名,否则执行器将使用
RunTimeParameter的值)--><!-- 使用时可以在尾部添加=标识取上一个值 --> <NewStaticData name="StaticData" type="index">1-100</NewStaticData><!-- 范围必须在0到2147483647之间,使用-连接且只能连接一次 --> <NewStaticData name="StaticData0" type="index">1-1000</NewStaticData> <NewStaticData name="StaticData1" type="random">10-6</NewStaticData><!-- 使用-连接2个数字,第一个标识字符串长度,第个标识类型 0-是有可见ASCII / 1-数字
/ 2-大写字母 / 3-小写字母 / 4-特殊字符 / 5-大小写字母 / 6-字母和数字 --> <NewStaticData name="StaticData2" type="time"><!-- 当前时间,时间格式支持DateTimeFormatInfo ,如不了解可以填空,示例"yyyy-MM-ddTHH:mm:ss" --> </NewStaticData> </RunTimeStaticData> </ScriptRunTime> <Project id="1000010001" name="Project device/active" remark="device_sn测试"> <Case id="1000010001" remark="case备注"> <!-- Case根下若出现非法重复节点,将取第一个 ,重复Case将被抛弃--> <Content protocol="vanelife_http" actuator="httpApi"> <!-- 必须元素,protocol及actuator属性也必须指定,其子节点【ContentData】同为必要元素 --> <ContentData target="device/active"
isHaveParameters="true">access_id=FD3318A540AA14292757218592220CFD&ep_id=VaneTest0005&dp_id=1</ContentData><!-- 可以使用【isHaveParameters】,target为
必要属性,如果没有强制为“” --> <HttpConfig httpMethod="POST"><!-- 如不含以下特殊描述该项可不含有,默认使用POST,该项节点如不需要皆可省略 --> <AisleConfig> <HttpAddress>http://api.vanelife.com/v1/</HttpAddress><!-- 可以使用【isHaveParameters】 --> <HttpDataDown>123</HttpDataDown><!-- 可以使用【isHaveParameters】 这里的路径及下文中的路径如无特殊说明全部使用相当路径,于程序运行目录下的
testData\下(如果用@开头则强制使用绝对路径)--> </AisleConfig> <HttpMultipart><!-- 【MultipartData】,【MultipartFile】不能同时出现,若同时出现将只取MultipartData,name及filename为Multipart相应属性描述 --> <MultipartData name="dp_data" filename="123">{"door":true}</MultipartData><!-- 不可以使用【isHaveParameters】,name,filename不存在则默认为空“”
--> <MultipartFile name="dp_data" filename="123">path</MultipartFile><!-- 不可以使用【isHaveParameters】 --> </HttpMultipart> </HttpConfig> </Content> <Expect method="is"> <!-- 可以使用【isHaveParameters】 method 若你不存在即表示为is ,如果不含有该项即表示断言为default 即无条件通过,可使用的断言
【default/is/not/like/endwith/startwith/contain/uncontain】--> </Expect><!-- 内容中[or],[and]为保留字段标识或且,/is断言看含[or]/endwith,starwith断言可含[or]/contain,uncontain可含[or]或and--> <Action><!-- goto retry stop alarm continue --> <Pass action="goto">P100001C10001</Pass> <Fail action="retry">10</Fail> </Action> <Attribute> <ParameterSave> <NewParameter name="myDevId_1" mode="json">dev_id</NewParameter><!-- json xml str 值不能为空“”--> <NewParameter name="myAppId_1" mode="json">app_id</NewParameter> </ParameterSave> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000100001" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/update_status" isHaveParameters="true">device_sn=ZkTest000001&device_status={"online":true}</ContentData> </Content> <Expect method="is"> </Expect> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000100002" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/get_status"
isHaveParameters="true">access_id=29F55306F9546A19D8A98F95595C6B8B&ep_id=ZkTest000001&dp_id=1</ContentData> </Content> <Expect method="contain">"online":true</Expect> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000100003" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="datapoint/publish"
isHaveParameters="true">access_id=29F55306F9546A19D8A98F95595C6B8B&ep_id=ZkTest000001&dp_id=1</ContentData> <HttpConfig httpMethod="POST"> <HttpMultipart name="dp_data"> <MultipartData name="dp_data" filename="123">{"door":true}</MultipartData> </HttpMultipart> </HttpConfig> </Content> <Expect method="contain"></Expect> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000100004" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="datapoint/publish"
isHaveParameters="true">access_id=29F55306F9546A19D8A98F95595C6B8B&ep_id=ZkTest000001&dp_id=1</ContentData> <HttpConfig httpMethod="POST"> <HttpMultipart > <MultipartFile name="dp_data" filename="123">fileToUp\path</MultipartFile> </HttpMultipart> </HttpConfig> </Content> <Expect method="is"></Expect> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000100005" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/get_info" isHaveParameters="true">access_id=FD3318A540AA14292757218592220CFD</ContentData> <HttpConfig httpMethod="GET"> <AisleConfig> <HttpDataDown isHaveParameters="true" >fileToDown\123</HttpDataDown> </AisleConfig> </HttpConfig> </Content> <Expect method="contain">保存</Expect> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000100006" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/get_info" isHaveParameters="true">access_id=FD3318A540AA14292757218592220CFD</ContentData> <HttpConfig httpMethod="GET"> <AisleConfig> <HttpDataDown isHaveParameters="true" >fileToDown\123_*#StaticData2*#</HttpDataDown> </AisleConfig> </HttpConfig> </Content> <Expect method="contain">保存</Expect> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000100007" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/get_info" isHaveParameters="true">access_id=FD3318A540AA14292757218592220CFD</ContentData> <HttpConfig httpMethod="GET"> <AisleConfig> <HttpDataDown isHaveParameters="true" >fileToDown\123</HttpDataDown> </AisleConfig> </HttpConfig> </Content> <Expect method="contain">保存</Expect> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000100008" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/get_info" isHaveParameters="true">access_id=FD3318A540AA14292757218592220CFD</ContentData> <HttpConfig httpMethod="GET"> <AisleConfig> <HttpDataDown isHaveParameters="true" >fileToDown\123_*#StaticData0*#</HttpDataDown> </AisleConfig> </HttpConfig> </Content> <Expect method="contain">保存</Expect> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000100009" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="datapoint/publish" >access_id=29F55306F9546A19D8A98F95595C6B8B&ep_id=ZkTest000001&dp_id=1</ContentData> <HttpConfig httpMethod="POST"> <HttpMultipart name="dp_data"> <MultipartData name="dp_data" filename="123">{"door":*#StaticData1*#}</MultipartData> </HttpMultipart> </HttpConfig> </Content> <Expect method="is"></Expect> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000100010" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="datapoint/publish" >access_id=29F55306F9546A19D8A98F95595C6B8B&ep_id=ZkTest000001&dp_id=1</ContentData> <HttpConfig httpMethod="POST"> <HttpMultipart name="dp_data"> <MultipartData name="dp_data" filename="123" isHaveParameters="true">{"door":*#StaticData1*#}</MultipartData> </HttpMultipart> </HttpConfig> </Content> <Expect method="is"></Expect> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000010002" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="datapoint/publish"
isHaveParameters="true">access_id=FD3318A540AA14292757218592220CFD&ep_id=VaneTest0005&dp_id=1</ContentData> <HttpConfig httpMethod="POST"> <AisleConfig> <HttpAddress> </HttpAddress> <HttpDataDown> </HttpDataDown> </AisleConfig> <HttpMultipart > <MultipartData name="dp_data" filename="123">{"door":true}</MultipartData> <MultipartFile name="dp_data" filename="123">path</MultipartFile> </HttpMultipart> </HttpConfig> </Content> <Expect method="is"> </Expect> <Attribute> <ParameterSave> <NewParameter name="myDevId_1" mode="json">dev_id</NewParameter> <NewParameter name="myAppId_1" mode="json">app_id</NewParameter> </ParameterSave> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000010003" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/active"
isHaveParameters="true">access_id=FD3318A540AA14292757218592220CFD&ep_id=VaneTest0005&dp_id=1</ContentData> <HttpConfig httpMethod="POST"> <AisleConfig> <HttpAddress> </HttpAddress> <HttpDataDown> </HttpDataDown> </AisleConfig> <HttpMultipart > <MultipartData name="dp_data" filename="123">{"door":true}</MultipartData> <MultipartFile name="dp_data" filename="123">path</MultipartFile> </HttpMultipart> </HttpConfig> </Content> <Expect method="is"> </Expect> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Repeat remark="备注" times="2"> <Case id="1000020001" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/list_ep" isHaveParameters="true">access_id=2966E520EA90DCCB605CD9ED9C0E0592</ContentData> </Content> <Expect method="contain">ZkTest000001</Expect> <Action> <Pass action="goto">P1000010002C1000010001</Pass> </Action> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Repeat remark="备注" times="10"> </Repeat> <Repeat remark="备注" times="50"> <Case id="1000030001" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/list_ep" isHaveParameters="true">access_id=2966E520EA90DCCB605CD9ED9C0E0592</ContentData> </Content> <Expect method="contain">ZkTest000001</Expect> </Case> <Case id="1000030002" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/list_ep" isHaveParameters="true">access_id=2966E520EA90DCCB605CD9ED9C0E0592</ContentData> </Content> <Expect method="contain" isHaveParameters="true"> ZkTest000001[or]ZkTest000002 </Expect> </Case> <Case id="1000030003" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/list_ep" isHaveParameters="true">access_id=2966E520EA90DCCB605CD9ED9C0E0592</ContentData> </Content> <Expect method="contain">ZkTest000001</Expect> </Case> </Repeat> <Case id="1000020002" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/list_ep" isHaveParameters="true">access_id=2966E520EA90DCCB605CD9ED9C0E0592</ContentData> </Content> <Expect method="contain" isHaveParameters="true"> ZkTest000001[or]ZkTest000002 </Expect> <Action> <Fail action="stop"> </Fail> </Action> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000020003" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/list_ep" isHaveParameters="true">access_id=2966E520EA90DCCB605CD9ED9C0E0592</ContentData> </Content> <Expect method="contain">ZkTest000001</Expect> </Case> </Repeat> <Case id="1000010004" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/active"
isHaveParameters="true">access_id=FD3318A540AA14292757218592220CFD&ep_id=VaneTest0005&dp_id=1</ContentData> <HttpConfig httpMethod="POST"> <AisleConfig> <HttpAddress> </HttpAddress> <HttpDataDown> </HttpDataDown> </AisleConfig> <HttpMultipart > <MultipartData name="dp_data" filename="123">{"door":true}</MultipartData> <MultipartFile name="dp_data" filename="123">path</MultipartFile> </HttpMultipart> </HttpConfig> </Content> <Expect method="is"> </Expect> <Action> <Pass action="goto">P100001C10001</Pass> <Fail action="XXXXX"> </Fail> </Action> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000010005" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/active"
isHaveParameters="true">access_id=FD3318A540AA14292757218592220CFD&ep_id=VaneTest0005&dp_id=1</ContentData> <HttpConfig httpMethod="POST"> <AisleConfig> <HttpAddress> </HttpAddress> <HttpDataDown> </HttpDataDown> </AisleConfig> <HttpMultipart > <MultipartData name="dp_data" filename="123">{"door":true}</MultipartData> <MultipartFile name="dp_data" filename="123">path</MultipartFile> </HttpMultipart> </HttpConfig> </Content> <Expect method="default">19</Expect> <Action> <Pass action="goto">P1000010002C1000010001</Pass> <Fail action="retry"> </Fail> </Action> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000010006" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/active"
isHaveParameters="true">access_id=FD3318A540AA14292757218592220CFD&ep_id=VaneTest0005&dp_id=1</ContentData> <HttpConfig httpMethod="POST"> <AisleConfig> <HttpAddress> </HttpAddress> <HttpDataDown> </HttpDataDown> </AisleConfig> <HttpMultipart > <MultipartData name="dp_data" filename="123">{"door":true}</MultipartData> <MultipartFile name="dp_data" filename="123">path</MultipartFile> </HttpMultipart> </HttpConfig> </Content> <Expect method="is"> </Expect> <Action> <Pass action="goto">P1000010002C10001</Pass> <Fail action="retry">19</Fail> </Action> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000010007" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/active"
isHaveParameters="true">access_id=FD3318A540AA14292757218592220CFD&ep_id=VaneTest0005&dp_id=1</ContentData> <HttpConfig httpMethod="POST"> <AisleConfig> <HttpAddress> </HttpAddress> <HttpDataDown> </HttpDataDown> </AisleConfig> <HttpMultipart > <MultipartData name="dp_data" filename="123">{"door":true}</MultipartData> <MultipartFile name="dp_data" filename="123">path</MultipartFile> </HttpMultipart> </HttpConfig> </Content> <Expect method="is"> </Expect> <Action> <Pass action="goto">P1000010002C10001</Pass> <Fail action="alarm">发现错误</Fail> </Action> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> </Project> <Project id="1000010002" name="Project device/active" remark="device_sn测试"> <Case id="1000010001" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/active"
isHaveParameters="true">access_id=FD3318A540AA14292757218592220CFD&ep_id=VaneTest0005&dp_id=1</ContentData> <HttpConfig httpMethod="POST"> <AisleConfig> <HttpAddress> </HttpAddress> <HttpDataDown> </HttpDataDown> </AisleConfig> <HttpMultipart > <MultipartData name="dp_data" filename="123">{"door":true}</MultipartData> <MultipartFile name="dp_data" filename="123">path</MultipartFile> </HttpMultipart> </HttpConfig> </Content> <Expect method="is"> </Expect> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000010002" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/active"
isHaveParameters="true">access_id=FD3318A540AA14292757218592220CFD&ep_id=VaneTest0005&dp_id=1</ContentData> <HttpConfig httpMethod="POST"> <AisleConfig> <HttpAddress> </HttpAddress> <HttpDataDown> </HttpDataDown> </AisleConfig> <HttpMultipart > <MultipartData name="dp_data" filename="123">{"door":true}</MultipartData> <MultipartFile name="dp_data" filename="123">path</MultipartFile> </HttpMultipart> </HttpConfig> </Content> <Expect method="is"> </Expect> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000010003" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/active"
isHaveParameters="true">access_id=FD3318A540AA14292757218592220CFD&ep_id=VaneTest0005&dp_id=1</ContentData> <HttpConfig httpMethod="POST"> <AisleConfig> <HttpAddress> </HttpAddress> <HttpDataDown> </HttpDataDown> </AisleConfig> <HttpMultipart > <MultipartData name="dp_data" filename="123">{"door":true}</MultipartData> <MultipartFile name="dp_data" filename="123">path</MultipartFile> </HttpMultipart> </HttpConfig> </Content> <Expect method="is"> </Expect> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Repeat remark="备注" times="100"> <Case id="1000020001" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/list_ep" isHaveParameters="true">access_id=2966E520EA90DCCB605CD9ED9C0E0592</ContentData> </Content> <Expect method="contain">ZkTest000001</Expect> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000020002" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/list_ep" isHaveParameters="true">access_id=2966E520EA90DCCB605CD9ED9C0E0592</ContentData> </Content> <Expect method="contain" isHaveParameters="true"> ZkTest000001[or]ZkTest000002 </Expect> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Case id="1000020003" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/list_ep" isHaveParameters="true">access_id=2966E520EA90DCCB605CD9ED9C0E0592</ContentData> </Content> <Expect method="contain">ZkTest000001</Expect> </Case> </Repeat> <Case id="1000010004" remark="case备注"> <Content protocol="vanelife_http" actuator="httpApi"> <ContentData target="device/active"
isHaveParameters="true">access_id=FD3318A540AA14292757218592220CFD&ep_id=VaneTest0005&dp_id=1</ContentData> <HttpConfig httpMethod="POST"> <AisleConfig> <HttpAddress> </HttpAddress> <HttpDataDown> </HttpDataDown> </AisleConfig> <HttpMultipart > <MultipartData name="dp_data" filename="123">{"door":true}</MultipartData> <MultipartFile name="dp_data" filename="123">path</MultipartFile> </HttpMultipart> </HttpConfig> </Content> <Expect method="is"> </Expect> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> </Project> <Project id="1000010003" name="Project http" remark="http测试"> <Case id="1000010001" remark="case备注"> <Content protocol="http" actuator="http"> <ContentData target="cityjson">ie=utf-8</ContentData> <HttpConfig httpMethod="GET"> <AisleConfig> <HttpAddress>http://pv.sohu.com/</HttpAddress> </AisleConfig> </HttpConfig> </Content> <Expect method="contain">浙江[or]北京</Expect> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> <Repeat remark="备注" times="2000"> <Case id="1000010002" remark="case备注"> <Content protocol="http" actuator="http"> <ContentData target="cityjson">ie=utf-8</ContentData> <HttpConfig httpMethod="GET"> <AisleConfig> <HttpAddress>http://pv.sohu.com/</HttpAddress> </AisleConfig> </HttpConfig> </Content> <Expect method="contain">浙江[or]北京</Expect> <Attribute> <Delay>100</Delay> <Level>1</Level> </Attribute> </Case> </Repeat> </Project> </VaneLife_V1>
标签:
原文地址:http://www.cnblogs.com/lulianqi/p/4773471.html