on my mac
paul:MacOS paul$ ./firefox-bin -v Mozilla Firefox 3.0.4, Copyright (c) 1998 - 2008 mozilla.org ( looks like I need to update ;-) ) and for ff2 paul:MacOS paul$ ./firefox-bin -v Mozilla Firefox 2.0.0.20, Copyright (c) 1998 - 2008 mozilla.org On Wed, Mar 25, 2009 at 7:26 PM, Al Snow <jas...@hotmail.com> wrote: > From https://developer.mozilla.org/En/Command_Line_Options-h or -help or > -? Print the list of all available command line options. Note that on > Windows this only work with debug builds ( bug > 355889<https://bugzilla.mozilla.org/show_bug.cgi?id=355889>). > This option is available only in command console. > > Thanks, > Al Snow > > ------------------------------ > Date: Wed, 25 Mar 2009 19:07:32 -0600 > Subject: [wtr-general] Re: os and browser version > From: paul.rog...@shaw.ca > > To: watir-general@googlegroups.com > > Nice! Theres probably a better way to get the firefox version too, > > does firefox.exe take a -v to return version number? > > Paul > > On Wed, Mar 25, 2009 at 5:39 PM, Alan Baird <alan.ba...@riskmetrics.com>wrote: > > Paul – > > Thanks for that. Since I needed to verify which IE version was installed > before starting it, I have a windows only (IE only) script that will get the > version of IE from the registry. Probably limited usefulness but here it is > just in case it’s useful to someone. > > require 'win32/registry' > > reg_val = '' > key = 'Software\Microsoft\Internet Explorer' > Win32::Registry::HKEY_LOCAL_MACHINE.open(key) do |reg| > reg_typ, reg_val = reg.read('Version') > end > ver1, ver2, ver3, ver4 = reg_val.split('.') > puts ver1 > > Wrap this in a function if needed. > > Alan > > ------------------------------ > *From:* watir-general@googlegroups.com [mailto: > watir-gene...@googlegroups.com] *On Behalf Of *Paul Rogers > *Sent:* Wednesday, March 25, 2009 5:12 PM > *To:* watir-general@googlegroups.com > *Subject:* [wtr-general] os and browser version > > > some one on irc wanted to get the browser and os versions. > > THis code uses the user-agent, so might not always be correct, but its > probably good enough. Not sure if it works on IE8 > > It came from a module that was included into the Watir and FireWatir > modules. Its from an old code base, so may need some help making it work on > newer versions of watir > > Paul > > > # returns the browser version > # based on http://blogs.msdn.com/ie/archive/2006/09/20/763891.aspx > # and > http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/aboutuseragent.asp > def browser_version > > if self.class.ancestors.collect{|c| c.to_s}.include? "Watir::IE" > version = self.document.parentWindow.navigator.appVersion > if v = /compatible; MSIE (.*?);/.match(version) > version = v[1] > end > app = self.document.parentWindow.navigator.appName > else > cmd = "#{FireWatir::Firefox::WINDOW_VAR}.navigator.userAgent" > > @jssh_socket.send("#{cmd}\n", 0) > useragent = read_socket() > if m=/(Firefox)\/(.*)/.match( useragent) > app =m[1] > version = m[2] > end > end > > return app , version > > end > > # this method gets the os version from the browsers useragent string > # based on http://blogs.msdn.com/ie/archive/2006/09/20/763891.aspx > # and > http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/aboutuseragent.asp > def os_version > if self.class.ancestors.collect{|c| c.to_s}.include? "Watir::IE" > b = self.document.invoke('parentWindow').navigator.appVersion > > else > cmd = "#{FireWatir::Firefox::WINDOW_VAR}.navigator.userAgent" > @jssh_socket.send("#{cmd}\n", 0) > b = read_socket() > end > > if n=b.match(/Windows NT(.*?);/) > if n[1].strip == "5.1" > return "Windows XP" > elsif n[1].strip == "5.2" > return "Windows 2003 Server" > elsif n[1].strip == "6.0" > return "Vista" > else > return "" > end > else > if b.match(/Macintosh/) > return "Mac" > end > end > > return "??" > end > > > > > > > > > ------------------------------ > Windows Live™ SkyDrive: Get 25 GB of free online storage. Check it > out.<http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_skydrive_032009> > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Watir General" group. To post to this group, send email to watir-general@googlegroups.com Before posting, please read the following guidelines: http://wiki.openqa.org/display/WTR/Support To unsubscribe from this group, send email to watir-general-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/watir-general -~----------~----~----~----~------~----~------~--~---