Re: [Wtr-general] Using an ie.table.each do |row| loop when thepage in the ie window refreshes itself
Thanks - this does look like a good approach. The table's layout doesn't change, it just reloads to update the data within the table with the entries that were just made in the popup window. It's a really annoying UI, especially when you have test cases that require changing a dozen rows and therefore opening the popup a dozen times.. hence why I'm quite eager to get Watir doing it instead. However, each_with_index appears to be an undefined method for ie.table objects. I can iterate on .each just fine, but .each_with_index is undefined. (.rows is undefined as well; .each works fine if I leave it out) I'm wondering if maybe there's a way to store the indices of the buttons it's going to click on within the array, rather than the rows themselves. I tried buttons_to_click << row[5].link(:index,1), but that doesn't work. Thanks, Ian -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ethan Jewett Sent: Saturday, May 05, 2007 6:55 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Using an ie.table.each do |row| loop when thepage in the ie window refreshes itself Ian, Reloading probably invalidates the table object, resulting in your "Access denied" error when ruby goes back for the next row in the table. Suggestion: Assuming that submitting and reloading doesn't affect the table layout, use rows.each_with_index to build an array of indices of relevant rows. Then cycle through the array clicking and submitting. For instance (untested, unfortunately): rows_to_click = Array.new ie.table(:index, 29).rows.each_with_index do |row, i| rows_to_click << i if (row[1].text =~ /#{journals}/) != nil end rows_to_click.each do |i| [Do the clicking and such for row i here.] end This could be made substantially prettier, but hopefully it gets the job done. Ethan On 5/4/07, Ian Webb <[EMAIL PROTECTED]> wrote: > Here's the code snippet that's giving me problems: > > ie.table(:index,29).each do |row| > if (row[1].text =~ /#{journals}/) != nil then #If there is a match > for that regex > row[5].link(:index,1).click # this makes the popup window appear > cw = Watir::IE.attach(:title,'Popup Window') # attach to the popup > window > doRolesPopup(cw) # fill out and submit the form > end > end > > doRolesPopup fills out a form in the cw page, then clicks submit. The > submit button submits the form, then closes the cw window and reloads > the ie window. This reload of the page referenced by the ie object > appears to break the row object, since I get the following error: > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `invoke': unknown > property or method `rows' (WIN32OLERuntimeError) > HRESULT error code:0x80070005 > Access is denied. from > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `row' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `upto' > from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' > from assignroles.rb:51 > from c:/ruby/lib/ruby/1.8/csv.rb:532:in `parse' > from c:/ruby/lib/ruby/1.8/csv.rb:560:in `each' > from c:/ruby/lib/ruby/1.8/csv.rb:531:in `parse' > from assignroles.rb:35 > > Is there any way to keep this simple .each loop, or do I need to work > around it? > > Thanks, > Ian > ___ > 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 mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Using an ie.table.each do |row| loop when thepage in the ie window refreshes itself
On 5/7/07, Ian Webb <[EMAIL PROTECTED]> wrote: I'm wondering if maybe there's a way to store the indices of the buttons it's going to click on within the array, rather than the rows themselves. I tried buttons_to_click << row[5].link(:index,1), but that doesn't work. Hi Ian, I am not sure I understood what you want to do here (I need to see html), but try changing buttons_to_click << row[5].link(:index,1) to buttons_to_click << ie.row[5].link(:index,1) Zeljko -- ZeljkoFilipin.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] Excelent debugging tool - Unroller
All, I stumbled across this handy little debugging tool the other day when I was trying to find a tool that would display/trace the execution of my test script. This tool called "Unroller" will print out each line of code that is executed along with the values of the variable passed into and returned from methods. (optionally it will also keep track of local variables.) It is very helpful for quickly identifying exactly where your script died, and what values were causing it to choke. http://unroller.rubyforge.org/ For some reason I had to install the win32console gem as well to get it working: http://rubyforge.org/frs/?group_id=1766 Tip: when you invoke the unroller, you may want to "exclude" the common classes that you don't care about ie watir, string, array ... So that it only traces your code. For example: Unroller::trace(:max_depth => 5, :show_locals=>true,:exclude_classes =>[/Watir/,/String/,/Array/]) do # some watir test script code goes here end I hope some of you find this helpful! -David ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Using an ie.table.each do |row| loop when thepagein the ie window refreshes itself
Here's the HTML. This row repeats with different values. The field with "Name Goes Here" in it is the field we're filtering on - if this field is matched by a given regex, then make a note that we need to click the button in the last column of this row. Name Goes Here Active Member AU, REV Support The PERSON_ID field in this request is constant for each user/time the table is displayed, but is not constant between instances. The ORGANIZATION_ID field changes for each row of the table, and *is* the same between instances. I would rather not parse out the HTML and then manually construct these requests - this should as much as possible be based on what the user sees, not the underlying HTML. However, if I have to that's a possibility. Thanks, Ian From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Željko Filipin Sent: Monday, May 07, 2007 9:04 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Using an ie.table.each do |row| loop when thepagein the ie window refreshes itself On 5/7/07, Ian Webb <[EMAIL PROTECTED]> wrote: I'm wondering if maybe there's a way to store the indices of the buttons it's going to click on within the array, rather than the rows themselves. I tried buttons_to_click << row[5].link(:index,1), but that doesn't work. Hi Ian, I am not sure I understood what you want to do here (I need to see html), but try changing buttons_to_click << row[5].link(:index,1) to buttons_to_click << ie.row[5].link(:index,1) Zeljko -- ZeljkoFilipin.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] Remote Watir
I am in the process of switching our test environment from Selenium to Watir. So, I am a newb with respect to Ruby and Watir. Is there any thing in Watir or inherent in Ruby that would mimic the capability of "Selenium Remote Control"? In particular, we have a room full of Windows boxes with various flavors of IE. >From one central Linux box, we want to execute tests on all of the Windows >boxes concurrently. This was trivial to do with the Selenium Remote Control server but I have found nothing similar for Ruby/Watir yet. Any ideas, or do I have to write my own proxy server in ruby to remotely execute scripts and return results? Thanks in advance. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] The Plan for Watir
Bret Pettichord wrote: > I've been doing a lot of thinking and planning for what we need to do > with Watir. Hi Brett, I think your current plans are great! I'm looking forward to greater integration of the various watirs to the main code base, as well as better support for modal_dialogs on the supported platforms. Thanks! Chris * * ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] WIN32OLERuntimeError
Hello, I have a test case below: 1. Open IE browser window, change the language setting using autoit. Then, close the window. 2. Open a web page in IE to do a sample testing. Then, close IE window. 3. Open IE browser window, reset the language setting using autoit. Then, close the window. The code for step 1 is: ie = Watir::IE.new autoit = WIN32OLE.new('AutoItX3.Control') autoit.WinWaitActive("Blank Page - Windows Internet Explorer provided by Yahoo!") autoit.Send ("!to") #sends Alt T (Tools) and O (options) to open Internet Options autoit.WinWaitActive("Internet Options") autoit.Send ("!l") autoit.Send ("!a") When running the script for step 1 and 2, the setps get completed fine. But, at step 3, received error message and IE browser is not open: C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1570:in `initialize': failed to create WIN32OLE object from `InternetExplorer.Application' (WIN32OLERuntimeError) HRESULT error code:0x80004002 No such interface supported from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1570:in `new' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1570:in `create_browser_window' from C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1164/./watir.rb:1477:in `initialize' from C:/depot/eng/bedrock/active/qa/all/cc/qa/Ruby/test.rb:51:in `new' from C:/depot/eng/bedrock/active/qa/all/cc/qa/Ruby/test.rb:51 Step3 is very similar to the step1. Why it is working in step 1, but not working in step 3? Please help! Thanks. Kui ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Community involvement with Watir
Charley Baker wrote: > Hi all, > > I'd like to send out another annoucement asking for people to > contribute to > the Watir user guide and volunteer. I've started poking around at the > user > guide today and made a few changes, notably to update view source with > the > ie developer toolbar. I'll make further changes if as I get time, but am > making the call for volunteers to add information and help out, much of > which is related to Watir 1.5. Let me know if you're interested in > helping > out. Hi Charley, Thanks! How should we contribute to the User Guide? It doesn't appear to be user editable: http://wtr.rubyforge.org/watir_user_guide.html Is this the wiki we should be editing? http://wiki.openqa.org/display/WTR/Project+Home Feel free to add my tutorial for installing FireWatir on Mac OS X (Intel) (or let me know where I should add it): http://crasch.livejournal.com/550521.html#cutid1 Under what license do you publish the Watir documention? Chris ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Remote Watir
drb might be what you want. Also search the list here - someone posted a link to a library that might be more like what you want. I wish I could remember who/what/when to help narrow your search - Original Message - From: "Aaron" <[EMAIL PROTECTED]> To: Sent: Monday, May 07, 2007 2:20 PM Subject: [Wtr-general] Remote Watir >I am in the process of switching our test environment from Selenium to >Watir. > So, I am a newb with respect to Ruby and Watir. > > Is there any thing in Watir or inherent in Ruby that would mimic the > capability of "Selenium Remote Control"? > > In particular, we have a room full of Windows boxes with various flavors > of IE. >>From one central Linux box, we want to execute tests on all of the Windows >>boxes concurrently. > This was trivial to do with the Selenium Remote Control server but I have > found nothing similar for Ruby/Watir yet. > > Any ideas, or do I have to write my own proxy server in ruby to remotely > execute scripts and return results? > > Thanks in advance. > ___ > 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] Community involvement with Watir
> Thanks! How should we contribute to the User Guide? It doesn't appear > to be user editable: I'd suggest either adding to this thread, or contacting Zeljko directly. > Feel free to add my tutorial for installing FireWatir on Mac OS X > (Intel) (or let me know where I should add it): > > http://crasch.livejournal.com/550521.html#cutid1 I couldn't get the Linux jssh xpi to function with the lastest osx and latest FF. In another thread (and mentioned to Angrez) I found a Darwin jssh that worked properly. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Community involvement with Watir
Chris McMahon wrote: >> Thanks! How should we contribute to the User Guide? It doesn't appear >> to be user editable: >> > > I'd suggest either adding to this thread, or contacting Zeljko directly. > > Thanks! >> Feel free to add my tutorial for installing FireWatir on Mac OS X >> (Intel) (or let me know where I should add it): >> >> http://crasch.livejournal.com/550521.html#cutid1 >> > > I couldn't get the Linux jssh xpi to function with the lastest osx and > latest FF. In another thread (and mentioned to Angrez) I found a > Darwin jssh that worked properly. > Hmm...the only message I could find was this one, which suggest that the Linux jssh xpi worked. On 5/3/07, Angrez Singh <[EMAIL PROTECTED]> wrote: > > Hi Chris, > > > > Did you tried the XPI at > > http://alephzarro.com/blog/2007/03/12/jssh-for-firefox-on-linux-because-firewatir-loves-it > > Its an XPI for linux but seems to work on Mac OS also (according the link i > > sent you in last mail) > Yay! That one works. Interestingly, it has the same name as the one from mozilla, but it behaves differently. -Chris ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Watir and smartclient
Hi Angrez, What i have attched is the source that is got by right clicking on the page. I think this is what you are refering in your prevoius reply. Thanks, Sadeesh Vinoth T ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general