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.

when in Chrome browser the _isChrome() and _isSafari() both return

PradeepPradeep Members
edited November -1 in Sahi - Open Source
hi,

Below script that i have executed in Chrome and it displays both "Chrome" later "Safari" in text box. i just want the scrip to return only name.

if(_isIE())
{
_setValue(_textbox("ctl00\$ParticipantContent\$LastNameTextBox"), "IE");
}
if(_isFF())
{
_setValue(_textbox("ctl00\$ParticipantContent\$LastNameTextBox"), "FF");
}
if(_isChrome())
{
_setValue(_textbox("ctl00\$ParticipantContent\$LastNameTextBox"), "Chrome");
}
if(_isSafari())
{
_setValue(_textbox("ctl00\$ParticipantContent\$LastNameTextBox"), "Safari");
}
_wait(5000)

i tried calling it from a suite file still it returns both values.

Chrome v12+
Safari 5.1

thanks,
Pradeep.

Comments

  • narayannarayan Administrators
    Open sahi/htdocs/spr/concat.js, search for
    Sahi.prototype._isSafari = function () {return /Safari/.test(this.navigator.userAgent);};
    

    and change it to
    Sahi.prototype._isSafari = function () {return /Safari/.test(this.navigator.userAgent) && !(/Chrome/.test(this.navigator.userAgent));};
    

    Restart Sahi, and it should work fine. This fix will be available in the next build.

    Thanks,
    Narayan
  • thanks man works fine
This discussion has been closed.