I have 2 environments (test & uat) and has different domains. test is http://sampletest and uat is http://sampleuat. Stored both the domains in global variables under profiles. suffix urls are same in both the environments. Trying to validate anchor tag urls eg I have Release Notes on the main page. URL would be http://sampletest/Menu/ReleaseNotes. for that i wrote the code like below:
WebElement element = WebUiCommonHelper.findWebElement(findTestObject(‘path to object’), 20)
List urlReleaseNotes = Arrays.asList(element.getAttribute(‘href’))
println(“Release Notes link—>” + urlReleaseNotes)
arrUrlSegments = urlReleaseNotes.split(’/’)
urlSuffix = arrUrlSegments[(arrUrlSegments.length - 1)].replace(‘Menu/ReleaseNotes’, ‘’)
urlToSwitch = (‘GlobalVariable.G_SiteURL’ + urlSuffix)
println(“Release Notes link—>” + urlToSwitch)
Error in console:
groovy.lang.MissingMethodException: No signature of method: java.util.Arrays$ArrayList.split() is applicable for argument types: (java.lang.String) values: [/]
Possible solutions: split(groovy.lang.Closure), split(groovy.lang.Closure), split(groovy.lang.Closure), wait(), sort(), init()
at TC02_Verifying UI.run(TC02_Verifying UI:144)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:339)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:330)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:309)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:301)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:235)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1600353399109.run(TempTestCase1600353399109.groovy:25)
can anyone help me on this?