Team,
I am looking to pull a numeric string Id out of a URL after the page loads. Im not quite sure how to leverage Katalon to do this.
Example: www.somegreatwebsite/yourstate/123456678645/mydomain.com
Any feedback is greatly appreciated.
Team,
I am looking to pull a numeric string Id out of a URL after the page loads. Im not quite sure how to leverage Katalon to do this.
Example: www.somegreatwebsite/yourstate/123456678645/mydomain.com
Any feedback is greatly appreciated.
Please try the following test case. You should be able to modify this so that it applies to your target url.
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUIdef url = 'https://weather.yahoo.co.jp/weather/jp/30/'WebUI.openBrowser('')WebUI.navigateToUrl(url)String currentUrl = WebUI.getUrl()String[] urlComponents = currentUrl.split('/')StringBuilder sb = new StringBuilder()for (int i = 0; i < urlComponents.length; i++) { sb.append("${i}: \'${urlComponents[i]}\'\n") }WebUI.comment(sb.toString())WebUI.comment("region code: ${urlComponents[5]}")WebUI.closeBrowser()
Worked perfectly with a bit of tweaking. Thank you!