Re: [Wtr-general] Watir can't find IEnum interface
Thanks Chris, FYI, I uninstalled Ruby 186-25 and Watir 1.5.1.1158 from this machine that fails. The OLE version from this prior install was showing 0.7.1. I loaded Ruby 185-21 and Watir 1.5.1.1136 on my failing machine and still see the problem. I have this same version (Ruby 185-21 / Watir 1.5.1.1136) on another machine running Windows XP and I don't see this problem. The OLE version now shows 0.6.9. Brad ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] watir execution from webserver
> In all it only took 5 rails controllers (less than 100 lines total) and 5 or > 6 separate views. (And I'm sure it could be compacted even more.) I came > out of the experience pretty impressed with rails. If there's interest I can > try to clean up the code and post it. I'm interested as well. I've barely touched Rails, and this would be a great way to learn more about it. -Chris ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] watir execution from webserver
Consider me interested. I've had this concept on the backburner for a while, but haven't had the time to get ahead on the code while working on tests. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bill Agee Sent: Monday, March 26, 2007 2:55 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] watir execution from webserver One bare-bones solution for this problem is to use the Ruby gserver library to start your tests - see the code snippets in this post: http://www.mail-archive.com/wtr-general@rubyforge.org/msg07247.html The idea is to leave a little Ruby script listening on the test client, and when someone sends any traffic to it (a telnet connection, hitting the port with a web browser, etc), your Watir script is executed. It sounds like you're looking for a more full-featured solution, though. For that I'd suggest creating a little Ruby on Rails app. Last year I put together a rails app that did something similar - it displayed a list of Watir scripts as links, and when one was clicked on it would execute the script and display console output in the browser. This worked surprisingly well (even for scripts that used IE#attach, which can cause problems if present in a script that gets started remotely). I stopped before adding the ability to locate and display logfiles, though. But that wouldn't be too hard to do. In all it only took 5 rails controllers (less than 100 lines total) and 5 or 6 separate views. (And I'm sure it could be compacted even more.) I came out of the experience pretty impressed with rails. If there's interest I can try to clean up the code and post it. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] watir execution from webserver
One bare-bones solution for this problem is to use the Ruby gserver library to start your tests - see the code snippets in this post: http://www.mail-archive.com/wtr-general@rubyforge.org/msg07247.html The idea is to leave a little Ruby script listening on the test client, and when someone sends any traffic to it (a telnet connection, hitting the port with a web browser, etc), your Watir script is executed. It sounds like you're looking for a more full-featured solution, though. For that I'd suggest creating a little Ruby on Rails app. Last year I put together a rails app that did something similar - it displayed a list of Watir scripts as links, and when one was clicked on it would execute the script and display console output in the browser. This worked surprisingly well (even for scripts that used IE#attach, which can cause problems if present in a script that gets started remotely). I stopped before adding the ability to locate and display logfiles, though. But that wouldn't be too hard to do. In all it only took 5 rails controllers (less than 100 lines total) and 5 or 6 separate views. (And I'm sure it could be compacted even more.) I came out of the experience pretty impressed with rails. If there's interest I can try to clean up the code and post it. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Watir can't find IEnum interface
Ruby 182-15, Watir 1.5.1.1136 works fine ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Watir can't find IEnum interface
Hi Chris, Sorry I haven't been back on this one: I only have access to the machine on which I have the problem on Thursdays (long story), and I missed last week's session altogether. On 26/03/07, Chris McMahon <[EMAIL PROTECTED]> wrote: > I run Brad's code with no problem (thanks for the example!). I'll check it next chance I can - although I'm sure what I'll see... > Googling, I find that "IEnum interface" is an error coming from Ruby's > WIN32OLE library. The root cause seems to be some kind of error in > the interface between Ruby and Windows on the particular machine. This was my suspicion too, because I installed the same ruby download on two machines and got different results. > One very suggestive issue is that Kevin Rutherford's error said > "failed" and not "Failed", and this site > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/3213 > suggests that Rutherford has a Ruby WIN32OLE library from 2004 or > earlier. > > Based on what we've learned so far, I'll suggest that either the Ruby > installation is flawed, or Windows itself on these particular machines > has a flawed OLE of some sort. This would be worrying, but I'll check. > Without more information, my best suggestion is to uninstall and > reinstall Ruby, then re-install Watir on top of the new Ruby. Make > sure you're using the Ruby one-click installer. I did that. i wonder if 1.8.6 has introduced this...? Thanks for keeping this alive, Cheers, Kevin ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Watir can't find IEnum interface
Sorry I can't help more. I'm using ruby 1.8.5 (2006-08-25) and Watir 1.5.1.1158, WinXP. You might try playing with OLE directly. For instance, try to move object from Paint to Word, or something. See if you can get the same error from pure MS applications. -C On 3/26/07, Brad <[EMAIL PROTECTED]> wrote: > Thanks Chris, > > I just did the following and see the same error: > > * uninstalled Ruby 186-25 > * reboot PC > * installed Ruby 186-25 using Windows installer > * run latest Watir gem 1.5.1.1158 > > This use to work on an earlier version Ruby (185-21) and Watir (1.5.1.1136) > but left this for a while (over a month) and when I came back I saw these > errors so I decided to update Ruby and Watir. I wander if something broke > when IT ran Microsoft patches to our machines. > > Thanks, > Brad > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Watir can't find IEnum interface
Thanks Chris, I just did the following and see the same error: * uninstalled Ruby 186-25 * reboot PC * installed Ruby 186-25 using Windows installer * run latest Watir gem 1.5.1.1158 This use to work on an earlier version Ruby (185-21) and Watir (1.5.1.1136) but left this for a while (over a month) and when I came back I saw these errors so I decided to update Ruby and Watir. I wander if something broke when IT ran Microsoft patches to our machines. Thanks, Brad ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Watir can't find IEnum interface
I run Brad's code with no problem (thanks for the example!). Googling, I find that "IEnum interface" is an error coming from Ruby's WIN32OLE library. The root cause seems to be some kind of error in the interface between Ruby and Windows on the particular machine. One very suggestive issue is that Kevin Rutherford's error said "failed" and not "Failed", and this site http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/3213 suggests that Rutherford has a Ruby WIN32OLE library from 2004 or earlier. Based on what we've learned so far, I'll suggest that either the Ruby installation is flawed, or Windows itself on these particular machines has a flawed OLE of some sort. Without more information, my best suggestion is to uninstall and reinstall Ruby, then re-install Watir on top of the new Ruby. Make sure you're using the Ruby one-click installer. On 3/26/07, Brad <[EMAIL PROTECTED]> wrote: > I'm seeing the same error on my environment. Here is the same code along > with the error. > > Code: > > require 'rubygems' > require 'watir' > include Watir > #require 'watir_ext' # extension to watir for 'visible?' > #include Watir > require 'test/unit' > require 'csv' > > > puts Watir::IE::VERSION # check for WATIR version > > class TC_recorded < Test::Unit::TestCase > def test_recorded > ie = IE.new > ie.goto('http://wtr.rubyforge.org/watir_user_guide.html') > ie.button(:name, 'clickme').click > ie.goto('http://wtr.rubyforge.org/watir_user_guide.html') > ie.text_field(:name, 'typeinme').set('Watir World') > end > end > ___ > Wtr-general mailing list > Wtr-general@rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] WATiR work in San Francisco
National retailer has an immediate need for a test engineer with experience in Ruby/WATiR. Work on a high profile J2EE based Ecommerce effort. Lead type role, involving mainly test automation. 6-9 months downtown. Calls or email are fine. Thanks, Bob Lepesh JD Strategies 650-941-2900 Bob Lepesh JD Strategies a workforce solutions service 343 State St. Suite 202 Los Altos, Calif. 94022 T. 650.941.2900 F. 650.941.2933 [EMAIL PROTECTED] http:/www.jdstrategies.net ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Reading from excel files (basic)
Hi Nicola, you could try something like this: excel = WIN32OLE::new('excel.Application') workbook = excel.Workbooks.Open('C:\Documents and Settings\kennedyn\My Documents\WATIR_RUBY\excel _testdata2.xls') worksheet = workbook.Worksheets(1) #get hold of the first worksheet worksheet.Select [EMAIL PROTECTED] = [] [EMAIL PROTECTED] = worksheet.Range('a1:z1').value # The data is in cell a1. #puts @mydata # to c wether the content is in the array. excel['Visible'] = true # hide the spreadsheet from view line = '1' while val = worksheet.Range("a#{line}")['Value'] #pull the value stored in the cell while it's valid ie.goto(val)#use the value line.succ! #update the line number end This will only loop through for the first column a(1-end of valid values). You can expand it to pull an array if you want. -Charley workbook.close excel.Quit On 3/26/07, Nicola Kennedy <[EMAIL PROTECTED]> wrote: Hi, I did this and the logs showed the websites as follows: ... ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Watir can't find IEnum interface
I'm seeing the same error on my environment. Here is the same code along with the error. Code: require 'rubygems' require 'watir' include Watir #require 'watir_ext' # extension to watir for 'visible?' #include Watir require 'test/unit' require 'csv' puts Watir::IE::VERSION # check for WATIR version class TC_recorded < Test::Unit::TestCase def test_recorded ie = IE.new ie.goto('http://wtr.rubyforge.org/watir_user_guide.html') ie.button(:name, 'clickme').click ie.goto('http://wtr.rubyforge.org/watir_user_guide.html') ie.text_field(:name, 'typeinme').set('Watir World') end end ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Reading from excel files (basic)
Hi, I did this and the logs showed the websites as follows: www.google.co.uk www.freeuk.com www.bbc.co.uk www.manilow.com nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil The test then just ends, with no errors, but the test doesn't take me to the four websites. As an aside as well, I don't want it to enter nil as the web address, so is there a way once this is fixed, that it knows to stop putting stuff into the array when the next cell is empty. Have pasted script as it stands below excel = WIN32OLE::new('excel.Application') workbook = excel.Workbooks.Open('C:\Documents and Settings\kennedyn\My Documents\WATIR_RUBY\excel_testdata2.xls') worksheet = workbook.Worksheets(1) #get hold of the first worksheet worksheet.Select @mydata = [] @mydata = worksheet.Range('a1:z1').value # The data is in cell a1. puts @mydata # to c wether the content is in the array. excel['Visible'] = true # hide the spreadsheet from view workbook.close excel.Quit # Insert the data read from the spreadsheet into the text field #$ie.text_field(:name, 'TEST').set $data #ie.goto('http://' + @mydata) # Insert the data read from the spreadsheet into the text field #$ie.text_field(:name, 'TEST').set $data @mydata.length do |x| ie.goto('http://' + @mydata[x]) end TIA ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Reading from excel files (basic)
try this @mydata = worksheet.Range('a1:a4').value puts @mydata # to c wether the content is in the array. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Reading from excel files (basic)
Hi, Have done this, but am getting error: 1) Error: test_recorded(TC_recorded): NoMethodError: undefined method `length' for nil:NilClass testnic2.rb:50:in `test_recorded' Have copied my script again in case I've done something wrong? excel = WIN32OLE::new('excel.Application') workbook = excel.Workbooks.Open('C:\Documents and Settings\kennedyn\My Documents\WATIR_RUBY\excel_testdata.xls') worksheet = workbook.Worksheets(1) #get hold of the first worksheet worksheet.Select @mydata = [] @mydata = worksheet.Range('a1:a4')['text'] # The data is in cell a1. excel['Visible'] = true # hide the spreadsheet from view workbook.close excel.Quit # Insert the data read from the spreadsheet into the text field #$ie.text_field(:name, 'TEST').set $data #ie.goto('http://' + @mydata) # Insert the data read from the spreadsheet into the text field #$ie.text_field(:name, 'TEST').set $data @mydata.length do |x| ie.goto('http://' + @mydata[x]) end TIA ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Control windows dialog box
h = $ie2.enabled_popup() why do this through an unknown name Exception??? ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Reading from excel files (basic)
$data = [] $data = worksheet.Range('a1:z1')'text' # The data is in cell a1. excel'Visible' = false # hide the spreadsheet from view workbook.close excel.Quit # Insert the data read from the spreadsheet into the text field #$ie.text_field(:name, 'TEST').set $data $data.length do |x| ie.goto('http://' + $data[x]) end $data is not a good idea as the $ stands for global variable. If not needed to be global remove them and replace with @ or @@ as your definitions needs. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] Reading from excel files (basic)
Hi, I am completely new to WATIR, and don't have much programming experience so forgive the simplicity of this question! I am just learning the basics and have created a script that calls an excel file which has a column of web addresses. I have got the scripts to read in the first value from A1 and when executed, the script goes to that web address. My question is how do I set the script up to loop round reading in all the web addresses in the column, so it goes to each web address in turn and then finish when it gets to an empty line. My script looks like this at the minute: require 'win32ole' excel = WIN32OLE::new('excel.Application') workbook = excel.Workbooks.Open('C:\Documents and Settings\kennedyn\My Documents\WATIR_RUBY\excel_testdata.xls') worksheet = workbook.Worksheets(1) #get hold of the first worksheet worksheet.Select #bring it to the front -need sometimes to run macros, not for working with a worksheet from ruby excel['Visible'] = false #make visible, set to false to make invisible again. Don't need it to be visible for script to work excel = WIN32OLE::new('excel.Application') workbook = excel.Workbooks.Open('C:\Documents and Settings\excel_testdata.xls') worksheet = workbook.Worksheets(1) #get hold of the first worksheet worksheet.Select $data = worksheet.Range('a1')['text'] # The data is in cell a1. excel['Visible'] = false # hide the spreadsheet from view workbook.close excel.Quit # Insert the data read from the spreadsheet into the text field #$ie.text_field(:name, 'TEST').set $data ie.goto('http://' + $data) TIA ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] clicking on menu
Vikash, I could not find OnMouseOver anywhere in html that you sent. In any case you can fire that event with this slightly modified code from FAQ page ( http://wiki.openqa.org/display/WTR/FAQ#FAQ-TriggeringJavaScriptevents) ie.text_field(:name, "my_field").fire_event("OnMouseOver") -- ZeljkoFilipin.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] handling custom HTML attribute
On 3/24/07, x y <[EMAIL PROTECTED]> wrote: Done All of this worked for me (watir 1.5.1.1158). ie.cell(:html, /iwname/).flash ie.cell(:html, /ModalPageWrapper:okClicked/).flash ie.cell(:html, /iwname="ModalPageWrapper:okClicked"/).flash -- ZeljkoFilipin.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] watir execution from webserver
alright, well i realized that when the watir script is executed it does create an instance of iexplore.exe but the script dies when it attempts to execute ie.goto(site). ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general