If the URL will always be the same size, then you can parse it using the “substring(startPosition, endPosition)” function, such as myUrl.substring(47, 79)
.
def myUrl = WebUI.getUrl()
def myContents = myUrl.substring(47, 79)
WebUI.comment("your contents are ${myContents}")
If the URL may not always be the same size, then you can try parsing it with the split("/")
function, such as myUrl.split("/")[5]
def myUrl = WebUI.getUrl()
def myContents = myUrl.split("/")[5]
WebUI.comment("your contents are ${myContents}")
the 5 means we want the 6th item of the array that the split() creates (I think it’s the sixth we want) because the counting of arrays starts at zero.