Simple way to append a baseurl


#1

I have a test case that verifies a header is present on every page of a website. Right now, it navigates to each page individually and verifies, but I need to be able to run this test on multiple environments. I have profiles and baseurls set up as global variables, but I don’t know how to go from

WebUI.navigateToUrl(GlobalVariable.baseurl, FailureHandling.STOP_ON_FAILURE)

which opens, for example, https://facebook.com to opening https://facebook.com/help by somehow combining GlobalVariable.baseurl with /help. That way, I can have a different profile go to https://myspace.com/help without having to make a separate test case because the baseurl is different.

I’ve read through a couple of topics that cover this with complex answers that I’m hoping are now outdated. Is there a straightforward way to do what I’m after?


#2

Actually, the solution was right in front of me but I thought it was too simple to work!

If I add +"/help" it works the way I intended.

WebUI.navigateToUrl(GlobalVariable.baseurl + "/help", FailureHandling.STOP_ON_FAILURE)

#3