18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

Java+Sahi getting browser information e.g. current URL

jameztccjameztcc Members
edited November -1 in Sahi - Open Source
Hi,

how do I use "_set($endURL, window.document.location.href);" in the Java sample? I learned how to click, navigate and fill in forms but now wish to know how to get the browser's information such as what is the current URL it's on to pass it to another function.


thanks a lot,
James Tan

Comments

  • Hi, I managed to find after reading the javadocs about a DOM feature.

    " String newurl = browser.fetch("window.location.href");
    System.out.println(newurl);"

    It works for me, is this proper?

    thanks a lot,
    James Tan
  • narayannarayan Administrators
    Absolutely!
Sign In or Register to comment.