Since all the manipulation with URLs should be done via java.net.URL class, you can use utilities in URLUtils to build new URLs from the specific context.
For example you can build new URL from test's contextPath and the relative URL obtained from page.