From aidy.lewis at googlemail.com Tue May 5 18:22:55 2009 From: aidy.lewis at googlemail.com (aidy lewis) Date: Tue, 5 May 2009 23:22:55 +0100 Subject: [Wtr-development] visible methods Message-ID: <7ac2300c0905051522r2cc9fb40tc9f4c92b8bce4152@mail.gmail.com> Hi, There is a contributions visible? method for IE and a JS one on the FireWatir wiki. Can anyone tell me why these methods are not added to their relevant Element classes in the core code please? -- Aidy blog: www.agiletester.co.uk twitter: http://twitter.com/aidy_lewis From davids at tower-mt.com Tue May 5 20:04:42 2009 From: davids at tower-mt.com (David Schmidt) Date: Tue, 5 May 2009 17:04:42 -0700 Subject: [Wtr-development] visible methods In-Reply-To: <7ac2300c0905051522r2cc9fb40tc9f4c92b8bce4152@mail.gmail.com> References: <7ac2300c0905051522r2cc9fb40tc9f4c92b8bce4152@mail.gmail.com> Message-ID: Aidy, The short story is that when I created that method (and others) I was working on writing screen scraping applications. In spite of the fact that the same functionality is used whether screen scraping or doing acceptance testing, I was told by Brent that Watir was for testing only and did NOT support screen scraping. When I questioned this attitude, given the same code is used for both, I was moderated and unable to post anything that disagreed with this or mentioned screen scraping. I posted that page to the wiki because nothing I wrote would get integrated into Watir proper. I have since moved on to other projects and no longer work with screen scraping applications so feel free to try and get that code integrated into Watir proper (with the fix in the comments). I'd like to retain the wiki page if possible as it shows one of my contributions to Watir. Be warned that there may be resistance to integrating that code JUST because of where it came from and why it was written (screen scraping). BTW, I still get folks emailing me with questions about both that method and the methods I came up with to attach to IE's modal dialog boxes, showing their usefulness to folks even though Brent refused to integrate them. David Schmidt davids at tower-mt.com On May 5, 2009, at 3:22 PM, aidy lewis wrote: > Hi, > > There is a contributions visible? method for IE and a JS one on the > FireWatir wiki. > > Can anyone tell me why these methods are not added to their relevant > Element classes in the core code please? > > -- > Aidy > blog: www.agiletester.co.uk > twitter: http://twitter.com/aidy_lewis > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development From aidy.lewis at googlemail.com Wed May 6 06:43:04 2009 From: aidy.lewis at googlemail.com (aidy lewis) Date: Wed, 6 May 2009 11:43:04 +0100 Subject: [Wtr-development] visible methods In-Reply-To: References: <7ac2300c0905051522r2cc9fb40tc9f4c92b8bce4152@mail.gmail.com> Message-ID: <7ac2300c0905060343x7c822a7epefb691c2d881e7b@mail.gmail.com> > I have a backlog of patches to be reviewed that are in Jira. I'd love to have help. Are these in Jira? This: WTR-53 "Methods for visible/hidden" has been closed,when this method was added to contributions: class Watir::Element # If any parent element isn't visible then we cannot write to the # element. The only realiable way to determine this is to iterate # up the DOM element tree checking every element to make sure it's # visible. def visible? # Now iterate up the DOM element tree and return false if any # parent element isn't visible or is disabled. object = document while object begin if object.currentstyle.invoke('visibility') =~ /^hidden$/i return false end if object.currentstyle.invoke('display') =~ /^none$/i return false end if object.invoke('isDisabled') return false end rescue WIN32OLERuntimeError end object = object.parentElement end true end end The FireWatir method using JS is here: class Element def visible? assert_exists displayed= js_eval "#{element_object}.style.display" visibility= js_eval "#{element_object}.style.visibility" @@current_level = 0 !(displayed == "none" || visibility == "hidden") end end They both haven't got tests and without unit tests, they are unlikely to be accepted anywhere. >I cant remember how these work, but they need to be used with caution. One app I work with makes things invisible by moving them off the screen Then I think the first thing we should do in the method is assert_exists. Aidy 2009/5/6 Paul Rogers : > I cant remember how these work, but they need to be used with caution. One > app I work with makes things invisible by moving them off the screen. > > I have no idea how you test and code html all these different ways and > explain to others what is meant by visible. I think I have used this code, > or at least a simplified form that showed what was visible for the app I > worked on. > > Paul > > On Tue, May 5, 2009 at 7:53 PM, Bret Pettichord wrote: >> >> Do we have unit tests for these? >> >> Bret >> >> On Tue, May 5, 2009 at 7:04 PM, David Schmidt wrote: >>> >>> Aidy, >>> >>> The short story is that when I created that method (and others) I was >>> working on writing screen scraping applications. ?In spite of the fact that >>> the same functionality is used whether screen scraping or doing acceptance >>> testing, I was told by Brent that Watir was for testing only and did NOT >>> support screen scraping. >>> >>> When I questioned this attitude, given the same code is used for both, I >>> was moderated and unable to post anything that disagreed with this or >>> mentioned screen scraping. ?I posted that page to the wiki because nothing I >>> wrote would get integrated into Watir proper. >>> >>> I have since moved on to other projects and no longer work with screen >>> scraping applications so feel free to try and get that code integrated into >>> Watir proper (with the fix in the comments). ?I'd like to retain the wiki >>> page if possible as it shows one of my contributions to Watir. ?Be warned >>> that there may be resistance to integrating that code JUST because of where >>> it came from and why it was written (screen scraping). >>> >>> BTW, I still get folks emailing me with questions about both that method >>> and the methods I came up with to attach to IE's modal dialog boxes, showing >>> their usefulness to folks even though Brent refused to integrate them. >>> >>> David Schmidt >>> davids at tower-mt.com >>> >>> >>> On May 5, 2009, at 3:22 PM, aidy lewis wrote: >>> >>>> Hi, >>>> >>>> There is a contributions visible? method for IE and a JS one on the >>>> FireWatir wiki. >>>> >>>> Can anyone tell me why these methods are not added to their relevant >>>> Element classes in the core code please? >>>> >>>> -- >>>> Aidy >>>> blog: www.agiletester.co.uk >>>> twitter: http://twitter.com/aidy_lewis >>>> _______________________________________________ >>>> Wtr-development mailing list >>>> Wtr-development at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/wtr-development >>> >>> _______________________________________________ >>> Wtr-development mailing list >>> Wtr-development at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/wtr-development >> >> >> >> -- >> Bret Pettichord >> CTO, WatirCraft LLC, www.watircraft.com >> Lead Developer, Watir, www.watir.com >> >> Blog, www.io.com/~wazmo/blog >> Twitter, www.twitter.com/bpettichord >> GTalk: bpettichord at gmail.com >> >> Ask Me About Watir Training >> www.watircraft.com/training >> >> _______________________________________________ >> Wtr-development mailing list >> Wtr-development at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wtr-development > > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > -- Aidy blog: www.agiletester.co.uk twitter: http://twitter.com/aidy_lewis From aidy.lewis at googlemail.com Wed May 6 12:06:43 2009 From: aidy.lewis at googlemail.com (aidy lewis) Date: Wed, 6 May 2009 17:06:43 +0100 Subject: [Wtr-development] visible methods In-Reply-To: References: <7ac2300c0905051522r2cc9fb40tc9f4c92b8bce4152@mail.gmail.com> <7ac2300c0905060343x7c822a7epefb691c2d881e7b@mail.gmail.com> Message-ID: <7ac2300c0905060906l4fcd75e1s526c1d2183d164c7@mail.gmail.com> 2009/5/6 Bret Pettichord : > Aidy, > > Would you be willing to write unit tests for this? > > Bret > I will write some post-implementation tests that could retrospectively influence design. Aidy From xflibble at yahoo.com Sun May 10 21:43:21 2009 From: xflibble at yahoo.com (Jared Quinert) Date: Sun, 10 May 2009 18:43:21 -0700 (PDT) Subject: [Wtr-development] Pop-ups Message-ID: <375242.35131.qm@web50409.mail.re2.yahoo.com> Posted this originally to the general list, but thought this might be a better forum, with some more specifics - A few pages I'm scripting against pop up IE's 'Security information' dialog boxes due to the link being https instead of http. The main issue I have is that Watir is 'blocked'. There's no timeout or error when the popup appears. The current example for handling these popups (http://wiki.openqa.org/display/WTR/Security+Alerts) looks like it's creating a new browser class, not extending the existing one. I tried to extend the IE class but couldn't figure out my way around an error I was getting. In the end, I came up with the extension below. As I don't want all my requests to have to pause and check for the presence of a security dialog box, I had to introduce the condition on secure requests. I'm really expecting the security prompt to cause a timeout, then I could handle the exception by checking for pop-ups. Is there any way to get Watir to timeout on these? (My current extension) class Watir::IE # Modified Watir's goto method so that it clears the security information box on pages that mix secure and non-secure items def goto(url) wsh = WIN32OLE.new('Wscript.Shell') m = Thread.new(self) { @ie.navigate(url) wait } if url.match(/^https/) t = Thread.new(){ sleep 2 8.times {sleep 1} if !wsh.AppActivate('Security Information') wsh.SendKeys("{ESC}") if wsh.AppActivate('Security Information') } end m.join t.join if url.match(/^https/) return @down_load_time end end On May 7, 9:58 am, Jared wrote: > Hi, > > Just taking a quick look at the example onhttp://wiki.openqa.org/display/WTR/Security+Alerts > > Is this still the general way to do it, now that there's an actual > Watir class 'Browser'? > > Jared From a.j.collins.02 at gmail.com Sun May 17 17:22:21 2009 From: a.j.collins.02 at gmail.com (Alex Collins) Date: Sun, 17 May 2009 22:22:21 +0100 Subject: [Wtr-development] Firewatir - Multiple browsers Message-ID: <0D768EFC-CA66-4574-B341-4BC1F4D05514@gmail.com> I've been working on getting multiple browser support into Firewatir - WTR-224. I have now reached the stage where all unit tests pass and it seems stable. It should support both versions of the JSSH XPI. To work with multiple browsers you need to: - Install the patched XPI - Create additional profiles for each of the instances you wish to use (firefox -CreateProfile ) - Start Firefox in the profile and install the JSSH XPI (firefox -P ), then close Firefox. - Provide :multiple_browser_xpi => true as one of the options to Firefox.new - Provide :profile => 'profile_name' as one of the options to Firefox.new - Provide :port => 9998 (example) that the JSSH connection should be made on [this could be auto-incremented in future] For an example, see the multiple_browsers unit test. The code can be found here: http://github.com/ajcollins/watir/tree/multiple Additional testing - especially on other platforms - would be most appreciated. == XPIs == To get this to work, you need a patched Firefox plugin (XPI). I have bumped the version to 0.95, although I have not made any attempt to do anything other than patch them. For reference, the patched code is part of the Firefox 3.5 development trunk. I have updated the plugins based on the latest Firefox 3 version on wtr.rubyforge.org and made them available here: http://github.com/ajcollins/JSSH-XPIs/tree/master The built XPIs are available in the "plugins" directory. You can build them yourself by running the scripts/build.sh shell script. == Caveats == - I've only tested this on Mac OS X 10.5.7 with Firefox 3.0.10. - I've not tested this against an old XPI, but the unit tests do run in this mode, so it should be fine but doesn't check the XPI. - The NoMethodError unit test still fails (I've done no further work on this). - This branch also has Lukas' patch for handling cookies. - This branch contains all of my other patches to date (it's based off of my master) == Further work == If anyone is keen to extend this... - Auto-increment the profile eg port9998, port9999 based on a class variable - Auto-create the profiles as required? - Separate out firefox.rb into multiple files dealing with the different areas of navigation, process handling etc - Separate out some of the XPCOM methods to reduce coupling with JSSH (JSSH becomes just a window into the browser, firewatir holds all of the brains) and reduce duplication - Replace the JSSH plugin with one of the alternatives Best wishes, Alex From michael_hwee at yahoo.com Mon May 18 12:17:48 2009 From: michael_hwee at yahoo.com (Michael Hwee) Date: Mon, 18 May 2009 09:17:48 -0700 (PDT) Subject: [Wtr-development] Firewatir - Multiple browsers In-Reply-To: <0D768EFC-CA66-4574-B341-4BC1F4D05514@gmail.com> References: <0D768EFC-CA66-4574-B341-4BC1F4D05514@gmail.com> Message-ID: <795330.11052.qm@web31803.mail.mud.yahoo.com> Thanks Alex for working this out. Really appreciate your effort! Michael ----- Original Message ---- From: Alex Collins To: Watir development Sent: Sunday, May 17, 2009 2:22:21 PM Subject: [Wtr-development] Firewatir - Multiple browsers I've been working on getting multiple browser support into Firewatir - WTR-224. I have now reached the stage where all unit tests pass and it seems stable. It should support both versions of the JSSH XPI. To work with multiple browsers you need to: - Install the patched XPI - Create additional profiles for each of the instances you wish to use (firefox -CreateProfile ) - Start Firefox in the profile and install the JSSH XPI (firefox -P ), then close Firefox. - Provide :multiple_browser_xpi => true as one of the options to Firefox.new - Provide :profile => 'profile_name' as one of the options to Firefox.new - Provide :port => 9998 (example) that the JSSH connection should be made on [this could be auto-incremented in future] For an example, see the multiple_browsers unit test. The code can be found here: http://github.com/ajcollins/watir/tree/multiple Additional testing - especially on other platforms - would be most appreciated. == XPIs == To get this to work, you need a patched Firefox plugin (XPI). I have bumped the version to 0.95, although I have not made any attempt to do anything other than patch them. For reference, the patched code is part of the Firefox 3.5 development trunk. I have updated the plugins based on the latest Firefox 3 version on wtr.rubyforge.org and made them available here: http://github.com/ajcollins/JSSH-XPIs/tree/master The built XPIs are available in the "plugins" directory. You can build them yourself by running the scripts/build.sh shell script. == Caveats == - I've only tested this on Mac OS X 10.5.7 with Firefox 3.0.10. - I've not tested this against an old XPI, but the unit tests do run in this mode, so it should be fine but doesn't check the XPI. - The NoMethodError unit test still fails (I've done no further work on this). - This branch also has Lukas' patch for handling cookies. - This branch contains all of my other patches to date (it's based off of my master) == Further work == If anyone is keen to extend this... - Auto-increment the profile eg port9998, port9999 based on a class variable - Auto-create the profiles as required? - Separate out firefox.rb into multiple files dealing with the different areas of navigation, process handling etc - Separate out some of the XPCOM methods to reduce coupling with JSSH (JSSH becomes just a window into the browser, firewatir holds all of the brains) and reduce duplication - Replace the JSSH plugin with one of the alternatives Best wishes, Alex _______________________________________________ Wtr-development mailing list Wtr-development at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-development From zeljko.filipin at wa-research.ch Thu May 28 05:03:18 2009 From: zeljko.filipin at wa-research.ch (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 28 May 2009 11:03:18 +0200 Subject: [Wtr-development] input_elements.rb Message-ID: I have been playing with Watir::FileField#set recently. Take a look if you are interested: http://tinyurl.com/qtpje3 When I wanted to see how the code I have been working on has been developed, I clicked `history` link, and got error message `Sorry, this commit log is taking too long to generate.` Then I took a look at Bret's original version but there is only a few commits there: http://tinyurl.com/qubdco Looks like input_elements.rb was created from watir.rb, but I can not locate that file. Can somebody help me? All I want is to see how Watir::FileField#set is developed. Even better, if somebody can explain to me why are we using this: thrd = Thread.new do system("rubyw -e \"require 'win32ole'; @autoit=WIN32OLE.new('AutoItX3.Control');") # shortened the code for clarity end thrd.join(1) Specifically, why are we calling ruby from ruby? And putting all code in a string (loosing sytax highlighting and all that good stuff). Is there an alternative that will create more readable code? ?eljko -------------- next part -------------- An HTML attachment was scrubbed... URL: From marekj.com at gmail.com Thu May 28 13:29:39 2009 From: marekj.com at gmail.com (marekj) Date: Thu, 28 May 2009 12:29:39 -0500 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: I use FileField in this way: pathFileName.gsub!("/", "\\") ie.bring_to_front #necessary for sending keys into window # instead fo ie.file_field(:name, "file").set(pathFileName) #Change it to setting focus and using AutoIt directly to set the pathFileName # instead of 1 line I change to 3 lines ie.file_field(:name, "file").focus autoit = WIN32OLE.new('AutoItX3.Control') autoit.Send pathFileName So this gets the input into the file field. the FileField#set uses a separate thread as we see and uses rubyw to silently execute the -e "code..." I wonder why you have POPUP_TITLES = ['Choose file', 'Choose File to Upload'] is there a diff between XP and Vista in titles? I'll look at some more later. marekj Watirloo: Semantic Page Objects in UseCases http://github.com/marekj/watirloo/ On Thu, May 28, 2009 at 4:03 AM, ?eljko Filipin wrote: > I have been playing with Watir::FileField#set recently. Take a look if you > are interested: > > http://tinyurl.com/qtpje3 > > When I wanted to see how the code I have been working on has been developed, > I clicked `history` link, and got error message `Sorry, this commit log is > taking too long to generate.` > > Then I took a look at Bret's original version but there is only a few > commits there: > > http://tinyurl.com/qubdco > > Looks like input_elements.rb was created from watir.rb, but I can not locate > that file. Can somebody help me? All I want is to see how > Watir::FileField#set is developed. > > Even better, if somebody can explain to me why are we using this: > > thrd = Thread.new do > ? system("rubyw -e \"require 'win32ole'; > @autoit=WIN32OLE.new('AutoItX3.Control');") # shortened the code for clarity > end > thrd.join(1) > > Specifically, why are we calling ruby from ruby? And putting all code in a > string (loosing sytax highlighting and all that good stuff). Is there an > alternative that will create more readable code? > > ?eljko > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > From arkie at compli.com Thu May 28 13:59:01 2009 From: arkie at compli.com (Alan Ark) Date: Thu, 28 May 2009 10:59:01 -0700 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: I think that the different titles come into play when using different versions of IE (6/7/8) -----Original Message----- From: wtr-development-bounces at rubyforge.org [mailto:wtr-development-bounces at rubyforge.org] On Behalf Of marekj Sent: Thursday, May 28, 2009 10:30 AM To: Watir development Subject: Re: [Wtr-development] input_elements.rb I use FileField in this way: pathFileName.gsub!("/", "\\") ie.bring_to_front #necessary for sending keys into window # instead fo ie.file_field(:name, "file").set(pathFileName) #Change it to setting focus and using AutoIt directly to set the pathFileName # instead of 1 line I change to 3 lines ie.file_field(:name, "file").focus autoit = WIN32OLE.new('AutoItX3.Control') autoit.Send pathFileName So this gets the input into the file field. the FileField#set uses a separate thread as we see and uses rubyw to silently execute the -e "code..." I wonder why you have POPUP_TITLES = ['Choose file', 'Choose File to Upload'] is there a diff between XP and Vista in titles? I'll look at some more later. marekj Watirloo: Semantic Page Objects in UseCases http://github.com/marekj/watirloo/ On Thu, May 28, 2009 at 4:03 AM, ?eljko Filipin wrote: > I have been playing with Watir::FileField#set recently. Take a look if you > are interested: > > http://tinyurl.com/qtpje3 > > When I wanted to see how the code I have been working on has been developed, > I clicked `history` link, and got error message `Sorry, this commit log is > taking too long to generate.` > > Then I took a look at Bret's original version but there is only a few > commits there: > > http://tinyurl.com/qubdco > > Looks like input_elements.rb was created from watir.rb, but I can not locate > that file. Can somebody help me? All I want is to see how > Watir::FileField#set is developed. > > Even better, if somebody can explain to me why are we using this: > > thrd = Thread.new do > ? system("rubyw -e \"require 'win32ole'; > @autoit=WIN32OLE.new('AutoItX3.Control');") # shortened the code for clarity > end > thrd.join(1) > > Specifically, why are we calling ruby from ruby? And putting all code in a > string (loosing sytax highlighting and all that good stuff). Is there an > alternative that will create more readable code? > > ?eljko > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > _______________________________________________ Wtr-development mailing list Wtr-development at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-development From marekj.com at gmail.com Thu May 28 14:35:44 2009 From: marekj.com at gmail.com (marekj) Date: Thu, 28 May 2009 13:35:44 -0500 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: On Thu, May 28, 2009 at 1:01 PM, Charley Baker wrote: > Hey, snip > The reason for the separate processes in some cases for dialog handling is > due to ruby threads not being native and our connection to IE through COM > can have a tendency to block. Ugly and has caused problems - namely the > latest click_no_wait not working posts due to a change in how the latest one > click installer handles cmd line args and quoting. Epiphany: This 'block' may be the reason some of my code craps out when I use threads for handling popups will try diff 'process' by invoking system('blabla') Thanks for the pointer. and click_no_wait not a problem for me upto ruby186-26.exe installer I saw it on ruby186-27.exe > > ?Bret and I have talked about an upcoming 1.7.0 release, for which I'd like > to get some of the fixes and merges...merged for lack of better terms. :) > There are quite a lot of merge conflicts plus the need to test on various > oses/browser versions. If anyone wants to help, I'd much appreciate it. I have WinXP+IE6 as my production platform and Vista+IE7 Ubutnu(J)+Firefox > ?Thanks guys, > Charley Baker > blog: http://blog.charleybaker.org/ > Lead Developer, Watir, http://wtr.rubyforge.org > QA Architect, Gap Inc Direct > marekj From marekj.com at gmail.com Thu May 28 16:01:24 2009 From: marekj.com at gmail.com (marekj) Date: Thu, 28 May 2009 15:01:24 -0500 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: Ubuntu has a nice ease about it, Got Firefox and xpi but have not run tests yet. I got Netbeans set up and Jedit as my primary text editor for Ruby. >From Ubuntu I got direct access to /media/windows partition but everything there seems to show up as mode 777 (clueless) I installed Virtualbox in hopes of running XP inside from Ubuntu (not done yet) I also installed VirtualBox in Vista thinking of Running Ubuntu in there or other versions of Win. currently ubuntu shows up at 800X600 resolution only. (clueless how to make it 1280, may need a driver etc..) My current project is to update all my production tests to rspec (I use mixture of test::unit and test/spec) Got a setup working to exit on failure in rspec that is very useful in exploratory testing. http://gist.github.com/118186 Also I keep track of browsers on the desktop and I store their handles to yaml so when I stop tests for exploratory testing I can restart and reuse browsers (even in multiple threads) with that storage mechanism. half baked code (with tests of course) http://github.com/marekj/watirloo/blob/b922677cf7bc0336f5b1d90db513f13d3ea40503/lib/watirloo/browsers_storage.rb http://github.com/marekj/watirloo/blob/b922677cf7bc0336f5b1d90db513f13d3ea40503/lib/watirloo/browsers.rb and I got this setup the BrowserEventsPublisher that helps me save HTML when I do testing. http://gist.github.com/112587 (no tests) and I am overwhelmed by Taza and Watircraft and Rubigen generator so much to do so little time. (I just felt like sharing this in a seemingly unrelated thread. oy) marekj Watirloo: Semantic Page Objects in UseCases http://github.com/marekj/watirloo/ On Thu, May 28, 2009 at 2:19 PM, Charley Baker wrote: > Marek, > > ?? How's Ubuntu working for you? Have you run the firewatir tests, I know > there are some issues with speed. I really don't feel like leafing through > all the threads on that conversation. Going multiple oses has been fun, but > it also means my primary operating mode is changing, must run those against > what I'm using to actually browse the web and do some work. :) Seriously > considering getting a mac mini to run this stuff. Of course my wife may kill > me with yet another computer in the house. :) > > > Charley Baker > blog: http://blog.charleybaker.org/ > Lead Developer, Watir, http://wtr.rubyforge.org > QA Architect, Gap Inc Direct > > > On Thu, May 28, 2009 at 12:35 PM, marekj wrote: >> >> On Thu, May 28, 2009 at 1:01 PM, Charley Baker >> wrote: >> > Hey, >> snip >> >> > The reason for the separate processes in some cases for dialog handling >> > is >> > due to ruby threads not being native and our connection to IE through >> > COM >> > can have a tendency to block. Ugly and has caused problems - namely the >> > latest click_no_wait not working posts due to a change in how the latest >> > one >> > click installer handles cmd line args and quoting. >> >> Epiphany: This 'block' may be the reason some of my code craps out >> when I use threads for handling popups >> will try diff 'process' by invoking system('blabla') >> Thanks for the pointer. >> and click_no_wait not a problem for me upto ruby186-26.exe installer >> I saw it on ruby186-27.exe >> >> > >> > ?Bret and I have talked about an upcoming 1.7.0 release, for which I'd >> > like >> > to get some of the fixes and merges...merged for lack of better terms. >> > :) >> > There are quite a lot of merge conflicts plus the need to test on >> > various >> > oses/browser versions. If anyone wants to help, I'd much appreciate it. >> >> I have WinXP+IE6 as my production platform >> and >> Vista+IE7 >> Ubutnu(J)+Firefox >> >> > ?Thanks guys, >> > Charley Baker >> > blog: http://blog.charleybaker.org/ >> > Lead Developer, Watir, http://wtr.rubyforge.org >> > QA Architect, Gap Inc Direct >> > >> >> marekj >> _______________________________________________ >> Wtr-development mailing list >> Wtr-development at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wtr-development > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > From marekj.com at gmail.com Thu May 28 20:15:17 2009 From: marekj.com at gmail.com (marekj) Date: Thu, 28 May 2009 19:15:17 -0500 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: I took the liberty and refactored a bit http://gist.github.com/119677 - got rid of POPUP_TITLES alltogether. (no reason to declare them and then massage them with inspect and gsub) - reversed position of titles to prefer 'Choose File to Upload' first as I think IE7 has greater share (I hope) - moved the code_string to be executed away from the execution mechanism, now you can see tigher thread block - and I was just fancy with system %Q|rubyw -e "#{code_as_string}"| mainly because I try to avoid escaping \"string\" (or should it be %q lowercase in this example?) AND: I wonder if there is also much difference between using @autoit.ControlSend(popup_title, '', 'Button2', '{ENTER}') versus @autoit.ControlClick(popup_title, '', 'Button2') I have not ran any Benchmark on it. Should you like my hacking please incorporate I did not run against IE7 Tested on winxp, ruby 1.8.6, IE6 blowser That was fun ( might be additcting) marekj Watirloo: Semantic Page Objects in UseCases http://github.com/marekj/watirloo/ On Thu, May 28, 2009 at 4:03 AM, ?eljko Filipin wrote: > I have been playing with Watir::FileField#set recently. Take a look if you > are interested: > > http://tinyurl.com/qtpje3 > > When I wanted to see how the code I have been working on has been developed, > I clicked `history` link, and got error message `Sorry, this commit log is > taking too long to generate.` > > Then I took a look at Bret's original version but there is only a few > commits there: > > http://tinyurl.com/qubdco > > Looks like input_elements.rb was created from watir.rb, but I can not locate > that file. Can somebody help me? All I want is to see how > Watir::FileField#set is developed. > > Even better, if somebody can explain to me why are we using this: > > thrd = Thread.new do > ? system("rubyw -e \"require 'win32ole'; > @autoit=WIN32OLE.new('AutoItX3.Control');") # shortened the code for clarity > end > thrd.join(1) > > Specifically, why are we calling ruby from ruby? And putting all code in a > string (loosing sytax highlighting and all that good stuff). Is there an > alternative that will create more readable code? > > ?eljko > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > From zeljko.filipin at wa-research.ch Fri May 29 04:21:17 2009 From: zeljko.filipin at wa-research.ch (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 29 May 2009 10:21:17 +0200 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: On Thu, May 28, 2009 at 7:29 PM, marekj wrote: > I wonder why you have POPUP_TITLES = ['Choose file', 'Choose File to Upload'] > is there a diff between XP and Vista in titles? No. IE6 and IE7 have 'Choose file', IE8 has 'Choose File to Upload'. ?eljko -------------- next part -------------- An HTML attachment was scrubbed... URL: From zeljko.filipin at wa-research.ch Fri May 29 04:39:56 2009 From: zeljko.filipin at wa-research.ch (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 29 May 2009 10:39:56 +0200 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: On Fri, May 29, 2009 at 2:15 AM, marekj wrote: > I took the liberty and refactored a bit Thanks, I will definitely move string declaration from thread and try to make it more readable. > - got rid of POPUP_TITLES alltogether. (no reason to declare them and > then massage them with inspect and gsub) Actually, POPUP_TITLES were requested at #watir irc channel by Jari Bakken. If you have OS language different than English, file upload popup title will be different. POPUP_TITLES allows you to add new file upload popup title with Watir::FileField::POPUP_TITLES << "My Funky Popup" > - reversed position of titles to prefer 'Choose File to Upload' first > as I think IE7 has greater share (I hope) Revert. No matter if IE6 or IE7 have bigger market share, they still have the same popup title. IE8 has low market share, so his title should be the second (making it about a second slower to find popup). > - moved the code_string to be executed away from the execution > mechanism, now you can see tigher thread block Nice. Will use. > - and I was just fancy with system %Q|rubyw -e "#{code_as_string}"| > mainly because I try to avoid escaping \"string\" > (or should it be %q lowercase in this example?) Will take a look. Thanks a lot Marek. ?eljko -------------- next part -------------- An HTML attachment was scrubbed... URL: From zeljko.filipin at wa-research.ch Fri May 29 09:14:52 2009 From: zeljko.filipin at wa-research.ch (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 29 May 2009 15:14:52 +0200 Subject: [Wtr-development] input_elements.rb In-Reply-To: <2a379a300905290552ga2b157bpa0b074b24505b771@mail.gmail.com> References: <2a379a300905290552ga2b157bpa0b074b24505b771@mail.gmail.com> Message-ID: On Fri, May 29, 2009 at 2:52 PM, Alan Baird wrote: > One thing I would add, change the 15 second timeout and make it an optional argument to set: "def set(path_to_file, popup_timeout=15)". I have set it to 15 because that was autoit timeout before. Why would you like to have a shorter timeout? If autoit can not find the popup, script will halt anyway. :) > Also, although I like the fact that this will work unmodified for all IE browsers, you will end up waiting for a while if your choice of window titles is long. True, but you would probably never have more that 3 or 4 titles. Each title brings approximately 1 second slow down. But I could probably say autoit not to wait for popup to appear, so there will be no delay. Will try. > Seems like this would be a good candidate to put in the option files and then if you were tweaking for speed, you could make sure that your choice of string would be the first one in the list. Good idea. Or just make the title of the popup an optional argument of FileField#set and then you will be sure that it only checks for one title. def set(path_to_file, popup_title = 'Choose file') There are a lot of possible things to do, not sure what to do. Anyway, this was just a way for me to get used to Git, Github and Watir code, I am not sure anybody really needs file uploads for IE8. :) ?eljko -------------- next part -------------- An HTML attachment was scrubbed... URL: From invite+ium~dwmd at facebookmail.com Fri May 29 10:41:38 2009 From: invite+ium~dwmd at facebookmail.com (Sunil Reddy) Date: Fri, 29 May 2009 07:41:38 -0700 Subject: [Wtr-development] Check out my photos on Facebook Message-ID: <3ee22f3fb55014ccfcae76ec00c04e2a@10.22.41.194> Hi wtr-development at rubyforge.org, I invited you to join Facebook a while back and wanted to remind you that once you join, we'll be able to connect online, share photos, organize groups and events, and more. Thanks, Sunil To sign up for Facebook, follow the link below: http://www.facebook.com/p.php?i=1609157505&k=SXMXPW523V6M5JE1RGVXUS&r wtr-development at rubyforge.org was invited to join Facebook by Sunil Reddy. If you do not wish to receive this type of email from Facebook in the future, please click on the link below to unsubscribe. http://www.facebook.com/o.php?k=b854ca&u=1810359447&mid=89f150G6be7e497G0G8 Facebook's offices are located at 1601 S. California Ave., Palo Alto, CA 94304. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marekj.com at gmail.com Fri May 29 12:30:55 2009 From: marekj.com at gmail.com (marekj) Date: Fri, 29 May 2009 11:30:55 -0500 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: ok, now I get the intention behind the POPUP_TITLES I also put them back in and reverted to your original array position. code here: http://gist.github.com/119677 again, this is becoming fun. thanks On Fri, May 29, 2009 at 3:39 AM, ?eljko Filipin wrote: > On Fri, May 29, 2009 at 2:15 AM, marekj wrote: >> I took the liberty and refactored a bit > > Thanks, I will definitely move string declaration from thread and try to > make it more readable. > >> - got rid of POPUP_TITLES alltogether. (no reason to declare them and >> then massage them with inspect and gsub) > > Actually, POPUP_TITLES were requested at #watir irc channel by Jari Bakken. > If you have OS language different than English, file upload popup title will > be different. POPUP_TITLES allows you to add new file upload popup title > with > > Watir::FileField::POPUP_TITLES << "My Funky Popup" > >> - reversed position of titles to prefer 'Choose File to Upload' first >> as I think IE7 has greater share (I hope) > > Revert. No matter if IE6 or IE7 have bigger market share, they still have > the same popup title. IE8 has low market share, so his title should be the > second (making it about a second slower to find popup). Thanks for explanation, I only had IE6 so I just assmed IE7 changed >> - moved the code_string to be executed away from the execution >> mechanism, now you can see tigher thread block > > Nice. Will use. > >> - and I was just fancy with system %Q|rubyw -e "#{code_as_string}"| >> mainly because I try to avoid escaping \"string\" >> (or should it be %q lowercase in this example?) > > Will take a look. > > Thanks a lot Marek. > > ?eljko > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > From aidy.lewis at googlemail.com Tue May 5 18:22:55 2009 From: aidy.lewis at googlemail.com (aidy lewis) Date: Tue, 5 May 2009 23:22:55 +0100 Subject: [Wtr-development] visible methods Message-ID: <7ac2300c0905051522r2cc9fb40tc9f4c92b8bce4152@mail.gmail.com> Hi, There is a contributions visible? method for IE and a JS one on the FireWatir wiki. Can anyone tell me why these methods are not added to their relevant Element classes in the core code please? -- Aidy blog: www.agiletester.co.uk twitter: http://twitter.com/aidy_lewis From bret at pettichord.com Tue May 5 18:40:25 2009 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 5 May 2009 17:40:25 -0500 Subject: [Wtr-development] visible methods In-Reply-To: <7ac2300c0905051522r2cc9fb40tc9f4c92b8bce4152@mail.gmail.com> References: <7ac2300c0905051522r2cc9fb40tc9f4c92b8bce4152@mail.gmail.com> Message-ID: I have a backlog of patches to be reviewed that are in Jira. I'd love to have help. Are these in Jira? Bret On Tue, May 5, 2009 at 5:22 PM, aidy lewis wrote: > Hi, > > There is a contributions visible? method for IE and a JS one on the > FireWatir wiki. > > Can anyone tell me why these methods are not added to their relevant > Element classes in the core code please? > > -- > Aidy > blog: www.agiletester.co.uk > twitter: http://twitter.com/aidy_lewis > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > -- Bret Pettichord CTO, WatirCraft LLC, www.watircraft.com Lead Developer, Watir, www.watir.com Blog, www.io.com/~wazmo/blog Twitter, www.twitter.com/bpettichord GTalk: bpettichord at gmail.com Ask Me About Watir Training www.watircraft.com/training -------------- next part -------------- An HTML attachment was scrubbed... URL: From davids at tower-mt.com Tue May 5 20:04:42 2009 From: davids at tower-mt.com (David Schmidt) Date: Tue, 5 May 2009 17:04:42 -0700 Subject: [Wtr-development] visible methods In-Reply-To: <7ac2300c0905051522r2cc9fb40tc9f4c92b8bce4152@mail.gmail.com> References: <7ac2300c0905051522r2cc9fb40tc9f4c92b8bce4152@mail.gmail.com> Message-ID: Aidy, The short story is that when I created that method (and others) I was working on writing screen scraping applications. In spite of the fact that the same functionality is used whether screen scraping or doing acceptance testing, I was told by Brent that Watir was for testing only and did NOT support screen scraping. When I questioned this attitude, given the same code is used for both, I was moderated and unable to post anything that disagreed with this or mentioned screen scraping. I posted that page to the wiki because nothing I wrote would get integrated into Watir proper. I have since moved on to other projects and no longer work with screen scraping applications so feel free to try and get that code integrated into Watir proper (with the fix in the comments). I'd like to retain the wiki page if possible as it shows one of my contributions to Watir. Be warned that there may be resistance to integrating that code JUST because of where it came from and why it was written (screen scraping). BTW, I still get folks emailing me with questions about both that method and the methods I came up with to attach to IE's modal dialog boxes, showing their usefulness to folks even though Brent refused to integrate them. David Schmidt davids at tower-mt.com On May 5, 2009, at 3:22 PM, aidy lewis wrote: > Hi, > > There is a contributions visible? method for IE and a JS one on the > FireWatir wiki. > > Can anyone tell me why these methods are not added to their relevant > Element classes in the core code please? > > -- > Aidy > blog: www.agiletester.co.uk > twitter: http://twitter.com/aidy_lewis > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development From paul.rogers at shaw.ca Tue May 5 21:06:21 2009 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 5 May 2009 19:06:21 -0600 Subject: [Wtr-development] Fwd: [Win32utils-devel] [ win32utils-Feature Requests-25792 ] Create a pure Ruby win32-ole library In-Reply-To: <20090506002938.A2C8318581E9@rubyforge.org> References: <20090506002938.A2C8318581E9@rubyforge.org> Message-ID: FYI ---------- Forwarded message ---------- From: Date: Tue, May 5, 2009 at 6:29 PM Subject: [Win32utils-devel] [ win32utils-Feature Requests-25792 ] Create a pure Ruby win32-ole library To: noreply at rubyforge.org Feature Requests item #25792, was opened at 2009-05-05 17:29 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=414&aid=25792&group_id=85 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Daniel Berger (djberg96) Assigned to: Nobody (None) Summary: Create a pure Ruby win32-ole library Initial Comment: The current Win32OLE library is a C monster, has some bugs, and doesn't have a particularly good interface. I think a pure Ruby version would be easier to write and maintain, could have a more Ruby-ish interface, and could be installed as a gem instead of people having to wait for the next release of Ruby. Regards, Dan (me) ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=414&aid=25792&group_id=85 _______________________________________________ win32utils-devel mailing list win32utils-devel at rubyforge.org http://rubyforge.org/mailman/listinfo/win32utils-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From bret at pettichord.com Tue May 5 21:53:47 2009 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 5 May 2009 20:53:47 -0500 Subject: [Wtr-development] visible methods In-Reply-To: References: <7ac2300c0905051522r2cc9fb40tc9f4c92b8bce4152@mail.gmail.com> Message-ID: Do we have unit tests for these? Bret On Tue, May 5, 2009 at 7:04 PM, David Schmidt wrote: > Aidy, > > The short story is that when I created that method (and others) I was > working on writing screen scraping applications. In spite of the fact that > the same functionality is used whether screen scraping or doing acceptance > testing, I was told by Brent that Watir was for testing only and did NOT > support screen scraping. > > When I questioned this attitude, given the same code is used for both, I > was moderated and unable to post anything that disagreed with this or > mentioned screen scraping. I posted that page to the wiki because nothing I > wrote would get integrated into Watir proper. > > I have since moved on to other projects and no longer work with screen > scraping applications so feel free to try and get that code integrated into > Watir proper (with the fix in the comments). I'd like to retain the wiki > page if possible as it shows one of my contributions to Watir. Be warned > that there may be resistance to integrating that code JUST because of where > it came from and why it was written (screen scraping). > > BTW, I still get folks emailing me with questions about both that method > and the methods I came up with to attach to IE's modal dialog boxes, showing > their usefulness to folks even though Brent refused to integrate them. > > David Schmidt > davids at tower-mt.com > > > > On May 5, 2009, at 3:22 PM, aidy lewis wrote: > > Hi, >> >> There is a contributions visible? method for IE and a JS one on the >> FireWatir wiki. >> >> Can anyone tell me why these methods are not added to their relevant >> Element classes in the core code please? >> >> -- >> Aidy >> blog: www.agiletester.co.uk >> twitter: http://twitter.com/aidy_lewis >> _______________________________________________ >> Wtr-development mailing list >> Wtr-development at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wtr-development >> > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > -- Bret Pettichord CTO, WatirCraft LLC, www.watircraft.com Lead Developer, Watir, www.watir.com Blog, www.io.com/~wazmo/blog Twitter, www.twitter.com/bpettichord GTalk: bpettichord at gmail.com Ask Me About Watir Training www.watircraft.com/training -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul.rogers at shaw.ca Tue May 5 22:32:19 2009 From: paul.rogers at shaw.ca (Paul Rogers) Date: Tue, 5 May 2009 20:32:19 -0600 Subject: [Wtr-development] visible methods In-Reply-To: References: <7ac2300c0905051522r2cc9fb40tc9f4c92b8bce4152@mail.gmail.com> Message-ID: I cant remember how these work, but they need to be used with caution. One app I work with makes things invisible by moving them off the screen. I have no idea how you test and code html all these different ways and explain to others what is meant by visible. I think I have used this code, or at least a simplified form that showed what was visible for the app I worked on. Paul On Tue, May 5, 2009 at 7:53 PM, Bret Pettichord wrote: > Do we have unit tests for these? > > Bret > > > On Tue, May 5, 2009 at 7:04 PM, David Schmidt wrote: > >> Aidy, >> >> The short story is that when I created that method (and others) I was >> working on writing screen scraping applications. In spite of the fact that >> the same functionality is used whether screen scraping or doing acceptance >> testing, I was told by Brent that Watir was for testing only and did NOT >> support screen scraping. >> >> When I questioned this attitude, given the same code is used for both, I >> was moderated and unable to post anything that disagreed with this or >> mentioned screen scraping. I posted that page to the wiki because nothing I >> wrote would get integrated into Watir proper. >> >> I have since moved on to other projects and no longer work with screen >> scraping applications so feel free to try and get that code integrated into >> Watir proper (with the fix in the comments). I'd like to retain the wiki >> page if possible as it shows one of my contributions to Watir. Be warned >> that there may be resistance to integrating that code JUST because of where >> it came from and why it was written (screen scraping). >> >> BTW, I still get folks emailing me with questions about both that method >> and the methods I came up with to attach to IE's modal dialog boxes, showing >> their usefulness to folks even though Brent refused to integrate them. >> >> David Schmidt >> davids at tower-mt.com >> >> >> >> On May 5, 2009, at 3:22 PM, aidy lewis wrote: >> >> Hi, >>> >>> There is a contributions visible? method for IE and a JS one on the >>> FireWatir wiki. >>> >>> Can anyone tell me why these methods are not added to their relevant >>> Element classes in the core code please? >>> >>> -- >>> Aidy >>> blog: www.agiletester.co.uk >>> twitter: http://twitter.com/aidy_lewis >>> _______________________________________________ >>> Wtr-development mailing list >>> Wtr-development at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/wtr-development >>> >> >> _______________________________________________ >> Wtr-development mailing list >> Wtr-development at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wtr-development >> > > > > -- > Bret Pettichord > CTO, WatirCraft LLC, www.watircraft.com > Lead Developer, Watir, www.watir.com > > Blog, www.io.com/~wazmo/blog > Twitter, www.twitter.com/bpettichord > GTalk: bpettichord at gmail.com > > Ask Me About Watir Training > www.watircraft.com/training > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > -------------- next part -------------- An HTML attachment was scrubbed... URL: From aidy.lewis at googlemail.com Wed May 6 06:43:04 2009 From: aidy.lewis at googlemail.com (aidy lewis) Date: Wed, 6 May 2009 11:43:04 +0100 Subject: [Wtr-development] visible methods In-Reply-To: References: <7ac2300c0905051522r2cc9fb40tc9f4c92b8bce4152@mail.gmail.com> Message-ID: <7ac2300c0905060343x7c822a7epefb691c2d881e7b@mail.gmail.com> > I have a backlog of patches to be reviewed that are in Jira. I'd love to have help. Are these in Jira? This: WTR-53 "Methods for visible/hidden" has been closed,when this method was added to contributions: class Watir::Element # If any parent element isn't visible then we cannot write to the # element. The only realiable way to determine this is to iterate # up the DOM element tree checking every element to make sure it's # visible. def visible? # Now iterate up the DOM element tree and return false if any # parent element isn't visible or is disabled. object = document while object begin if object.currentstyle.invoke('visibility') =~ /^hidden$/i return false end if object.currentstyle.invoke('display') =~ /^none$/i return false end if object.invoke('isDisabled') return false end rescue WIN32OLERuntimeError end object = object.parentElement end true end end The FireWatir method using JS is here: class Element def visible? assert_exists displayed= js_eval "#{element_object}.style.display" visibility= js_eval "#{element_object}.style.visibility" @@current_level = 0 !(displayed == "none" || visibility == "hidden") end end They both haven't got tests and without unit tests, they are unlikely to be accepted anywhere. >I cant remember how these work, but they need to be used with caution. One app I work with makes things invisible by moving them off the screen Then I think the first thing we should do in the method is assert_exists. Aidy 2009/5/6 Paul Rogers : > I cant remember how these work, but they need to be used with caution. One > app I work with makes things invisible by moving them off the screen. > > I have no idea how you test and code html all these different ways and > explain to others what is meant by visible. I think I have used this code, > or at least a simplified form that showed what was visible for the app I > worked on. > > Paul > > On Tue, May 5, 2009 at 7:53 PM, Bret Pettichord wrote: >> >> Do we have unit tests for these? >> >> Bret >> >> On Tue, May 5, 2009 at 7:04 PM, David Schmidt wrote: >>> >>> Aidy, >>> >>> The short story is that when I created that method (and others) I was >>> working on writing screen scraping applications. ?In spite of the fact that >>> the same functionality is used whether screen scraping or doing acceptance >>> testing, I was told by Brent that Watir was for testing only and did NOT >>> support screen scraping. >>> >>> When I questioned this attitude, given the same code is used for both, I >>> was moderated and unable to post anything that disagreed with this or >>> mentioned screen scraping. ?I posted that page to the wiki because nothing I >>> wrote would get integrated into Watir proper. >>> >>> I have since moved on to other projects and no longer work with screen >>> scraping applications so feel free to try and get that code integrated into >>> Watir proper (with the fix in the comments). ?I'd like to retain the wiki >>> page if possible as it shows one of my contributions to Watir. ?Be warned >>> that there may be resistance to integrating that code JUST because of where >>> it came from and why it was written (screen scraping). >>> >>> BTW, I still get folks emailing me with questions about both that method >>> and the methods I came up with to attach to IE's modal dialog boxes, showing >>> their usefulness to folks even though Brent refused to integrate them. >>> >>> David Schmidt >>> davids at tower-mt.com >>> >>> >>> On May 5, 2009, at 3:22 PM, aidy lewis wrote: >>> >>>> Hi, >>>> >>>> There is a contributions visible? method for IE and a JS one on the >>>> FireWatir wiki. >>>> >>>> Can anyone tell me why these methods are not added to their relevant >>>> Element classes in the core code please? >>>> >>>> -- >>>> Aidy >>>> blog: www.agiletester.co.uk >>>> twitter: http://twitter.com/aidy_lewis >>>> _______________________________________________ >>>> Wtr-development mailing list >>>> Wtr-development at rubyforge.org >>>> http://rubyforge.org/mailman/listinfo/wtr-development >>> >>> _______________________________________________ >>> Wtr-development mailing list >>> Wtr-development at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/wtr-development >> >> >> >> -- >> Bret Pettichord >> CTO, WatirCraft LLC, www.watircraft.com >> Lead Developer, Watir, www.watir.com >> >> Blog, www.io.com/~wazmo/blog >> Twitter, www.twitter.com/bpettichord >> GTalk: bpettichord at gmail.com >> >> Ask Me About Watir Training >> www.watircraft.com/training >> >> _______________________________________________ >> Wtr-development mailing list >> Wtr-development at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wtr-development > > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > -- Aidy blog: www.agiletester.co.uk twitter: http://twitter.com/aidy_lewis From paul.rogers at shaw.ca Wed May 6 11:16:39 2009 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 6 May 2009 09:16:39 -0600 Subject: [Wtr-development] visible methods In-Reply-To: <7ac2300c0905060343x7c822a7epefb691c2d881e7b@mail.gmail.com> References: <7ac2300c0905051522r2cc9fb40tc9f4c92b8bce4152@mail.gmail.com> <7ac2300c0905060343x7c822a7epefb691c2d881e7b@mail.gmail.com> Message-ID: here are 2 methods I appear to have been using. I say appear as its been along time, so I cant remember exactly def hidden? # log "---------id: #{self.id}---------" vis = self.style.visibility disp = self.attribute_value("style[\'display\']") #log "disp is #{disp}" #log "vis is #{vis}" return true if vis =='hidden' or disp == 'none' return false end def available? exists = self.exists? return false unless exists if self.respond_to? :enabled? enabled = self.enabled? else enabled = true end hidden = self.hidden? return false if self.left_edge < 0 return false if self.top_edge < 0 return true if ( enabled and !hidden ) return false end this appears to be specific to my app Paul On Wed, May 6, 2009 at 4:43 AM, aidy lewis wrote: > > I have a backlog of patches to be reviewed that are in Jira. I'd love to > have help. Are these in Jira? > > > This: > > WTR-53 "Methods for visible/hidden" > > has been closed,when this method was added to contributions: > > class Watir::Element > > # If any parent element isn't visible then we cannot write to the > # element. The only realiable way to determine this is to iterate > # up the DOM element tree checking every element to make sure it's > # visible. > def visible? > # Now iterate up the DOM element tree and return false if any > # parent element isn't visible or is disabled. > object = document > while object > begin > if object.currentstyle.invoke('visibility') =~ /^hidden$/i > return false > end > if object.currentstyle.invoke('display') =~ /^none$/i > return false > end > if object.invoke('isDisabled') > return false > end > rescue WIN32OLERuntimeError > end > object = object.parentElement > end > true > end > end > > The FireWatir method using JS is here: > > class Element > def visible? > assert_exists > displayed= js_eval "#{element_object}.style.display" > visibility= js_eval "#{element_object}.style.visibility" > @@current_level = 0 > !(displayed == "none" || visibility == "hidden") > end > end > > > They both haven't got tests and without unit tests, they are unlikely > to be accepted anywhere. > > >I cant remember how these work, but they need to be used with caution. One > app I work with makes things invisible by moving them off the screen > > Then I think the first thing we should do in the method is assert_exists. > > Aidy > > > > 2009/5/6 Paul Rogers : > > I cant remember how these work, but they need to be used with caution. > One > > app I work with makes things invisible by moving them off the screen. > > > > I have no idea how you test and code html all these different ways and > > explain to others what is meant by visible. I think I have used this > code, > > or at least a simplified form that showed what was visible for the app I > > worked on. > > > > Paul > > > > On Tue, May 5, 2009 at 7:53 PM, Bret Pettichord > wrote: > >> > >> Do we have unit tests for these? > >> > >> Bret > >> > >> On Tue, May 5, 2009 at 7:04 PM, David Schmidt > wrote: > >>> > >>> Aidy, > >>> > >>> The short story is that when I created that method (and others) I was > >>> working on writing screen scraping applications. In spite of the fact > that > >>> the same functionality is used whether screen scraping or doing > acceptance > >>> testing, I was told by Brent that Watir was for testing only and did > NOT > >>> support screen scraping. > >>> > >>> When I questioned this attitude, given the same code is used for both, > I > >>> was moderated and unable to post anything that disagreed with this or > >>> mentioned screen scraping. I posted that page to the wiki because > nothing I > >>> wrote would get integrated into Watir proper. > >>> > >>> I have since moved on to other projects and no longer work with screen > >>> scraping applications so feel free to try and get that code integrated > into > >>> Watir proper (with the fix in the comments). I'd like to retain the > wiki > >>> page if possible as it shows one of my contributions to Watir. Be > warned > >>> that there may be resistance to integrating that code JUST because of > where > >>> it came from and why it was written (screen scraping). > >>> > >>> BTW, I still get folks emailing me with questions about both that > method > >>> and the methods I came up with to attach to IE's modal dialog boxes, > showing > >>> their usefulness to folks even though Brent refused to integrate them. > >>> > >>> David Schmidt > >>> davids at tower-mt.com > >>> > >>> > >>> On May 5, 2009, at 3:22 PM, aidy lewis wrote: > >>> > >>>> Hi, > >>>> > >>>> There is a contributions visible? method for IE and a JS one on the > >>>> FireWatir wiki. > >>>> > >>>> Can anyone tell me why these methods are not added to their relevant > >>>> Element classes in the core code please? > >>>> > >>>> -- > >>>> Aidy > >>>> blog: www.agiletester.co.uk > >>>> twitter: http://twitter.com/aidy_lewis > >>>> _______________________________________________ > >>>> Wtr-development mailing list > >>>> Wtr-development at rubyforge.org > >>>> http://rubyforge.org/mailman/listinfo/wtr-development > >>> > >>> _______________________________________________ > >>> Wtr-development mailing list > >>> Wtr-development at rubyforge.org > >>> http://rubyforge.org/mailman/listinfo/wtr-development > >> > >> > >> > >> -- > >> Bret Pettichord > >> CTO, WatirCraft LLC, www.watircraft.com > >> Lead Developer, Watir, www.watir.com > >> > >> Blog, www.io.com/~wazmo/blog > >> Twitter, www.twitter.com/bpettichord > >> GTalk: bpettichord at gmail.com > >> > >> Ask Me About Watir Training > >> www.watircraft.com/training > >> > >> _______________________________________________ > >> Wtr-development mailing list > >> Wtr-development at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/wtr-development > > > > > > _______________________________________________ > > Wtr-development mailing list > > Wtr-development at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-development > > > > > > -- > Aidy > blog: www.agiletester.co.uk > twitter: http://twitter.com/aidy_lewis > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bret at pettichord.com Wed May 6 11:33:37 2009 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 6 May 2009 10:33:37 -0500 Subject: [Wtr-development] visible methods In-Reply-To: <7ac2300c0905060343x7c822a7epefb691c2d881e7b@mail.gmail.com> References: <7ac2300c0905051522r2cc9fb40tc9f4c92b8bce4152@mail.gmail.com> <7ac2300c0905060343x7c822a7epefb691c2d881e7b@mail.gmail.com> Message-ID: Aidy, Would you be willing to write unit tests for this? Bret On Wed, May 6, 2009 at 5:43 AM, aidy lewis wrote: > > I have a backlog of patches to be reviewed that are in Jira. I'd love to > have help. Are these in Jira? > > > This: > > WTR-53 "Methods for visible/hidden" > > has been closed,when this method was added to contributions: > > class Watir::Element > > # If any parent element isn't visible then we cannot write to the > # element. The only realiable way to determine this is to iterate > # up the DOM element tree checking every element to make sure it's > # visible. > def visible? > # Now iterate up the DOM element tree and return false if any > # parent element isn't visible or is disabled. > object = document > while object > begin > if object.currentstyle.invoke('visibility') =~ /^hidden$/i > return false > end > if object.currentstyle.invoke('display') =~ /^none$/i > return false > end > if object.invoke('isDisabled') > return false > end > rescue WIN32OLERuntimeError > end > object = object.parentElement > end > true > end > end > > The FireWatir method using JS is here: > > class Element > def visible? > assert_exists > displayed= js_eval "#{element_object}.style.display" > visibility= js_eval "#{element_object}.style.visibility" > @@current_level = 0 > !(displayed == "none" || visibility == "hidden") > end > end > > > They both haven't got tests and without unit tests, they are unlikely > to be accepted anywhere. > > >I cant remember how these work, but they need to be used with caution. One > app I work with makes things invisible by moving them off the screen > > Then I think the first thing we should do in the method is assert_exists. > > Aidy > > > > 2009/5/6 Paul Rogers : > > I cant remember how these work, but they need to be used with caution. > One > > app I work with makes things invisible by moving them off the screen. > > > > I have no idea how you test and code html all these different ways and > > explain to others what is meant by visible. I think I have used this > code, > > or at least a simplified form that showed what was visible for the app I > > worked on. > > > > Paul > > > > On Tue, May 5, 2009 at 7:53 PM, Bret Pettichord > wrote: > >> > >> Do we have unit tests for these? > >> > >> Bret > >> > >> On Tue, May 5, 2009 at 7:04 PM, David Schmidt > wrote: > >>> > >>> Aidy, > >>> > >>> The short story is that when I created that method (and others) I was > >>> working on writing screen scraping applications. In spite of the fact > that > >>> the same functionality is used whether screen scraping or doing > acceptance > >>> testing, I was told by Brent that Watir was for testing only and did > NOT > >>> support screen scraping. > >>> > >>> When I questioned this attitude, given the same code is used for both, > I > >>> was moderated and unable to post anything that disagreed with this or > >>> mentioned screen scraping. I posted that page to the wiki because > nothing I > >>> wrote would get integrated into Watir proper. > >>> > >>> I have since moved on to other projects and no longer work with screen > >>> scraping applications so feel free to try and get that code integrated > into > >>> Watir proper (with the fix in the comments). I'd like to retain the > wiki > >>> page if possible as it shows one of my contributions to Watir. Be > warned > >>> that there may be resistance to integrating that code JUST because of > where > >>> it came from and why it was written (screen scraping). > >>> > >>> BTW, I still get folks emailing me with questions about both that > method > >>> and the methods I came up with to attach to IE's modal dialog boxes, > showing > >>> their usefulness to folks even though Brent refused to integrate them. > >>> > >>> David Schmidt > >>> davids at tower-mt.com > >>> > >>> > >>> On May 5, 2009, at 3:22 PM, aidy lewis wrote: > >>> > >>>> Hi, > >>>> > >>>> There is a contributions visible? method for IE and a JS one on the > >>>> FireWatir wiki. > >>>> > >>>> Can anyone tell me why these methods are not added to their relevant > >>>> Element classes in the core code please? > >>>> > >>>> -- > >>>> Aidy > >>>> blog: www.agiletester.co.uk > >>>> twitter: http://twitter.com/aidy_lewis > >>>> _______________________________________________ > >>>> Wtr-development mailing list > >>>> Wtr-development at rubyforge.org > >>>> http://rubyforge.org/mailman/listinfo/wtr-development > >>> > >>> _______________________________________________ > >>> Wtr-development mailing list > >>> Wtr-development at rubyforge.org > >>> http://rubyforge.org/mailman/listinfo/wtr-development > >> > >> > >> > >> -- > >> Bret Pettichord > >> CTO, WatirCraft LLC, www.watircraft.com > >> Lead Developer, Watir, www.watir.com > >> > >> Blog, www.io.com/~wazmo/blog > >> Twitter, www.twitter.com/bpettichord > >> GTalk: bpettichord at gmail.com > >> > >> Ask Me About Watir Training > >> www.watircraft.com/training > >> > >> _______________________________________________ > >> Wtr-development mailing list > >> Wtr-development at rubyforge.org > >> http://rubyforge.org/mailman/listinfo/wtr-development > > > > > > _______________________________________________ > > Wtr-development mailing list > > Wtr-development at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-development > > > > > > -- > Aidy > blog: www.agiletester.co.uk > twitter: http://twitter.com/aidy_lewis > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > -- Bret Pettichord CTO, WatirCraft LLC, www.watircraft.com Lead Developer, Watir, www.watir.com Blog, www.io.com/~wazmo/blog Twitter, www.twitter.com/bpettichord GTalk: bpettichord at gmail.com Ask Me About Watir Training www.watircraft.com/training -------------- next part -------------- An HTML attachment was scrubbed... URL: From abaird at bairdsnet.net Wed May 6 11:32:32 2009 From: abaird at bairdsnet.net (Alan Baird) Date: Wed, 6 May 2009 10:32:32 -0500 Subject: [Wtr-development] visible methods In-Reply-To: References: <7ac2300c0905051522r2cc9fb40tc9f4c92b8bce4152@mail.gmail.com> <7ac2300c0905060343x7c822a7epefb691c2d881e7b@mail.gmail.com> Message-ID: <2a379a300905060832u10b8154ld3babf17723304c2@mail.gmail.com> We (the company I work for) use the visible? method in watir\lib\watir\contrib a lot. The basic use case we have is dealing with forms encapsulated in divs that can be hidden or visible. Personally, I feel like this should be in Watir since we use it all the time for our core testing. I am willing to attempt to write some tests for this code if that's what it takes, although I'm not so sure how to go about it. Any test would of course have to cover whether or not an element was visible or not. This would have to cover the case where the attribute was associated with the specific element in question or it's parents. This is all I can come up with right now but I'm sure there are several more complex cases. Some of the other testers at my company and I are thinking of some other cases we could write (I have copied them on this e-mail). If anyone else has some suggestions I would love to hear them. If we can come up with some good tests for visible? is this what is needed to get them incorporated? Alan On Wed, May 6, 2009 at 10:16 AM, Paul Rogers wrote: > here are 2 methods I appear to have been using. I say appear as its been > along time, so I cant remember exactly > def hidden? > # log "---------id: #{self.id}---------" > vis = self.style.visibility > disp = self.attribute_value("style[\'display\']") > #log "disp is #{disp}" > #log "vis is #{vis}" > return true if vis =='hidden' or disp == 'none' > return false > end > > def available? > > exists = self.exists? > return false unless exists > > if self.respond_to? :enabled? > enabled = self.enabled? > else > enabled = true > end > > hidden = self.hidden? > > return false if self.left_edge < 0 > return false if self.top_edge < 0 > return true if ( enabled and !hidden ) > return false > end > > > this appears to be specific to my app > > Paul > > > > > > > > On Wed, May 6, 2009 at 4:43 AM, aidy lewis wrote: > >> > I have a backlog of patches to be reviewed that are in Jira. I'd love to >> have help. Are these in Jira? >> >> >> This: >> >> WTR-53 "Methods for visible/hidden" >> >> has been closed,when this method was added to contributions: >> >> class Watir::Element >> >> # If any parent element isn't visible then we cannot write to the >> # element. The only realiable way to determine this is to iterate >> # up the DOM element tree checking every element to make sure it's >> # visible. >> def visible? >> # Now iterate up the DOM element tree and return false if any >> # parent element isn't visible or is disabled. >> object = document >> while object >> begin >> if object.currentstyle.invoke('visibility') =~ /^hidden$/i >> return false >> end >> if object.currentstyle.invoke('display') =~ /^none$/i >> return false >> end >> if object.invoke('isDisabled') >> return false >> end >> rescue WIN32OLERuntimeError >> end >> object = object.parentElement >> end >> true >> end >> end >> >> The FireWatir method using JS is here: >> >> class Element >> def visible? >> assert_exists >> displayed= js_eval "#{element_object}.style.display" >> visibility= js_eval "#{element_object}.style.visibility" >> @@current_level = 0 >> !(displayed == "none" || visibility == "hidden") >> end >> end >> >> >> They both haven't got tests and without unit tests, they are unlikely >> to be accepted anywhere. >> >> >I cant remember how these work, but they need to be used with caution. >> One app I work with makes things invisible by moving them off the screen >> >> Then I think the first thing we should do in the method is assert_exists. >> >> Aidy >> >> >> >> 2009/5/6 Paul Rogers : >> > I cant remember how these work, but they need to be used with caution. >> One >> > app I work with makes things invisible by moving them off the screen. >> > >> > I have no idea how you test and code html all these different ways and >> > explain to others what is meant by visible. I think I have used this >> code, >> > or at least a simplified form that showed what was visible for the app I >> > worked on. >> > >> > Paul >> > >> > On Tue, May 5, 2009 at 7:53 PM, Bret Pettichord >> wrote: >> >> >> >> Do we have unit tests for these? >> >> >> >> Bret >> >> >> >> On Tue, May 5, 2009 at 7:04 PM, David Schmidt >> wrote: >> >>> >> >>> Aidy, >> >>> >> >>> The short story is that when I created that method (and others) I was >> >>> working on writing screen scraping applications. In spite of the fact >> that >> >>> the same functionality is used whether screen scraping or doing >> acceptance >> >>> testing, I was told by Brent that Watir was for testing only and did >> NOT >> >>> support screen scraping. >> >>> >> >>> When I questioned this attitude, given the same code is used for both, >> I >> >>> was moderated and unable to post anything that disagreed with this or >> >>> mentioned screen scraping. I posted that page to the wiki because >> nothing I >> >>> wrote would get integrated into Watir proper. >> >>> >> >>> I have since moved on to other projects and no longer work with screen >> >>> scraping applications so feel free to try and get that code integrated >> into >> >>> Watir proper (with the fix in the comments). I'd like to retain the >> wiki >> >>> page if possible as it shows one of my contributions to Watir. Be >> warned >> >>> that there may be resistance to integrating that code JUST because of >> where >> >>> it came from and why it was written (screen scraping). >> >>> >> >>> BTW, I still get folks emailing me with questions about both that >> method >> >>> and the methods I came up with to attach to IE's modal dialog boxes, >> showing >> >>> their usefulness to folks even though Brent refused to integrate them. >> >>> >> >>> David Schmidt >> >>> davids at tower-mt.com >> >>> >> >>> >> >>> On May 5, 2009, at 3:22 PM, aidy lewis wrote: >> >>> >> >>>> Hi, >> >>>> >> >>>> There is a contributions visible? method for IE and a JS one on the >> >>>> FireWatir wiki. >> >>>> >> >>>> Can anyone tell me why these methods are not added to their relevant >> >>>> Element classes in the core code please? >> >>>> >> >>>> -- >> >>>> Aidy >> >>>> blog: www.agiletester.co.uk >> >>>> twitter: http://twitter.com/aidy_lewis >> >>>> _______________________________________________ >> >>>> Wtr-development mailing list >> >>>> Wtr-development at rubyforge.org >> >>>> http://rubyforge.org/mailman/listinfo/wtr-development >> >>> >> >>> _______________________________________________ >> >>> Wtr-development mailing list >> >>> Wtr-development at rubyforge.org >> >>> http://rubyforge.org/mailman/listinfo/wtr-development >> >> >> >> >> >> >> >> -- >> >> Bret Pettichord >> >> CTO, WatirCraft LLC, www.watircraft.com >> >> Lead Developer, Watir, www.watir.com >> >> >> >> Blog, www.io.com/~wazmo/blog >> >> Twitter, www.twitter.com/bpettichord >> >> GTalk: bpettichord at gmail.com >> >> >> >> Ask Me About Watir Training >> >> www.watircraft.com/training >> >> >> >> _______________________________________________ >> >> Wtr-development mailing list >> >> Wtr-development at rubyforge.org >> >> http://rubyforge.org/mailman/listinfo/wtr-development >> > >> > >> > _______________________________________________ >> > Wtr-development mailing list >> > Wtr-development at rubyforge.org >> > http://rubyforge.org/mailman/listinfo/wtr-development >> > >> >> >> >> -- >> Aidy >> blog: www.agiletester.co.uk >> twitter: http://twitter.com/aidy_lewis >> _______________________________________________ >> Wtr-development mailing list >> Wtr-development at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wtr-development >> > > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bret at pettichord.com Wed May 6 11:53:50 2009 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 6 May 2009 10:53:50 -0500 Subject: [Wtr-development] Watir 1.7 Status Message-ID: A couple of weeks ago I started working on the Watir 1.7 release. Here was my to-do list: 1. Write up release notes for commits that had been made since the Watir 1.6 releases. 2. Review patches in Jira. http://jira.openqa.org/secure/IssueNavigator.jspa?mode=hide&requestId=10474 3. Review pull requests in GitHub. After pulling together the list for #2 and getting about half-way through #1, I sprained my knee rollerblading. I'm only now getting back to this, and needless to say, have acquired quite a backlog of other work. Bret -- Bret Pettichord CTO, WatirCraft LLC, www.watircraft.com Lead Developer, Watir, www.watir.com Blog, www.io.com/~wazmo/blog Twitter, www.twitter.com/bpettichord GTalk: bpettichord at gmail.com Ask Me About Watir Training www.watircraft.com/training -------------- next part -------------- An HTML attachment was scrubbed... URL: From bret at pettichord.com Wed May 6 12:05:54 2009 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 6 May 2009 11:05:54 -0500 Subject: [Wtr-development] visible methods In-Reply-To: <2a379a300905060832u10b8154ld3babf17723304c2@mail.gmail.com> References: <7ac2300c0905051522r2cc9fb40tc9f4c92b8bce4152@mail.gmail.com> <7ac2300c0905060343x7c822a7epefb691c2d881e7b@mail.gmail.com> <2a379a300905060832u10b8154ld3babf17723304c2@mail.gmail.com> Message-ID: I think you understand the issues involved. We need to have unit tests for new features so that we can ensure that they are implemented compatibly by the different implementations of Watir. The lack of unit tests for this method was the reason this was placed in contrib, rather than in core Watir. Bret On Wed, May 6, 2009 at 10:32 AM, Alan Baird wrote: > We (the company I work for) use the visible? method > in watir\lib\watir\contrib a lot. The basic use case we have is dealing > with forms encapsulated in divs that can be hidden or visible. Personally, > I feel like this should be in Watir since we use it all the time for our > core testing. I am willing to attempt to write some tests for this code if > that's what it takes, although I'm not so sure how to go about it. > Any test would of course have to cover whether or not an element was > visible or not. This would have to cover the case where the attribute was > associated with the specific element in question or it's parents. This is > all I can come up with right now but I'm sure there are several more complex > cases. Some of the other testers at my company and I are thinking of some > other cases we could write (I have copied them on this e-mail). If anyone > else has some suggestions I would love to hear them. > > If we can come up with some good tests for visible? is this what is needed > to get them incorporated? > > Alan > > > On Wed, May 6, 2009 at 10:16 AM, Paul Rogers wrote: > >> here are 2 methods I appear to have been using. I say appear as its been >> along time, so I cant remember exactly >> def hidden? >> # log "---------id: #{self.id}---------" >> vis = self.style.visibility >> disp = self.attribute_value("style[\'display\']") >> #log "disp is #{disp}" >> #log "vis is #{vis}" >> return true if vis =='hidden' or disp == 'none' >> return false >> end >> >> def available? >> >> exists = self.exists? >> return false unless exists >> >> if self.respond_to? :enabled? >> enabled = self.enabled? >> else >> enabled = true >> end >> >> hidden = self.hidden? >> >> return false if self.left_edge < 0 >> return false if self.top_edge < 0 >> return true if ( enabled and !hidden ) >> return false >> end >> >> >> this appears to be specific to my app >> >> Paul >> >> >> >> >> >> >> >> On Wed, May 6, 2009 at 4:43 AM, aidy lewis wrote: >> >>> > I have a backlog of patches to be reviewed that are in Jira. I'd love >>> to have help. Are these in Jira? >>> >>> >>> This: >>> >>> WTR-53 "Methods for visible/hidden" >>> >>> has been closed,when this method was added to contributions: >>> >>> class Watir::Element >>> >>> # If any parent element isn't visible then we cannot write to the >>> # element. The only realiable way to determine this is to iterate >>> # up the DOM element tree checking every element to make sure it's >>> # visible. >>> def visible? >>> # Now iterate up the DOM element tree and return false if any >>> # parent element isn't visible or is disabled. >>> object = document >>> while object >>> begin >>> if object.currentstyle.invoke('visibility') =~ /^hidden$/i >>> return false >>> end >>> if object.currentstyle.invoke('display') =~ /^none$/i >>> return false >>> end >>> if object.invoke('isDisabled') >>> return false >>> end >>> rescue WIN32OLERuntimeError >>> end >>> object = object.parentElement >>> end >>> true >>> end >>> end >>> >>> The FireWatir method using JS is here: >>> >>> class Element >>> def visible? >>> assert_exists >>> displayed= js_eval "#{element_object}.style.display" >>> visibility= js_eval "#{element_object}.style.visibility" >>> @@current_level = 0 >>> !(displayed == "none" || visibility == "hidden") >>> end >>> end >>> >>> >>> They both haven't got tests and without unit tests, they are unlikely >>> to be accepted anywhere. >>> >>> >I cant remember how these work, but they need to be used with caution. >>> One app I work with makes things invisible by moving them off the screen >>> >>> Then I think the first thing we should do in the method is assert_exists. >>> >>> Aidy >>> >>> >>> >>> 2009/5/6 Paul Rogers : >>> > I cant remember how these work, but they need to be used with caution. >>> One >>> > app I work with makes things invisible by moving them off the screen. >>> > >>> > I have no idea how you test and code html all these different ways and >>> > explain to others what is meant by visible. I think I have used this >>> code, >>> > or at least a simplified form that showed what was visible for the app >>> I >>> > worked on. >>> > >>> > Paul >>> > >>> > On Tue, May 5, 2009 at 7:53 PM, Bret Pettichord >>> wrote: >>> >> >>> >> Do we have unit tests for these? >>> >> >>> >> Bret >>> >> >>> >> On Tue, May 5, 2009 at 7:04 PM, David Schmidt >>> wrote: >>> >>> >>> >>> Aidy, >>> >>> >>> >>> The short story is that when I created that method (and others) I was >>> >>> working on writing screen scraping applications. In spite of the >>> fact that >>> >>> the same functionality is used whether screen scraping or doing >>> acceptance >>> >>> testing, I was told by Brent that Watir was for testing only and did >>> NOT >>> >>> support screen scraping. >>> >>> >>> >>> When I questioned this attitude, given the same code is used for >>> both, I >>> >>> was moderated and unable to post anything that disagreed with this or >>> >>> mentioned screen scraping. I posted that page to the wiki because >>> nothing I >>> >>> wrote would get integrated into Watir proper. >>> >>> >>> >>> I have since moved on to other projects and no longer work with >>> screen >>> >>> scraping applications so feel free to try and get that code >>> integrated into >>> >>> Watir proper (with the fix in the comments). I'd like to retain the >>> wiki >>> >>> page if possible as it shows one of my contributions to Watir. Be >>> warned >>> >>> that there may be resistance to integrating that code JUST because of >>> where >>> >>> it came from and why it was written (screen scraping). >>> >>> >>> >>> BTW, I still get folks emailing me with questions about both that >>> method >>> >>> and the methods I came up with to attach to IE's modal dialog boxes, >>> showing >>> >>> their usefulness to folks even though Brent refused to integrate >>> them. >>> >>> >>> >>> David Schmidt >>> >>> davids at tower-mt.com >>> >>> >>> >>> >>> >>> On May 5, 2009, at 3:22 PM, aidy lewis wrote: >>> >>> >>> >>>> Hi, >>> >>>> >>> >>>> There is a contributions visible? method for IE and a JS one on the >>> >>>> FireWatir wiki. >>> >>>> >>> >>>> Can anyone tell me why these methods are not added to their relevant >>> >>>> Element classes in the core code please? >>> >>>> >>> >>>> -- >>> >>>> Aidy >>> >>>> blog: www.agiletester.co.uk >>> >>>> twitter: http://twitter.com/aidy_lewis >>> >>>> _______________________________________________ >>> >>>> Wtr-development mailing list >>> >>>> Wtr-development at rubyforge.org >>> >>>> http://rubyforge.org/mailman/listinfo/wtr-development >>> >>> >>> >>> _______________________________________________ >>> >>> Wtr-development mailing list >>> >>> Wtr-development at rubyforge.org >>> >>> http://rubyforge.org/mailman/listinfo/wtr-development >>> >> >>> >> >>> >> >>> >> -- >>> >> Bret Pettichord >>> >> CTO, WatirCraft LLC, www.watircraft.com >>> >> Lead Developer, Watir, www.watir.com >>> >> >>> >> Blog, www.io.com/~wazmo/blog >>> >> Twitter, www.twitter.com/bpettichord >>> >> GTalk: bpettichord at gmail.com >>> >> >>> >> Ask Me About Watir Training >>> >> www.watircraft.com/training >>> >> >>> >> _______________________________________________ >>> >> Wtr-development mailing list >>> >> Wtr-development at rubyforge.org >>> >> http://rubyforge.org/mailman/listinfo/wtr-development >>> > >>> > >>> > _______________________________________________ >>> > Wtr-development mailing list >>> > Wtr-development at rubyforge.org >>> > http://rubyforge.org/mailman/listinfo/wtr-development >>> > >>> >>> >>> >>> -- >>> Aidy >>> blog: www.agiletester.co.uk >>> twitter: http://twitter.com/aidy_lewis >>> _______________________________________________ >>> Wtr-development mailing list >>> Wtr-development at rubyforge.org >>> http://rubyforge.org/mailman/listinfo/wtr-development >>> >> >> >> _______________________________________________ >> Wtr-development mailing list >> Wtr-development at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wtr-development >> > > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > -- Bret Pettichord CTO, WatirCraft LLC, www.watircraft.com Lead Developer, Watir, www.watir.com Blog, www.io.com/~wazmo/blog Twitter, www.twitter.com/bpettichord GTalk: bpettichord at gmail.com Ask Me About Watir Training www.watircraft.com/training -------------- next part -------------- An HTML attachment was scrubbed... URL: From aidy.lewis at googlemail.com Wed May 6 12:06:43 2009 From: aidy.lewis at googlemail.com (aidy lewis) Date: Wed, 6 May 2009 17:06:43 +0100 Subject: [Wtr-development] visible methods In-Reply-To: References: <7ac2300c0905051522r2cc9fb40tc9f4c92b8bce4152@mail.gmail.com> <7ac2300c0905060343x7c822a7epefb691c2d881e7b@mail.gmail.com> Message-ID: <7ac2300c0905060906l4fcd75e1s526c1d2183d164c7@mail.gmail.com> 2009/5/6 Bret Pettichord : > Aidy, > > Would you be willing to write unit tests for this? > > Bret > I will write some post-implementation tests that could retrospectively influence design. Aidy From bret at pettichord.com Wed May 6 12:11:45 2009 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 6 May 2009 11:11:45 -0500 Subject: [Wtr-development] Fwd: [Win32utils-devel] [ win32utils-Feature Requests-25792 ] Create a pure Ruby win32-ole library In-Reply-To: References: <20090506002938.A2C8318581E9@rubyforge.org> Message-ID: OK. Now we just need to find someone who would want to write it. Bret On Tue, May 5, 2009 at 8:06 PM, Paul Rogers wrote: > > FYI > > ---------- Forwarded message ---------- > From: > Date: Tue, May 5, 2009 at 6:29 PM > Subject: [Win32utils-devel] [ win32utils-Feature Requests-25792 ] Create a > pure Ruby win32-ole library > To: noreply at rubyforge.org > > > Feature Requests item #25792, was opened at 2009-05-05 17:29 > You can respond by visiting: > http://rubyforge.org/tracker/?func=detail&atid=414&aid=25792&group_id=85 > > Category: None > Group: None > Status: Open > Resolution: None > Priority: 3 > Submitted By: Daniel Berger (djberg96) > Assigned to: Nobody (None) > Summary: Create a pure Ruby win32-ole library > > Initial Comment: > The current Win32OLE library is a C monster, has some bugs, and doesn't > have a particularly good interface. > > I think a pure Ruby version would be easier to write and maintain, could > have a more Ruby-ish interface, and could be installed as a gem instead of > people having to wait for the next release of Ruby. > > Regards, > > Dan (me) > > ---------------------------------------------------------------------- > > You can respond by visiting: > http://rubyforge.org/tracker/?func=detail&atid=414&aid=25792&group_id=85 > _______________________________________________ > win32utils-devel mailing list > win32utils-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/win32utils-devel > > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > -- Bret Pettichord CTO, WatirCraft LLC, www.watircraft.com Lead Developer, Watir, www.watir.com Blog, www.io.com/~wazmo/blog Twitter, www.twitter.com/bpettichord GTalk: bpettichord at gmail.com Ask Me About Watir Training www.watircraft.com/training -------------- next part -------------- An HTML attachment was scrubbed... URL: From bret at pettichord.com Wed May 6 12:37:47 2009 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 6 May 2009 11:37:47 -0500 Subject: [Wtr-development] visible methods In-Reply-To: <7ac2300c0905060906l4fcd75e1s526c1d2183d164c7@mail.gmail.com> References: <7ac2300c0905051522r2cc9fb40tc9f4c92b8bce4152@mail.gmail.com> <7ac2300c0905060343x7c822a7epefb691c2d881e7b@mail.gmail.com> <7ac2300c0905060906l4fcd75e1s526c1d2183d164c7@mail.gmail.com> Message-ID: According to this ticket, Charley fixed this problem last fall. http://jira.openqa.org/browse/WTR-262 The code is in trunk, and thus would be included in the 1.7 release. Bret On Wed, May 6, 2009 at 11:06 AM, aidy lewis wrote: > 2009/5/6 Bret Pettichord : > > Aidy, > > > > Would you be willing to write unit tests for this? > > > > Bret > > > > I will write some post-implementation tests that could retrospectively > influence design. > > Aidy > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > -- Bret Pettichord CTO, WatirCraft LLC, www.watircraft.com Lead Developer, Watir, www.watir.com Blog, www.io.com/~wazmo/blog Twitter, www.twitter.com/bpettichord GTalk: bpettichord at gmail.com Ask Me About Watir Training www.watircraft.com/training -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul.rogers at shaw.ca Wed May 6 13:03:44 2009 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 6 May 2009 11:03:44 -0600 Subject: [Wtr-development] Fwd: [Win32utils-devel] [ win32utils-Feature Requests-25792 ] Create a pure Ruby win32-ole library In-Reply-To: References: <20090506002938.A2C8318581E9@rubyforge.org> Message-ID: Bret, looks like some of its been done ---------- Forwarded message ---------- From: Heesob Park Date: Wed, May 6, 2009 at 12:31 AM Subject: Re: [Win32utils-devel] [ win32utils-Feature Requests-25792 ] Create a pure Ruby win32-ole library To: Development and ideas for win32utils projects < win32utils-devel at rubyforge.org> 2009/5/6 : > Feature Requests item #25792, was opened at 2009-05-05 17:29 > You can respond by visiting: > http://rubyforge.org/tracker/?func=detail&atid=414&aid=25792&group_id=85 > > Category: None > Group: None > Status: Open > Resolution: None > Priority: 3 > Submitted By: Daniel Berger (djberg96) > Assigned to: Nobody (None) > Summary: Create a pure Ruby win32-ole library > > Initial Comment: > The current Win32OLE library is a C monster, has some bugs, and doesn't have a particularly good interface. > > I think a pure Ruby version would be easier to write and maintain, could have a more Ruby-ish interface, and could be installed as a gem instead of people having to wait for the next release of Ruby. > As you know, OLE Automation programming in C is more difficult than in C++. Furthermore, OLE Automation programming in pure Ruby is a pain :) Here is a literal translation of the sample code from http://support.microsoft.com/kb/181473 require 'windows/com' require 'windows/unicode' require 'windows/error' require 'windows/national' require 'windows/msvcrt/buffer' include Windows::COM include Windows::Unicode include Windows::National include Windows::Error include Windows::MSVCRT::Buffer VariantInit = Win32::API.new('VariantInit', 'P', 'V', 'oleaut32') OleUninitialize = Win32::API.new('OleUninitialize', 'V', 'V', 'ole32') DISPID_UNKNOWN = -1 DISPID_VALUE = 0 DISPID_PROPERTYPUT = -3 DISPID_NEWENUM = -4 DISPID_EVALUATE = -5 DISPID_CONSTRUCTOR = -6 DISPID_DESTRUCTOR = -7 DISPID_COLLECT = -8 DISPATCH_METHOD = 0x1 DISPATCH_PROPERTYGET = 0x2 DISPATCH_PROPERTYPUT = 0x4 DISPATCH_PROPERTYPUTREF = 0x8 # Initialize OLE Libraries. OleInitialize() # Get CLSID for Excel.Application from registry. clsid_ptr = 0.chr * 4 hr = CLSIDFromProgID(multi_to_wide("Excel.Application"), clsid_ptr) clsid = clsid_ptr.unpack('L').first if hr != S_OK raise StandardError, "Excel not registered." end # Start Excel97, Excel 2000, or Excel 2002 and get its IDispatch pointer. pDisp = 0.chr * 4 IID_IDispatch = [0x00020400,0x0000,0x0000,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x46].pack('LSSC8') hr = CoCreateInstance(clsid_ptr, nil, CLSCTX_LOCAL_SERVER, IID_IDispatch, pDisp) if hr != S_OK raise StandardError, "Couldn't start Excel." end pDisp = pDisp.unpack('L').first # Get the 'visible' property's DISPID. ucPtr = multi_to_wide("Visible") lpVtbl = 0.chr * 4 table = 0.chr * 28 memcpy(lpVtbl,pDisp,4) memcpy(table,lpVtbl.unpack('L').first,28) table = table.unpack('L*') GetIDsOfNames = Win32::API::Function.new(table[5],'PPPLLP','L') dispID = 0.chr * 4 IID_NULL = [0x00000000,0x0000,0x0000,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00].pack('LSSC8') GetIDsOfNames.call(pDisp,IID_NULL,[ucPtr].pack('P'),1,LOCALE_USER_DEFAULT,dispID) dispID = dispID.unpack('L').first puts("DISPID for 'Visible' property = 0x%08x" % dispID) # Initiate parameters to set visible property to true. parm1 = [VT_I4,0,0,0,1,0].pack('SSSSLL') # One argument. # Handle special-case for property-puts! dispidNamed = [DISPID_PROPERTYPUT].pack('L') dispParams = [[parm1].pack('P').unpack('L').first,[dispidNamed].pack('P').unpack('L').first,1,1].pack('LLLL') # Set 'visible' property to true. Invoke = Win32::API::Function.new(table[6],'PLPLLPPPP','L') hr = Invoke.call(pDisp, dispID, IID_NULL, LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYPUT | DISPATCH_METHOD, dispParams, nil, nil, nil) if hr != S_OK raise StandardError, "IDispatch::Invoke() failed with %08x" % hr end puts "done." gets # Uninitialize OLE Libraries. OleUninitialize.call() Regards, Park Heesob _______________________________________________ win32utils-devel mailing list win32utils-devel at rubyforge.org http://rubyforge.org/mailman/listinfo/win32utils-devel -------------- next part -------------- An HTML attachment was scrubbed... URL: From xflibble at yahoo.com Sun May 10 21:43:21 2009 From: xflibble at yahoo.com (Jared Quinert) Date: Sun, 10 May 2009 18:43:21 -0700 (PDT) Subject: [Wtr-development] Pop-ups Message-ID: <375242.35131.qm@web50409.mail.re2.yahoo.com> Posted this originally to the general list, but thought this might be a better forum, with some more specifics - A few pages I'm scripting against pop up IE's 'Security information' dialog boxes due to the link being https instead of http. The main issue I have is that Watir is 'blocked'. There's no timeout or error when the popup appears. The current example for handling these popups (http://wiki.openqa.org/display/WTR/Security+Alerts) looks like it's creating a new browser class, not extending the existing one. I tried to extend the IE class but couldn't figure out my way around an error I was getting. In the end, I came up with the extension below. As I don't want all my requests to have to pause and check for the presence of a security dialog box, I had to introduce the condition on secure requests. I'm really expecting the security prompt to cause a timeout, then I could handle the exception by checking for pop-ups. Is there any way to get Watir to timeout on these? (My current extension) class Watir::IE # Modified Watir's goto method so that it clears the security information box on pages that mix secure and non-secure items def goto(url) wsh = WIN32OLE.new('Wscript.Shell') m = Thread.new(self) { @ie.navigate(url) wait } if url.match(/^https/) t = Thread.new(){ sleep 2 8.times {sleep 1} if !wsh.AppActivate('Security Information') wsh.SendKeys("{ESC}") if wsh.AppActivate('Security Information') } end m.join t.join if url.match(/^https/) return @down_load_time end end On May 7, 9:58 am, Jared wrote: > Hi, > > Just taking a quick look at the example onhttp://wiki.openqa.org/display/WTR/Security+Alerts > > Is this still the general way to do it, now that there's an actual > Watir class 'Browser'? > > Jared From paul.rogers at shaw.ca Sun May 10 22:41:45 2009 From: paul.rogers at shaw.ca (Paul Rogers) Date: Sun, 10 May 2009 20:41:45 -0600 Subject: [Wtr-development] Pop-ups In-Reply-To: <375242.35131.qm@web50409.mail.re2.yahoo.com> References: <375242.35131.qm@web50409.mail.re2.yahoo.com> Message-ID: I think the security pop up will block watir, so it wont create the timeout exception. Paul On Sun, May 10, 2009 at 7:43 PM, Jared Quinert wrote: > > Posted this originally to the general list, but thought this might be a > better forum, with some more specifics - > > A few pages I'm scripting against pop up IE's 'Security information' dialog > boxes due to the link being https instead of http. The main issue I have is > that Watir is 'blocked'. There's no timeout or error when the popup > appears. > > The current example for handling these popups ( > http://wiki.openqa.org/display/WTR/Security+Alerts) looks like it's > creating a new browser class, not extending the existing one. I tried to > extend the IE class but couldn't figure out my way around an error I was > getting. > > In the end, I came up with the extension below. As I don't want all my > requests to have to pause and check for the presence of a security dialog > box, I had to introduce the condition on secure requests. I'm really > expecting the security prompt to cause a timeout, then I could handle the > exception by checking for pop-ups. Is there any way to get Watir to timeout > on these? > > > (My current extension) > class Watir::IE > > # Modified Watir's goto method so that it clears the security information > box on pages that mix secure and non-secure items > > def goto(url) > wsh = WIN32OLE.new('Wscript.Shell') > m = Thread.new(self) { > @ie.navigate(url) > wait > } > if url.match(/^https/) > t = Thread.new(){ > sleep 2 > 8.times {sleep 1} if !wsh.AppActivate('Security Information') > wsh.SendKeys("{ESC}") if wsh.AppActivate('Security Information') > } > end > > m.join > t.join if url.match(/^https/) > return @down_load_time > end > end > > > > > On May 7, 9:58 am, Jared wrote: > > Hi, > > > > Just taking a quick look at the example onhttp:// > wiki.openqa.org/display/WTR/Security+Alerts > > > > Is this still the general way to do it, now that there's an actual > > Watir class 'Browser'? > > > > Jared > > > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.j.collins.02 at gmail.com Sun May 17 17:22:21 2009 From: a.j.collins.02 at gmail.com (Alex Collins) Date: Sun, 17 May 2009 22:22:21 +0100 Subject: [Wtr-development] Firewatir - Multiple browsers Message-ID: <0D768EFC-CA66-4574-B341-4BC1F4D05514@gmail.com> I've been working on getting multiple browser support into Firewatir - WTR-224. I have now reached the stage where all unit tests pass and it seems stable. It should support both versions of the JSSH XPI. To work with multiple browsers you need to: - Install the patched XPI - Create additional profiles for each of the instances you wish to use (firefox -CreateProfile ) - Start Firefox in the profile and install the JSSH XPI (firefox -P ), then close Firefox. - Provide :multiple_browser_xpi => true as one of the options to Firefox.new - Provide :profile => 'profile_name' as one of the options to Firefox.new - Provide :port => 9998 (example) that the JSSH connection should be made on [this could be auto-incremented in future] For an example, see the multiple_browsers unit test. The code can be found here: http://github.com/ajcollins/watir/tree/multiple Additional testing - especially on other platforms - would be most appreciated. == XPIs == To get this to work, you need a patched Firefox plugin (XPI). I have bumped the version to 0.95, although I have not made any attempt to do anything other than patch them. For reference, the patched code is part of the Firefox 3.5 development trunk. I have updated the plugins based on the latest Firefox 3 version on wtr.rubyforge.org and made them available here: http://github.com/ajcollins/JSSH-XPIs/tree/master The built XPIs are available in the "plugins" directory. You can build them yourself by running the scripts/build.sh shell script. == Caveats == - I've only tested this on Mac OS X 10.5.7 with Firefox 3.0.10. - I've not tested this against an old XPI, but the unit tests do run in this mode, so it should be fine but doesn't check the XPI. - The NoMethodError unit test still fails (I've done no further work on this). - This branch also has Lukas' patch for handling cookies. - This branch contains all of my other patches to date (it's based off of my master) == Further work == If anyone is keen to extend this... - Auto-increment the profile eg port9998, port9999 based on a class variable - Auto-create the profiles as required? - Separate out firefox.rb into multiple files dealing with the different areas of navigation, process handling etc - Separate out some of the XPCOM methods to reduce coupling with JSSH (JSSH becomes just a window into the browser, firewatir holds all of the brains) and reduce duplication - Replace the JSSH plugin with one of the alternatives Best wishes, Alex From michael_hwee at yahoo.com Mon May 18 12:17:48 2009 From: michael_hwee at yahoo.com (Michael Hwee) Date: Mon, 18 May 2009 09:17:48 -0700 (PDT) Subject: [Wtr-development] Firewatir - Multiple browsers In-Reply-To: <0D768EFC-CA66-4574-B341-4BC1F4D05514@gmail.com> References: <0D768EFC-CA66-4574-B341-4BC1F4D05514@gmail.com> Message-ID: <795330.11052.qm@web31803.mail.mud.yahoo.com> Thanks Alex for working this out. Really appreciate your effort! Michael ----- Original Message ---- From: Alex Collins To: Watir development Sent: Sunday, May 17, 2009 2:22:21 PM Subject: [Wtr-development] Firewatir - Multiple browsers I've been working on getting multiple browser support into Firewatir - WTR-224. I have now reached the stage where all unit tests pass and it seems stable. It should support both versions of the JSSH XPI. To work with multiple browsers you need to: - Install the patched XPI - Create additional profiles for each of the instances you wish to use (firefox -CreateProfile ) - Start Firefox in the profile and install the JSSH XPI (firefox -P ), then close Firefox. - Provide :multiple_browser_xpi => true as one of the options to Firefox.new - Provide :profile => 'profile_name' as one of the options to Firefox.new - Provide :port => 9998 (example) that the JSSH connection should be made on [this could be auto-incremented in future] For an example, see the multiple_browsers unit test. The code can be found here: http://github.com/ajcollins/watir/tree/multiple Additional testing - especially on other platforms - would be most appreciated. == XPIs == To get this to work, you need a patched Firefox plugin (XPI). I have bumped the version to 0.95, although I have not made any attempt to do anything other than patch them. For reference, the patched code is part of the Firefox 3.5 development trunk. I have updated the plugins based on the latest Firefox 3 version on wtr.rubyforge.org and made them available here: http://github.com/ajcollins/JSSH-XPIs/tree/master The built XPIs are available in the "plugins" directory. You can build them yourself by running the scripts/build.sh shell script. == Caveats == - I've only tested this on Mac OS X 10.5.7 with Firefox 3.0.10. - I've not tested this against an old XPI, but the unit tests do run in this mode, so it should be fine but doesn't check the XPI. - The NoMethodError unit test still fails (I've done no further work on this). - This branch also has Lukas' patch for handling cookies. - This branch contains all of my other patches to date (it's based off of my master) == Further work == If anyone is keen to extend this... - Auto-increment the profile eg port9998, port9999 based on a class variable - Auto-create the profiles as required? - Separate out firefox.rb into multiple files dealing with the different areas of navigation, process handling etc - Separate out some of the XPCOM methods to reduce coupling with JSSH (JSSH becomes just a window into the browser, firewatir holds all of the brains) and reduce duplication - Replace the JSSH plugin with one of the alternatives Best wishes, Alex _______________________________________________ Wtr-development mailing list Wtr-development at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-development From zeljko.filipin at wa-research.ch Thu May 28 05:03:18 2009 From: zeljko.filipin at wa-research.ch (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 28 May 2009 11:03:18 +0200 Subject: [Wtr-development] input_elements.rb Message-ID: I have been playing with Watir::FileField#set recently. Take a look if you are interested: http://tinyurl.com/qtpje3 When I wanted to see how the code I have been working on has been developed, I clicked `history` link, and got error message `Sorry, this commit log is taking too long to generate.` Then I took a look at Bret's original version but there is only a few commits there: http://tinyurl.com/qubdco Looks like input_elements.rb was created from watir.rb, but I can not locate that file. Can somebody help me? All I want is to see how Watir::FileField#set is developed. Even better, if somebody can explain to me why are we using this: thrd = Thread.new do system("rubyw -e \"require 'win32ole'; @autoit=WIN32OLE.new('AutoItX3.Control');") # shortened the code for clarity end thrd.join(1) Specifically, why are we calling ruby from ruby? And putting all code in a string (loosing sytax highlighting and all that good stuff). Is there an alternative that will create more readable code? ?eljko -------------- next part -------------- An HTML attachment was scrubbed... URL: From marekj.com at gmail.com Thu May 28 13:29:39 2009 From: marekj.com at gmail.com (marekj) Date: Thu, 28 May 2009 12:29:39 -0500 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: I use FileField in this way: pathFileName.gsub!("/", "\\") ie.bring_to_front #necessary for sending keys into window # instead fo ie.file_field(:name, "file").set(pathFileName) #Change it to setting focus and using AutoIt directly to set the pathFileName # instead of 1 line I change to 3 lines ie.file_field(:name, "file").focus autoit = WIN32OLE.new('AutoItX3.Control') autoit.Send pathFileName So this gets the input into the file field. the FileField#set uses a separate thread as we see and uses rubyw to silently execute the -e "code..." I wonder why you have POPUP_TITLES = ['Choose file', 'Choose File to Upload'] is there a diff between XP and Vista in titles? I'll look at some more later. marekj Watirloo: Semantic Page Objects in UseCases http://github.com/marekj/watirloo/ On Thu, May 28, 2009 at 4:03 AM, ?eljko Filipin wrote: > I have been playing with Watir::FileField#set recently. Take a look if you > are interested: > > http://tinyurl.com/qtpje3 > > When I wanted to see how the code I have been working on has been developed, > I clicked `history` link, and got error message `Sorry, this commit log is > taking too long to generate.` > > Then I took a look at Bret's original version but there is only a few > commits there: > > http://tinyurl.com/qubdco > > Looks like input_elements.rb was created from watir.rb, but I can not locate > that file. Can somebody help me? All I want is to see how > Watir::FileField#set is developed. > > Even better, if somebody can explain to me why are we using this: > > thrd = Thread.new do > ? system("rubyw -e \"require 'win32ole'; > @autoit=WIN32OLE.new('AutoItX3.Control');") # shortened the code for clarity > end > thrd.join(1) > > Specifically, why are we calling ruby from ruby? And putting all code in a > string (loosing sytax highlighting and all that good stuff). Is there an > alternative that will create more readable code? > > ?eljko > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > From charley.baker at gmail.com Thu May 28 14:01:35 2009 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 28 May 2009 12:01:35 -0600 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: Hey, I'm seriously trying to make some headway on incorporating patches and pull requests which is a bit of a challenge. The code Zeljko has for the dialogs are for different versions of IE, which sadly have different titles, I've dealt with that some as well in the code base. We're actually still doing the bulk of our testing on IE6 due to internal 3rd party apps that have that as a req. The reason for the separate processes in some cases for dialog handling is due to ruby threads not being native and our connection to IE through COM can have a tendency to block. Ugly and has caused problems - namely the latest click_no_wait not working posts due to a change in how the latest one click installer handles cmd line args and quoting. Bret and I have talked about an upcoming 1.7.0 release, for which I'd like to get some of the fixes and merges...merged for lack of better terms. :) There are quite a lot of merge conflicts plus the need to test on various oses/browser versions. If anyone wants to help, I'd much appreciate it. Alex, there are a lot of changes and merges that you have, many of them conflict. Ping me if you're interested in walking through some of the changes and helping merge some of that code. Thanks guys, Charley Baker blog: http://blog.charleybaker.org/ Lead Developer, Watir, http://wtr.rubyforge.org QA Architect, Gap Inc Direct On Thu, May 28, 2009 at 11:29 AM, marekj wrote: > I use FileField in this way: > > pathFileName.gsub!("/", "\\") > ie.bring_to_front #necessary for sending keys into window > # instead fo ie.file_field(:name, "file").set(pathFileName) > #Change it to setting focus and using AutoIt directly to set the > pathFileName > # instead of 1 line I change to 3 lines > ie.file_field(:name, "file").focus > autoit = WIN32OLE.new('AutoItX3.Control') > autoit.Send pathFileName > > So this gets the input into the file field. > > the FileField#set uses a separate thread as we see and uses rubyw to > silently execute the -e "code..." > > I wonder why you have POPUP_TITLES = ['Choose file', 'Choose File to > Upload'] > is there a diff between XP and Vista in titles? > > I'll look at some more later. > > marekj > > Watirloo: Semantic Page Objects in UseCases > http://github.com/marekj/watirloo/ > > > > > On Thu, May 28, 2009 at 4:03 AM, ?eljko Filipin > wrote: > > I have been playing with Watir::FileField#set recently. Take a look if > you > > are interested: > > > > http://tinyurl.com/qtpje3 > > > > When I wanted to see how the code I have been working on has been > developed, > > I clicked `history` link, and got error message `Sorry, this commit log > is > > taking too long to generate.` > > > > Then I took a look at Bret's original version but there is only a few > > commits there: > > > > http://tinyurl.com/qubdco > > > > Looks like input_elements.rb was created from watir.rb, but I can not > locate > > that file. Can somebody help me? All I want is to see how > > Watir::FileField#set is developed. > > > > Even better, if somebody can explain to me why are we using this: > > > > thrd = Thread.new do > > system("rubyw -e \"require 'win32ole'; > > @autoit=WIN32OLE.new('AutoItX3.Control');") # shortened the code for > clarity > > end > > thrd.join(1) > > > > Specifically, why are we calling ruby from ruby? And putting all code in > a > > string (loosing sytax highlighting and all that good stuff). Is there an > > alternative that will create more readable code? > > > > ?eljko > > > > _______________________________________________ > > Wtr-development mailing list > > Wtr-development at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-development > > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development -------------- next part -------------- An HTML attachment was scrubbed... URL: From arkie at compli.com Thu May 28 13:59:01 2009 From: arkie at compli.com (Alan Ark) Date: Thu, 28 May 2009 10:59:01 -0700 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: I think that the different titles come into play when using different versions of IE (6/7/8) -----Original Message----- From: wtr-development-bounces at rubyforge.org [mailto:wtr-development-bounces at rubyforge.org] On Behalf Of marekj Sent: Thursday, May 28, 2009 10:30 AM To: Watir development Subject: Re: [Wtr-development] input_elements.rb I use FileField in this way: pathFileName.gsub!("/", "\\") ie.bring_to_front #necessary for sending keys into window # instead fo ie.file_field(:name, "file").set(pathFileName) #Change it to setting focus and using AutoIt directly to set the pathFileName # instead of 1 line I change to 3 lines ie.file_field(:name, "file").focus autoit = WIN32OLE.new('AutoItX3.Control') autoit.Send pathFileName So this gets the input into the file field. the FileField#set uses a separate thread as we see and uses rubyw to silently execute the -e "code..." I wonder why you have POPUP_TITLES = ['Choose file', 'Choose File to Upload'] is there a diff between XP and Vista in titles? I'll look at some more later. marekj Watirloo: Semantic Page Objects in UseCases http://github.com/marekj/watirloo/ On Thu, May 28, 2009 at 4:03 AM, ?eljko Filipin wrote: > I have been playing with Watir::FileField#set recently. Take a look if you > are interested: > > http://tinyurl.com/qtpje3 > > When I wanted to see how the code I have been working on has been developed, > I clicked `history` link, and got error message `Sorry, this commit log is > taking too long to generate.` > > Then I took a look at Bret's original version but there is only a few > commits there: > > http://tinyurl.com/qubdco > > Looks like input_elements.rb was created from watir.rb, but I can not locate > that file. Can somebody help me? All I want is to see how > Watir::FileField#set is developed. > > Even better, if somebody can explain to me why are we using this: > > thrd = Thread.new do > ? system("rubyw -e \"require 'win32ole'; > @autoit=WIN32OLE.new('AutoItX3.Control');") # shortened the code for clarity > end > thrd.join(1) > > Specifically, why are we calling ruby from ruby? And putting all code in a > string (loosing sytax highlighting and all that good stuff). Is there an > alternative that will create more readable code? > > ?eljko > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > _______________________________________________ Wtr-development mailing list Wtr-development at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-development From marekj.com at gmail.com Thu May 28 14:35:44 2009 From: marekj.com at gmail.com (marekj) Date: Thu, 28 May 2009 13:35:44 -0500 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: On Thu, May 28, 2009 at 1:01 PM, Charley Baker wrote: > Hey, snip > The reason for the separate processes in some cases for dialog handling is > due to ruby threads not being native and our connection to IE through COM > can have a tendency to block. Ugly and has caused problems - namely the > latest click_no_wait not working posts due to a change in how the latest one > click installer handles cmd line args and quoting. Epiphany: This 'block' may be the reason some of my code craps out when I use threads for handling popups will try diff 'process' by invoking system('blabla') Thanks for the pointer. and click_no_wait not a problem for me upto ruby186-26.exe installer I saw it on ruby186-27.exe > > ?Bret and I have talked about an upcoming 1.7.0 release, for which I'd like > to get some of the fixes and merges...merged for lack of better terms. :) > There are quite a lot of merge conflicts plus the need to test on various > oses/browser versions. If anyone wants to help, I'd much appreciate it. I have WinXP+IE6 as my production platform and Vista+IE7 Ubutnu(J)+Firefox > ?Thanks guys, > Charley Baker > blog: http://blog.charleybaker.org/ > Lead Developer, Watir, http://wtr.rubyforge.org > QA Architect, Gap Inc Direct > marekj From charley.baker at gmail.com Thu May 28 15:19:26 2009 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 28 May 2009 13:19:26 -0600 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: Marek, How's Ubuntu working for you? Have you run the firewatir tests, I know there are some issues with speed. I really don't feel like leafing through all the threads on that conversation. Going multiple oses has been fun, but it also means my primary operating mode is changing, must run those against what I'm using to actually browse the web and do some work. :) Seriously considering getting a mac mini to run this stuff. Of course my wife may kill me with yet another computer in the house. :) Charley Baker blog: http://blog.charleybaker.org/ Lead Developer, Watir, http://wtr.rubyforge.org QA Architect, Gap Inc Direct On Thu, May 28, 2009 at 12:35 PM, marekj wrote: > On Thu, May 28, 2009 at 1:01 PM, Charley Baker > wrote: > > Hey, > snip > > > The reason for the separate processes in some cases for dialog handling > is > > due to ruby threads not being native and our connection to IE through COM > > can have a tendency to block. Ugly and has caused problems - namely the > > latest click_no_wait not working posts due to a change in how the latest > one > > click installer handles cmd line args and quoting. > > Epiphany: This 'block' may be the reason some of my code craps out > when I use threads for handling popups > will try diff 'process' by invoking system('blabla') > Thanks for the pointer. > and click_no_wait not a problem for me upto ruby186-26.exe installer > I saw it on ruby186-27.exe > > > > > Bret and I have talked about an upcoming 1.7.0 release, for which I'd > like > > to get some of the fixes and merges...merged for lack of better terms. :) > > There are quite a lot of merge conflicts plus the need to test on various > > oses/browser versions. If anyone wants to help, I'd much appreciate it. > > I have WinXP+IE6 as my production platform > and > Vista+IE7 > Ubutnu(J)+Firefox > > > Thanks guys, > > Charley Baker > > blog: http://blog.charleybaker.org/ > > Lead Developer, Watir, http://wtr.rubyforge.org > > QA Architect, Gap Inc Direct > > > > marekj > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marekj.com at gmail.com Thu May 28 16:01:24 2009 From: marekj.com at gmail.com (marekj) Date: Thu, 28 May 2009 15:01:24 -0500 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: Ubuntu has a nice ease about it, Got Firefox and xpi but have not run tests yet. I got Netbeans set up and Jedit as my primary text editor for Ruby. >From Ubuntu I got direct access to /media/windows partition but everything there seems to show up as mode 777 (clueless) I installed Virtualbox in hopes of running XP inside from Ubuntu (not done yet) I also installed VirtualBox in Vista thinking of Running Ubuntu in there or other versions of Win. currently ubuntu shows up at 800X600 resolution only. (clueless how to make it 1280, may need a driver etc..) My current project is to update all my production tests to rspec (I use mixture of test::unit and test/spec) Got a setup working to exit on failure in rspec that is very useful in exploratory testing. http://gist.github.com/118186 Also I keep track of browsers on the desktop and I store their handles to yaml so when I stop tests for exploratory testing I can restart and reuse browsers (even in multiple threads) with that storage mechanism. half baked code (with tests of course) http://github.com/marekj/watirloo/blob/b922677cf7bc0336f5b1d90db513f13d3ea40503/lib/watirloo/browsers_storage.rb http://github.com/marekj/watirloo/blob/b922677cf7bc0336f5b1d90db513f13d3ea40503/lib/watirloo/browsers.rb and I got this setup the BrowserEventsPublisher that helps me save HTML when I do testing. http://gist.github.com/112587 (no tests) and I am overwhelmed by Taza and Watircraft and Rubigen generator so much to do so little time. (I just felt like sharing this in a seemingly unrelated thread. oy) marekj Watirloo: Semantic Page Objects in UseCases http://github.com/marekj/watirloo/ On Thu, May 28, 2009 at 2:19 PM, Charley Baker wrote: > Marek, > > ?? How's Ubuntu working for you? Have you run the firewatir tests, I know > there are some issues with speed. I really don't feel like leafing through > all the threads on that conversation. Going multiple oses has been fun, but > it also means my primary operating mode is changing, must run those against > what I'm using to actually browse the web and do some work. :) Seriously > considering getting a mac mini to run this stuff. Of course my wife may kill > me with yet another computer in the house. :) > > > Charley Baker > blog: http://blog.charleybaker.org/ > Lead Developer, Watir, http://wtr.rubyforge.org > QA Architect, Gap Inc Direct > > > On Thu, May 28, 2009 at 12:35 PM, marekj wrote: >> >> On Thu, May 28, 2009 at 1:01 PM, Charley Baker >> wrote: >> > Hey, >> snip >> >> > The reason for the separate processes in some cases for dialog handling >> > is >> > due to ruby threads not being native and our connection to IE through >> > COM >> > can have a tendency to block. Ugly and has caused problems - namely the >> > latest click_no_wait not working posts due to a change in how the latest >> > one >> > click installer handles cmd line args and quoting. >> >> Epiphany: This 'block' may be the reason some of my code craps out >> when I use threads for handling popups >> will try diff 'process' by invoking system('blabla') >> Thanks for the pointer. >> and click_no_wait not a problem for me upto ruby186-26.exe installer >> I saw it on ruby186-27.exe >> >> > >> > ?Bret and I have talked about an upcoming 1.7.0 release, for which I'd >> > like >> > to get some of the fixes and merges...merged for lack of better terms. >> > :) >> > There are quite a lot of merge conflicts plus the need to test on >> > various >> > oses/browser versions. If anyone wants to help, I'd much appreciate it. >> >> I have WinXP+IE6 as my production platform >> and >> Vista+IE7 >> Ubutnu(J)+Firefox >> >> > ?Thanks guys, >> > Charley Baker >> > blog: http://blog.charleybaker.org/ >> > Lead Developer, Watir, http://wtr.rubyforge.org >> > QA Architect, Gap Inc Direct >> > >> >> marekj >> _______________________________________________ >> Wtr-development mailing list >> Wtr-development at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wtr-development > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > From marekj.com at gmail.com Thu May 28 20:15:17 2009 From: marekj.com at gmail.com (marekj) Date: Thu, 28 May 2009 19:15:17 -0500 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: I took the liberty and refactored a bit http://gist.github.com/119677 - got rid of POPUP_TITLES alltogether. (no reason to declare them and then massage them with inspect and gsub) - reversed position of titles to prefer 'Choose File to Upload' first as I think IE7 has greater share (I hope) - moved the code_string to be executed away from the execution mechanism, now you can see tigher thread block - and I was just fancy with system %Q|rubyw -e "#{code_as_string}"| mainly because I try to avoid escaping \"string\" (or should it be %q lowercase in this example?) AND: I wonder if there is also much difference between using @autoit.ControlSend(popup_title, '', 'Button2', '{ENTER}') versus @autoit.ControlClick(popup_title, '', 'Button2') I have not ran any Benchmark on it. Should you like my hacking please incorporate I did not run against IE7 Tested on winxp, ruby 1.8.6, IE6 blowser That was fun ( might be additcting) marekj Watirloo: Semantic Page Objects in UseCases http://github.com/marekj/watirloo/ On Thu, May 28, 2009 at 4:03 AM, ?eljko Filipin wrote: > I have been playing with Watir::FileField#set recently. Take a look if you > are interested: > > http://tinyurl.com/qtpje3 > > When I wanted to see how the code I have been working on has been developed, > I clicked `history` link, and got error message `Sorry, this commit log is > taking too long to generate.` > > Then I took a look at Bret's original version but there is only a few > commits there: > > http://tinyurl.com/qubdco > > Looks like input_elements.rb was created from watir.rb, but I can not locate > that file. Can somebody help me? All I want is to see how > Watir::FileField#set is developed. > > Even better, if somebody can explain to me why are we using this: > > thrd = Thread.new do > ? system("rubyw -e \"require 'win32ole'; > @autoit=WIN32OLE.new('AutoItX3.Control');") # shortened the code for clarity > end > thrd.join(1) > > Specifically, why are we calling ruby from ruby? And putting all code in a > string (loosing sytax highlighting and all that good stuff). Is there an > alternative that will create more readable code? > > ?eljko > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > From zeljko.filipin at wa-research.ch Fri May 29 04:21:17 2009 From: zeljko.filipin at wa-research.ch (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 29 May 2009 10:21:17 +0200 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: On Thu, May 28, 2009 at 7:29 PM, marekj wrote: > I wonder why you have POPUP_TITLES = ['Choose file', 'Choose File to Upload'] > is there a diff between XP and Vista in titles? No. IE6 and IE7 have 'Choose file', IE8 has 'Choose File to Upload'. ?eljko -------------- next part -------------- An HTML attachment was scrubbed... URL: From zeljko.filipin at wa-research.ch Fri May 29 04:39:56 2009 From: zeljko.filipin at wa-research.ch (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 29 May 2009 10:39:56 +0200 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: On Fri, May 29, 2009 at 2:15 AM, marekj wrote: > I took the liberty and refactored a bit Thanks, I will definitely move string declaration from thread and try to make it more readable. > - got rid of POPUP_TITLES alltogether. (no reason to declare them and > then massage them with inspect and gsub) Actually, POPUP_TITLES were requested at #watir irc channel by Jari Bakken. If you have OS language different than English, file upload popup title will be different. POPUP_TITLES allows you to add new file upload popup title with Watir::FileField::POPUP_TITLES << "My Funky Popup" > - reversed position of titles to prefer 'Choose File to Upload' first > as I think IE7 has greater share (I hope) Revert. No matter if IE6 or IE7 have bigger market share, they still have the same popup title. IE8 has low market share, so his title should be the second (making it about a second slower to find popup). > - moved the code_string to be executed away from the execution > mechanism, now you can see tigher thread block Nice. Will use. > - and I was just fancy with system %Q|rubyw -e "#{code_as_string}"| > mainly because I try to avoid escaping \"string\" > (or should it be %q lowercase in this example?) Will take a look. Thanks a lot Marek. ?eljko -------------- next part -------------- An HTML attachment was scrubbed... URL: From abaird at bairdsnet.net Fri May 29 08:52:04 2009 From: abaird at bairdsnet.net (Alan Baird) Date: Fri, 29 May 2009 07:52:04 -0500 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: <2a379a300905290552ga2b157bpa0b074b24505b771@mail.gmail.com> Zstar/Marek - One thing I would add, change the 15 second timeout and make it an optional argument to set: "def set(path_to_file, popup_timeout=15)". Also, although I like the fact that this will work unmodified for all IE browsers, you will end up waiting for a while if your choice of window titles is long. Seems like this would be a good candidate to put in the option files and then if you were tweaking for speed, you could make sure that your choice of string would be the first one in the list. What do you think? Alan -------------- next part -------------- An HTML attachment was scrubbed... URL: From zeljko.filipin at wa-research.ch Fri May 29 09:14:52 2009 From: zeljko.filipin at wa-research.ch (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 29 May 2009 15:14:52 +0200 Subject: [Wtr-development] input_elements.rb In-Reply-To: <2a379a300905290552ga2b157bpa0b074b24505b771@mail.gmail.com> References: <2a379a300905290552ga2b157bpa0b074b24505b771@mail.gmail.com> Message-ID: On Fri, May 29, 2009 at 2:52 PM, Alan Baird wrote: > One thing I would add, change the 15 second timeout and make it an optional argument to set: "def set(path_to_file, popup_timeout=15)". I have set it to 15 because that was autoit timeout before. Why would you like to have a shorter timeout? If autoit can not find the popup, script will halt anyway. :) > Also, although I like the fact that this will work unmodified for all IE browsers, you will end up waiting for a while if your choice of window titles is long. True, but you would probably never have more that 3 or 4 titles. Each title brings approximately 1 second slow down. But I could probably say autoit not to wait for popup to appear, so there will be no delay. Will try. > Seems like this would be a good candidate to put in the option files and then if you were tweaking for speed, you could make sure that your choice of string would be the first one in the list. Good idea. Or just make the title of the popup an optional argument of FileField#set and then you will be sure that it only checks for one title. def set(path_to_file, popup_title = 'Choose file') There are a lot of possible things to do, not sure what to do. Anyway, this was just a way for me to get used to Git, Github and Watir code, I am not sure anybody really needs file uploads for IE8. :) ?eljko -------------- next part -------------- An HTML attachment was scrubbed... URL: From abaird at bairdsnet.net Fri May 29 09:36:09 2009 From: abaird at bairdsnet.net (Alan Baird) Date: Fri, 29 May 2009 08:36:09 -0500 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: <2a379a300905290552ga2b157bpa0b074b24505b771@mail.gmail.com> Message-ID: <2a379a300905290636k70998d15qc213c7ebfcce6ccd@mail.gmail.com> > I have set it to 15 because that was autoit timeout before. Why would you like to have a shorter timeout? If autoit can not find the popup, script will halt anyway. :) I wasn't really disagreeing with the number of seconds, which is fine. Making it an argument just a way of increasing the timeout if your application is slow to respond. This happens to us a lot in our application because we allow users to upload an XML query. Sometimes the application behind the scenes is slow and we may need to adjust timeouts slightly. > > >> Also, although I like the fact that this will work unmodified for all IE > browsers, you will end up waiting for a while if your choice of window > titles is long. > > >True, but you would probably never have more that 3 or 4 titles. Each > title brings approximately 1 second slow down. But I could probably say > autoit not to wait for popup to appear, so there will be no delay. Will try. If the program is looking for a popup window with an incorrect title, shouldn't it wait for the full timeout value? Maybe I'm missing something. Oh, I see it now, you are right, that's not that bad. Alan -------------- next part -------------- An HTML attachment was scrubbed... URL: From invite+ium~dwmd at facebookmail.com Fri May 29 10:41:38 2009 From: invite+ium~dwmd at facebookmail.com (Sunil Reddy) Date: Fri, 29 May 2009 07:41:38 -0700 Subject: [Wtr-development] Check out my photos on Facebook Message-ID: <3ee22f3fb55014ccfcae76ec00c04e2a@10.22.41.194> Hi wtr-development at rubyforge.org, I invited you to join Facebook a while back and wanted to remind you that once you join, we'll be able to connect online, share photos, organize groups and events, and more. Thanks, Sunil To sign up for Facebook, follow the link below: http://www.facebook.com/p.php?i=1609157505&k=SXMXPW523V6M5JE1RGVXUS&r wtr-development at rubyforge.org was invited to join Facebook by Sunil Reddy. If you do not wish to receive this type of email from Facebook in the future, please click on the link below to unsubscribe. http://www.facebook.com/o.php?k=b854ca&u=1810359447&mid=89f150G6be7e497G0G8 Facebook's offices are located at 1601 S. California Ave., Palo Alto, CA 94304. -------------- next part -------------- An HTML attachment was scrubbed... URL: From marekj.com at gmail.com Fri May 29 12:30:55 2009 From: marekj.com at gmail.com (marekj) Date: Fri, 29 May 2009 11:30:55 -0500 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: ok, now I get the intention behind the POPUP_TITLES I also put them back in and reverted to your original array position. code here: http://gist.github.com/119677 again, this is becoming fun. thanks On Fri, May 29, 2009 at 3:39 AM, ?eljko Filipin wrote: > On Fri, May 29, 2009 at 2:15 AM, marekj wrote: >> I took the liberty and refactored a bit > > Thanks, I will definitely move string declaration from thread and try to > make it more readable. > >> - got rid of POPUP_TITLES alltogether. (no reason to declare them and >> then massage them with inspect and gsub) > > Actually, POPUP_TITLES were requested at #watir irc channel by Jari Bakken. > If you have OS language different than English, file upload popup title will > be different. POPUP_TITLES allows you to add new file upload popup title > with > > Watir::FileField::POPUP_TITLES << "My Funky Popup" > >> - reversed position of titles to prefer 'Choose File to Upload' first >> as I think IE7 has greater share (I hope) > > Revert. No matter if IE6 or IE7 have bigger market share, they still have > the same popup title. IE8 has low market share, so his title should be the > second (making it about a second slower to find popup). Thanks for explanation, I only had IE6 so I just assmed IE7 changed >> - moved the code_string to be executed away from the execution >> mechanism, now you can see tigher thread block > > Nice. Will use. > >> - and I was just fancy with system %Q|rubyw -e "#{code_as_string}"| >> mainly because I try to avoid escaping \"string\" >> (or should it be %q lowercase in this example?) > > Will take a look. > > Thanks a lot Marek. > > ?eljko > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > From paul.rogers at shaw.ca Fri May 29 12:52:25 2009 From: paul.rogers at shaw.ca (Paul Rogers) Date: Fri, 29 May 2009 10:52:25 -0600 Subject: [Wtr-development] input_elements.rb In-Reply-To: References: Message-ID: sounds like a good place to be using some kind of browser detection, and use the correct value..... On Fri, May 29, 2009 at 10:30 AM, marekj wrote: > ok, now I get the intention behind the POPUP_TITLES > I also put them back in and reverted to your original array position. > code here: http://gist.github.com/119677 > > again, this is becoming fun. > thanks > > On Fri, May 29, 2009 at 3:39 AM, ?eljko Filipin > wrote: > > On Fri, May 29, 2009 at 2:15 AM, marekj wrote: > >> I took the liberty and refactored a bit > > > > Thanks, I will definitely move string declaration from thread and try to > > make it more readable. > > > >> - got rid of POPUP_TITLES alltogether. (no reason to declare them and > >> then massage them with inspect and gsub) > > > > Actually, POPUP_TITLES were requested at #watir irc channel by Jari > Bakken. > > If you have OS language different than English, file upload popup title > will > > be different. POPUP_TITLES allows you to add new file upload popup title > > with > > > > Watir::FileField::POPUP_TITLES << "My Funky Popup" > > > >> - reversed position of titles to prefer 'Choose File to Upload' first > >> as I think IE7 has greater share (I hope) > > > > Revert. No matter if IE6 or IE7 have bigger market share, they still have > > the same popup title. IE8 has low market share, so his title should be > the > > second (making it about a second slower to find popup). > > Thanks for explanation, I only had IE6 so I just assmed IE7 changed > > >> - moved the code_string to be executed away from the execution > >> mechanism, now you can see tigher thread block > > > > Nice. Will use. > > > >> - and I was just fancy with system %Q|rubyw -e "#{code_as_string}"| > >> mainly because I try to avoid escaping \"string\" > >> (or should it be %q lowercase in this example?) > > > > Will take a look. > > > > Thanks a lot Marek. > > > > ?eljko > > > > _______________________________________________ > > Wtr-development mailing list > > Wtr-development at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-development > > > _______________________________________________ > Wtr-development mailing list > Wtr-development at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-development > -------------- next part -------------- An HTML attachment was scrubbed... URL: