I’ve done the Google thing for several days and I’m hitting a blank.
I’m wondering if there’s a way to attach to a running IE process (on
Windows) by using win32ole alone. I can do it with watir, ie =
Watir::IE.attach(:url, url), but I may need to do this on platforms that
don’t have watir installed.
I’ve done the Google thing for several days and I’m hitting a blank.
I’m wondering if there’s a way to attach to a running IE process (on
Windows) by using win32ole alone. I can do it with watir, ie =
Watir::IE.attach(:url, url), but I may need to do this on platforms that
don’t have watir installed.
Thanks in advance for any pointers,
Geoff
Hi,
it’s certainly possible. In programming ruby you’llfind an example how
to attach to running excel. Then you’ll need to find out Explorer’s
API - it shouldn’t be that hard (see MSDN etc.)
I’ve done the Google thing for several days and I’m hitting a blank.
I’m wondering if there’s a way to attach to a running IE process (on
Windows) by using win32ole alone. I can do it with watir, ie =
Watir::IE.attach(:url, url), but I may need to do this on platforms that
don’t have watir installed.
The Watir code uses win32ole to implement Watir::IE.attach. Have you
looked at it? It’s open source and the latest code is in the repository
on OpenQA.org.
IE objects are included in the Windows collection of the Shell object,
so you could do something like the following (code not tested):
Excellent – I’ll give it a go! Thanks everyone for your help. I’ve
been wading trough the watir source (oh man, that was a bad pun), but
it’s nice to have a small snippet like that to get me started.
Thanks again, and I’ll post back if I get it working. (I’m working on a
preview in browser command for the e Text Editor, which uses TextMate
bundles–but Windows doesn’t have AppleScript so I’m rewriting those
commands in ruby.)
Each item in the the shell’s Windows collection is an actual
InternetExplorer object, so once you get to that object you will
utilize the standard IE object’s properties and methods:
Each item in the the shell’s Windows collection is an actual
InternetExplorer object, so once you get to that object you will
utilize the standard IE object’s properties and methods:
shell = WIN32OLE.new(‘Shell.Application’)
shell.Windows.each do | window |
Do you how I’d look for the URL instead of window.Document.Title? I’m
guaranteed to have a file name (with full path), but may not know the
title. Or could you point me to the docs where I could find all the
methods and properties? (I found them from IE, but not for
Shell.Application.)