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.

hostname as variable

rj412rj412 Members
edited November -1 in Sahi - Open Source
can somebody advise how to obtain/set the hostname then slice it to remove https://

var $hostname = <_getHostname>.<thenSliceTheHttp:> ;
if ( $hostname == "sahi.co.in/w/" ) DoThis ();
else DoThat();

Thanks

Comments

  • narayannarayan Administrators
    Hi rj412

    To remove https:// you could just do

    var $url = "";
    _set($url, location.href);
    var $modified = $url.replace("https://", "")

    if ( $modified == "sahi.co.in/w/" ) DoThis ();
    else DoThat();

    Regards,
    Narayan
  • rj412rj412 Members
    thanks - that worked
This discussion has been closed.