config: inputs: # here we define input variables that we can change in ASM - name: "inputsTestVar" default: "/vod/999/example(999).ism/example(999).m3u8" externalfiles: # we can declare external files that we want to be added to the zip file that results from running ZebraCLI e.g host files - path: "test1014.yml" # the relative path to the file (inside the yml folder) javaoption: "addtoclasspath" # declare possible java options like classpath and xbootclasspath nextproxy: httphost: "zebracli.zebracli.zebracli" httpport: "7997" httpcachedisabled: "false" httpshost: "" httpsport: "" authusername: "" authpassword: "" nonextproxy: "" variables: - timestamp: as: "time111" - random: as: "ran111" from: 3 to: 100 leadingZeroes: false - javaproperty: key: "testJavaKey" value: "testJavaValue" as: "java11" inputfiles: - path: "testInputFile1.csv" fields: - "testfield" order: "sequential" scope: "global" eof: "close" - path: "testInputFile2.csv" fields: - "testfield2" scenarios: # we can define multiple scenarios in 1 yml file if we want to - name: "TV_Test_iosE789" # in this case we have only 1 scenario, this is the name of the scenario flow: - page: # URLs need to be attached to pages, if a p age is not defined, then one is automatically created name: "FirstPage" # name of the page thinktime: 6000 - transaction: transactionname: "Trans1" flow: - post: # HTTP method goes here url: "http://zebracli.zebracli.zebracli" # this is an example of using a relative URL json: # the post payload client: "tv-ios" password: "hunter2" username: "test.example" capture: # signifies the targetion of a variable from the source below - header: target: "header name" as: "abc" - cookie: target: "cookie name" as: "def" - cookie: target: "cookie name" as: "ghi" - post: # HTTP method goes here form: - key: "testMultipart" value: "testMultiPartValue" url: "http://zebracli.zebracli.zebracli" # this is an example of using a relative URL - loop: loopname: "Loop1" count: 3 flow: - page: name: "DRM" - get: url: "http://zebracli.zebracli.zebracli" headers: # signifies the adding or updating of a header field Authorization: "{{inputsTestVar}}" # variables go inside curly brackets - page: name: "Manifest" - get: capture: - header: target: 'x-cdn-forward' as: 'cdncompare' assert: # allow both 302 and 200 because the cdn can change - status: codes: - 200 - 302 - text: string1: "test" operand: "1" string2: "test2" onfail: "continue" after: - inline: code: | isakamai = strCompareIgnoreCase(cdncompare,"Akamai") IF isakamai THEN Location = getHTTPResponseHeaderField("Location") temp1 = strSplit(Location,"\\/vod") temp2 = temp1(1) temp3 = strSplit(temp2,"https:\\/\\/") cdnforward = temp3(2) ELSE cdnforward = "lbs-usp-hls-vod.cmore.se" ENDIF input: - '{{testVarInlineAfterInput1}}' output: - '{{testVarInlineAfterOutput1}}' before: - inline: code: | isakamai = strCompareIgnoreCase(cdncompare,"Akamai") IF isakamai THEN Location = getHTTPResponseHeaderField("Location") temp1 = strSplit(Location,"\\/vod") temp2 = temp1(1) temp3 = strSplit(temp2,"https:\\/\\/") cdnforward = temp3(2) ELSE cdnforward = "lbs-usp-hls-vod.cmore.se" ENDIF input: - '{{testVarInlineBeforeInput1}}' output: - '{{testVarInlineBeforeOutput1}}' url: "http://zebracli.zebracli.zebracli/{{inputsTestVar}}" - get: capture: - regex: target: '([a-zA-Z0-9\(\)\_]+-audio_eng=[a-zA-Z0-9\(\)\_]+-video_eng=.*m3u8)' as: "submanifest_url" - xpath: target: 'test' as: "xpath_test" - json: target: 'jsonstring' as: "json_target" url: "http://zebracli.zebracli.zebracli" - page: name: "Submanifest" - get: capture: - boundary: leftboundary: "leftTest" rightboundary: "rightTest" as: 'boundaryVar' - regex: target: '(.*\.ts?)' occurrence: 1 as: 'regexVar' - header: target: "headerName" as: "headerVar" url: "http://zebracli.zebracli.zebracli" - page: name: "Segments" - loop: flow: - page: name: "testPagex" - transaction: transactionname: "testTransactionx" flow: - post: url: "http://zebracli.zebracli.zebracli/{{segment_loop_Item}}" body: "

Hello, World!

" before: - inline: code: | print("test") input: - '{{testVarInlineBeforeInput2}}' output: - '{{testVarInlineBeforeOutput2}}' - plugin: file: "addNumbers.class" output: - "testvaroutput" input: - "testvarinput" after: - inline: code: | print("test") input: - '{{testVarInlineAfterInput2}}' output: - '{{testVarInlineAfterOutput2}}' - plugin: output: - "testvaroutput2" input: - "testvarinput2" file: "addNumbers.class" - get: url: "http://zebracli.zebracli.zebracli" - get: # the "segment_loop_Item" part of the url is replaced with a segment defined in the "over" list after: - inline: code: | print("test") input: - '{{testVarInlineAfterInput3}}' output: - '{{testVarInlineAfterOutput3}}' before: - inline: code: | print("test") input: - '{{testVarInlineBeforeInput3}}' output: - '{{testVarInlineBeforeOutput3}}' url: "http://zebracli.zebracli.zebracli" - page: name: "testPagey" loopname: "segment_loop" over: # the loop iterates once over each item in the "over" list - "{{boundaryVar}}" - "{{regexVar}}" - "{{headerVar}}"