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.

what is proper usage of isIE9 or any of the browser detection api's?

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

Trying to figure out how to put in the log files which browser it is that I've kicked off.

I tried using the isIE9() as a test to putting into the log files.. currently have:

function onScriptFailure(){
_log(">> In onScriptFailure..ERROR", "error");
}

if (_isIE9()) { _log("Browser Name: IE9", "info");}
else {_log("Browser Name: NOT IE9", "info");}

_setValue(_textbox("uname"), "testuser000");
_setValue(_password("pword"), "123456");
_click(_radio("rb_tkper"));
_click(_submit("Log In"));

_assertNotExists(_submit("Log In"), "ERROR: did not log in correctly");


In the logs I'm getting the following:

Starting script
_sahi.setServerVar('___lastValue___1334061684380', _isIE9()); at Apr 10, 2012 8:41:24 AM
_setValue(_textbox("uname"), "testuser000"); at Apr 10, 2012 8:41:24 AM
...

Is the _sahi.setServerVar output an error?? shouldn't I be getting some kind of actual text string value? Or is there some other way that I'm supposed to interpret this?

Thanks for any help :)

Regards,
Glenn

Comments

  • Hi glenn,

    _sahi.setServerVar is not an error.
    It's sahi's way of interpreting the condition.

    And, there is also nothing wrong in your code.
    Maybe, you just need to set spaces or tabs,
    if (_isIE9()) {
        _log("Browser Name: IE9", "info"); 
    } else { 
        _log("Browser Name: NOT IE9", "info"); 
    }
    
  • I guess one thing I should point out is that I was using Firefox in that test, not ie9. Therefore, why did I not get the text in my log statement but instead got the msg that contained the api, making it look like it was telling me I was using ie9?

    Thanks,
    Glenn
Sign In or Register to comment.