We retry a call until a xPath path expression on the response is a certain value.
Setup server
script | mock xml server setup | ||
add response | 0 response | with status | 200 |
add response | 1 response | with status | 201 |
add response | 2 response | with status | 200 |
add response | 3 response | with status | 203 |
add response | 4 response | with status | 202 |
add response | 5 response | with status | 201 |
add response | 6 response | with status | 299 |
add response | 7 response | with status | 300 |
add response | 8 response | with status | 200 |
add response | 9 response | with status | 300 |
add response | 10 response | with status | 300 |
$url<-[http://127.0.0.1:8000/FitNesseMock] | get mock server url |
script | xml http test | |||
set repeat interval to | 50 | milliseconds | ||
repeat at most | 2 | times | ||
post | 0 request | to | $url->[http://127.0.0.1:8000/FitNesseMock] | |
repeat until xPath | /body | is | 0 response | |
check | response status | 200 | ||
check | xPath | /body | 0 response | |
check | repeat count | 0 | ||
post | 1 request | to | $url->[http://127.0.0.1:8000/FitNesseMock] | |
repeat until xPath | /body | is | 2 response | |
check | response status | 200 | ||
check | xPath | /body | 2 response | |
check | repeat count | 1 | ||
get from | $url->[http://127.0.0.1:8000/FitNesseMock] | |||
repeat until xPath | /body | is | 5 response | |
check | response status | 201 | ||
check | xPath | /body | 5 response | |
check | repeat count | 2 | ||
put | 6 request | to | $url->[http://127.0.0.1:8000/FitNesseMock] | |
check | response status | 299 | ||
repeat until xPath | /body | is | 8 response | |
check | response status | 200 | ||
check | xPath | /body | 8 response | |
check | repeat count | 2 | ||
repeat at most | 1 | times | ||
delete | $url->[http://127.0.0.1:8000/FitNesseMock] | |||
reject | repeat until xPath | /body | is | does not happen |
check | response status | 300 | ||
check | xPath | /body | 10 response | |
check | repeat count | 1 | ||
check | time spent repeating | 59>= 50 |
Stop Server
table: Mock Server Message Report | |||||||||||||||||||||||||||||||||||
|
script | mock xml server setup |
stop |