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.

how to detect which browser is being used?

bagsmodebagsmode Members
edited April 2012 in Sahi - Open Source
I'd like to have the browser type and version reported to the log file so that I know which browser and version was tested in the case a failure is specific to a browser/version.

EDIT: I see the isIE, is IE9, isFF, etc. .. however you don't have all the versions. For example, for FireFox (FF) I'm currently testing for FF3.6, FF9, FF10 and FF11. I have found functions for isFF, isFF2, isFF3 and isFF4; but nothing for 9, 10, or 11. I would like to know if there is a failure, if it's specific to a particular browser and/or version.

I also see in the Browser.java file in the client directory, that you use BrowserName. Can we somehow access that instead of recreating a case statement using all the isXX API's?

Kind Regards,
Glenn

Comments

  • Hi

    try _alert(_sahi.getDiagnostics()) and evaluate the output to get the used browser.

    Regards
    Wormi
  • There are a number of different smoking cessation support systems available, from nicotine replacement therapy, counselling and even prescription drugs. Success natural smoking help rates for these treatments are significantly higher than willpower alone, but that is not hard to beat! For example, nicotine patches work for 13%(1), combined with counselling that figure rises to 20%¹ and one of the more recent prescription drugs, Champix helps around 22%(2) stop smoking, when measured one year later.
  • try _alert(_sahi.getDiagnostics()) and evaluate the output to get the used browser.

    Thank you Wormi, this is exactly what I'm looking for :)

    Kind Regards,
    Glenn
Sign In or Register to comment.