18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
Operating system detection
Hi,
I have added 2 sahi functions to concat.js and normal_functions.txt
My User Agent variable is following
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
What am I doing wrong ??
Lech
(I am on sahi 2010_03_21, FF 3.6 and Windows 7,
I have tested user agent with following
http://www.docsteve.com/DocSteve/Samples/JS/javascript_env.html)
I have added 2 sahi functions to concat.js and normal_functions.txt
Sahi.prototype._isLinux = function () {return /Linux/.test(navigator.userAgent);};
Sahi.prototype._isWindows = function () {return /Windows/.test(navigator.userAgent);};
When I run them, they both return true.My User Agent variable is following
Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6
What am I doing wrong ??
Lech
(I am on sahi 2010_03_21, FF 3.6 and Windows 7,
I have tested user agent with following
http://www.docsteve.com/DocSteve/Samples/JS/javascript_env.html)
Comments
Please use this:
Also, I would recommend that you use the latest version of Sahi. (Build:2011-07-19).
Regards
Sumitra
I have tried 2011-07-19 and adding "this.", but still the same result.
There must be some ADDITIONAL MAGIC to be done when adding a new function.
The additional line is generated for isIE (which is not generated for my functions)
_sahi.setServerVar('___lastValue___1325675607155', _isIE()); at Jan 4, 2012 12:13:27
What do I need to add to make functions work exactly as isIE() ?
Please see the result
Could you try using:
Regards
Sumitra
It works for sahi_20110719 !!
Is there a way Sumitra I can invite you for a beer (cola) ?
Lech