4

The page object I have is the result of a long chain of click() calls (just in case you were wondering how I could have a page object without knowing the URL used to obtain it).

  • The method HtmlPage.getDocumentURI is not implemented.
  • HtmlPage.getOwnerDocument returns null.
  • page.executeJavaScript("return document.location").getJavaScriptResult() also returns null.

Any hints?

pdc
  • 2,314
  • 20
  • 28

2 Answers2

2
page.getUrl()

worked fine for me.

Gamer1120
  • 236
  • 1
  • 8
2

The answer is of course to realize that executeJavaScript should have been called evalJavaScript, and write something like

page.executeJavaScript("document.location").getJavaScriptResult()
pdc
  • 2,314
  • 20
  • 28