Trying to parameterize a section of the URI Path in karate

Viewed 42

This is my first time trying out Karate.

I have a URI - Eq -https://xxxx.xxx.com:8643/xxx/xxx/xxx/xxxx/xxx/xxxxx/{equipmentNumber}/xxxx

I want to parametrize only equipmentNumber in this path. How do I do it?.

1 Answers

Here you go:

* def equipmentNumber = 'foo'
* url 'https://xxxx.xxx.com:8643/xxx/xxx/xxx/xxxx/xxx/xxxxx'
* path equipmentNumber, 'xxxx'

Or:

* url 'https://xxxx.xxx.com:8643/xxx/xxx/xxx/xxxx/xxx/xxxxx/' + equipmentNumber + '/xxxx'

There are many options. Read the docs.

Related