defining a varible with static and dynamic string in karate

Viewed 17
def result = google
  * print  'the domain name is:', result
  * def url1 = 'https://'+result+'.com'
 * print  url1

output

the domain is google
HTTPS:\\"google".com

I am trying to add a dynamic variable in my string, but it added a " before the dynamic string, how can I ignore this?

Thanks for help

1 Answers

This completely depends on what google is and you haven't provided that information. Otherwise it would work properly.

Try this and see:

* def result = 'foo'
* print  'the domain name is:', result
* def url1 = 'https://' + result + '.com'
* print url1

If you are still stuck, follow this process: https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue

Related