tag:blogger.com,1999:blog-284600789737488130.post3160390778719935299..comments2024-02-07T02:22:20.642-05:00Comments on Ruby on Windows: Automating Internet Explorer with Ruby: Without WatirDavid Mullethttp://www.blogger.com/profile/05597492688893461137noreply@blogger.comBlogger17125tag:blogger.com,1999:blog-284600789737488130.post-45497099871746247992012-07-13T00:45:57.046-05:002012-07-13T00:45:57.046-05:00Can IE dialog boxes for downloading any file be au...Can IE dialog boxes for downloading any file be automated ?Anonymoushttps://www.blogger.com/profile/02519840576107010727noreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-55212041799036558592009-03-05T23:46:00.000-05:002009-03-05T23:46:00.000-05:00Is there a way to access tabs in IEIs there a way to access tabs in IEUnknownhttps://www.blogger.com/profile/05581559409483478026noreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-60283117400521648912008-11-29T19:39:00.000-05:002008-11-29T19:39:00.000-05:00This topic might be a little bit old, but I have g...This topic might be a little bit old, but I have got a question to Win32ole.<BR/><BR/>There is a page, where I can click several buttons and get to new pages. But when I try to read out these new pages, I only get the text of the old page, although I do see this new page. (well, this was a lot of pages ;)<BR/><BR/>Exemple:<BR/><BR/># call a page<BR/># read out via ie.Document.All.Tags("a")<BR/># click on a button -> get a new page<BR/># read out again<BR/># get the same text ??<BR/><BR/>How can I update ie to get the text (html) of this new page?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-3374788470888623892007-10-07T11:28:00.000-05:002007-10-07T11:28:00.000-05:00@Anonymous:You can use Windows Scripting to activa...@Anonymous:<BR/><BR/>You can use Windows Scripting to activate a window and send keystrokes to it:<BR/><BR/>require 'win32ole'<BR/><BR/>wsh = WIN32OLE.new('Wscript.Shell')<BR/><BR/>if wsh.AppActivate("Save As")<BR/> wsh.SendKeys("c:\temp\myfile.xls{ENTER}")<BR/>end<BR/><BR/>I've written an article that covers this <A HREF="http://rubyonwindows.blogspot.com/2007/05/automating-applications-with-ruby.html" REL="nofollow">here</A>.<BR/><BR/>DavidDavid Mullethttps://www.blogger.com/profile/05597492688893461137noreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-13912501388729838002007-10-03T15:07:00.000-05:002007-10-03T15:07:00.000-05:00Any way to click on a save or open dialog box? ca...Any way to click on a save or open dialog box? can you post an example of how to click on any of these buttons?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-70892805361491485002007-09-07T19:27:00.000-05:002007-09-07T19:27:00.000-05:00@anonymous:In IE7...To navigate to a site in a new...@anonymous:<BR/><BR/>In IE7...<BR/><BR/>To navigate to a site in a new tab, pass the Navigate method a second parameter of 2048:<BR/><BR/>ie.Navigate('http://google.com', 2048)<BR/><BR/>To navigate to a site in a new window, pass the Navigate method a second parameter of 1:<BR/><BR/>ie.Navigate('http://google.com', 1)<BR/><BR/>DavidDavid Mullethttps://www.blogger.com/profile/05597492688893461137noreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-36793656113784380672007-08-28T17:55:00.000-05:002007-08-28T17:55:00.000-05:00How do you open up multiple tabs with the WIN32OLE...How do you open up multiple tabs with the WIN32OLE library?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-74193546265584956692007-07-02T03:52:00.000-05:002007-07-02T03:52:00.000-05:00Problem solved. You need to run as Administrator ...Problem solved. You need to run as Administrator in order for it to work.Unknownhttps://www.blogger.com/profile/02898026737344384858noreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-57399208961839148212007-07-02T02:52:00.000-05:002007-07-02T02:52:00.000-05:00I just tested the Ruby WIN32OLE functionality with...I just tested the Ruby WIN32OLE functionality with 32-bit Vista. Attempting to access Document gives the same error code as with 64-bit Vista.<BR/><BR/>Do you know if this capability has been tested with Vista? Both tests used the latest Ruby included with InstantRails.Unknownhttps://www.blogger.com/profile/02898026737344384858noreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-57680979202913558482007-07-01T21:55:00.000-05:002007-07-01T21:55:00.000-05:00I'm having trouble getting IE automation to work o...I'm having trouble getting IE automation to work on Vista x64 with 32-bit IE 7.<BR/><BR/>When I try to access the Document property, OLE returns the error code 0x80040005.<BR/><BR/>Also, the gohome method works, but returns error code 0x800704c7.<BR/><BR/>Do you have any idea as to what is going on here?Unknownhttps://www.blogger.com/profile/02898026737344384858noreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-44031381730608894202007-06-26T10:43:00.000-05:002007-06-26T10:43:00.000-05:00Thanks David, I tried on the mailing list to and g...Thanks David, I tried on the mailing list to and got the answer<BR/><BR/> "Either pass -b to watir as a command line option, or set<BR/> $HIDE_IE = true before calling Watir::IE.new."<BR/><BR/>But it seems to be harder to clear the cache.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-62416162016421791932007-06-24T20:56:00.000-05:002007-06-24T20:56:00.000-05:00@LeoB:To hide the browser window from the start, r...@LeoB:<BR/><BR/>To hide the browser window from the start, run your watir script with the "-b" command line argument:<BR/><BR/>myTest.rb -b<BR/><BR/>I'm not aware of a means to programatically empty the browser cache directly. You could perhaps include code to delete files in the user's 'Temporary Internet Files' folder, though I haven't tried that.<BR/><BR/>DavidDavid Mullethttps://www.blogger.com/profile/05597492688893461137noreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-88903175319982742912007-06-24T16:09:00.000-05:002007-06-24T16:09:00.000-05:00David: Thanks. I think I could have wondered a lon...David: Thanks. I think I could have wondered a long time about that "Invalid number of parameters" ... ;-)<BR/><BR/>I started testing Watir afterwards. It has some nice features for testing. I want to do some testing from my pc (or some other pc) at irregular intervals of some web pages I am responsible for.<BR/><BR/>One problem I immediately ran into then is how to hide the IE window. I hide it this way now<BR/><BR/> $ie = Watir::IE.new()<BR/> $ie.getIE.Visible = false<BR/><BR/>However doing it that way IE flashes bye. That could be quite inconvenient.<BR/><BR/>Another problem I wonder about is how to empty IE:s cache when I use Watir. I need to do that to check the performance of the web server.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-72434505298304408312007-06-24T12:09:00.000-05:002007-06-24T12:09:00.000-05:00@leob:Change this:sleep(1) until ie.ReadyState = 4...@leob:<BR/><BR/>Change this:<BR/><BR/>sleep(1) until ie.ReadyState = 4<BR/><BR/>To this:<BR/><BR/>sleep(1) until ie.ReadyState == 4<BR/><BR/>Ruby uses '==' to test for equality.<BR/><BR/>DavidDavid Mullethttps://www.blogger.com/profile/05597492688893461137noreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-79180656661875509422007-06-24T11:59:00.000-05:002007-06-24T11:59:00.000-05:00I am a total beginner in Ruby. To learn a little b...I am a total beginner in Ruby. To learn a little bit easily I just took code from your blog article and created a file ie-check.rb:<BR/><BR/> require 'win32ole'<BR/> ie = WIN32OLE.new('InternetExplorer.Application')<BR/> ie.Visible = true<BR/> ie.Navigate('http://google.com/')<BR/> sleep(1) until ie.ReadyState = 4<BR/> ie.Quit<BR/><BR/>Then I ran this with<BR/><BR/> ruby -dw ie-check.rb<BR/><BR/>IE started and loaded the page as expected, but I got<BR/><BR/> C:\rubytest\ie>ruby -dw ie-check.rb<BR/> Exception `WIN32OLERuntimeError' at ie-check.rb:5 -<BR/> OLE error code:0 in Unknown<BR/> No Description<BR/> HRESULT error code:0x8002000e<BR/> Invalid number of parameters.<BR/> ie-check.rb:5:in `method_missing': (WIN32OLERuntimeError)<BR/> OLE error code:0 in Unknown<BR/> No Description<BR/> HRESULT error code:0x8002000e<BR/> Invalid number of parameters. from ie-check.rb:5<BR/><BR/>What is wrong here?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-24419735099667291562007-05-21T07:42:00.000-05:002007-05-21T07:42:00.000-05:00Yes it is ! FireWatir for Firefox and works very w...Yes it is ! FireWatir for Firefox and works very well - http://code.google.com/p/firewatir/downloads/list .Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-83675508272746765892007-05-21T00:41:00.000-05:002007-05-21T00:41:00.000-05:00Is there also an easy way how to automate other br...Is there also an easy way how to automate other browsers such as Firefox or Opera?hAnonymousnoreply@blogger.com