Get text (token) and delete the exclamation mark at beginning and at end

“eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIzNTU1ZWFjNi1hYmUwLTQ4M2EtYWIyMi1hZjIxNGExZjJlNWYiLCJpYXQiOjE1NzY3NjE2NTMsImV4cCI6MTU3Njg0ODA1M30.B5uWkUMsNFsJIAqoOSqamGTtLnqw6hIKU8Vc9Diq4lyPRD3VB0JWMOtVB-DxBJouiZXZvGwIn4Bv4S39X8rsbQ”

Focus on how to delete the exclamation mark ( " ) at beginning and at end

result = WebUI.getText(findTestObject('Page_Swagger UI/span_token'))

WebUI.navigateToUrl('http://online-wave.tst.kinet.local/login?token=+' + result + '&shift-id=64464d79-2217-4674-8920-3f2e95152aed&pos-client-id=1&store-id=101271')

Well… you can just simple remove them with substring

result = result.substring(1); // Removes the first character
result = result.substring(0, result.length() - 1); // Removes the last character
or combine…
result = result.substring(1, result.length() - 1); // Removes first and last character

2 Likes

Thanks bro