Strange bug where <string>.replace(...) does not work.
In one of my scripted assertion I need to replace a substring with another value. For some strange reason that doesn't work:
My expression reads:
${=context.endpoint.replace("http","https")}
... but for some odd reason the resulting link still starts with "http://" instead of "https://" ?!?
To debug this I tried the following:
endpoint: ${=context.endpoint} result1: ${=context.endpoint.replace("http","https")}
result2: ${=context.endpoint.replace('http','https')}
but the result still reads:
endpoint: http://chbbatscsoa01:9895/references_v2.0.0
result1: http://chbbatscsoa01:9895/references_v2.0.0
result2: http://chbbatscsoa01:9895/references_v2.0.0
According to the docs, both arguments of the replace()-method are simple strings (i.e. no reg. exps. or such), so why does this simple replace(...) not work? What am I missing here???
When I tried again today for some reason the original
${=context.endpoint.replace('http','https')}
suddenly worked!
Beats me, why this was not properly handled last time! Really weird!