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|<body>0 response</body> |with status|200|
|add response|<body>1 response</body> |with status|201|
|add response|<body>2 response</body> |with status|200|
|add response|<body>3 response</body> |with status|203|
|add response|<body>4 response</body> |with status|202|
|add response|<body>5 response</body> |with status|201|
|add response|<body>6 response</body> |with status|299|
|add response|<body>7 response</body> |with status|300|
|add response|<body>8 response</body> |with status|200|
|add response|<body>9 response</body> |with status|300|
|add response|<body>10 response</body>|with status|300|
|add response|<body>11 response</body>|with status|300|
|add response|<body>12 response</body>|with status|300|
|$url=       |get mock server url                     |

*!

|script                |xml http test                                |
|set repeat interval to|50                  |milliseconds            |
|repeat at most        |2                   |times                   |
|post                  |0 request           |to   |$url              |
|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              |
|repeat until xPath    |/body               |is   |2 response        |
|check                 |response status     |200                     |
|check                 |xPath               |/body|2 response        |
|check                 |repeat count        |1                       |
|get from              |$url                                         |
|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              |
|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                                         |
|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|>= 50                   |
|repeat at most        |3                   |times                   |
|repeat until xPath    |/body               |is   |=~/\d2 .+/        |
|check                 |xPath               |/body|12 response       |







!*> Stop Server
|table: Mock Server Message Report|

|script|mock xml server setup|
|stop                        |
*!



