From: Dossy Date: 2002-07-17T12:51:40+09:00 Subject: Re: Win32OLE: Is getting MSIE HTTP status possible? On 2002.07.17, Hal E. Fulton wrote: > > Instead of asking "Why use Ruby?" let's ask "Why use IE?" (Not to bash > Microsoft (not to bash those who bash Microsoft.)) The answer: I'm automating _acceptance testing_ of a _web application_. I'm just depressed that Netscape has no similar COM interface for automating/remote controlling it. Speaking of which, has anyone wrote any helper/utility classes around Win32API for easy remote-controlling/automation? Otherwise, I'm going to start writing them. Also, interesting thing I just noted: irb(main):001:0> require 'win32api' LoadError: 127: The specified procedure could not be found. - Init_win32api C:/RUBY/lib/ruby/1.6/i586-mswin32/win32api.so from (irb):1:in `require' from (irb):1 irb(main):002:0> require 'Win32API' true I wouldn't have expected it to be case-sensitive, but it makes sense why it was. :-) > Is it because you are manually examining each page in addition to > automated testing? No, I'm only automating testing (matter of fact, I'm leaving visible = false for speed). However, since this is acceptance testing, it actually NEEDS to be fetched by MS IE so that JavaScript gets executed and so on -- we need to know that the page will render correctly in versions of IE (5.0, 5.5, and now 6.0). Yes, we can automate other testing by simply doing a HTTP GET of a page and parsing the HTML document into a DOM tree and writing assertions against the tree -- this testing would be browser-independent, probably more suitable for unit testing. However, the acceptance testing is also important (perhaps even more important, in my business customer's eyes) and must be done by driving the actual browser. > Would ActiveScriptRuby be of any help here? You can run Ruby within IE > that way (as you do Javascript). Not sure. I haven't played with ActiveScriptRuby. I'll try to look into it. > Also: Doesn't every COM object have some kind of reflection API? (Not > sure -- I'm not a COMmie.) Yes. However, the information returned is only a list of methods, not full documentation. ;-) -- Dossy -- Dossy Shiobara mail: dossy@panoptic.com Panoptic Computer Network web: http://www.panoptic.com/ "He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on." (p. 70)