Re: [wtr-general] Re: making old watir scripts compatiable with new watir webdriver
Vapir is another alternative - vapir is a fork of watir (and firewatir). It uses the same API as watir, and brings more of the API from watir to be compatible with firefox where firewatir was not. However, it was forked quite a while ago now, and newer features of watir may not have all been merged in yet. the only big one I can think of offhand is zero-based indexing, which hasn't made it to a release yet (though it has been implemented). Vapir-Firefox can connect to Firefox using either MozRepl or JSSH, and MozRepl is actively maintained and works from firefox versions 3.0 - 7 (support for 8 and up is landing shortly). more info at http://vapir.org/ -Ethan On Fri, Nov 11, 2011 at 10:21, sumanth anansumanthku...@gmail.com wrote: Hi Chuck and Jari, Thanks a lot for the information. I am planning to upgrade Watir to 2.x on one testing machine and see what and all things breaks up in my library and start fixing them. As I am little busy in some other stuff which needs to be completed before this. It may take little time to start with. I will post you more information on my experience with this work. On Nov 10, 10:27 pm, Chuck van der Linden sqa...@gmail.com wrote: The FF situation is annoying, but it's been made pretty clear that JSSH support for FireFox versions 4.x and above will not be happening, and since firewatir was built on that, it means that code is pretty much at a dead end. As testers their current path is a bit of a pain because it has fractured the FF userbase, and now similar to IE, there are a large number of users still using older versions, which increases the size of our test matrixes. Generally I might recommend first upgrading the scripts to Watir 2.0.x, the API there is very aligned with what is in Watir-Webdriver, and it allows for a slightly more incremental transition (IMHO) since for example you can control if it uses the older 1 based indexing, or newer 0 based indexing. There are a very few things you cannot do in watir-webdriver which you can do in watir The browser.attach method you mention is one where yes, that exact method is not there, but is replaced by a different method browser.window which can be used to do all that attach did and more See the spec for this herehttps:// github.com/jarib/watirspec/blob/watir2/window_switching_spec.rb A list of differences between watitr-webdriver and watir 1.x is here: https://github.com/jarib/watir-webdriver/wiki/Comparison-with-Watir-1.X there's a lot of very small little details covered, but most of them are unlikely to affect a majority of scripts unless you were making use of a few very specific quirks/features The biggest areas of change IMHO are 1) switching your indexing from 1 based to zero based.. if you use Index a lot, this will require revising a lot of scripts. However if most of these uses in your current scripts are of the form browser.element1(:how, 'what').element2(:index, 1), then the change is not that bad. What you can do is take advantage of the new feature of all elements where if no (:how, 'what') is specified it defaults to looking for the 'first instance' of that element within the specified container, and just strip all instances of (:index,1) from your current scripts. Now verify they all work using watir 2.0 with the indexing still set to one based. Then you only have to modify the remaining uses of :index as a selector, which can be done via a series of replace in all files operations (source control will be your friend ;-) ) and you should then be able to run them with the indexing set for zero based. 2) The shift in Watir 2.0 from AutoIt, to RAutomation for any UI level automation (for popups and such, although watir 2.0 does have some improved methods for some popups and things like filedownload windows, so you will want to look for the areas where you can just deal with it via watir, vs having to automate at the OS level. 3) Changes to Sendkeys for special keys. the coding of these is a lot clearer IMHO but it will require a bunch of search/replace operations for sure to alter these from the keyboard codes to labels like :enter or :f7 4) Changes from .attach to the new .window api 5) any other picky little details you see on the changes list that end up affecting you. There are a few instances where Watir is still superior for driving IE, so you may want to take care of updating everything to use watir 2.0, and take care of steps 1 2, and then fork the scripts off and deal with items 3 and 4 with respect to running things under Watir- Webdriver. On Nov 10, 8:06 am, sumanth anansumanthku...@gmail.com wrote: Hi All, We have pretty big framework written with watir 1.6.5 and as you know watir is not supporting ff4.0 or greater versions. only solution seems to migrate to watir-webdriver. But It looks lots
Re: [wtr-general] Fix for ie.close throwing NoMethodError when using ruby 1.92 watir 1.9.2
there's an open ticket - http://jira.openqa.org/browse/WTR-481 so hopefully one of the devs will get this in soon. On Fri, Jul 15, 2011 at 13:40, David Brown suf...@gmail.com wrote: I've been using ruby 1.86 and Watir for years. I've been trying to upgrade to ruby 1.92 so that we don't have to maintain 2 versions of ruby. Using the latest version of Watir (1.9.2), one of the only issues I'm noticing is that any time I call ie.close win32ole in ruby 1.92 raises a NoMethodError instead of WIN32OLERuntimeError. I've been able to patch this manually, but it's a pain to always re- patch on on all our workstations every time a new release of watir comes out. It would be nice if someone could make the simple change below to fix the issue in the next release of watir. STEPS TO REPRODUCE ISSUE: (when running ruby 1.92 Watir 1.9.2) ie = Watir::IE.start('google.com') ie.close NoMethodError: unknown property or method: `name' HRESULT error code:0x800706ba The RPC server is unavailable. from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.9.2/lib/watir/ ie-class.rb:333:in `method_missing' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.9.2/lib/watir/ ie-class.rb:333:in `exists?' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.9.2/lib/watir/ ie-class.rb:420:in `close' from (irb):4 from C:/Ruby192/bin/irb:12:in `main' TO FIX THE ISSUE: change ie-class.rb:333:in `exists?' FROM: rescue WIN32OLERuntimeError TO: rescue WIN32OLERuntimeError, NoMethodError If someone on the DEV team could make this simple change I'd appreciate it :) Thanks! -David Brown -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: string to boolean?
instance_eval is a really terrible idea here. it's probably a string true / false because it's coming from somewhere less-trusted. eval is something I avoid, though it has its uses on occasion, but eval'ing external input is pretty much never good. match the strings you want to the values you want. option == 'true' ? true : option == 'false' ? false : something_else. don't eval. On Thu, Jul 7, 2011 at 10:17, Jarmo Pertman jarm...@gmail.com wrote: Yeah, of course. My bad. Another way would be to use instance_eval: irb(main):004:0 a = true = true irb(main):006:0 instance_eval a = true irb(main):007:0 b = false = false irb(main):008:0 instance_eval b = false Your solution works only with true correctly. What if the string is something else than false or true? If that's not a problem then i'd use that, otherwise you'd have to check that value is indeed a true or false string. Jarmo On Jul 7, 1:33 am, Michael mmcwill...@gmail.com wrote: Jarmo - your example just proved that doesn't work because both the string true and the string false return true when double negated. I think you'll have to handle it in some way, for example: value = ( value == true.to_s ) -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Managing multiple version of Watir
you know, you can just choose which gem version to activate within ruby. require 'rubygems' gem 'watir', '1.6.2' require 'watir' # rubygems will only require v1.6.2. then you can have as many versions of the watir gem installed simultaneously as you want, and switch between them by changing, say, a yaml config file (and doing: gem('watir', loaded_yaml_config_hash['version']). or something) rvm's gemsets would work but are slight overkill, and rvm isn't an option on windows. managing your entire ruby + gems in a git repo is way overkill. On Mon, Apr 4, 2011 at 22:24, Darryl Brown d-l-br...@roadrunner.com wrote: Hi, Thanks for your reply, Yes, it is way overkill for managing gems. It works but it's slow when changing branches, I'm planning to checkout RVM and Bundler as soon as I can. Darryl On Apr 4, 4:16 pm, Jarmo Pertman jarm...@gmail.com wrote: If you're versioning your ruby directory then it makes sense that it works of course. It just seems like a pretty much overkill to do that. I'd still recommend using other approaches :) Jarmo Pertman - IT does really matter -http://www.itreallymatters.net On Apr 2, 5:40 pm, Darryl Brown d-l-br...@roadrunner.com wrote: Hi Jarmo, Thanks for your reply. I will simply say that it does work like that. I am using git to manage the entire ruby directory - so Ruby Gems directory is included. I will explain it in very basic terms using three files in the example below. Imagine that rooby = ruby. Note that the branches are totally independent. Also note that 'git merge' is never used. The master branch contains readme.txt only. The v162 branch contains readme.txt and has a file - watir.txt with I am 162 as its' contents. The v170 branch contains readme.txt and has a file - watir.txt with I am 170 as its' contents. Now if I checkout branch v162, there is no notion of the latest version - I am 170. Please note that each version is installed on its' own branch. If I had merged these branches back into master, then what you are saying would definitely be true. So, in this manner, I never need to change my scripts to point to a specific version of Watir. I think that this behavior mimics managing gem sets with RVM. C:\mkdir rooby C:\cd rooby C:\roobygit init Initialized empty Git repository in C:/rooby/.git/ C:\rooby echo This is rooby readme.txt C:\roobygit add readme.txt C:\roobygit commit -madd readme [master (root-commit) 57f48df] add readme 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 readme.txt C:\roobygit checkout -b v162 Switched to a new branch 'v162' C:\roobyecho I am 162 watir.txt C:\roobygit add watir.txt C:\roobygit commit -madd watir 162 [v162 50fae75] add watir 162 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 watir.txt C:\roobygit checkout master Switched to branch 'master' C:\roobygit checkout -b v170 Switched to a new branch 'v170' C:\rooby echo I am 170 watir.txt C:\roobygit add watir.txt C:\roobygit commit -madd watir 170 [v170 e8ebd80] add watir 170 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 watir.txt C:\roobygit checkout master Switched to branch 'master' C:\roobygit branch * master v162 v170 C:\roobydir watir.txt Volume in drive C has no label. Volume Serial Number is C0EA-646B Directory of C:\rooby File Not Found C:\rooby C:\roobygit checkout v162 Switched to branch 'v162' C:\roobytype watir.txt I am 162 C:\roobygit checkout v170 Switched to branch 'v170' C:\roobytype watir.txt I am 170 C:\rooby Yes, I could specify the specific versions in the require statement as Dmitriy suggested and I have done it that way in the past. The end result here using git is the appearance of two Ruby complete installations - one with Watir V1.6.2 and one with Watir v1.7.0 Thanks again - I think that you did not realize that git is managing the entire ruby installation. Please let me know if you understand now. Regards, Darryl On Apr 2, 7:34 am, Jarmo Pertman jarm...@gmail.com wrote: Hi! I don't understand how your current solution works? It doesn't work like that. As soon as you install newer version of Watir then it will be used and it doesn't matter which branch you're with your git since gem will be loaded from the Ruby gems directory and hasn't anything to do with your git branch. So, even if you checkout older branch, then you're still using newest Watir version. You could specify the exact version of Watir as Dmitriy already suggested like this. Instead of: require 'watir' use: gem watir, 1.6.2 # to use 1.6.2 Now, if you commit that change into your branch, then you can be sure
Re: [wtr-general] Re: Watir at Facebook
ruby-watir, or watir-ruby, perhaps? On Fri, Feb 25, 2011 at 10:19, sdemian sergeydemjanc...@gmail.com wrote: I like watircom - very simple and understandable as for me. Suggestions:) How about: https://www.facebook.com/watirhome On Feb 25, 3:11 pm, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Tue, Feb 22, 2011 at 4:02 PM, Željko Filipin zeljko.fili...@wa-research.ch wrote: I did not find a way how to create simple URL like https://www.facebook.com/pages/Watiror evenhttps:// www.facebook.com/Watir, if somebody knows how to do it, please let me know. Found how to do it (athttps://www.facebook.com/username/). Looks like the page had to have certain number of likes. (By the way, likes stopped at 30, feel free to like it.) Once we set the page name, we can not change it. https://www.facebook.com/watiris taken. watir.com is not available, I guess you can not have dot (.) in the url. wtr is too short, it insists on 5 characters. watirdotcom, watircom, watirproject are available. What do you think? Any other suggestions? Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Hide Ruby.exe cmd window
invoking rubyw instead of ruby will not create a cmd window On Fri, Feb 11, 2011 at 06:30, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Fri, Feb 11, 2011 at 12:17 PM, Saurabh Gupta saurabhgupta...@gmail.com wrote: While execution, trying to hide the Ruby.exe command promt window. Minimize the command prompt window. Why do you want it hidden? Watir Version: 2.0 Really?! :) I thought 1.7.1 was the latest: https://rubygems.org/gems/watir Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] ruby1.9.2
Vapir is a fork of watir with various improvements, including compatibility with ruby 1.9.* see http://vapir.org/ -Ethan 2010/12/24 深谷 芳和 richv...@gmail.com Thank you for quick reply. iPhoneから送信 On 2010/12/24, at 13:48, Yuping Zhong littlezhong...@gmail.com wrote: You have better run it on ruby1.8.6 On Fri, Dec 24, 2010 at 11:47 AM, 深谷 芳和 richv...@gmail.com richv...@gmail.com wrote: is it possible to use watir with ruby1.9.2? -- Before posting, please read http://watir.com/support http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.comwatir-general@googlegroups.com http://groups.google.com/group/watir-generalwatir-general+unsubscr...@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.comwatir-general@googlegroups.com http://groups.google.com/group/watir-general http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] OT: WIN32OLE and Word difficulty
Hi Adam, I don't have any experience with OLE stuff in Word, but since I doubt anybody else here has much either, I can make one general suggestion. I'd suggest looking for support for COM/OLE automation with Word outside of the ruby community (definitely outside the watir community - almost all anybody here is likely to know is IE automation, with a smattering of Excel). The capabilities that you have using OLE are the same in Ruby as any other language with bindings for it, but I think that that stuff gets used in .NET languages much much more than in Ruby, so you're a lot more likely to find people who know more about things like automating Word using .NET languages. But since OLE is basically the same no matter what language you're in, it should be simple to translate anything you learn back to ruby usage. On Sat, Dec 11, 2010 at 21:16, Adam Reed reed.a...@gmail.com wrote: I've worked with the win32ole library in my WATIR scripts for a long time, and I've just now stumbled onto a problem that I'm hoping some of you have also encountered. I have a script that reads from various Word file formats (doc, docx), however the documents that are being provided to me from our users have the text written in a Text Box rather than at the top level of the document. When I try to read document.Sentences or .Words, I get none of this text (just a special character representing the background image). I worked through the API and ole_methods and haven't found anything that seemed to work right yet. Have any of you had to access this type of object before? I've posted on StackOverflow but I know that a lot of you work with win32ole often, so I thought I'd bring some attention to it here. http://stackoverflow.com/questions/4419446/how-to-access-textbox-object-text-in-document-using-ruby-win32ole Thanks, Adam -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Watir Console issues
probably. I don't think it's useful - it is just a somewhat opinionated irb. On Fri, Nov 26, 2010 at 04:19, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Wed, Nov 24, 2010 at 9:10 PM, Ethan notet...@gmail.com wrote: I don't think watir console is maintained or really supported. Should we remove it from Watir then? Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Watir Console issues
I don't think watir console is maintained or really supported. I'd recommend just using normal irb and requiring watir. On Tue, Nov 23, 2010 at 12:04, enriquem enrique.j.ma...@gmail.com wrote: Hey Everyone, I try to fire up watir-console and I get the following error: C:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/irb-history.rb: 3:TypeError: History is not a module I am using ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32] and Gem version 1.3.7 on a Windows XP machine. Any help would be greatly appreciated :) -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comhttp://groups.google.com/group/watir-generalwatir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Entering UTF8 Characters
Firewatir doesn't work with UTF8. Vapir-Firefox is a much-improved fork of firewatir which fully supports UTF8 characters. See http://vapir.org/ On Wed, Nov 10, 2010 at 09:45, Richard Wijdenes richard.wijde...@gmail.comwrote: I've also ran into this problem. I've started working on my testscripts using IE and reading data form a spreadsheet. This wasn't functioning for special chars untill i've added require 'win32ole' WIN32OLE.codepage = WIN32OLE::CP_UTF8 But when i tried to get the same scripts running in firefox, the described problem occured. I didn't find a solution yet. So my only advice to you is to use IE -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Problem clicking with element_by_xpath
Hi Dave, I'm continuing to improve Vapir and release new versions, and committed to doing so for the foreseeable future. On Wed, Nov 10, 2010 at 12:56, Dave McNulla mcnu...@gmail.com wrote: Ethan, You have some really good ideas in there. How committed are you to Vapir? Just curious. I think the Watir community is pretty strong. How adoption and community affect sustainability are going to affect people's decisions for which library to use. Just my opinion. Either way, keep the ideas rolling. Thanks, Dave On Nov 5, 12:33 pm, Ethan notet...@gmail.com wrote: Vapir is an fork of Watir, so it's an alternative to it. Everything is compatible with Watir's API, with a couple minor exceptions. It works with all recent versions of ruby. have a look at these wiki pages: - Getting Started http://wiki.github.com/vapir/vapir/getting-started - Coming from Watir http://wiki.github.com/vapir/vapir/coming-from-watir - Differences from Watir (API)http://wiki.github.com/vapir/vapir/differences-from-watir-api On Fri, Nov 5, 2010 at 14:51, Reciprocity george.wi...@gmail.com wrote: Thanks for you reply. So if I want to move to a newer version of ruby I should use Vapir. If I want move to a newer version of watir, ruby 186 is recommended? Does Vapir work with the newest versions of ruby and watir? On Nov 5, 12:03 pm, Ethan notet...@gmail.com wrote: I don't think the mingw32 ruby version (that is, the latest one-click installers) are supported by watir; the older mswin32 ruby 1.8.6 is currently recommended. I recommend Vapir (http://vapir.org);itworks on all versions of ruby since 1.8.6. On Fri, Nov 5, 2010 at 11:47, Reciprocity george.wi...@gmail.com wrote: I'm trying to click this using Ruby 1.8.7 and Watir 1.6.7. tr onclick=goTo('/Administration/DeleteFilter.asp', 'Claim') The code below worked in Ruby 1.8.6 and Watir 1.6.2 @what = '/Administration/DeleteFilter.asp' ie.element_by_xpath(//tr[contains(@onclick, '#...@what}')]/).click() I'm getting this error. C:/ruby187/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/winClicker.rb: 208: [BUG] Segmentation fault ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Any ideas? -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com- Hide quoted text - - Show quoted text - -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] How to get back to the base browser window after closing the second browser instance
This appears to be a frequently-encountered issue of firewatir; it cannot handle multiple browser windows. I recommend Vapir-Firefox which is a much-improved fork of Firewatir. see http://vapir.org/ for information on this library. On Mon, Nov 8, 2010 at 02:07, Pavithra pavi...@gmail.com wrote: Hi, I am testing the website in Firefox. On a click of the link it opens the new browser window and I closed that using close method. But after closing its unable to identify the objects using browser variable. Below was my browser variable which worked to open the website and perform various actions, however the same variable is not working after closing the second browser window. For 1st browser @@browser = Watir::Browser.new For 2nd browser: @@browser1 = Watir::Browser Testcase flow: @@browser.link(:text,XYZ).click[Worked] @@abc=@@browser1.attach(:url,http://xyz;) [Worked] @@abc.close() [Worked] @@browser.link(:text,ABCD).click [Not working] Note: After closing the second browser window, its showing my initial browser, however i am not sure whether the script has come back to initial browser. Kindly help me out to get back to the initial browser window. Thanks, Pavithra -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Error installing Watir on Ubuntu-64
the watir gem is for IE on windows - you might want firewatir, or webdriver (as zeljko links to). or if I may recommend vapir-firefox, a much-improved version of firewatir (http://vapir.org/) On Fri, Nov 5, 2010 at 09:44, Francisco Diaz Trepat - gmail francisco.diaztre...@gmail.com wrote: Any Ideas? sudo gem1.8 install watir [sudo] password for francisco: Building native extensions. This could take a while... ERROR: Error installing watir: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb checking for strncpy_s()... no creating Makefile make gcc -I. -I. -I/usr/lib/ruby/1.8/x86_64-linux -I. -fPIC -fno-strict-aliasing -g -g -O2 -fPIC -c win32/api.c win32/api.c:2: fatal error: windows.h: No such file or directory compilation terminated. make: *** [api.o] Error 1 Gem files will remain installed in /var/lib/gems/1.8/gems/win32-api-1.4.6 for inspection. Results logged to /var/lib/gems/1.8/gems/win32-api-1.4.6/ext/gem_make.out f(t) -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Problem clicking with element_by_xpath
I don't think the mingw32 ruby version (that is, the latest one-click installers) are supported by watir; the older mswin32 ruby 1.8.6 is currently recommended. I recommend Vapir (http://vapir.org); it works on all versions of ruby since 1.8.6. On Fri, Nov 5, 2010 at 11:47, Reciprocity george.wi...@gmail.com wrote: I'm trying to click this using Ruby 1.8.7 and Watir 1.6.7. tr onclick=goTo('/Administration/DeleteFilter.asp', 'Claim') The code below worked in Ruby 1.8.6 and Watir 1.6.2 @what = '/Administration/DeleteFilter.asp' ie.element_by_xpath(//tr[contains(@onclick, '#...@what}')]/).click() I'm getting this error. C:/ruby187/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/winClicker.rb: 208: [BUG] Segmentation fault ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Any ideas? -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Problem clicking with element_by_xpath
Vapir is an fork of Watir, so it's an alternative to it. Everything is compatible with Watir's API, with a couple minor exceptions. It works with all recent versions of ruby. have a look at these wiki pages: - Getting Started http://wiki.github.com/vapir/vapir/getting-started - Coming from Watirhttp://wiki.github.com/vapir/vapir/coming-from-watir - Differences from Watir (API)http://wiki.github.com/vapir/vapir/differences-from-watir-api On Fri, Nov 5, 2010 at 14:51, Reciprocity george.wi...@gmail.com wrote: Thanks for you reply. So if I want to move to a newer version of ruby I should use Vapir. If I want move to a newer version of watir, ruby 186 is recommended? Does Vapir work with the newest versions of ruby and watir? On Nov 5, 12:03 pm, Ethan notet...@gmail.com wrote: I don't think the mingw32 ruby version (that is, the latest one-click installers) are supported by watir; the older mswin32 ruby 1.8.6 is currently recommended. I recommend Vapir (http://vapir.org);it works on all versions of ruby since 1.8.6. On Fri, Nov 5, 2010 at 11:47, Reciprocity george.wi...@gmail.com wrote: I'm trying to click this using Ruby 1.8.7 and Watir 1.6.7. tr onclick=goTo('/Administration/DeleteFilter.asp', 'Claim') The code below worked in Ruby 1.8.6 and Watir 1.6.2 @what = '/Administration/DeleteFilter.asp' ie.element_by_xpath(//tr[contains(@onclick, '#...@what}')]/).click() I'm getting this error. C:/ruby187/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/winClicker.rb: 208: [BUG] Segmentation fault ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Any ideas? -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com- Hide quoted text - - Show quoted text - -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] $browser.url method
I think I recall hearing of an issue like this with firewatir - are you using watir (ie) or firewatir? On Fri, Oct 22, 2010 at 12:08, xguarder shams...@gmail.com wrote: Hello, as of late, anything I run the $browser.url method, I keep getting an empty string returned. I know for sure this used to work. Any ideas as to why this method is no longer returning the proper value? Thanks in advance! -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: $browser.url method
Yeah, there is a message about that issue here: http://groups.google.com/group/watir-general/browse_thread/thread/6f94126da40a4ff1?pli=1 It seems to be related to handling multiple windows, and firewatir's lack of capability there is coming up on this list repeatedly. I recommend Vapir-Firefox over firewatir, handling multiple windows works fine along with many other improvements. see http://vapir.org/ -Ethan On Fri, Oct 22, 2010 at 14:17, xguarder shams...@gmail.com wrote: Sorry, forgot to specify, it's firewatir. Even using irb...something simple as Firefox.new or Firefox.attach, followed by a .url method won't return anything. Pretty much any other method I use is fine though. Thanks again! On Oct 22, 1:16 pm, Ethan notet...@gmail.com wrote: I think I recall hearing of an issue like this with firewatir - are you using watir (ie) or firewatir? On Fri, Oct 22, 2010 at 12:08, xguarder shams...@gmail.com wrote: Hello, as of late, anything I run the $browser.url method, I keep getting an empty string returned. I know for sure this used to work. Any ideas as to why this method is no longer returning the proper value? Thanks in advance! -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: $browser.url method
you can check this with `gem which firewatir` On Fri, Oct 22, 2010 at 14:54, xguarder shams...@gmail.com wrote: Thanks! Oh, I also read somewhere that you can edit an entry in the FireWatir library. Any idea where under /usr/lib/ruby/ this is stored (Mac OS X)? Thanks, Ken On Oct 22, 2:30 pm, Ethan notet...@gmail.com wrote: Yeah, there is a message about that issue here: http://groups.google.com/group/watir-general/browse_thread/thread/6f9... It seems to be related to handling multiple windows, and firewatir's lack of capability there is coming up on this list repeatedly. I recommend Vapir-Firefox over firewatir, handling multiple windows works fine along with many other improvements. seehttp://vapir.org/ -Ethan On Fri, Oct 22, 2010 at 14:17, xguarder shams...@gmail.com wrote: Sorry, forgot to specify, it's firewatir. Even using irb...something simple as Firefox.new or Firefox.attach, followed by a .url method won't return anything. Pretty much any other method I use is fine though. Thanks again! On Oct 22, 1:16 pm, Ethan notet...@gmail.com wrote: I think I recall hearing of an issue like this with firewatir - are you using watir (ie) or firewatir? On Fri, Oct 22, 2010 at 12:08, xguarder shams...@gmail.com wrote: Hello, as of late, anything I run the $browser.url method, I keep getting an empty string returned. I know for sure this used to work. Any ideas as to why this method is no longer returning the proper value? Thanks in advance! -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com watir-general%2bunsubscr...@googlegroups.comwatir-general%252bunsubscr...@googlegroups.com -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] AutoITx3 works on one machine but not another for opening Excel files
I don't think this has anything to do with AutoIt, or indeed Watir - the error is about excel, and looks like a WIN32OLE error. Is Excel actually installed on your automation box? I've seen this error on machines where Excel has not been installed. If that's not the issue, you'll need to include more than the error message - at a bare minimum include the full error class, stacktrace, and message, and the code that raised the error. But if it's not actually anything to do with Watir (and it doesn't look like it is), I don't know that anybody will necessarily be able to help you here. On Thu, Oct 14, 2010 at 14:58, Schase promac...@gmail.com wrote: I have a watir test that downloads some information from a web app to an Excel file, and I then open the file to confirm the contents. On my dev box everything works fine, but the scheduled automation runs (via Hudson) always fail attempting to open the Excel file. I have checked that the correct version of AutoITX3.dll is registered on both machines (Ruby 1.8, Watir 1.6.5). No other versions of AutoITx3 are registered on either machine. The error on the Hudson box is the one expected if the dll is NOT registered, but it is present in regedit in the same location as on my dev box. Both machines are WinXP. Running the test manually on the Hudson box results in the same error -- unknown OLE server: 'Excel.Application' HRESULT error code:0x800401f3 Invalid class string. I searched for similar errors and saw one instance here where running on a virtual machine had caused similar problems, but only if the VM window was closed. I don't think this is a code error since it runs on the dev box. Any suggestions for debugging this? TIA, Sabrina -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comhttp://groups.google.com/group/watir-generalwatir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Difficulty typing into textfield
I can answer what the developers were thinking, I believe - they were thinking I want the word 'password' to be seen in this text field as a sort of help-text, but when the user clicks on it, I want that to disappear and their password should show up as asterisks like normal. If the field is initially a password type, then the default value shows up as '*'s rather than as 'password'. Various sites do various bits of hackery (usually CSS) to have help-text-like stuff in password fields. This is one of the poorer implementations I've seen. On Wed, Oct 13, 2010 at 17:08, Jarmo Pertman jarm...@gmail.com wrote: Or try $b.text_field(:name, password).value = text instead of #set, without invoking any JavaScript events. Also, you could ask from the developers what the hell did they think with that onfocus event when they did that :) Jarmo Pertman - IT does really matter - http://www.itreallymatters.net On Oct 11, 9:31 pm, Ethan notet...@gmail.com wrote: your onfocus event seems to do some interesting stuff. onfocus=jQuery('#mockPassword').hide();jQuery('#password').show();jQuery(' #password').focus(); basically, you're not going to be able to type into the mockPassword field because when you focus it, it hides itself and gives you another field. try something like: $b.text_field(:name, mockPassword).focus $b.text_field(:name, password).set(pass_word) On Mon, Oct 11, 2010 at 14:02, blkjk blkjk@gmail.com wrote: Thx. $b.text_field(:name, password).exists? found object, but... When I run: $b.text_field(:name, password).set(pass_word) I get error msg: WIN32OLERuntimeError: focus OLE error code:800A083E in htmlfile Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus. HRESULT error code:0x80020009 Exception occurred. C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/ input_elements.rb:370:in `method_missing' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/ input_elements.rb:370:in `set' IPN_Login.rb:56:in `test_login' Still unable to access object, even though Watir thinks it exists. Further thoughts? On Oct 7, 8:09 am, CJ Romberger c...@wildwoodinteractive.com wrote: I have it working like this: password = 'abc123' b.text_field(:name, mock_password).set password If that doesn't work, you might want to just test to see if watir can even see that element. if b.text_field(:name, mock_password).exists? puts Password field exists else puts Password field missing end On Wed, Oct 6, 2010 at 8:54 PM, Eric Mathiesen mathiese...@gmail.com wrote: Could also try .flash to ensure you are calling the right element from orb. Css has given me some challenges in the past.. also try emwith (;index, #).set On Oct 6, 2010 6:35 PM, blkjk blkjk@gmail.com wrote: I am trying to type text to a Login textfield. And when I use this code to access it: $b.text_field(:name, 'mockPassword').set('abc123') No password actually gets typed into the textfield and used for login. Here is what Firebug caught to identify the textfield: input type=text onfocus=jQuery('#mockPassword').hide();jQuery('#password').show();jQuery(' #password').focus(); value=password name=mockPassword id=mockPassword style=width: 150px; color: rgb(204, 204, 204); class=input Any thoughts on how to make the code type the password into that field? And yes, I wish to make it work on both IE8 FF3.5 in Win7. Thanks for any help on this. -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com watir-general%2bunsubscr...@goog legroups.com http://groups.google.com/group/watir-generalwatir-general+unsubscribe... -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com watir-general%2bunsubscr...@goog legroups.com watir-general%2bunsubscr...@goog legroups.com -- CJ Romberger Wildwood Interactivehttp://www.wildwoodinteractive.com/ 512.732.9916 PLEASE NOTE: I only check this email address about once a day! If you're a client, the fastest way to reach me is to login to Basecamp, OR email supp...@wildwoodinteractive.com. If you're NOT a client? Why not become one!? :) -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice
Re: [wtr-general] Re: Difficulty typing into textfield
your onfocus event seems to do some interesting stuff. onfocus=jQuery('#mockPassword').hide();jQuery('#password').show();jQuery('#password').focus(); basically, you're not going to be able to type into the mockPassword field because when you focus it, it hides itself and gives you another field. try something like: $b.text_field(:name, mockPassword).focus $b.text_field(:name, password).set(pass_word) On Mon, Oct 11, 2010 at 14:02, blkjk blkjk@gmail.com wrote: Thx. $b.text_field(:name, password).exists? found object, but... When I run: $b.text_field(:name, password).set(pass_word) I get error msg: WIN32OLERuntimeError: focus OLE error code:800A083E in htmlfile Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus. HRESULT error code:0x80020009 Exception occurred. C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/ input_elements.rb:370:in `method_missing' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.6/lib/watir/ input_elements.rb:370:in `set' IPN_Login.rb:56:in `test_login' Still unable to access object, even though Watir thinks it exists. Further thoughts? On Oct 7, 8:09 am, CJ Romberger c...@wildwoodinteractive.com wrote: I have it working like this: password = 'abc123' b.text_field(:name, mock_password).set password If that doesn't work, you might want to just test to see if watir can even see that element. if b.text_field(:name, mock_password).exists? puts Password field exists else puts Password field missing end On Wed, Oct 6, 2010 at 8:54 PM, Eric Mathiesen mathiese...@gmail.com wrote: Could also try .flash to ensure you are calling the right element from orb. Css has given me some challenges in the past.. also try emwith (;index, #).set On Oct 6, 2010 6:35 PM, blkjk blkjk@gmail.com wrote: I am trying to type text to a Login textfield. And when I use this code to access it: $b.text_field(:name, 'mockPassword').set('abc123')No password actually gets typed into the textfield and used for login. Here is what Firebug caught to identify the textfield: input type=text onfocus=jQuery('#mockPassword').hide();jQuery('#password').show();jQuery(' #password').focus(); value=password name=mockPassword id=mockPassword style=width: 150px; color: rgb(204, 204, 204); class=input Any thoughts on how to make the code type the password into that field? And yes, I wish to make it work on both IE8 FF3.5 in Win7. Thanks for any help on this. -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com http://groups.google.com/group/watir-generalwatir-general+unsubscribe... -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com watir-general%2bunsubscr...@goog legroups.com -- CJ Romberger Wildwood Interactivehttp://www.wildwoodinteractive.com/ 512.732.9916 PLEASE NOTE: I only check this email address about once a day! If you're a client, the fastest way to reach me is to login to Basecamp, OR email supp...@wildwoodinteractive.com. If you're NOT a client? Why not become one!? :) -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Manipulate Keystrokes on a MAC
stop sending the same question to the list over and over. On Thu, Oct 7, 2010 at 10:05, Ozzi usmanhhuss...@gmail.com wrote: Hi Guys, If anyone knows how to manipulate keystrokes on a MAC I would be really grateful if you can tell me how to do this. I need to hit the ENTER and TAB keys on the keyboard. I know I can use AutoIT on windows but am totally lost on how to do this on a MAC. Kind regards, Usman Hussain -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Manipulate Keystrokes on a MAC
if you have more to add, add it to the original thread where you asked. On Thu, Oct 7, 2010 at 11:50, Ozzi usmanhhuss...@gmail.com wrote: Am just trying to see if anyone has a solution or if anyone has ever come across this problem... maybe asking it in a different way will make people understand the question a bit better?... After all this is a forum where people help each other out... On Oct 7, 4:42 pm, Ethan notet...@gmail.com wrote: stop sending the same question to the list over and over. On Thu, Oct 7, 2010 at 10:05, Ozzi usmanhhuss...@gmail.com wrote: Hi Guys, If anyone knows how to manipulate keystrokes on a MAC I would be really grateful if you can tell me how to do this. I need to hit the ENTER and TAB keys on the keyboard. I know I can use AutoIT on windows but am totally lost on how to do this on a MAC. Kind regards, Usman Hussain -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Manipulate Keystrokes on a MAC
well, I'd have posted in the original thread if I had a solution. same is true for everybody else, I suspect, so spamming the same thing repeatedly isn't going to help, regardless of minimally different wording. however, generally, sending keystrokes via the operating system is a poor solution (in my opinion), and much more error-prone than going through the DOM. if it's interacting with a web page that is being problematic, it may be just a question of firing the right events in javascript. not knowing more about the actual problem, it's not possible to get more specific than that, but that is my general, broad advice. On Thu, Oct 7, 2010 at 12:02, saqi saqibowl...@gmail.com wrote: I have a similar problem and have been checking the site for a solution for a few days now and still haven't found anything. I am very eager to find a solution to this problem also. In fact I appreciate Ozzi's eagerness to find a solution by posting the problem in different terms to make it more understandable by more users, therefore increasing his (and others) chance to find a solution. Come on guys, someone must have a solution out there for manipulating keystrokes on a MAC? Ethan - HELP if you don't want no more new posts lol On Oct 7, 4:52 pm, Ethan notet...@gmail.com wrote: if you have more to add, add it to the original thread where you asked. On Thu, Oct 7, 2010 at 11:50, Ozzi usmanhhuss...@gmail.com wrote: Am just trying to see if anyone has a solution or if anyone has ever come across this problem... maybe asking it in a different way will make people understand the question a bit better?... After all this is a forum where people help each other out... On Oct 7, 4:42 pm, Ethan notet...@gmail.com wrote: stop sending the same question to the list over and over. On Thu, Oct 7, 2010 at 10:05, Ozzi usmanhhuss...@gmail.com wrote: Hi Guys, If anyone knows how to manipulate keystrokes on a MAC I would be really grateful if you can tell me how to do this. I need to hit the ENTER and TAB keys on the keyboard. I know I can use AutoIT on windows but am totally lost on how to do this on a MAC. Kind regards, Usman Hussain -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com watir-general%2bunsubscr...@goog legroups.com -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Could not attach with UAC turned on
Run ruby as administrator, or turn off protected mode in IE. On Wed, Oct 6, 2010 at 06:28, Ashok Prabhu ashokprab...@gmail.com wrote: I have been facing the issue of not being able to attach to a ie 8 window using the title in windows 2008 with UAC turned on. I m able to attach to the window using title with UAC turned off. Could someone suggest a fix for this without turning off UAC in Windows 2008. Thanks, ~Ashok. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Registering the Watir autoit .dll control without local admin?
Vapir has a good api for popup handling whose only external dependency is FFI. http://vapir.org/ http://github.com/vapir/vapir/wiki/modal-dialogs On Tue, Oct 5, 2010 at 06:14, Alister Scott alister.sc...@gmail.com wrote: Hi, I was wondering if anyone knows how to get Watir to work with dialog boxes without being able to register the autoit .dll file? (regsvr32 AutoItX3.dll does not work) Basically we have no access to update the registry and everything works in watir besides the dialogs that autoit handles. Any ideas? Cheers, Alister Scott -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Question on Sendkeys XPATH
1) send_keys isn't going to work with two things trying to send_keys simultaneously. 2) send_keys is almost never a good solution, in my experience, doing through the dom via watir's api is better. 3) your xpath refers to an image with class of CreateRequestComboContainerRightImageCell but the thing that has that class is a table. 4) you don't really need xpath for this, watir's api is simpler: b.table(:class, 'CreateRequestComboContainerRightImageCell') will get the table and you can get the image inside that. On Tue, Oct 5, 2010 at 07:10, Taki Sama timothy...@gmail.com wrote: Hi All, Im new to Watir, coming from a QTP background. I'm using the following Ruby 1.8.7, Rubygems 1.3.6, Watir 1.6.6 on a Windows 7 X64 system. I happen to need to run multiple 'modules' at the same time on 1 box. Would it be possible to implement a separate instance of 'send_keys' per each run? If the 'modules' happen to use 'sendkeys' at the same time, the whole script gets messed up (focus, typing and sending on the wrong browser). I was also looking at XPATH to avoid using sendkeys (trying to click actual objects); but I am stumped with the syntax to get it working.. please help? Like with and without regex methods please. b.element_by_xpath(// i...@class='CreateRequestComboContainerRightImageCell']/).click b.image(:xpath, // i...@class='CreateRequestComboContainerRightImageCell']/).click None of them seem to get the desired result; (I'm assuming this for instances that I wont be able to get a unique id or name) Here is a sample structure: td class=CreateRequestComboContainerRightImageCell id=Master_PageContentPlaceHolder_screen_ctl01_bc8ee8e9_1efe_463b_9e46_780e216598f1_screen_jobTitleCombo_ContainerRightImageCell jQuery1286272679885=60 img class=CreateRequestComboRightImage id=Master_PageContentPlaceHolder_screen_ctl01_bc8ee8e9_1efe_463b_9e46_780e216598f1_screen_jobTitleCombo_RightImage src=/XXX/Theme/AttachmentHandler.ashx? Parameter=Theme.ControlImages.XComboSelectorDropDown complete=complete/ -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] for editbox Fire_event(onclick) does not work in Firefox while working fine in IE
it doesn't work is not a useful question, and unlikely to get a useful response. describe what is happening (compared to what should be happening), include code, include error messages, include a minimum needed to reproduce. On Sun, Sep 19, 2010 at 22:32, Rajiv Nanduani rajivkumarnandv...@gmail.comwrote: Hi All, I am facing problem for onclick event fire event method it is not working in firefox(3.5.6) while fine in IE $ie.form(:id ,mainForm).text_field(:id, ItemTagSearchWidgetGameDate) .fire_event(onclick) input type=text readonly=readonly value=click here to pick a game date class=gameDate onclick=bam.dateSelector.prepareAndShow(this) style=width: 235px; id=ItemTagSearchWidgetGameDate firewatir (1.6.5) is this bug with firewati -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] The problem about UTF-8
Firewatir does not support utf-8. Vapir-Firefox does, I recommend trying it. http://vapir.org/ On Fri, Sep 10, 2010 at 10:01, Keith Hughes khughe...@gmail.com wrote: I tried your script and got a problem with the format of the text entered in firefox. However it worked fine in Internet Explorer. Could this be a firewatir or firefox issue specifically? On Fri, Sep 10, 2010 at 1:59 PM, Quang quang...@gmail.com wrote: I have a problem about UTF-8 when set text_field and click link, I searched alot of it on GROUP and Forum but can't find any answer about it. Can you help me resolve my problem. Thanks! myscript.rb require 'rubygems' require 'firewatir' Watir::Browser.default = 'firefox' ff = Watir::Browser.start(www.google.com) ff.text_field(:name,q).value = năng động mỗi ngày -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Watir on Ruby 1.9.2
Vapir does work on 1.9.2. On Thu, Sep 9, 2010 at 07:26, Željko Filipin zeljko.fili...@wa-research.chwrote: On Thu, Sep 9, 2010 at 6:18 AM, Jason freezingki...@gmail.com wrote: I'm in a slight quandry where Rails3.0 requires ruby 1.9.2, but Watir only appears to run on 1.8.6 Until Watir supports Ruby 1.9, there are two solutions (neither tested): - watir-webdriver (not sure if it works on 1.9): http://zeljkofilipin.com/2010/01/12/watir-on-webdriver/ - vapir (as far as I remember, it claims to work on 1.9): http://vapir.org/ Let us know if you try any of them. Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Watir on Ruby 1.9.2
True. I think no_wait stuff is still broken on 1.8.7, but not sure. I don't recall there being anything else that doesn't work (but I haven't tested). On Thu, Sep 9, 2010 at 10:41, Jarmo Pertman jarm...@gmail.com wrote: Also, rails 3 works on 1.8.7. 1.9.2 is not absolutely necessary :) Jarmo On Sep 9, 7:18 am, Jason freezingki...@gmail.com wrote: I'm in a slight quandry where Rails3.0 requires ruby 1.9.2, but Watir only appears to run on 1.8.6 (although I did manage to get it running previously on 1.9.1, see here: http://groups.google.com/group/watir-general/browse_thread/thread/f1e... but Rails definitely doesn't run on 1.9.1) What's the latest in Ruby 1.9.2 support? Is it in the pipeline at all? J -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Watir on Ruby 1.9.2
This is a win32-api gem issue. See the below link on how to solve it: http://groups.google.com/group/vapir/msg/10a07844050c9bd2 -Ethan On Thu, Sep 9, 2010 at 17:55, Jason freezingki...@gmail.com wrote: You say that, although I get the exact same error message somewhere in the win32-api: require watir-vapir browser = Vapir::IE.new C:/Ruby192/lib/ruby/gems/1.9.1/gems/win32-api-1.4.5-x86-mswin32-60/lib/ win32/api.so: [BUG] Segmentation fault So I'm not so sure. J On Sep 10, 1:35 am, Ethan notet...@gmail.com wrote: Vapir does work on 1.9.2. On Thu, Sep 9, 2010 at 07:26, Željko Filipin zeljko.fili...@wa-research.chwrote: On Thu, Sep 9, 2010 at 6:18 AM, Jason freezingki...@gmail.com wrote: I'm in a slight quandry where Rails3.0 requires ruby 1.9.2, but Watir only appears to run on 1.8.6 Until Watir supports Ruby 1.9, there are two solutions (neither tested): - watir-webdriver (not sure if it works on 1.9): http://zeljkofilipin.com/2010/01/12/watir-on-webdriver/ - vapir (as far as I remember, it claims to work on 1.9): http://vapir.org/ Let us know if you try any of them. Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com watir-general%2bunsubscr...@goog legroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] HTML element order different in IE8 from IE7
There are several problems here. - The attributes of an html object aren't meant to be in any particular order; them changing is not really a bug. - Using a regexp to parse html is a fundamentally broken idea. - Why are you passing a third argument to #radio at all if you are just getting that value from the html, corresponding to the same element you are trying to retrieve? why not just do ie.radio(:name, 'anniversaryDate') ? The error message isn't great, that is true. I would recommend to open a ticket for that at http://jira.openqa.org/browse/WTR On Fri, Sep 3, 2010 at 15:34, Lisa Crispin lisa.cris...@gmail.com wrote: I had a script fail when running it on IE8, it's several years old and works fine on IE7. It's setting a radio button: ie.radio(:name, 'anniversaryDate', anniversary_date).set The value of anniversary_date is a date like '10-01-2008' (at least, in IE7), it's set by using regex to parse the html anniv_regex = /id=anniversaryDate(\d+).*?value=?(.+?)? name=/ In IE7 the html looks like this: input type=radio value=10-01-1992 name=anniversaryDate id=anniversaryDate1 In IE8 the html looks like this: input name=anniversaryDate id=anniversaryDate1 type=radio value=10-01-1992/ In IE7, the value of anniversary_date ends up as: 10-01-2010 In IE8, the value of anniversary_date ends up as: 10-01-2010 type=radio And I get an error Watir::Exception::UnknownObjectException: Unable to locate element, using :name, anniversaryDate C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:56:in `assert_exists' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:288:in `enabled?' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:60:in `assert_enabled' C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/input_elements.rb:538:in `set' But in IRB if I type ie.radio(:name, 'anniversaryDate', '10-01-2010').set it works fine - so it's not that it can't find the name, the value is wrong. So one problem is a weird IE8 thing, I don't know what to do about that. But the other problem is, the error message is misleading. I wasted some time thinking something was wrong with the name. Thanks Lisa -- Lisa Crispin Co-author with Janet Gregory, _Agile Testing: A Practical Guide for Testers and Agile Teams_ (Addison-Wesley 2009) Contributor to _Beautiful Testing_ (O'Reilly 2009) http://lisacrispin.com @lisacrispin on Twitter -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: [Wtr-development] new window automation library: WinWindow
It's great that it is nicely documented :) Thank you. I tried hard to make sure everything had a useful description for the rdoc. From a developer's view i don't like that (almost) all the code is in one file with 1365 lines. Why? I could stand to split this up, that is very true. It grew from one 275-line file, which is reasonable, but I never split it up as it grew. It is time for that to happen, I agree. As a user's view i looked at the API and it seems to be really-really (i mean, really) confuzing. For example, there are methods like #set_foreground! and #really_set_foreground!. Like, what? My aim was to closely mirror the windows api. I basically wanted to expose the lowest level of functionality I could, and not be opinionated around it - for example, winclicker is very opinionated about what functionality is useful and exposes an extremely limiting set of functions, which I wanted to avoid. However, the windows API is confusing. Very confusing. That is reflected equally in the WinWindow library. I couldn't begin to tell you what all the show_* functions do, because microsoft's documentation for those (which is linked from each function), is frequently very unclear. But if somebody can make sense of microsoft's docs, they have those methods available in ruby. #really_set_foreground! is one of the few functions I wrote myself to expand on the windows API's capabilities, and I documented all of what it does to try to set the foreground window (things that #set_foreground! does not do). On another note, i've been lately producing some code using AutoIt since it is nicely integrated with current Watir. I'm being able to produce quite robust and effective results with it. I don't see many benefits of using something else currently (yup, you cannot use everything with AutoIt on locked workstation, but this is also true for FFI and something similar). Anyway, i'm planning to make it as a gem also probably. To my mind, the benefit is removing a largely redundant layer of API. Since AutoIt relies internally on the same windows API functions that WinWindow exposes more directly, there shouldn't be anything that you can do with AutoIt that you can't do with this library. However, AutoIt adds more code and more functionality on top of the windows API, and I have reproduced only some of these things as I have needed them (AutoIt implements a whole lot of stuff that doesn't seem very useful to me). But, things like AutoIt's SendKeys are useful, and not yet attempted with WinWindow. I hope to add to WinWindow things that people would find useful. Basically, to me, there are a few advantages. One, exposing the underlying windows API gives you more power through basic functions to build other things on top of. Two, having this in pure ruby is better than dealing with a DLL. Three, this is entirely open-source. AutoIt only open-sources part of its code these days, so if you want to know what is going on inside with any given function you use, you may not be able to tell that. One disadvantage right now is the lack of higher-level functionality built on top of the windows API such as AutoIt has. I will add functionality as there is demand for it. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Firewatir attach method doesn't work properly
fixing vapir-firefox for 3.0.* is buried on my backlog, I'm afraid, and it will be some time before I am able to get to that. On Thu, Sep 2, 2010 at 14:27, Amit amit.e...@gmail.com wrote: Hi Ethan, I used VAPIR 1.7.1 for attaching two browsers. Now i'm able to work on two instance on browser simultaneously. Thank you very much.. Btw .. did you fixed that problem recently? Thank You On Mon, Aug 16, 2010 at 11:19 AM, Ethan notet...@gmail.com wrote: Vapir is currently broken on 3.0.*. A fix is coming, but I have a number of other higher-priority issues to fix first. You can upgrade to 3.5 or 3.6, or wait until I can get 3.0 support working. On Thu, Aug 12, 2010 at 11:50, Amit amit.e...@gmail.com wrote: its 3.06 On Thu, Aug 12, 2010 at 8:56 PM, Ethan notet...@gmail.com wrote: What version of firefox are you using? On Thu, Aug 12, 2010 at 06:17, Amit amit.e...@gmail.com wrote: Hi Ethan, I tried below code: require 'watir-vapir' ff = Vapir::Firefox.new ff.start(www.google.com) After executing above code, A new instance of firefox opened and got following error. Could you please tell me why i'm getting this error? C:/Ruby/lib/ruby/gems/1.8/gems/vapir-firefox-1.7.0/lib/vapir-firefox/jssh_socket.rb:118:in `initialize': Something went wrong loading Prototype - message SyntaxError: unterminated comment\n SyntaxError: return not in function\n TypeError: this.getUTCMonth is not a function\n SyntaxError: syntax error\n SyntaxError: return not in function\n SyntaxError: syntax error\n SyntaxError: syntax error\n \n SyntaxError: syntax error\n \n SyntaxError: syntax error\n \n SyntaxError: syntax error\n \n function () {\nif (!this.currentlyExecuting) {\ntry {\n this.currentlyExecuting = true;\nthis.execute();\n} catch (e) {\n} finally {\nthis.currentlyExecuting = false;\n}\n}\n}\n SyntaxError: syntax error\n SyntaxError: syntax error\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: syntax error\n SyntaxError: syntax error\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n SyntaxError: unterminated comment\n ReferenceError: document is not defined\n TypeError: this.replace is not a function\n SyntaxError: return not in function\n SyntaxError: invalid label\n SyntaxError: missing ; before statement\n SyntaxError: syntax error\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n SyntaxError: unterminated comment\n SyntaxError: return not in function\n SyntaxError: syntax error\n \n \n \n \n \n ReferenceError: reference to undefined XML name *::*\n \n \n \n \n \n \n \n \n \n \n \n SyntaxError: return not in function\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n \n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n \n \n \n \n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: syntax error\n SyntaxError: syntax error\n SyntaxError: return not in function\n SyntaxError: syntax error\n SyntaxError: return not in function\n SyntaxError: syntax error\n SyntaxError: syntax error\n \n function (object) {\nif (object Object.isFunction(object.toTemplateReplacements)) {\nobject = object.toTemplateReplacements();\n}\nreturn this.template.gsub(this.pattern, function (match) {if (object == null) {return match[1] + \\;}var before = match[1] || \\;if (before == \\) {return match[2];}var ctx = object, expr = match[3];var pattern = /^([^.[]+|\\[((?:.*?[^])?)\\])(\\.|\\[|$)/;match = pattern.exec(expr);if (match == null) {return before;}while (match != null) {var comp = match[1].startsWith(\[\) ? match[2].gsub(\]\, \]\) : match[1];ctx = ctx[comp];if (null == ctx || \\ == match[3]) {break;}expr = expr.substring(\[\ == match[3] ? match[1].length : match[0].length);match = pattern.exec(expr);}return before + String.interpret(ctx);});\n}\n SyntaxError: syntax error\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n SyntaxError: return not in function\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: syntax error\n SyntaxError
Re: [wtr-general] Watir Search
I agree that it is a useful tool. I think that it would be a good link to have in the mailing list footer, where we currently have: Before posting, please read http://watir.com/support. In short: search before you ask, be nice. Though it is already prominently featured on that link, so maybe one level of indirection is good enough. On Fri, Aug 27, 2010 at 06:54, Željko Filipin zeljko.fili...@wa-research.ch wrote: For years we have Google custom search that searches all Watir related sites, but nothing else: http://bit.ly/watirsearch So far, it had 13099 total queries. Not bad. It used to search sites whose URL contains (* is wildcard): rubyforge.org/pipermail/wtr-core rubyforge.org/pipermail/wtr-development rubyforge.org/pipermail/wtr-general mail-archive.com/wtr-gene...@rubyforge.org forums.openqa.org/forum.jspa?forumID=6 forums.openqa.org/forum.jspa?forumID=5 groups.google.com/group/watir-general wtr.rubyforge.org wiki.openqa.org/display/WTR jira.openqa.org/browse/WTR wikipedia.org/wiki/Watir rubyforge.org/projects/wtr svn.openqa.org/svn/watir/trunk/watir svn.openqa.org/fisheye/browse/watir/trunk/watir rubyforge.org/*group_id=104 clearspace.openqa.org/community/watir Some of the sites are not used any more, or even do not exits, so I have removed them: forums.openqa.org/forum.jspa?forumID=6 forums.openqa.org/forum.jspa?forumID=5 wtr.rubyforge.org svn.openqa.org/svn/watir/trunk/watir svn.openqa.org/fisheye/browse/watir/trunk/watir clearspace.openqa.org/community/watir I have added the following sites: watir.com github.com/bret/watir rubygems.org/gems/*watir* wtr.rubyforge.org/rdoc github.com/jarib/watir-webdriver celerity.rubyforge.org twitter.com/watir I think we should promote it more, since it is for sure the first tool you should use if you have a Watir related question. I have tried to add custom search to watir.com (instead of built in wordpress.com search), but no luck so far: http://wordpress.stackexchange.com/questions/956/add-google-custom-search-to-wordpress-com Questions: 1) Anybody knows how to add Google custom search to wordpress.com site? 2) I would like to add blogs from http://watir.com/blogs/ to the search. Should I just add posts tagged Watir? (Not sure if all blogs listed there have that option.) 3) So far I have added only github.com/jarib/watir-webdriver and celerity.rubyforge.org for watir-webdriver and celerity. I plan to add all other sites related to them. Anybody thinks it would not be a good idea? 4) Did I miss a site that should be added? Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: More than one condition
True. In fact I believe watir even has unit tests to make sure it works with multiple identical IDs despite that being quite invalid html. On Thu, Aug 26, 2010 at 04:50, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Wed, Aug 25, 2010 at 7:10 PM, Chuck van der Linden sqa...@gmail.com wrote: Watir presumes valid html I think this is not true. Watir does not care if HTML is valid or not. It will just pick the first element that has the attribute you have provided. Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Jssh for Firefox 4.0 beta3
There are a number of other plugins which do basically the same thing a jssh, which I found researching alternatives. I never got around to doing anything with any of them, but I think it's a good time for jssh to die, compiling it for every version on every platform is a huge pain. not that I know whether any of these still work in ff4.0, of course, but something seems bound to. xush: - http://github.com/admc/xush - https://addons.mozilla.org/en-US/firefox/addon/10585/ mozrepl: - http://wiki.github.com/bard/mozrepl/ sdconnector: - http://www.activestate.com/blog/2008/05/jssh-replacement-sd-connector and more: - https://developer.mozilla.org/en/JavaScript/Shells On Wed, Aug 25, 2010 at 10:03, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Wed, Aug 25, 2010 at 3:49 PM, Angrez Singh ang...@gmail.com wrote: Need to find other way to interact with Firefox. Webdriver? http://zeljkofilipin.com/2010/01/12/watir-on-webdriver/ Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: More than one condition
Tricky. I would get all the links that match what you want, and then reject any of them that are inside the table. The following entirely untested code may work, or at least give you some ideas - note that it'll only work in IE due to its reliance on unique_number; if you want to use firewatir, I can't help you; if you want to use firefox with vapir-firefox I can come up with something that'll work. # get the links that match what I want: links = browser.links.select{|link| link.href =~ /imperativeMain.*do.*?navTrailRequired=/ } # get the table table = browser.table(:id, 'breadcrumbTable') # get the links in the table, that I don't want table_links = table.links.select{|link| link.href =~ /imperativeMain.*do.*?navTrailRequired=/ } # reject the table links, matching on unique_number good_link = links.detect do |link| # find the first link ... !table_links.any? do |table_link| # where there aren't any links inside the table ... table_link.unique_number == link.unique_number # with the same unique number end end 2010/8/25 Shlomit Gazit shlomitpatr...@gmail.com Guys, Sorry for the misunderstanding. First of all I dont have ids. I said in the beginning id but it is actually url I am clicking on. The links are dynamic so I cannot give the exact one. In the page when I am deleting an item, it records the item in recently visited table. If after deleting the item I will click on the link in Recently visited, I will get to a dead end. It is obviously a bug but it is not being fixed for time being, and I will have easier life with watir tests if I can get a work around. I will give you exact examples: I want to click on this html tag: a href=/c2p/imperativeMain.do?navTrailRequired=falseamp;id=1 class=linkList onmouseover=TagToTip('ID_SPAN_CONTEXT_NOTE__1', WIDTH, -240, SHADOW, true, BORDERCOLOR, '#e9e1c5', FONTCOLOR, '#99', BGCOLOR, '#c0', STICKY, true, FONTFACE, 'verdana, arial, helvetica', FONTSIZE, '11px', CLICKCLOSE, true); onmouseout=UnTip();Source: font class=supporting[Pending] /fontbSS very long name imperative /b/a The link that will lead me to a dead end its html is: a onclick=pageTracker._trackEvent('Recently visited', 'Recently visited - Source', 'belt;scriptgt;alert( c...');= title=belt;scriptgt;alert( copy)lt;= scriptgt;?= href=/c2p/imperativeMain.do?navTrailRequired=falseamp;id=262span class=breadcrumb_gray(Source) /spanbelt;scriptgt;alert(C.../a For clicking on each of them I will do with watir: ie.link(:url,/imperativeMain.*do.*?navTrailRequired=/).click What I found is that the link that leads me to dead end is surrounded by a table: table id=breadcrumbTable ...link to dead end... /table I thought it can give me an option to tell watir not to choose this link. Is it possible? Again, I cannot access with ids because the items' ids are unexpected. I hope it is clearer. On Wed, Aug 25, 2010 at 10:24 AM, Chuck van der Linden sqa...@gmail.comwrote: The problem is that the link above has the same url, but I dont want to click on the link in that table since it will take me to a dead end. HUH? If THE URL IS THE SAME, then how can one link lead you somewhere the other link does not? If both links point to the same URL, they should both take you to the same page, otherwise if they take you different places, they must have different url's . The problem appears to be that you are trying to select via a regular expression, and more than one thing is matching that expression. Can you change the regex so it will select one unique link instead of matching multiple links on the page?? Or another way to consider it, if you were working the page manually, how would you know which link is the one you want to click, what identifies it to you visually? Instead of supplying us with detailed HTML of the table and links you don't want to select, how about you provide some HTML of the one you DO want to select? Perhaps it is inside some other unique container like a div which could be used to identify it better? On Aug 25, 7:37 am, Shlomit Gazit shlomitpatr...@gmail.com wrote: I have this table: table id=breadcrumbTable and inside the table I have: a onclick=pageTracker._trackEvent('Recently visited', 'Recently visited - Issue', '[1482] - 1AIM-issue_name_1'); title=[1482] - 1AIM-issue_name_1 href=/c2p/urlspan class=breadcrumb_gray(Issue) /span[1482] - 1AIM-issue_name_1/a I am getting to the link I wish by doing: ie.link(:url,/url/).click The problem is that the link above has the same url, but I dont want to click on the link in that table since it will take me to a dead end. Index is not working for me since the table is not static and is growing with deletion of items. This is the entire table if it helps better: table id=breadcrumbTable tbodytr td class=breadcrumbs align=lefth2Recently Visited/h2/td /tr
Re: [wtr-general] Exception when clicking on items from the 'images' collection
Looks like a Firewatir bug. I recommend Vapir-Firefox over firewatir, it is forked from firewatir and has mostly the same API, but fixes many bugs and improves a lot of functionality. see http://vapir.org/ On Tue, Aug 24, 2010 at 13:45, balexis bale...@gmail.com wrote: Hello, I want to write a script that clicks on all the images present on a given web page. The goal is to ultimately see which images link to anything. I can't use the 'links' collection as I want to catch javascript redirections as well. --- require 'rubygems' require 'watir' test_site = http://my test site Watir::Browser.default = 'firefox' browser = Watir::Browser.new browser.goto test_site browser.images.each do |img| img.click sleep 5 end -- So, running this on a very specific site, I get the following stack trace: /opt/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ jssh_socket.rb:12:in `js_eval': arr_coll_IMG_0[2] is undefined (JsshSocket::JSTypeError) from /opt/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ jssh_socket.rb:20:in `js_eval_method' from /opt/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ element.rb:931:in `enabled?' from /opt/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ element.rb:917:in `assert_enabled' from /opt/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ element.rb:1067:in `click' from watir-test.rb:11 from /opt/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ element_collections.rb:141:in `each' from /opt/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ element_collections.rb:140:in `each' from watir-test.rb:10 Am I doing something wrong / missing some mandatory check? I am very new to Watir. Here is my environment. OSX 10.6.4 ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-darwin10] firewatir (1.6.5) firefox 3.6.8 Contact me privately to get the URL I am testing on (balexis @ gmail) Thanks -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] ruby 1.9.2-p0
As far as I know watir only works on windows with 1.8.6p111. Vapir (fork of watir) works with all current ruby versions from 1.8.6 onward, including 1.9.2 - http://vapir.org/ On Tue, Aug 24, 2010 at 17:20, lawcab law...@gmail.com wrote: Has anyone tried watir 1.6.5 with ruby 1.9.2-p0? I got this big error : See below. Thanks! C:/Utilities/Programs/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/win32- api-1.4.6-x86-mingw32/lib/win32/api.so: [BUG] Segmentation fault ruby 1.9.2p0 (2010-08-18) [i386-mingw32] -- control frame -- c:0031 p:-5419484 s:0102 b:0102 l:000101 d:000101 TOP c:0030 p: s:0100 b:0100 l:99 d:99 CFUNC :require c:0029 p:0013 s:0096 b:0096 l:95 d:95 METHOD internal:lib/ rubygems/custom_require:29 c:0028 p:0011 s:0091 b:0091 l:90 d:90 TOPC:/Utilities/ Programs/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/windows-api-0.4.0/lib/ windows/api.rb:1 c:0027 p: s:0089 b:0089 l:88 d:88 FINISH c:0026 p: s:0087 b:0087 l:86 d:86 CFUNC :require c:0025 p:0013 s:0083 b:0083 l:82 d:82 METHOD internal:lib/ rubygems/custom_require:29 c:0024 p:0011 s:0078 b:0078 l:77 d:77 TOPC:/Utilities/ Programs/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/windows-pr-1.0.9/lib/ windows/error.rb:12 c:0023 p: s:0076 b:0076 l:75 d:75 FINISH c:0022 p: s:0074 b:0074 l:73 d:73 CFUNC :require c:0021 p:0013 s:0070 b:0070 l:69 d:69 METHOD internal:lib/ rubygems/custom_require:29 c:0020 p:0011 s:0065 b:0065 l:64 d:64 TOPC:/Utilities/ Programs/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/win32-process-0.6.2/lib/ win32/process.rb:1 c:0019 p: s:0063 b:0063 l:62 d:62 FINISH c:0018 p: s:0061 b:0061 l:60 d:60 CFUNC :require c:0017 p:0013 s:0057 b:0057 l:56 d:56 METHOD internal:lib/ rubygems/custom_require:29 c:0016 p:0011 s:0052 b:0052 l:51 d:51 TOPC:/Utilities/ Programs/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.6.5/lib/watir/ ie-process.rb:1 c:0015 p: s:0050 b:0050 l:49 d:49 FINISH c:0014 p: s:0048 b:0048 l:47 d:47 CFUNC :require c:0013 p:0013 s:0044 b:0044 l:43 d:43 METHOD internal:lib/ rubygems/custom_require:29 c:0012 p:0083 s:0039 b:0039 l:38 d:38 TOPC:/Utilities/ Programs/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.6.5/lib/watir/ ie.rb:45 c:0011 p: s:0037 b:0037 l:36 d:36 FINISH c:0010 p:0009 s:0035 b:0035 l:26 d:34 EVAL (eval):1 c:0009 p: s:0033 b:0033 l:32 d:32 FINISH c:0008 p: s:0031 b:0031 l:30 d:30 CFUNC :eval c:0007 p:0038 s:0027 b:0027 l:26 d:26 METHOD C:/Utilities/ Programs/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/commonwatir-1.6.5/lib/ watir/browser.rb:89 c:0006 p:0019 s:0023 b:0022 l:21 d:21 METHOD C:/Utilities/ Programs/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/commonwatir-1.6.5/lib/ watir/browser.rb:79 c:0005 p:0079 s:0018 b:0018 l:17 d:17 METHOD C:/Utilities/ Programs/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/commonwatir-1.6.5/lib/ watir/browser.rb:142 c:0004 p:0011 s:0013 b:0013 l:12 d:12 METHOD C:/Utilities/ Programs/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/commonwatir-1.6.5/lib/ watir/browser.rb:64 c:0003 p:0043 s:0010 b:0010 l:0015b4 d:0011bc EVAL C:/Documents and Settings/lcabal/My Documents/NetBeansProjects/MultiPayment/lib/ multiPayment.rb:10 c:0002 p: s:0004 b:0004 l:03 d:03 FINISH c:0001 p: s:0002 b:0002 l:0015b4 d:0015b4 TOP --- -- Ruby level backtrace information C:/Documents and Settings/lcabal/My Documents/NetBeansProjects/ MultiPayment/lib/multiPayment.rb:10:in `main' C:/Utilities/Programs/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/ commonwatir-1.6.5/lib/watir/browser.rb:64:in `new' C:/Utilities/Programs/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/ commonwatir-1.6.5/lib/watir/browser.rb:142:in `set_sub_options' C:/Utilities/Programs/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/ commonwatir-1.6.5/lib/watir/browser.rb:79:in `set_options' C:/Utilities/Programs/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/ commonwatir-1.6.5/lib/watir/browser.rb:89:in `klass' C:/Utilities/Programs/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/ commonwatir-1.6.5/lib/watir/browser.rb:89:in `eval' (eval):1:in `klass' C:/Utilities/Programs/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/ watir-1.6.5/lib/watir/ie.rb:45:in `top (required)' internal:lib/rubygems/custom_require:29:in `require' internal:lib/rubygems/custom_require:29:in `require' C:/Utilities/Programs/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/ watir-1.6.5/lib/watir/ie-process.rb:1:in `top (required)' internal:lib/rubygems/custom_require:29:in `require' internal:lib/rubygems/custom_require:29:in `require' C:/Utilities/Programs/Ruby/Ruby192/lib/ruby/gems/1.9.1/gems/win32- process-0.6.2/lib/win32/process.rb:1:in `top (required)' internal:lib/rubygems/custom_require:29:in `require'
Re: [wtr-general] Re: Exception when clicking on items from the 'images' collection
The page is changing while you're iterating over the images. If you have, say, 5 images, and clicking on the 3rd one will cause the page to change, then on the next iteration through the loop, you're trying to use the 4th image which has now stopped existing. Vapir tries to find it again, fails, and tells you it can't relocate the image. Firewatir gives a less informative error, but probably for the same reason. You should do some sort of check after clicking each image to see if anything happened, and if so stop trying to click more images (because they won't be there anymore). On Tue, Aug 24, 2010 at 16:36, balexis bale...@gmail.com wrote: Hi, thanks for pointing me to this fork. I get a similar error though: /opt/local/lib/ruby/gems/1.8/gems/vapir-common-1.7.1/lib/vapir-common/ element.rb:594:in `locate': This Vapir::Firefox::Image was specified using :element_object and cannot be relocated. (Vapir::Exception::UnableToRelocateException) from /opt/local/lib/ruby/gems/1.8/gems/vapir-common-1.7.1/lib/vapir- common/element.rb:663:in `locate!' from /opt/local/lib/ruby/gems/1.8/gems/vapir-common-1.7.1/lib/vapir- common/container.rb:103:in `assert_exists' from /opt/local/lib/ruby/gems/1.8/gems/vapir-common-1.7.1/lib/vapir- common/element.rb:731:in `with_highlight' from /opt/local/lib/ruby/gems/1.8/gems/vapir-firefox-1.7.1/lib/vapir- firefox/element.rb:173:in `click' from watir-test.rb:13 from /opt/local/lib/ruby/gems/1.8/gems/vapir-common-1.7.1/lib/vapir- common/element_collection.rb:15:in `each' from /opt/local/lib/ruby/gems/1.8/gems/vapir-firefox-1.7.1/lib/vapir- firefox/jssh_socket.rb:1062:in `each' from /opt/local/lib/ruby/gems/1.8/gems/vapir-firefox-1.7.1/lib/vapir- firefox/jssh_socket.rb:1056:in `each' from /opt/local/lib/ruby/gems/1.8/gems/vapir-common-1.7.1/lib/vapir- common/element_collection.rb:14:in `each' from watir-test.rb:12 The website I am analyzing uses uses Javascript to redirect to a new page when a click is performed on a specific image, it makes heavy use of Javascript and has a few level of indirections (hooks the click event of the image, when performs a fade-out, and on fade-out the redirection is done via this I believe: location.href = onhref; And its not over: that request will be answered with this: HTTP/1.1 302 Found [] Location: final_url_that_I_want_to_find I'm a bit at loss here. On Aug 24, 3:18 pm, Ethan notet...@gmail.com wrote: Looks like a Firewatir bug. I recommend Vapir-Firefox over firewatir, it is forked from firewatir and has mostly the same API, but fixes many bugs and improves a lot of functionality. seehttp://vapir.org/ On Tue, Aug 24, 2010 at 13:45, balexis bale...@gmail.com wrote: Hello, I want to write a script that clicks on all the images present on a given web page. The goal is to ultimately see which images link to anything. I can't use the 'links' collection as I want to catch javascript redirections as well. --- require 'rubygems' require 'watir' test_site = http://my test site Watir::Browser.default = 'firefox' browser = Watir::Browser.new browser.goto test_site browser.images.each do |img| img.click sleep 5 end -- So, running this on a very specific site, I get the following stack trace: /opt/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ jssh_socket.rb:12:in `js_eval': arr_coll_IMG_0[2] is undefined (JsshSocket::JSTypeError) from /opt/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ jssh_socket.rb:20:in `js_eval_method' from /opt/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ element.rb:931:in `enabled?' from /opt/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ element.rb:917:in `assert_enabled' from /opt/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ element.rb:1067:in `click' from watir-test.rb:11 from /opt/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ element_collections.rb:141:in `each' from /opt/local/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ element_collections.rb:140:in `each' from watir-test.rb:10 Am I doing something wrong / missing some mandatory check? I am very new to Watir. Here is my environment. OSX 10.6.4 ruby 1.8.7 (2010-06-23 patchlevel 299) [i686-darwin10] firewatir (1.6.5) firefox 3.6.8 Contact me privately to get the URL I am testing on (balexis @ gmail) Thanks -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr
Re: [wtr-general] Test if frame exists to avoid locate error (source code)
how is this any different than ie.frame(:name, mainFrame).exists? On Fri, Aug 20, 2010 at 04:43, pierrelebai...@gmail.com pierrelebai...@gmail.com wrote: Hi, I write a little procedure to test if a frame exists before access a object and have an error by locate method if the frames doesn't exist. before having an exists? methode in the next watir version ? def existsFrame(myIe,frameName=) begin if frameName != myFrame = myIe.frame(:name,frameName) return true else # frameName is empty return false return false end rescue return false # frameName doesn't exist return false end end def main ie= ... if existsFrame(ie,mainFrame) . end end -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: unable to find element using xpath
I don't think there's anything wrong with xpath. However, you are using #cell, which looks for a table cell, but specifying tag a which is a link. You won't find an element that is both a table cell and a link. ie.link(:xpath, '//a...@href=whatever]') On Thu, Aug 19, 2010 at 12:10, Eric Mathiesen mathiese...@gmail.com wrote: What are you so insistent on using x-path? That is probably the worst way to achieve what you are after, several people have agreed with this statement, yet you continue doing it. I just don't understand. Eric On Thu, Aug 19, 2010 at 8:33 AM, goutham mandadi goutham.mand...@gmail.com wrote: ie.cell(:xpath,//a...@href=' http://www.snapfish.com/snapfish/youraccount']/http://www.snapfish.com/snapfish/youraccount%27%5D/ ).click sorry thanks, goutham On Thu, Aug 19, 2010 at 9:01 PM, goutham mandadi goutham.mand...@gmail.com wrote: hai ethan thanks a lot its working now i used :href inside area bt when using :xpath i am getting the following error c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:56:in `assert_exists': Unable to locate element, using :xpath, //a[href=' http://www.snapfish.com/snapfish/youraccount'http://www.snapfish.com/snapfish/youraccount%27] (Watir::Exception::UnknownObjectException) from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:288:in `enabled?' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:60:in `assert_enabled' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:233:in `click!' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb:219:in `click' this is the element i am trying to click on tda href=http://www.snapfish.com/snapfish/youraccount;Mainhttp://www.snapfish.com/snapfish/youraccount%22%3EMainaccount page/a/td this is the codei have written Can anyone help me on this Thanks, Goutham On Wed, Aug 18, 2010 at 11:21 PM, Ethan notet...@gmail.com wrote: I don't think that you should be using element_by_xpath at all. It does not return a Watir::Element. You should use a normal element accessor with the :xpath specifier: ie.area(:xpath, //whatever/).click On Wed, Aug 18, 2010 at 13:18, goutham mandadi goutham.mand...@gmail.com wrote: Hai charley, I ahev installed from gems C:\ruby\lib\ruby\gems\1.8\gems in this path i am having commonwatir-1.6.5 and firewatir-1.6.5 and watir-1.6.5 folders when i run from this path i am getting th following error one.rb:7: undefined method `click' for nil:NilClass (NoMethodError) require 'watir' ie = Watir::IE.start(http://www.snapfish.com/login;) ie.text_field(:name, emailaddress).set( goutham.mand...@valuelabs.net) ie.text_field(:name, password).set(sfqatest) ie.button(:name, log in).click ie.element_by_xpath(//ar...@href=' www5.snapfish.com/snapfish/youraccount'http://www5.snapfish.com/snapfish/youraccount%27 ]).click waht might be the reason for this anyone help me Thankyou, Goutham this is code i am using On Tue, Aug 17, 2010 at 10:52 PM, Charley Baker charley.ba...@gmail.com wrote: Shouldn't be in site_ruby, that's gotta be version 1.4.1 with the Watir installer. Uninstall that and make sure you're reinstall the Watir gem, worst case wipe the ruby directory and install the latest Watir gem, should be 1.6.5 and run from the gem directory, not site_ruby. Charley Baker Lead Developer, Watir, http://watir.com On Tue, Aug 17, 2010 at 11:08 AM, goutham mandadi goutham.mand...@gmail.com wrote: Hai, c:/ruby/lib/ruby/site_ruby/1.8/watir.rb this is path from which it is executing here in watir.rb i couldnot find method element_by_xpath how to add this thanks, goutham On Tue, Aug 17, 2010 at 9:08 PM, goutham mandadi goutham.mand...@gmail.com wrote: Hi eric, I did not get you what are orb and .flash i am new to watir Thanks, Goutham On Tue, Aug 17, 2010 at 8:58 PM, Eric Mathiesen mathiese...@gmail.com wrote: You could also use orb and .flash the index. On Aug 17, 2010 8:23 AM, goutham mandadi goutham.mand...@gmail.com wrote: Hai Chuck, Thanks for ur reply we can add id or name for this element but why is element by xpath is not working for me can u help me on this Thankyou, Goutham On Tue, Aug 17, 2010 at 8:48 PM, Chuck van der Linden sqa...@gmail.com wrote: As an alternativ... -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe
Re: [wtr-general] Re: undefined method `element_by_xpath' for #Watir::IE:0x2bbabf0 (NoMethodError)
Mandadi, You need to share the code you are using, and if html is required to demonstrate an error, preferably a minimal snippet of html (do not paste several thousand lines of html into your email as some people have done). see the guidelines: http://wiki.openqa.org/display/WTR/Support On Wed, Aug 18, 2010 at 11:19, Chuck van der Linden sqa...@gmail.comwrote: how in the world would I know what URL you need to use? it's your app not mine. And you've never shared the URL with us. I'm good, but I'm not a mindreader You can attach using either the URL of the page the window is currently displaying or the Title of the page For URL look at the 'address' area of your browser. For title you can look at the titlebar of the browser window, looking at the source HTML, or via using something like firebug or the IE developer Toolbar. Note with title, omit anything like - Internet explorer provided by... which you might see when looking at the titlebar, just match on the part before that. On Aug 17, 8:35 am, goutham mandadi goutham.mand...@gmail.com wrote: Hi Chuck, yeah you are right when logging in to application it is displayed as https and then at home page it is normal http. is their any specific url i need to give in how can u please give me an example Thanks, Goutham On Tue, Aug 17, 2010 at 8:39 PM, Chuck van der Linden sqa...@gmail.com wrote: The most likely explanation when you see 'undefined method' (and you haven't mispelled the method or something like that) is that the browser object is no longer pointing at an instance of a web browser. That can happen in IE when the security context of the site changes (e.g. the browser starts up in 'internet' but you are working with a 'trusted site'. it's almost like IE starts a fresh browser instance and discards the old one, on the fly. Try using something like browser = Watir::IE.attach(:how, what)(how usually being either title or url) to ensure you are pointing at an instance a browser session, immediately before the step that is failing. On Aug 16, 10:07 pm, goutham mandadi goutham.mandad...@gmail.com wrote: Hai, can any one please help me on how to resolve this Thanks, Mandadi -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com watir-general%2bunsubscr...@goog legroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: unable to find element using xpath
I don't think that you should be using element_by_xpath at all. It does not return a Watir::Element. You should use a normal element accessor with the :xpath specifier: ie.area(:xpath, //whatever/).click On Wed, Aug 18, 2010 at 13:18, goutham mandadi goutham.mand...@gmail.comwrote: Hai charley, I ahev installed from gems C:\ruby\lib\ruby\gems\1.8\gems in this path i am having commonwatir-1.6.5 and firewatir-1.6.5 and watir-1.6.5 folders when i run from this path i am getting th following error one.rb:7: undefined method `click' for nil:NilClass (NoMethodError) require 'watir' ie = Watir::IE.start(http://www.snapfish.com/login;) ie.text_field(:name, emailaddress).set(goutham.mand...@valuelabs.net) ie.text_field(:name, password).set(sfqatest) ie.button(:name, log in).click ie.element_by_xpath(//ar...@href='www5.snapfish.com/snapfish/youraccount' ]).click waht might be the reason for this anyone help me Thankyou, Goutham this is code i am using On Tue, Aug 17, 2010 at 10:52 PM, Charley Baker charley.ba...@gmail.comwrote: Shouldn't be in site_ruby, that's gotta be version 1.4.1 with the Watir installer. Uninstall that and make sure you're reinstall the Watir gem, worst case wipe the ruby directory and install the latest Watir gem, should be 1.6.5 and run from the gem directory, not site_ruby. Charley Baker Lead Developer, Watir, http://watir.com On Tue, Aug 17, 2010 at 11:08 AM, goutham mandadi goutham.mand...@gmail.com wrote: Hai, c:/ruby/lib/ruby/site_ruby/1.8/watir.rb this is path from which it is executing here in watir.rb i couldnot find method element_by_xpath how to add this thanks, goutham On Tue, Aug 17, 2010 at 9:08 PM, goutham mandadi goutham.mand...@gmail.com wrote: Hi eric, I did not get you what are orb and .flash i am new to watir Thanks, Goutham On Tue, Aug 17, 2010 at 8:58 PM, Eric Mathiesen mathiese...@gmail.com wrote: You could also use orb and .flash the index. On Aug 17, 2010 8:23 AM, goutham mandadi goutham.mand...@gmail.com wrote: Hai Chuck, Thanks for ur reply we can add id or name for this element but why is element by xpath is not working for me can u help me on this Thankyou, Goutham On Tue, Aug 17, 2010 at 8:48 PM, Chuck van der Linden sqa...@gmail.com wrote: As an alternativ... -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Where does watir stores object properties
Sure. Feel free to submit a patch to firewatir. I don't think that project has much activity lately though, and it seems like it may be some time before anything happens. 2010/8/15 Amit amit.e...@gmail.com Does firewatir saves things in broswer_var ?? Can't we use multiple objects so we don't lose refrence of previous window? 2010/8/12 Ethan notet...@gmail.com Firewatir saves things in javascript variables, and reuses the same variables, so when you attach to a new window, it reuses the same variables as it does for the old window and you lose references to that window. On Thu, Aug 12, 2010 at 10:36, Amit amit.e...@gmail.com wrote: Hi Željko, Actually, i was checking behavior of attach function in firewatir. Currently, In firewatir, if we attach 2 windows then it loose control over first one. So, thats why i wanted to know wether it saves object properties or not... and if yes then where.. Thank You Amit On 8/12/10, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Thu, Aug 12, 2010 at 2:42 PM, Amit amit.e...@gmail.com wrote: I want to know where WATIR is storing this information so it can access objects for both window. Why do you need that information? To be precise, Watir is not storing it, but Ruby is (as far as I understand it). The most general answer would be in RAM. :) Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them vidipodkast.com - pričamo o hardveru, softveru i časopisu Vidi -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Firewatir attach method doesn't work properly
Vapir is currently broken on 3.0.*. A fix is coming, but I have a number of other higher-priority issues to fix first. You can upgrade to 3.5 or 3.6, or wait until I can get 3.0 support working. On Thu, Aug 12, 2010 at 11:50, Amit amit.e...@gmail.com wrote: its 3.06 On Thu, Aug 12, 2010 at 8:56 PM, Ethan notet...@gmail.com wrote: What version of firefox are you using? On Thu, Aug 12, 2010 at 06:17, Amit amit.e...@gmail.com wrote: Hi Ethan, I tried below code: require 'watir-vapir' ff = Vapir::Firefox.new ff.start(www.google.com) After executing above code, A new instance of firefox opened and got following error. Could you please tell me why i'm getting this error? C:/Ruby/lib/ruby/gems/1.8/gems/vapir-firefox-1.7.0/lib/vapir-firefox/jssh_socket.rb:118:in `initialize': Something went wrong loading Prototype - message SyntaxError: unterminated comment\n SyntaxError: return not in function\n TypeError: this.getUTCMonth is not a function\n SyntaxError: syntax error\n SyntaxError: return not in function\n SyntaxError: syntax error\n SyntaxError: syntax error\n \n SyntaxError: syntax error\n \n SyntaxError: syntax error\n \n SyntaxError: syntax error\n \n function () {\nif (!this.currentlyExecuting) {\ntry {\n this.currentlyExecuting = true;\nthis.execute();\n} catch (e) {\n} finally {\nthis.currentlyExecuting = false;\n}\n}\n}\n SyntaxError: syntax error\n SyntaxError: syntax error\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: syntax error\n SyntaxError: syntax error\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n SyntaxError: unterminated comment\n ReferenceError: document is not defined\n TypeError: this.replace is not a function\n SyntaxError: return not in function\n SyntaxError: invalid label\n SyntaxError: missing ; before statement\n SyntaxError: syntax error\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n SyntaxError: unterminated comment\n SyntaxError: return not in function\n SyntaxError: syntax error\n \n \n \n \n \n ReferenceError: reference to undefined XML name *::*\n \n \n \n \n \n \n \n \n \n \n \n SyntaxError: return not in function\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n \n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n \n \n \n \n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: syntax error\n SyntaxError: syntax error\n SyntaxError: return not in function\n SyntaxError: syntax error\n SyntaxError: return not in function\n SyntaxError: syntax error\n SyntaxError: syntax error\n \n function (object) {\nif (object Object.isFunction(object.toTemplateReplacements)) {\nobject = object.toTemplateReplacements();\n}\nreturn this.template.gsub(this.pattern, function (match) {if (object == null) {return match[1] + \\;}var before = match[1] || \\;if (before == \\) {return match[2];}var ctx = object, expr = match[3];var pattern = /^([^.[]+|\\[((?:.*?[^])?)\\])(\\.|\\[|$)/;match = pattern.exec(expr);if (match == null) {return before;}while (match != null) {var comp = match[1].startsWith(\[\) ? match[2].gsub(\]\, \]\) : match[1];ctx = ctx[comp];if (null == ctx || \\ == match[3]) {break;}expr = expr.substring(\[\ == match[3] ? match[1].length : match[0].length);match = pattern.exec(expr);}return before + String.interpret(ctx);});\n}\n SyntaxError: syntax error\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n SyntaxError: return not in function\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: syntax error\n SyntaxError: syntax error\n SyntaxError: return not in function\n SyntaxError: return not in function\n ReferenceError: iterable is not defined\n \n SyntaxError: return not in function\n SyntaxError: syntax error\n SyntaxError: return not in function\n ReferenceError: string is not defined\n SyntaxError: return not in function\n SyntaxError: syntax error\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n SyntaxError: unterminated comment\n \n \n SyntaxError: return
Re: [wtr-general] Where does watir stores object properties
Firewatir saves things in javascript variables, and reuses the same variables, so when you attach to a new window, it reuses the same variables as it does for the old window and you lose references to that window. On Thu, Aug 12, 2010 at 10:36, Amit amit.e...@gmail.com wrote: Hi Željko, Actually, i was checking behavior of attach function in firewatir. Currently, In firewatir, if we attach 2 windows then it loose control over first one. So, thats why i wanted to know wether it saves object properties or not... and if yes then where.. Thank You Amit On 8/12/10, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Thu, Aug 12, 2010 at 2:42 PM, Amit amit.e...@gmail.com wrote: I want to know where WATIR is storing this information so it can access objects for both window. Why do you need that information? To be precise, Watir is not storing it, but Ruby is (as far as I understand it). The most general answer would be in RAM. :) Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them vidipodkast.com - pričamo o hardveru, softveru i časopisu Vidi -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Watir script editor
I recommend notepad++ http://notepad-plus-plus.org/ actually, I recommend trying a few and seeing what you like best because, as evidenced by this thread, what any particular person wants out of an editor varies widely. On Thu, Aug 12, 2010 at 03:50, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Thu, Aug 12, 2010 at 3:00 AM, joedio joe...@comcast.net wrote: You may also want to check out any of thse other Free IDE's: I would recommend netbeans: http://netbeans.org/ Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Firewatir attach method doesn't work properly
What version of firefox are you using? On Thu, Aug 12, 2010 at 06:17, Amit amit.e...@gmail.com wrote: Hi Ethan, I tried below code: require 'watir-vapir' ff = Vapir::Firefox.new ff.start(www.google.com) After executing above code, A new instance of firefox opened and got following error. Could you please tell me why i'm getting this error? C:/Ruby/lib/ruby/gems/1.8/gems/vapir-firefox-1.7.0/lib/vapir-firefox/jssh_socket.rb:118:in `initialize': Something went wrong loading Prototype - message SyntaxError: unterminated comment\n SyntaxError: return not in function\n TypeError: this.getUTCMonth is not a function\n SyntaxError: syntax error\n SyntaxError: return not in function\n SyntaxError: syntax error\n SyntaxError: syntax error\n \n SyntaxError: syntax error\n \n SyntaxError: syntax error\n \n SyntaxError: syntax error\n \n function () {\nif (!this.currentlyExecuting) {\ntry {\n this.currentlyExecuting = true;\nthis.execute();\n} catch (e) {\n} finally {\nthis.currentlyExecuting = false;\n}\n}\n}\n SyntaxError: syntax error\n SyntaxError: syntax error\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: syntax error\n SyntaxError: syntax error\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n SyntaxError: unterminated comment\n ReferenceError: document is not defined\n TypeError: this.replace is not a function\n SyntaxError: return not in function\n SyntaxError: invalid label\n SyntaxError: missing ; before statement\n SyntaxError: syntax error\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n SyntaxError: unterminated comment\n SyntaxError: return not in function\n SyntaxError: syntax error\n \n \n \n \n \n ReferenceError: reference to undefined XML name *::*\n \n \n \n \n \n \n \n \n \n \n \n SyntaxError: return not in function\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n \n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n \n \n \n \n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: syntax error\n SyntaxError: syntax error\n SyntaxError: return not in function\n SyntaxError: syntax error\n SyntaxError: return not in function\n SyntaxError: syntax error\n SyntaxError: syntax error\n \n function (object) {\nif (object Object.isFunction(object.toTemplateReplacements)) {\nobject = object.toTemplateReplacements();\n}\nreturn this.template.gsub(this.pattern, function (match) {if (object == null) {return match[1] + \\;}var before = match[1] || \\;if (before == \\) {return match[2];}var ctx = object, expr = match[3];var pattern = /^([^.[]+|\\[((?:.*?[^])?)\\])(\\.|\\[|$)/;match = pattern.exec(expr);if (match == null) {return before;}while (match != null) {var comp = match[1].startsWith(\[\) ? match[2].gsub(\]\, \]\) : match[1];ctx = ctx[comp];if (null == ctx || \\ == match[3]) {break;}expr = expr.substring(\[\ == match[3] ? match[1].length : match[0].length);match = pattern.exec(expr);}return before + String.interpret(ctx);});\n}\n SyntaxError: syntax error\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n SyntaxError: return not in function\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: invalid label\n SyntaxError: syntax error\n SyntaxError: syntax error\n SyntaxError: return not in function\n SyntaxError: return not in function\n ReferenceError: iterable is not defined\n \n SyntaxError: return not in function\n SyntaxError: syntax error\n SyntaxError: return not in function\n ReferenceError: string is not defined\n SyntaxError: return not in function\n SyntaxError: syntax error\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n SyntaxError: unterminated comment\n \n \n SyntaxError: return not in function\n SyntaxError: syntax error\n \n \n \n \n \n \n \n ReferenceError: Enumerable is not defined\n \n function reverse() {\n[native code]\n}\n \n TypeError: Object.extend is not a function\n \n \n \n \n \n \n \n SyntaxError: syntax error\n SyntaxError: return not in function\n SyntaxError: syntax error\n \n \n \n \n \n \n \n \n
Re: [wtr-general] Unable to locate checkbox element ?
deep nesting with most elements is no issue, but there is some mention of a frame there. if it's inside a frame, then you'll need to access the frame first, then the checkbox in the frame. On Thu, Aug 12, 2010 at 18:42, Chan Nguyen atbl1...@gmail.com wrote: This is what I copied when using TestWise Recorder : # can't yet handle followFrame browser.checkbox(:id, cblModules_0).clear browser.checkbox(:id, cblModules_1).clear browser.checkbox(:id, cblModules_2).clear browser.checkbox(:id, cblModules_3).clear I think the reason that it failed because it's nested really deep. I can see a huge trtd slope when viewing with Firebug. Is there another way to get around this issue? Thanks On Thu, Aug 12, 2010 at 3:28 PM, Chan Nguyen atbl1...@gmail.com wrote: Hi Arihan, Yes, I checked the id name carefully. I don't really know why it failed, too obvious to be right :( Thanks, On Thu, Aug 12, 2010 at 3:04 PM, arihan sinha arihan.si...@gmail.comwrote: Have you given the correct id name? it seems from html code the id is *cblModules_2* but you have used i* cblModules_0* On Thu, Aug 12, 2010 at 10:15 PM, Chan Nguyen atbl1...@gmail.comwrote: Hi everyone, I followed a very simple example in Watir tutorial website http://wiki.openqa.org/display/WTR/Checkboxes. Here is the element HTML code: input type=checkbox checked=checked name=cblModules:2 id=cblModules_2 Then I tried browser.checkbox( :id, 'icblModules_0' ).clear but the compiler keeps complaining : C:/Ruby187/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/element.rb: 56:in `assert_exists': Unable to locate element, using :id, icblModules_0 (Watir::Exception::UnknownObjectException) Any idea? Thanks, -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Firewatir attach method doesn't work properly
Same as the Watir API: Vapir::Browser.attach(:title, the title) or Vapir::Browser.attach(:title, /part of the title/) or Vapir::Browser.attach(:url, /foobar.html/) If you want to continue using the watir namespace so that you don't have to modify your existing code extensively, you can do so using the watir-vapir require - see http://wiki.github.com/vapir/vapir/coming-from-watir for more information. On Wed, Aug 11, 2010 at 07:50, Amit amit.e...@gmail.com wrote: Hi Ethan, Can you please explain how can i integrate Vapir in my Watir framework? I just want to use attach method from vapir. Can you show me sample command for attaching a window in Vapir? Thank you On Tue, Aug 3, 2010 at 5:13 AM, Ethan notet...@gmail.com wrote: Vapir should be almost entirely compatible with Watir, so a framework written for Watir should not require much change, if any, to work with Vapir. see http://wiki.github.com/vapir/vapir/coming-from-watir and http://wiki.github.com/vapir/vapir/differences-from-watir-api On Wed, Jul 28, 2010 at 02:06, Amit Kumar amit.e...@gmail.com wrote: Hi Ethan, My whole framework has been written in Watir.. So, at this point i can't use Vapir. Guys, is there any other solution to attach multiple browser at a time? Thank You On Mon, Jul 26, 2010 at 10:58 PM, Ethan notet...@gmail.com wrote: I'd recommend Vapir-Firefox, which is a fork of FireWatir which I have updated and improved a lot. See the site for Vapir at http://vapir.org/ -Ethan On Mon, Jul 26, 2010 at 07:07, Amit Kumar amit.e...@gmail.com wrote: Hi All! I'm using Firewatir 1.6.5 I want to test an web application which open a pop up window. I want to attach this pop up window with firewatir. So, i have written below code: require 'firewatir' ff =FireWatir::Firefox.new ff.goto(www.example.com) ff.link(:text,Pop_up).click ff2= FireWatir::Firefox.attach(:title,New Pop Up Window) Now, the problem is... After attaching new pop up window, firewatir loose control over parent window. It remember only pop up window which have attached recently and forget parent window. So, i can't access parent application anymore. eg: puts ff.title == New Pop Up Window puts ff2.title == New Pop Up Window It doesn't return window title of parent window. Any comments or solution?? Thank You -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Watir on Windows, how is it done anymore?
My understanding was that the issue with quoting system arguments (which is a ruby bug on everything since 1.8.6p111) came up with the mingw32 releases for launching things in a new ruby process, which watir does for click_no_wait and other no_wait stuff. Did you test no_wait stuff? On Mon, Aug 9, 2010 at 11:08, Željko Filipin zeljko.fili...@wa-research.chwrote: On Mon, Aug 9, 2010 at 5:05 PM, Charley Baker charley.ba...@gmail.com wrote: I haven't tested it, but I don't see any reason it shouldn't work. Will try to test it this week. If anyone has tried with the new Ruby installer, let us know what you've seen. I use new installer in one virtual machine, and watir works just fine. Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Curious browser behavior: Firefox browser won't close on some pages but will everywhere else
It is true that Vapir does not have this bug. On Tue, Aug 3, 2010 at 15:01, Basim Baassiri ba...@baassiri.ca wrote: HI Schase, I had the same problem (method wasn't returning the named windows which causes the exception) and I switched to vapir which solved my problem Not much of a suggestion but it is my experience Basim On Tue, Aug 3, 2010 at 2:53 PM, Schase promac...@gmail.com wrote: I'm writing automated test code for a web application under development. All is well when I work on my development box and the code behaves as expected when I run it there. Once the test code is stabilized I check it in and it runs on a scheduled server. It has been displaying strange behavior there. If the test ends with the browser open at a particular page, the command @browser.close doesn't work and I get the following error: NoMethodError: undefined method `' for nil:NilClass c:/ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ firefox.rb:315:in `close' ../main_test_setup.rb:73:in `teardown' (eval):3:in `each_without_optional_block' (eval):3:in `each' (eval):3:in `each_without_optional_block' (eval):3:in `each' However, if I add a line that will click a link on that page that returns it to a different page of the application, @browser.close works just fine. This is also only a problem with Firefox. I checked the source code for FireWatir::firefox.rb and it appears that it is not finding the window that is there (even though it can find the link on the page to click and get back to the working part of the application!) Dev box: Windows Server 2003 R2 x64 Standard edition service pack 2 Scheduled Run box: XP Pro 2002 service pack 3 My test classes all inherit from Watir::TestCase Any suggestions on how I might debug this will be greatly appreciated. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: UTF8 encode in FireWatir under Mac
on updating Vapir: I regularly incorporate any improvements made to Firewatir into Vapir-Firefox, and likewise with the IE version. FireWatir doesn't seem to get much activity, though, codewise these days. On Tue, Jul 27, 2010 at 03:58, gs grzegorz.q...@googlemail.com wrote: Hi, Thanks Ethan... It works like a charm!! :) I need to do more test with Vapir to be sure that all tests work like with FireWatir. Just to be clear. I am wondering about the Vapir updates. Will you support it to have all such functionalities as Watir and FireWatir? Cause if all will go smoothly than I would think about moving to Vapir but would like to have clear view about the point that if new support or fix, implementation will be made for FireWatir will you try to merge it into Vapir project? Br, GS On Jul 26, 7:26 pm, Ethan notet...@gmail.com wrote: I've added a wiki page for this at: http://wiki.github.com/vapir/vapir/getting-started On Mon, Jul 26, 2010 at 05:46, gs grzegorz.q...@googlemail.com wrote: Hi Ethan, Could you provide me with script example how to user vapir? As I have installed it (vapir-common, vapir-firefox) and how to continue with it? Shall I start my script with: require 'firewatir' ff = FireWatir::Firefox.new ? Br, GS On Jul 24, 1:52 am, Ethan notet...@gmail.com wrote: This is fixed in Vapir-Firefox, an improved fork of firewatir - see the page for that project athttp://vapir.org/andits wiki athttp:// wiki.github.com/vapir/vapir/ On Fri, Jul 23, 2010 at 11:23, gs grzegorz.q...@googlemail.com wrote: Hi, I am using Firewatir under Mac I've faced an issue with clicking on link: ff.link(:text, Löschen).click Watir::Exception::UnknownObjectException: Unable to locate element, using :text, L\303\266schen Does any one has an idea why Löschen is being parsed by firewatir as L\303\266schen ? And any solution for such a problem? Br, GS -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com watir-general%2bunsubscr...@goog legroups.com watir-general%2bunsubscr...@goog legroups.com -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com watir-general%2bunsubscr...@goog legroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: UTF8 encode in FireWatir under Mac
It is true that it is slow on mac (also on ruby 1.9 on windows), and that is currently near the top of my priorities for improvement. For clicking a modal dialog, startClicker does not exist in vapir. See http://wiki.github.com/vapir/vapir/modal-dialogs for information on Vapir's modal dialog API. On Tue, Jul 27, 2010 at 04:27, grzegorz.smaj...@gmail.com grzegorz.smaj...@gmail.com wrote: Just noticed that Vapir is working very slownly under Mac...any possibilities to speed it up? Also I am using in my test startClicker (in FireWatir) it does not throw an exception so if it will not be found than it proceedes..but in Vapir..it throws an exception that modal was not found. Any advice of omitting this behavior? Sorry for so many questions :) Br, GS On Jul 27, 9:58 am, gs grzegorz.q...@googlemail.com wrote: Hi, Thanks Ethan... It works like a charm!! :) I need to do more test with Vapir to be sure that all tests work like with FireWatir. Just to be clear. I am wondering about the Vapir updates. Will you support it to have all such functionalities as Watir and FireWatir? Cause if all will go smoothly than I would think about moving to Vapir but would like to have clear view about the point that if new support or fix, implementation will be made for FireWatir will you try to merge it into Vapir project? Br, GS On Jul 26, 7:26 pm, Ethan notet...@gmail.com wrote: I've added a wiki page for this at: http://wiki.github.com/vapir/vapir/getting-started On Mon, Jul 26, 2010 at 05:46, gs grzegorz.q...@googlemail.com wrote: Hi Ethan, Could you provide me with script example how to user vapir? As I have installed it (vapir-common, vapir-firefox) and how to continue with it? Shall I start my script with: require 'firewatir' ff = FireWatir::Firefox.new ? Br, GS On Jul 24, 1:52 am, Ethan notet...@gmail.com wrote: This is fixed in Vapir-Firefox, an improved fork of firewatir - see the page for that project athttp://vapir.org/anditswiki athttp:// wiki.github.com/vapir/vapir/ On Fri, Jul 23, 2010 at 11:23, gs grzegorz.q...@googlemail.com wrote: Hi, I am using Firewatir under Mac I've faced an issue with clicking on link: ff.link(:text, Löschen).click Watir::Exception::UnknownObjectException: Unable to locate element, using :text, L\303\266schen Does any one has an idea why Löschen is being parsed by firewatir as L\303\266schen ? And any solution for such a problem? Br, GS -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com watir-general%2bunsubscr...@goog legroups.com watir-general%2bunsubscr...@goog legroups.com -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com watir-general%2bunsubscr...@goog legroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Firewatir attach method doesn't work properly
Vapir should be almost entirely compatible with Watir, so a framework written for Watir should not require much change, if any, to work with Vapir. see http://wiki.github.com/vapir/vapir/coming-from-watir and http://wiki.github.com/vapir/vapir/differences-from-watir-api On Wed, Jul 28, 2010 at 02:06, Amit Kumar amit.e...@gmail.com wrote: Hi Ethan, My whole framework has been written in Watir.. So, at this point i can't use Vapir. Guys, is there any other solution to attach multiple browser at a time? Thank You On Mon, Jul 26, 2010 at 10:58 PM, Ethan notet...@gmail.com wrote: I'd recommend Vapir-Firefox, which is a fork of FireWatir which I have updated and improved a lot. See the site for Vapir at http://vapir.org/ -Ethan On Mon, Jul 26, 2010 at 07:07, Amit Kumar amit.e...@gmail.com wrote: Hi All! I'm using Firewatir 1.6.5 I want to test an web application which open a pop up window. I want to attach this pop up window with firewatir. So, i have written below code: require 'firewatir' ff =FireWatir::Firefox.new ff.goto(www.example.com) ff.link(:text,Pop_up).click ff2= FireWatir::Firefox.attach(:title,New Pop Up Window) Now, the problem is... After attaching new pop up window, firewatir loose control over parent window. It remember only pop up window which have attached recently and forget parent window. So, i can't access parent application anymore. eg: puts ff.title == New Pop Up Window puts ff2.title == New Pop Up Window It doesn't return window title of parent window. Any comments or solution?? Thank You -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: UTF8 encode in FireWatir under Mac
I've added a wiki page for this at: http://wiki.github.com/vapir/vapir/getting-started On Mon, Jul 26, 2010 at 05:46, gs grzegorz.q...@googlemail.com wrote: Hi Ethan, Could you provide me with script example how to user vapir? As I have installed it (vapir-common, vapir-firefox) and how to continue with it? Shall I start my script with: require 'firewatir' ff = FireWatir::Firefox.new ? Br, GS On Jul 24, 1:52 am, Ethan notet...@gmail.com wrote: This is fixed in Vapir-Firefox, an improved fork of firewatir - see the page for that project athttp://vapir.org/and its wiki athttp:// wiki.github.com/vapir/vapir/ On Fri, Jul 23, 2010 at 11:23, gs grzegorz.q...@googlemail.com wrote: Hi, I am using Firewatir under Mac I've faced an issue with clicking on link: ff.link(:text, Löschen).click Watir::Exception::UnknownObjectException: Unable to locate element, using :text, L\303\266schen Does any one has an idea why Löschen is being parsed by firewatir as L\303\266schen ? And any solution for such a problem? Br, GS -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com watir-general%2bunsubscr...@goog legroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] UTF8 encode in FireWatir under Mac
This is fixed in Vapir-Firefox, an improved fork of firewatir - see the page for that project at http://vapir.org/ and its wiki at http://wiki.github.com/vapir/vapir/ On Fri, Jul 23, 2010 at 11:23, gs grzegorz.q...@googlemail.com wrote: Hi, I am using Firewatir under Mac I've faced an issue with clicking on link: ff.link(:text, Löschen).click Watir::Exception::UnknownObjectException: Unable to locate element, using :text, L\303\266schen Does any one has an idea why Löschen is being parsed by firewatir as L\303\266schen ? And any solution for such a problem? Br, GS -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Fwd: How to automate a scrollbar
I don't think you need javascript events - just set the scrollTop property of the dom. assuming this is a scrollable div in a variable 'div' in ruby, something like div.ole_object.scrollTop = div.ole_object.scrollHeight On Wed, Jul 21, 2010 at 11:58, Basim Baassiri ba...@baassiri.ca wrote: Padma Perhaps a link to a page or some html (and javascript) would be helpful in solving your problem. From the sounds of it, it might be solvable by sending a javascript event or using autoit you could move your mouse to the position of the scrollbar and send mouse clicks or send keyboard spacebar. Without html or code, it makes it extremely difficult to help you Good Luck! On Wed, Jul 21, 2010 at 3:18 AM, Padma Reddy padmaj...@gmail.com wrote: *someone please help me out.. its urgent!!* Hi all, I need to tick the checkbox and continue to the next page.. but the checkbox will be enabled only when the agreements are read and scrolled down(that particular pane). How to enable the checkbox without scrolling down or how to scrolldown to enable the checkbox?? Please let me knw if u can help. -- Padma -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Calling external javascript function from cell tag attribute
the GetResultForPage function will be defined on the window object, not the document. I'm not sure if that js_eval will work, though, as I'm not sure how you refer to the window in firewatir. I recommend Vapir-Firefox, an updated fork of Firewatir. it will fire the correct javascript events when you call #click. if there is any issue with that, you can call the function directly using something like: browser.content_window_object.GetResultForPage('2') Check Vapir's page at http://vapir.org/ and the wiki at http://wiki.github.com/vapir/vapir/ On Mon, Jul 19, 2010 at 23:53, Bruno Wüest wue...@ipz.uzh.ch wrote: I have some basic experience with watir, but struggle to get a javascript function called. More specifically, I try to get firewatir execute a javascript function which is embedded in a table cell. This cell contains a function to get a table with new results from a database query. It looks like this: td class=gotoPageCell onclick=GetResultForPage('2');next/td The function GetResultForPage('page') is located in an external javascript named GetResults1.js which is linked in the header of the respective page. I tried to directly execute the function with: browser.js_eval(document.GetResultForPage('2');) This, however, left me with the error JsshSocket::JSTypeError: document.GetResultForPage is not a function. I also tried to get to the table cell by its index and execute the function with .click or .fire_event('onclick'). Does 'firewatir' support the call of such external javascript functions? I appreciate any idea. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] How to get the original html source code via FireWatir
FireWatir has no outer_html method. I recommend Vapir-Firefox, a much-improved fork of FireWatir; it supports outer html. See the site at http://vapir.org/ and the wiki at http://wiki.github.com/vapir/vapir/ -Ethan On Mon, Jul 19, 2010 at 03:27, Will C changwei...@gmail.com wrote: I have a question about getting the original html source code. The html method in firefox.rb, only return the innerHTML of the body. But I need to get the original source code. just like, when I input view-source: wiki.openqa.org, the firefox will show the html source code. Anyone knows how to get the original html source code with FireWatir? Thanks. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Firewatir Doesn't Wait when Page is Cached
I've fixed a lot of Firewatir issues in my fork, Vapir-Firefox. I think I have improved the #wait method to work more reliably. You can give vapir a try; for more information see http://vapir.org/ and see the wiki at http://wiki.github.com/vapir/vapir/ -Ethan On Fri, Jul 16, 2010 at 16:44, rmcauley rmcau...@gmail.com wrote: Hello everyone, I'm noticing a strange behaviour when my Win32 Fx 3.6.6 (JSSH 0.9, Ruby 1.8.6, [Fire]Watir 1.6.5) loads a page and it winds up being pulled from cache: Firewatir doesn't wait for the page to load, at all. It immediately fires, often on a non-existent or still-rendering page/DOM. Is this a known problem? Is there a workaround? (either via browser settings or a Firewatir setting?) Since wait() is not doing anything in these situations, I don't want to have to start sprinkling Watir::Waiter::wait_for { } blocks in the hundreds of spots this would be potentially required in my test suite. Watir::IE handles everything I throw at it just fine. It's difficult to post code when working in a proprietary house, if requested I'll try to create a reproducible scenario based on what I'm seeing. - Rob -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] NoMethodError: undefined method `' for nil:NilClass when closing base browser on new window pop-up
It does look like a bug in firewatir. You can open a ticket and wait for it to be fixed, maybe. You can try Vapir-Firefox, which is my much-improved fork of firewatir - see http://vapir.org/ and the wiki at http://wiki.github.com/vapir/vapir/ There's also watir-webdriver, which may be worth a try. On Wed, Jul 14, 2010 at 14:14, Basim Baassiri ba...@baassiri.ca wrote: I tried the following without success irb(main):001:0 require 'watir' = true irb(main):002:0 Watir::Browser.default = 'firefox' = firefox irb(main):003:0 url = ' http://overlay-retail-test-files.overlay.tv/watir/watir-group-new-window.html ' = http://overlay-retail-test-files.overlay.tv/watir/watir-group-new-window.html irb(main):004:0 @browser = Watir::Browser.new = #FireWatir::Firefox:0x3fb6c08 url= title= irb(main):005:0 @browser.goto url = #FireWatir::Firefox:0x3fb6c08 url= title=Base irb(main):006:0 @browser.link(:id,twitter).click = 0 irb(main):008:0 @browser.attach(:title,Base) = #FireWatir::Firefox:0x3fb6c08 url= title=Base irb(main):009:0 @browser.close NoMethodError: undefined method `' for nil:NilClass from C:/development/ruby/lib/ruby/gems/1.8/gems/firewatir-1.6.5/lib/fire watir/firefox.rb:315:in `close' from (irb):9 Basically, I have a page that pops up a new window on clicking a link. I want to return the initial browser window and close it and start working with the new window Is this a bug in firewatir? in addition, I tried @browser.close alone (i.e. with attaching to it) and it gave me the following results irb(main):001:0 require 'watir' = true irb(main):002:0 Watir::Browser.default = 'firefox' = firefox irb(main):003:0 url = ' http://overlay-retail-test-files.overlay.tv/watir/watir-group-new-window.html ' = http://overlay-retail-test-files.overlay.tv/watir/watir-group-new-window.html irb(main):004:0 @browser = Watir::Browser.new = #FireWatir::Firefox:0x3fb6c08 url= title= irb(main):005:0 @browser.goto url = #FireWatir::Firefox:0x3fb6c08 url= title=Base irb(main):006:0 @browser.link(:id,twitter).click = 0 irb(main):007:0 @browser.close = nil --no browser windows closed -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Entering International (UTF-8) text into text fields with WATIR on Firefox
Unicode is properly supported in Vapir-Firefox, my fork of firewatir. I recommend you give it a try - see http://vapir.org/ and the wiki at http://wiki.github.com/vapir/vapir/ It's not perfect as it still enters unicode characters into a text field one byte at a time, rather than one character, but the end result is the same - correct unicode entered. That issue is already fixed in the code, and will be in the next release. -Ethan On Tue, Jul 13, 2010 at 07:30, Gudata i.barda...@gmail.com wrote: I have a problem when I am trying to enter UTF-8 international character text into Firefox 3.6.6 through WATIR. I have a script that attempts to set a string of characters into textfield. These characters are all cyrillic. The Ruby script is saved as UTF-8 and these characters can be read clearly in the source and in external text editors. I can also cut paste these characters into the text fields under test. However when watir is trying to enter them, I see the text field go yellow, but the characters are displayed as monkey characters (garbage) I have: $KCODE = 'u' require 'jcode' require rubygems require watir Watir::Browser.default = 'firefox' b = Watir::Browser.new b.goto http://www.omv.bg/portal/01/bg/shrek/tombola; b.goto(http://www.omv.bg; + b.frame(:name, lotus_form).src) b.text_field(:name, @map_inverse[key]).value = 'Ивайло' I have found some clues here #1 but they are for IE and it is not very clear to me what the IE patch does. Is there anything that I can do to enter the text right in Firefox? #1 http://groups.google.com/group/watir-general/browse_thread/thread/119f1e61bfd37cf7/d901173efe2c7e16?lnk=gstq=cyrillic#d901173efe2c7e16 -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] How to input data to the CKEDITOR?
I'd never heard of ckeditor before. I've had a look at their demo: http://ckeditor.com/demo Browsing through it a bit with developer tools, basically, that looks like complete hell to automate, and I'd stay as far away from it as possible. There aren't really any normal input / control elements, it's all javascript. And of course the javascript is all obfuscated. Automating that is beyond me, and, I suspect, beyond most anybody else on this list. On Mon, Jul 12, 2010 at 03:26, Soori sure...@gmail.com wrote: All, I have a form with CKEDITOR for fields. I am not able to input data to the CKEDITOR through my WATIR Script. I am getting the following error, OLE error code:800A083E in htmlfile Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus. HRESULT error code:0x80020009 Exception occurred. from c:/ruby/lib/ruby/gems/1.8/gems/ watir-1.6.5/lib/watir/input_elements.rb:333:in `set' from MyTest.rb:29 Please help me on this. /Soori -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Watir on Windows, how is it done anymore?
Watir has been locked to a very old version of ruby for a long time. Vapirhttp://vapir.org/, an updated fork of watir, runs on any recent version of ruby. On Mon, Jul 12, 2010 at 15:18, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Monday, July 12, 2010, Nathan Lane nathamberl...@gmail.com wrote: from (irb):9from C:/Ruby191/bin/irb:12:in `main' The last time I have tried, watir did not work with ruby 1.9. Try 1.8. Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Watir on Windows, how is it done anymore?
It's compatible with IE on windows, and Firefox on basically any operating system that runs both firefox and ruby. More info at: http://wiki.github.com/vapir/vapir/versions On Mon, Jul 12, 2010 at 15:27, Nathan Lane nathamberl...@gmail.com wrote: Thank you Ethan. Is Vapir compatible with as many browsers as Watir on as many OSs? On Mon, Jul 12, 2010 at 1:22 PM, Ethan notet...@gmail.com wrote: Watir has been locked to a very old version of ruby for a long time. Vapir http://vapir.org/, an updated fork of watir, runs on any recent version of ruby. On Mon, Jul 12, 2010 at 15:18, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Monday, July 12, 2010, Nathan Lane nathamberl...@gmail.com wrote: from (irb):9from C:/Ruby191/bin/irb:12:in `main' The last time I have tried, watir did not work with ruby 1.9. Try 1.8. Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Nathan Lane Blog, http://blog.nathandelane.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Issue retrieving URL for a HTML file loaded from local file system
By default, IE interacts with web pages at a low integrity level. It needs a medium or high to access content on local drives. You may get Scite to launch ruby with high integrity level by running scite as administrator. I'm not really familiar with scite, so I don't know if this will work. It may be possible to configure the way scite launches ruby itself to run it with administrator privileges, but I don't know how you might do that. Or you can force IE to always run at medium integrity - In IE's options, turning off Enable Protected Mode makes everything run at medium integrity level. This affects IE beyond the scope of watir, though. On Sun, Jul 11, 2010 at 08:43, joedio joe...@comcast.net wrote: Good advice guys! I am running on both Visa and Windows7 (two different PC's). Both systems have the out-of-the-box Windows User Account Control settings. Thus when I ran my scripts from the ScITS/Scintilla tool it was NOT launching ruby from a Console started with Admin rights. When I manually opened a console with admin rights, and run the script it passes, with no issues. So, aside from turning off Windows User Account Control settings (which a employer may disallow), does anyone know of a means to configure ScITE to launch the Window's console with Administrative rights? Joe On Jul 10, 10:46 pm, Ethan notet...@gmail.com wrote: Actually, on second thought, this looks more like a different issue. Are you running on windows vista or 7? If so, you should run ruby as administrator. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Issue retrieving URL for a HTML file loaded from local file system
Make sure you have checked Allow active content to run in files on my computer. Go to 'Internet Options' (under Tools in IE) - Advanced - scroll down to 'Security' heading. On Sat, Jul 10, 2010 at 19:18, joedio joe...@comcast.net wrote: # # Watir fails to get url for a file on the local file system, but not for same file on server # even though both files are the same, only difference is one is hosted is on server # while the other is on local file system. Both files load OK into the browser. require 'rubygems' require 'watir' sServerURL = http://myserver.com/html/bug.html; sLocalURL = file://C:/bug.html browser = Watir::Browser.new browser.goto(sServerURL) sCurrentServerURL = browser.url # --- THIS WORKS puts(Current URL: + sCurrentServerURL.to_s) sleep 2 # Wait long enough to see that the browser loaded the page browser.goto(sLocalURL) sCurrentLocalURL = browser.url # --- THIS FAILS. Why? puts(Current URL: + sCurrentLocalURL.to_s) sleep 2 # Wait long enough to see that the browser loaded the page browser.close ## Here's the contents of the file: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN html head titleWatir URL Bug/title /head body Why is this bug occuring? /body /html # Here's the error: ruby bug.rb Current URL: http://home.comcast.net/~watirworks/html/bug.html c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ie-class.rb: 465:in `method_missing': unknown property or method `LocationURL' (WIN32OLERuntimeError) HRESULT error code:0x80010108 The object invoked has disconnected from its clients. from c:/ ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ie-class.rb:465:in `url' from bug.rb:33 Exit code: 1 -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Issue retrieving URL for a HTML file loaded from local file system
Actually, on second thought, this looks more like a different issue. Are you running on windows vista or 7? If so, you should run ruby as administrator. On Sun, Jul 11, 2010 at 00:44, Ethan notet...@gmail.com wrote: Make sure you have checked Allow active content to run in files on my computer. Go to 'Internet Options' (under Tools in IE) - Advanced - scroll down to 'Security' heading. On Sat, Jul 10, 2010 at 19:18, joedio joe...@comcast.net wrote: # # Watir fails to get url for a file on the local file system, but not for same file on server # even though both files are the same, only difference is one is hosted is on server # while the other is on local file system. Both files load OK into the browser. require 'rubygems' require 'watir' sServerURL = http://myserver.com/html/bug.html; sLocalURL = file://C:/bug.html browser = Watir::Browser.new browser.goto(sServerURL) sCurrentServerURL = browser.url # --- THIS WORKS puts(Current URL: + sCurrentServerURL.to_s) sleep 2 # Wait long enough to see that the browser loaded the page browser.goto(sLocalURL) sCurrentLocalURL = browser.url # --- THIS FAILS. Why? puts(Current URL: + sCurrentLocalURL.to_s) sleep 2 # Wait long enough to see that the browser loaded the page browser.close ## Here's the contents of the file: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN html head titleWatir URL Bug/title /head body Why is this bug occuring? /body /html # Here's the error: ruby bug.rb Current URL: http://home.comcast.net/~watirworks/html/bug.html c:/ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ie-class.rb: 465:in `method_missing': unknown property or method `LocationURL' (WIN32OLERuntimeError) HRESULT error code:0x80010108 The object invoked has disconnected from its clients. from c:/ ruby/lib/ruby/gems/1.8/gems/watir-1.6.5/lib/watir/ie-class.rb:465:in `url' from bug.rb:33 Exit code: 1 -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Element #visible?
I agree - I've brought this up on the development mailing list before. I've also changed the behavior in vapir, my fork of watir. On Wed, Jun 16, 2010 at 15:56, chandu.tennety chandu.tenn...@gmail.comwrote: Hi, The visible? method returns false for a disabled element that is visible on the screen. Is this valid behavior? The intent of the code seems to be that if an element's parent is disabled, then the current element is not visible. But if it's just the current element that is disabled, but present on the screen, shouldn't it be treated as visible? Sample code --- HTML: input type=text value=test_read_only size=30 name=user[username] id=user_username disabled=disabled Ruby/Watir: t = ie.text_field(:id, 'user_username') t.visible? # = false t.disabled? # = true t.exists? # = true FWIW, using watir_webdriver, the visible? method for the same text field above returns true, which I believe should be the case. Any thoughts? Thanks! Chandu -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Firefox and TinyMCE
firewatir's execute_script executes in the context of the very top level exposed by jssh, which is different than the top level that's available to the web page. in jssh you can control the browser itself to a much greater extent than is possible through a page (which is how firewatir works). a top-level variable on the page is defined on the content window object of the browser. I don't know about in firewatir, but in vapir-firefox (my fork of firewatir, which I highly recommend over firewatir), your script should work because execute_script is defined in the context of the content window, not the top level of the jssh environment. or you can write your javascript in ruby, something like: firefox.content_window_object.tinyMCE.get('editor_id').setContent('some content') see http://vapir.org/ If you want to stick with firewatir, you'll have to figure out a reference to the content window object and evaluate your script in that context. I'm not sure what that would be. On Sat, Jun 12, 2010 at 23:53, Matt Wiseley m...@editme.com wrote: Writing a test that sets content in a TinyMCE instance using a firefox browser object. My first attempt was this: firefox.execute_script(tinyMCE.get('editor_id').setContent('some content')) This raises JsshSocket::JSReferenceError: tinyMCE is not defined even though the exact same code works if entered into Firebug. There's another post here about doing this with IE, getting the editor's element by ID, setting focus, and typing stuff into it - that doesn't work with the Firefox browser object. So here's what I've got working: firefox.goto(javascript:tinyMCE.get('editor_id').setContent('some content')) firefox.back firefox.wait # now I can submit the form and the value gets passed from TinyMCE Anyone know why execute_script doesn't see the tinyMCE JavaScript object? Is it running in some other context? Anyone have a more elegant way of doing this? If not, this works for the next guy trying to do it. MW -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Getting initialize': can't convert nil into String error
does this have anything to do with watir? On Tue, Jun 8, 2010 at 04:18, rrash586 rrash...@gmail.com wrote: Hi All, When i tried to to call finishReport method. CLReport.class.rb:170:in `initialize': can't convert nil into String (TypeError) from CLReport.class.rb:170:in `open' from CLReport.class.rb:170:in `finishReport' from report_html1.rb:98 please let me know any input will be helpful -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Ruby Desktop App With Embedded IE Controlled By Watir?
Not at all easily. There's been discussion of this before. There's some code floating around, but the code is not easy to understand. I don't know if the author would provide any support for the code; I don't think anybody else is in a position to do so. Previous discussion: http://rubyforge.org/pipermail/wtr-development/2009-August/001174.html Code: https://gist.github.com/224981/9d643daf08c9558235bf0e3ce65ed4ca0019f97f On Sat, Jun 5, 2010 at 00:19, dchuk darrindemc...@gmail.com wrote: I want to put together a desktop app that has an embedded Internet Explorer (similar to how you can embed an IE control in C#) that is then controlled by Watir. The reason for this is because I would like to distribute a specific and unified browser version to multiple clients and want to have control over which version that is. Does anyone know if this is possible? The desktop app will be coded in QtRuby and will only be Windows based. Thanks in advance. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: 'getWindows' is not defined - FireFox on Ubuntu
1. That message was intended to apply to the above method, not below. #set_text_field(value) is not implemented. #click_button(button_text) is implemented. I will update that to be less ambiguous. 2. No. Watir-Webdriver is, as far as I know, the only watiry thing that supports chrome to any extent, but I'm not sure what that extent is. (ChromeWatir is completely nonfunctional, last I was aware.) On Thu, May 27, 2010 at 11:28, Liberty1776 mlivsh...@gmail.com wrote: After checking it out, it looks like a better alternative indeed. Thank you. Just two questions: 1. Not yet implemented for Vapir-Firefox #click_button(button_text) Finds a button on the modal dialog with text matching the given text. Clicks on it. I have one modal dialog in the site that I need Vapir to click OK on. Is there a way to do it in Vapir? 2. Can Vapir work with other browsers that Watir supports. I'm interested in using Chrome to make the tests run a little faster than Firefox and far faster than IE. thanks, Michael On May 27, 9:50 am, Ethan notet...@gmail.com wrote: Vapir-Firefox is a more featureful and stable fork of Firewatir. The API is the same, with a few exceptions. You might have a look at it. Its homepage is athttp://vapir.org/ On Thu, May 27, 2010 at 06:34, Liberty1776 mlivsh...@gmail.com wrote: Update: This seems to happen after I close one of Firefox windows. I'm using 3.5.9, as that's current for my Ubuntu. Afterwards this problem manifests itself and have to quit Firefox and restart it.Then it works again. Except that after 2nd time restarting Ubuntu Firefox this way, Firefox refuses to start up. It brings up a startup window, but exists after 5 seconds of attempted startup. Do you have any ideas? Thank you, Michael On May 27, 5:01 am, Liberty1776 mlivsh...@gmail.com wrote: Hi all, I've just started using Watir. I'm developing in Linux, so I'm using FireFox 3.5 for Ubuntu 9.10 with firewatir 1.6.5. My simple script worked for 3 times and then started failing with this error. Even this fails now: b = FireWatir::Firefox.new I still have FireFox open and it hasn't changed anything since the first 3 runs succeeded. Do you have any ideas what can go wrong? Thank you, Michael JsshSocket::JSReferenceError: getWindows is not defined /var/lib/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/ jssh_socket.rb:12:in `js_eval' /var/lib/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/firefox.rb: 175:in `get_window_number' /var/lib/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/firefox.rb: 132:in `initialize' /var/lib/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/firefox.rb: 163:in `new' /var/lib/gems/1.8/gems/firewatir-1.6.5/lib/firewatir/firefox.rb: 163:in `start' ./watir_messagesend.rb:10:in `default_test' -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com watir-general%2bunsubscr...@googlegroups.comwatir-general%252bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Enabling button in FireWatir
Set the 'disabled' attribute to false. I don't recall if there is an accessor for this in watir. button.disabled = false that may not work - if it doesn't, try button.ole_object.disabled = false On Tue, May 18, 2010 at 05:57, gmile iamex...@gmail.com wrote: I'm trying to enable the button manually. How do I do that? I'd thought there's something as the following methods: — b.button(:value, MyButton).enable — b.button(:value, MyButton).set(:enabled, true) By there's no such methods. So is it possible to enable the button via Watir at all? -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
[wtr-general] Vapir
Dear Watir people, I am happy to announce the release of the Vapir library, which is a fork of Watir and FireWatir. It is documented primarily at the github wiki at http://wiki.github.com/vapir/vapir/ Documentation is sorely lacking at the moment, and improving it is my highest priority, but putting the code out for people to use preceded that. Links to other aspects of the forked project are listed at http://vapir.org/ The API is in most cases the same, with some changes where I felt it was best; these are enumerated at http://wiki.github.com/vapir/vapir/differences-from-watir-api It is a release candidate currently, and can be installed using the --pre flag to rubygems (rubygems 1.3.6 is required; run gem update --system if you are on an earlier version). gem install --pre vapir-firefox gem install --pre vapir-ie Major improvements over Watir are: - Modal dialog API which is (mostly) consistent between IE and Firefox - http://wiki.github.com/vapir/vapir/modal-dialogs - Unified codebase for both Firefox and IE interaction - basically, everything that works in IE works in Firefox as well, which is not the case with FireWatir. - Many bug fixes and feature enhancements for issues in Watir's issue tracker, which will be documented more thoroughly on the wiki in the coming days. I would encourage any questions or discussion to go to Vapir's mailing list, not Watir's. The forked project is intended to stand on its own, separate from the Watir library due to a great deal of changes in the codebase which make it to some degree (a small degree, hopefully) incompatible. Support will be on Vapir's mailing list at http://groups.google.com/group/vapir -Ethan -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Vapir
More unit tests of my changes are one area in need of major improvement, up there with documentation. Element#text isn't any different (except I think, for whitespace stuff in Firefox), and the only code change to inner/outer html is that I implemented outer_html for firefox where it doesn't exist in firewatir. Merging that back to firewatir would be very difficult. Class names shouldn't really affect usage very much if at all, since you don't instantiate classes directly, but get instances through the API. On Wed, May 5, 2010 at 17:17, Felipe Knorr Kuhn fkn...@gmail.com wrote: Charley, I don't know if I'm able to help with the merging because I would probably break everything, unless the unit tests are covering most part of the code :) Also, I have never worked as a coder in a project this big, but it could be a good time to try :) Since there are lots of changes, perhaps we could try to check which ones are the most important to the users, easier to merge, etc, and then start from there. What do you think, Ethan and devs? From my point of view, the changes I would use the most are: - Element#text - Element#inner_html / outer_html - Class names section and obviously, the new Model dialogs support. I know it certainly isn't simple as that. How active is the Watir development nowadays? If a release is not near, the core devs could focus on merging the most wanted features from Vapir. FK On Wed, May 5, 2010 at 4:00 PM, Charley Baker charley.ba...@gmail.comwrote: Felipe, We'd talked about merging some changes into the current Watir 1.x path. As Ethan mentioned, there are quite a lot of changes and not enough people currently to merge them back in. Hopefully with some time and ideally with pull requests as they can be broken out, I'd love to see some of these things merged. It requires a lot of work and discussion on the Watir development list, and most of us haven't had the time. I'm definitely in flux at this point since I've just left the Gap after 8 years. That being said, if you have some time to contribute and this is certainly one way to do it. We're always looking for pull requests for improvements. Cheers, Charley On Wed, May 5, 2010 at 12:29 PM, Ethan notet...@gmail.com wrote: On Wed, May 5, 2010 at 14:14, Felipe Knorr Kuhn fkn...@gmail.comwrote: Hello, Ethan, Congratulations, it looks very promising :) Even though I understand it's a fork, what can we expect from now on? To start with, hopefully, improved documentation. I have a backlog of features I want to implement, which I'll post somewhere, when I have time. And of course fixing bugs, which I'm sure will be encountered. I liked most of the differences pointed in the Wiki, and I believe others will like them too, so why not make them to the main Watir project? Some of them may be merged back into Watir, but some changes rely on major changes that I've made to the internals which probably won't be merged back into Watir. Will there be a new user group to support the new project? Yes, I've set up mailing list, bug tracker, wiki, all the usual good things projects have, and they're linked at the main site, http://vapir.org/ Will you be able to incorporate future Watir features quickly? :) I plan to. -Ethan -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Watir Attach and Find Methods
The post said IE is run as administrator. I said to run ruby as administrator. Ruby has to have at least as high an integrity as the IE to which it is trying to attach. On Mon, May 3, 2010 at 14:19, dholcombe dholco...@hotmail.com wrote: Running as admin doesn't solve the issue. As noted in the original post *The attach and find methods CANNOT find an IE instance that was opened *via clicking a link from another instance of IE started using “Run as *Administrator” or from a Run as Administrator command prompt run water *script. * *Here’s a simple script that demonstrates success if run as non-admin *and FAILURE if run as admin * * *require 'rubygems' *require 'watir' *ie = Watir::IE.start(http://www.quackit.com/html/codes/ *html_open_link_in_new_window.cfm) *ie.link(:text,HTML Help).click *ie2 = Watir::IE.attach(:title,/Help/) *#ie2 = Watir::IE.find(:title,/Help/) *if ie2==nil * print ie2 nil *else * print ie2 not nil *end -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Watir Attach and Find Methods
Run the ruby process as administrator. You can do this by launching the parent cmd window as administrator, or, if you're using a shortcut, modifying the shortcut to launch the process as administrator. On Fri, Apr 23, 2010 at 12:07, Zach Hayes csmath...@gmail.com wrote: Windows 7 Internet Explorer 8 Ruby 1.8.6 Watir 1.6.5 The attach and find methods CANNOT find an IE instance that was opened via clicking a link from another instance of IE started using “Run as Administrator” or from a Run as Administrator command prompt run water script. Here’s a simple script that demonstrates success if run as non-admin and failure if run as admin require 'rubygems' require 'watir' ie = Watir::IE.start(http://www.quackit.com/html/codes/ html_open_link_in_new_window.cfm) ie.link(:text,HTML Help).click ie2 = Watir::IE.attach(:title,/Help/) #ie2 = Watir::IE.find(:title,/Help/) if ie2==nil print ie2 nil else print ie2 not nil end These methods both work however on finding a window opened via admin or non-admin as long as it is the first window. Here’s a script demonstrating success for both admin and non-admin require 'rubygems' require 'watir' ie = Watir::IE.start(google.com) ie2 = Watir::IE.attach(:title,/Google/) #ie2 = Watir::IE.find(:title,/Google/) if ie2==nil print ie2 nil else print ie2 not nil end Has anyone run into this issue and have a solution? -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com
Re: [wtr-general] how ruby interacts with already opened powerpoint
This group is about Watir, not WIN32OLE. I would look for microsoft's documentation on what powerpoint exposes for OLE automation. You will probably have to iterate over open applications to detect the existing powerpoint window. You might look at the source of Watir::IE.each (ie-class.rb, line 236) for an example of iterating over application windows, though that is of course for IE windows and not powerpoint, and you'd have to adapt it heavily to get what you need out of it. On Thu, Apr 15, 2010 at 09:59, arihan sinha arihan.si...@googlemail.comwrote: Hi, In my application I've changed the setting so that the powerpoint would be opened without file download prompt. Now I need to focus on that already opened powerpoint and do some testing through ruby.( say count the no of slides) earlier i was saving the powerpoint ( clicking the save button from that file download prompt) and opening the same ppt as ppt = WIN32OLE.new('PowerPoint.Application') ppt.Visible = true * **doc = ppt.Presentations.Open('C:\Documents and Settings\sinhaa\My Documents\JHEPAT_2010_VOL51_PG845.ppt')* slidecount = doc.Slides.Count puts slidecount but the problem happend that when the remote system ( build server) is locked or minimised then it stuck in the file download prompt because it was not sending the key stroke. So after setting changed the ppt already opened so i should be able to directly count the slides on that ppt by focusing or activating the same ppt. i tried with below code but it seems not working. any thoughts??? $ie.goto( http://www.thelancet.com/journals/lancet/article/PIIS0140-6736%2810%2960523-5/fulltext ) $ie.link(:text, Download to PowerPoint).click ###The ppt gets opened automatically as a separate ppt file without file download prompt because settings changed. ppt = WIN32OLE.new('PowerPoint.Application') ppt.Visible = true slidecount = * ppt.Presentations*.Slides.Count puts slidecount Regards Arihan -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe, reply using remove me as the subject.
Re: [wtr-general] watir exit code
as Charley said, watir does not exit, itself. If you want to know if an exception occurred causing your program to exit, you can check if the global exception variable, $! is set. at_exit do if $! print an exception occurred of type #{$!.class} end end or something along those lines. On Wed, Apr 14, 2010 at 16:36, Charley Baker charley.ba...@gmail.comwrote: Watir itself doesn't have an exit code, it's just a library. Are you talking about your own testing framework, rspec, test::unit? Those generally can set exit codes. My question is what are you trying to do? Set it up in a CI run? Something else entirely? -c On Wed, Apr 14, 2010 at 2:30 PM, Shlomit Gazit shlomitpatr...@gmail.comwrote: Is there a method to use watir exit code (0 or 1)? I want to know that if it is 0 to do something at_exit. Thank you, Shlomit. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe, reply using remove me as the subject. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com
Re: [wtr-general] Re: Saving Javascript Files
It looks like you have the watir part down. It's easy to download data from a URL in ruby, though not through watir. Check the Net::HTTP library. http://www.ruby-doc.org/core/classes/Net/HTTP.html If the script's src attribute is set to a relative path then you'll have to combine it with the page's url to get an absolute path, but that shouldn't be too hard. On Wed, Apr 14, 2010 at 17:12, Brendan Grainger brendan.grain...@gmail.comwrote: Hi Tiffany, I realize water is a ruby library that interacts with web browsers. I also realize it's easy to enumerate all the linked script files with something like: jscripts = ie.document.getElementsTagName(script) jscripts.each do |js| puts Javascript file is located at: #{js.invoke('src')} #Easy way to download javascript file? I could do this I guess: javascritpt_content = ie.goto(js.invoke('src')).html # Obviously have to account for relative urls here end I was wondering more if there was a built in way. Thanks anyway Brendan On Apr 14, 2010, at 3:07 PM, Tiffany Fodor wrote: Hi! Watir is a Ruby library that allows users to interact with web browsers. There's a good chance that you could accomplish your file management with Ruby, but that is a question for a Ruby mailing list (http://www.ruby-lang.org/en/community/mailing-lists/). Good luck! -Tiffany On Apr 12, 10:33 pm, rainkinz brendan.grain...@gmail.com wrote: Hi, Is there an easy way to enumerate and save javascript files (and linked css files for that matter) using watir? Thanks -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe, reply using remove me as the subject. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com
Re: [wtr-general] Grrr! click_no_wait does not work :-(
Is the popup triggered by an onclick event, or an onmouseup or onmousedown event? If it's the latter, watir won't trigger it; #click and #click_no_wait don't do those events. you'll have to explicitly fire_event_no_wait('onmousedown') or mouseup. On Mon, Apr 12, 2010 at 16:57, Eric Mathiesen mathiese...@gmail.com wrote: Might be a simplistic answer, but have you set focus to the child popup window? On Mon, Apr 12, 2010 at 1:56 PM, Rats crapats...@yahoo.com.au wrote: I've been looking at ways of handling pop ups and it appears the way to go is via click_no_wait. Unfortunately this is not working for me as when I run the click_no_wait command it just flashes the button and does not click it hence no popup window. I'm running: ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] watir (1.6.5) Any ideas? Thanks. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe, reply using remove me as the subject. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com
Re: [wtr-general] file download
When the system is locked, windows doesn't send things like keypresses and button presses, as far as I've been able to determine. I know of no workaround for this, and would also be quite interested if anybody else knows one. On Fri, Apr 9, 2010 at 07:33, arihan sinha arihan.si...@googlemail.comwrote: Hello All, To handle the download prompt I am using the below code as save_dialog = WIN32OLE.new(AutoItX3.Control) // /// $ie.link(:text, Download images).click_no_wait click_link_text_no_wait(click Link Download images, Download images) save_dialog.WinWait(File Download,,20) save_dialog.WinActivate(File Download) #save_dialog.Send({TAB}) save_dialog.Send({Enter}) sleep 10.0 This piece of code is working fine but when the system is locked then its not working.. any idea how to handle this.? also in our remote build server when this piece of code is running and we just minimise that remote window then it stuck there and not moving further. Thanks Arihan -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe, reply using remove me as the subject.
Re: [wtr-general] Re: Error in IRB: LoadError: no such file to load -- watir
Watir being a library for ruby, some familiarity with ruby is assumed as a prerequisite for using it. That includes familiarity with ruby's environment, including irb and rubygems. Likewise, opening a command prompt is something we assume people know how to do. There are many excellent resources for getting started with ruby which go over rubygems and irb, and perhaps linking to some from watir's documentation would be helpful, but watir's documentation doesn't need to be another resource for that. Introducing people to all the needed technology is well beyond the scope of watir's documentation - it doesn't tell you how to use rubygems, it doesn't tell you how to use irb, it doesn't tell you how to use your operating system, it doesn't tell you how to buy a computer. Having used a great variety of ruby libraries, I've found watir's to be relatively thorough (in many cases with less well documented libraries I end up simply reading ruby source for lack of any real docs). Lastly, it's a wiki - please do make any improvements you see fit. That is infinitely more helpful than trashing the work that people have put into the existing documentation. On Wed, Apr 7, 2010 at 23:41, John Williams jwil...@gmail.com wrote: Solution: In Ruby 1.8.4 or later, you need to preceed the require 'watir' command with require 'rubygems'. How frustrating that this is not pointed out in the Watir documentation or examples. I found the solution in another discussion forum. In general I'm very disappointed with the sorry state of Watir installation documentation, all of which seems ad hoc, poorly integrated and universalized, and taking for granted big steps (e.g. using IRB, creating scripts in .rb files, executing .rb files, etc). Curiously, nearly all Watir documentation jumps right from installing the gems to using the Watir API, ignoring such critical steps as opening a Command Prompt with Ruby, opening IRB, requiring rubygems, editing and executing a .rb file, etc. Of course the Watir documentation shouldn't have to explain Ruby, IRB, or any other integrated technology in detail, but it should give the necessary steps in order to successfully complete a basic Watir command for someone like me who wasn't familiar with Ruby or IRB and certainly has no clue about which gems need to be required. Cheers, John On Apr 7, 7:56 pm, John Williams jwil...@gmail.com wrote: I couldn't get FireWatir to work on Mac, so I'm trying a more basic installation (I hope) of Watir with IE for Windows XP. After successfully installing the latest Ruby, RubyGems, and Watir 1.6.5, every Watir script I run chokes on the require command with the error no such file to load. This occurs whether I am executing a Ruby script or typing require 'watir' in the IRB command line. Clearly Ruby can't find watir. Since Watir installed successfully, do I need to use require commands from any particular directory? Any suggestions appreciated! Thanks, John -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe, reply using remove me as the subject. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com
Re: [wtr-general] Re: [ANN] WatiRspec 0.1.0
I don't think anybody wants to force (or can force) you to use a different name, but it is being pointed out that there exists a piece of work which is already using that name (even if slightly different case). I don't think anybody is implying that you intentionally took an already-in-use name, but the basic fact is that it is in use. Using that name may create confusion amongst people talking about either piece of work, and may conflict if the same name is used in various contexts, including a gem name. It seems to me the polite thing would be to choose a different name and cede the name to the existing, older piece of work. Asking that the existing watirspec change its name in the future to avoid conflict with yours does not seem reasonable. But, ultimately it is your own decision to make I think. On Wed, Apr 7, 2010 at 11:23, Jarmo Pertman jarm...@gmail.com wrote: Actually i didn't know about WatirCraft either. I know that i have heard about it, but i thought that it is doing something else... It is indeed somehow similar to my gem and i have also (maybe) a plan to add Cucumber support... i mean, there's not much to add as a support except just an additional dependency and require statement :P Anyway, ideas seem to be somehow similar indeed. But about the name. Since i didn't know anything (i swear!) about the existence of WatirSpec name and didn't find anything on rubygems.org, then that's why i decided to pick a name called WatiRspec (notice that there's also difference in case). Since i didn't steal the name or didn't do anything else bad intentionally, then i feel that it would not be fair against me if you or someone else would force me to change the name because of these reasons. I'm not sure that name conflict can happen on rubygems... So, if Jari or someone else decides to release a gem with already existing name, then i guess that they should be the ones to change their gem's name. I don't see any other solutions here at the moment unfortunately. No hard feelings, i hope. Best regards, Jarmo On Apr 6, 9:47 pm, Charley Baker charley.ba...@gmail.com wrote: A simple gem might make sense or you can help work on the existing gems, I haven't really thought about it too much but the WatirCraft gem does simplify things and add cucumber support. My thought in best to avoid, is that watirspec isn't currently gemified, but easily could be. So while there's not a name clash right now, the possibility exists that there may be in the future. It makes sense to make Jari's current work into a gem. Thoughts? -c On Tue, Apr 6, 2010 at 12:32 PM, Jarmo Pertman jarm...@gmail.com wrote: Well, as i understood, then Taza just offers extra functionality and in deep within Watir and RSpec is used for it. But as i already mentioned, then WatiRspec is not doing much extra except combining both of these tools. And this is enough for my work. What did you mean about this probably best to avoid that name for now exactly? Jarmo On Apr 6, 3:23 am, Charley Baker charley.ba...@gmail.com wrote: Hey Jarmo, No worries. Watirspec isn't a gem yet, but may be at some point, probably best to avoid that name for now. Taza's more complex to some degree, but the basics are fairly simple. Interested to hear more about your point of view and how you see it, or anyone else for that matter. Let me know. :) Cheers, Charley Baker Lead Developer, Watir,http://watir.com QA Architect, Gap Inc Direct On Mon, Apr 5, 2010 at 7:26 AM, Jarmo Pertman jarm...@gmail.com wrote: Hi. You are correct, i didn't know anything about these projects. But as far as i looked on Taza's documentation right now, then i can say that it is a completely different library. It might have a similar idea at some degree, but Taza seems to be just a lot more complex with all those extra features, which are not needed for me. I don't plan to make WatiRspec like that. WatiRspec's main idea is that it takes RSpec and Watir and just makes it easier to use both of these tools together by providing some helper methods and that's mainly it. I haven't been very original in thinking of names, thus i named it like Watir + RSpec = WatiRspec Sorry, if i caused any troubles with that. Jarmo On Apr 3, 10:27 pm, Charley Baker charley.ba...@gmail.com wrote: How is this different from Taza? http://github.com/charley/tazawhichdoes exactly the same sort of thing. watirspec is the name of Jari's rspec tests for celerity and watir, so despite the fact that it's not a gem yet, I'd cede that name to him. Let me know if I'm offbase, maybe you didn't know about these projects. :) I'd be happy to have you involved in Taza. Cheers, Charley Baker Lead Developer, Watir,http://watir.com QA Architect,
Re: [wtr-general] Re: Stop Firefox?
You can basically override any method anywhere in ruby. require 'firewatir' class FireWatir::Firefox def wait sleep 5 # just pause a few seconds rather than actually checking to see if the page is still loading end end that should clobber the existing Firefox#wait method. (Note: that's just written off the top of my head and untested.) On Wed, Apr 7, 2010 at 15:39, Nate nate.s.bar...@gmail.com wrote: Hey Ethan, Thanks for the response. Can I override the wait method through my script or do I have to do that through the source? On Apr 7, 11:49 am, Ethan notet...@gmail.com wrote: That is tricky. Watir generally should wait until the page is loaded until it tries to do anything, or it will probably end up interacting with a partially-loaded page where the elements that you try to use don't exist yet. But, if the application never says the page is loaded, there's no way to know when that is. You could override the #wait method to just sleep for some constant amount of time, perhaps. That's my best thought. On Wed, Apr 7, 2010 at 14:42, Nate nate.s.bar...@gmail.com wrote: Any suggestions? -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe, reply using remove me as the subject. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com
Re: [wtr-general] Re: Basic Authentication using FireWatir on Ubuntu Linux
Is the solution that is in Angrez's fork written using AutoIt, or JSSH? If it is the latter, it should be compatible across all operating systems. But I haven't looked at it to see. AutoIt is windows-only, yes. On Thu, Apr 1, 2010 at 13:54, lothar lotharsm...@gmail.com wrote: Thanks for the quick reply Željko. Yes, I checked out that site before I posted to the group, but it seems to contain windows only solutions. Solution 1 requires 'watir' and 'watir/WindowHelper' which in turn require things like 'watir/win32ole' and 'watir/ie'. It doesn't look like there is a firewatir equivalent to 'watir/ WindowHelper' (i.e. 'firewatir/WindowHelper'). Solution 2 is a windows only solution as well (uses autoit, which I *think* is IE only, but could be wrong on this). Unless I missed something, that page doesn't contain any solution that works on firewatir + linux. Any other suggestions? On Apr 1, 4:07 am, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Wed, Mar 31, 2010 at 10:26 PM, lothar lotharsm...@gmail.com wrote: I'm trying to use FireWatir (1.6.5) to access a site using Basic Authentication and I've been unable to find a solution that works on Firefox in Linux. Did you read this? http://wiki.openqa.org/display/WTR/Basic+Authentication Željko -- watir.com - community manager pledgie.com/campaigns/2982 - donate to Watir watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com To unsubscribe, reply using remove me as the subject. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: modal_dialog breaks in Rasta?
It sounds more like this is an issue with Watir's modifications to WIN32OLE - not something that another project would be in a position to fix. However, I'm not sure what in particular the incompatibility is. When I try loading the built-in win32ole.so at the same time as watir's win32ole.so, I get a bunch of warnings, but no errors. main require 'win32ole.so' = true main require 'watir/lib/watir/win32ole/win32ole.so' ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VERSION ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant ARGV ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant CP_ACP ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant CP_OEMCP ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant CP_MACCP ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant CP_THREAD_ACP ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant CP_SYMBOL ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant CP_UTF7 ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant CP_UTF8 ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_I2 ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_I4 ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_R4 ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_R8 ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_CY ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_DATE ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_BSTR ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_USERDEFINED ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_PTR ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_DISPATCH ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_ERROR ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_BOOL ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_VARIANT ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_UNKNOWN ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_I1 ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_UI1 ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_UI2 ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_UI4 ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_INT ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_UINT ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_ARRAY ./watir/lib/watir/win32ole/win32ole.so: warning: already initialized constant VT_BYREF = true main On Tue, Mar 30, 2010 at 05:04, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Tue, Mar 30, 2010 at 12:12 AM, Ross W rdwester...@gmail.com wrote: Evidently Rasta's use of win32ole for working with spreadsheets is conflicting with Watir's modified version of win32ole. In ...\lib\rasta\spreadsheet.rb, in the Book class, I replaced require 'win32ole' with require 'watir/win32ole' (line 156 in rasta 0.1.10), and voila, the above example runs fine. You should post this to Rasta mailing list, so they could fix it, I do not think they monitor this group. Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com To unsubscribe from this group, send email to watir-general+ unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com To unsubscribe from this group, send email to watir-general+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
Re: [wtr-general] Re: How to Click on the Browser File Menu Using Watir
Asking people to write your code for you isn't going to get you very far here. We are here to assist when you encounter problems, not do your work for you. On Wed, Mar 24, 2010 at 11:34, Praveen praveen99...@yahoo.com wrote: Its not the POp up.. pop willl come after i click on File Save as I wanna write a script so that it automatically does tat by clicking the FIle save Page as n then pop window comes, n i have to save it to a location using watir script itself... bec i cant do it manually since there are 8000 odd pdf files to be stored so.. plz do write a script for me -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com To unsubscribe from this group, send email to watir-general+ unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com To unsubscribe from this group, send email to watir-general+unsubscribegooglegroups.com or reply to this email with the words REMOVE ME as the subject.
Re: [wtr-general] Screen Capture error
This is due to a change between ruby 1.8 and 1.9 in how the syntax ?x is interpreted, where x is any character. You can change the screen_capture.rb file. Every instance of ?x needs to be replaced with 'x'.getbyte(0) so the line: keybd_event.Call(vkKeyScan.Call(?F), 1, 0, 0) should become: keybd_event.Call(vkKeyScan.Call('F'.getbyte(0)), 1, 0, 0) and so on. On Tue, Mar 16, 2010 at 19:28, barb bfwork2h...@yahoo.com wrote: Hi, I have written a quick little program to see how to use screen_capture and am having an error condition that I am not able to resolve. I suspect it is an easy fix.I will share the code from the program and command line error generated. Thanks in advance. === Code is as follows === require 'watir' require 'watir/screen_capture' include Watir::ScreenCapture browser = Watir::Browser.start https://xx.xxx.x.xx/iws/; browser.text_field(:name, j_username).set(supervisor1) browser.text_field(:name, j_password).set(Pwd) browser.button(:value,Sign-In).click Watir::Waiter::wait_until {browser.div(:text, Produce).exists? } #click on the Produce blue bar browser.div(:text, Produce).click #Click on New browser.div(:text,New).click #Click on Project browser.link(:text,Project).click #create a new project. browser.frame(:name, a2IFrame).form(:id, 'a2Object').text_field(:name, 'value(name)').set('capture test') #do a screen capture file_name='c:\a2web\projec.jpg' screen_capture(file_name, true) browser.close() Here is the error that appears screencapproj.rb(main):027:0*file_name='c:\a2web\projec.jpg' = c:\\a2web\\projec.jpg screencapproj.rb(main):028:0 screen_capture(file_name, true) TypeError: can't convert String into Integer from C:/Ruby19/lib/ruby/1.9.1/Win32API.rb:21:in `pack' from C:/Ruby19/lib/ruby/1.9.1/Win32API.rb:21:in `block in call' from C:/Ruby19/lib/ruby/1.9.1/Win32API.rb:19:in `each' from C:/Ruby19/lib/ruby/1.9.1/Win32API.rb:19:in `each_with_index' from C:/Ruby19/lib/ruby/1.9.1/Win32API.rb:19:in `call' from C:/Ruby19/lib/ruby/gems/1.9.1/gems/watir-1.6.5/lib/watir/ screen_cap ture.rb:54:in `screen_capture' from screencapproj.rb:28 from C:/Ruby19/bin/irb:12:in `main' screencapproj.rb(main):029:0 #browser.show_all_objects screencapproj.rb(main):030:0* screencapproj.rb(main):031:0* #puts divs screencapproj.rb(main):032:0* #browser.show_divs screencapproj.rb(main):033:0* screencapproj.rb(main):034:0* browser.close() -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Screen Capture error
Well, I'm not sure that watir officially supports ruby 1.9 yet. I think it does mostly. But, yes, that code should be changed in the source. On Wed, Mar 17, 2010 at 14:46, barb bfwork2h...@yahoo.com wrote: Thanks much that worked like a charm...though I do question the advisability of having to change underlying code if I ever have to reinstall. Thanks again...on to the next task. On Mar 17, 11:01 am, Ethan notet...@gmail.com wrote: This is due to a change between ruby 1.8 and 1.9 in how the syntax ?x is interpreted, where x is any character. You can change the screen_capture.rb file. Every instance of ?x needs to be replaced with 'x'.getbyte(0) so the line: keybd_event.Call(vkKeyScan.Call(?F), 1, 0, 0) should become: keybd_event.Call(vkKeyScan.Call('F'.getbyte(0)), 1, 0, 0) and so on. On Tue, Mar 16, 2010 at 19:28, barb bfwork2h...@yahoo.com wrote: Hi, I have written a quick little program to see how to use screen_capture and am having an error condition that I am not able to resolve. I suspect it is an easy fix.I will share the code from the program and command line error generated. Thanks in advance. === Code is as follows === require 'watir' require 'watir/screen_capture' include Watir::ScreenCapture browser = Watir::Browser.start https://xx.xxx.x.xx/iws/; browser.text_field(:name, j_username).set(supervisor1) browser.text_field(:name, j_password).set(Pwd) browser.button(:value,Sign-In).click Watir::Waiter::wait_until {browser.div(:text, Produce).exists? } #click on the Produce blue bar browser.div(:text, Produce).click #Click on New browser.div(:text,New).click #Click on Project browser.link(:text,Project).click #create a new project. browser.frame(:name, a2IFrame).form(:id, 'a2Object').text_field(:name, 'value(name)').set('capture test') #do a screen capture file_name='c:\a2web\projec.jpg' screen_capture(file_name, true) browser.close() Here is the error that appears screencapproj.rb(main):027:0*file_name='c:\a2web\projec.jpg' = c:\\a2web\\projec.jpg screencapproj.rb(main):028:0 screen_capture(file_name, true) TypeError: can't convert String into Integer from C:/Ruby19/lib/ruby/1.9.1/Win32API.rb:21:in `pack' from C:/Ruby19/lib/ruby/1.9.1/Win32API.rb:21:in `block in call' from C:/Ruby19/lib/ruby/1.9.1/Win32API.rb:19:in `each' from C:/Ruby19/lib/ruby/1.9.1/Win32API.rb:19:in `each_with_index' from C:/Ruby19/lib/ruby/1.9.1/Win32API.rb:19:in `call' from C:/Ruby19/lib/ruby/gems/1.9.1/gems/watir-1.6.5/lib/watir/ screen_cap ture.rb:54:in `screen_capture' from screencapproj.rb:28 from C:/Ruby19/bin/irb:12:in `main' screencapproj.rb(main):029:0 #browser.show_all_objects screencapproj.rb(main):030:0* screencapproj.rb(main):031:0* #puts divs screencapproj.rb(main):032:0* #browser.show_divs screencapproj.rb(main):033:0* screencapproj.rb(main):034:0* browser.close() -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com watir-general%2bunsubscr...@googlegroups.comwatir-general%252bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Packaging up an browser with a script?
No bindings exist for that browser, I expect. There are bindings for safari on Mac OSX, but I doubt they'd be at all compatible with that, the only similarity being Webkit. You might look into Firefox Portable, assuming you're on windows. I use that to keep a consistent browser environment for all the machines that people I work with use Watir on. You can run it alongside an installed Firefox without conflict, at the same time. On Mon, Mar 15, 2010 at 20:16, dchuk darrindemc...@gmail.com wrote: A possible option that I'm seeing is Arora (http://code.google.com/p/ arora/) Do bindings exist for this browser? On Mar 15, 2:26 pm, dchuk darrindemc...@gmail.com wrote: So I've found Watir to be really cool, great for a lot of scraping and testing needs. I especially love the ability to record interactions in Firefox and for the most part have code ready to drop into my scripts. But now I'm at a point where I'd like to be able to script out a tool or test, then switch it to an internal browser solution that can be packaged up and distributed to any machine and run on it's own, irrelevant of the system it's on. I know there is Celerity, which obviously does this stuff, but it's not the cleanest solution when it comes to working with AJAX and Javascript. I've been thinking that potentially being able to package up a stripped down webkit browser could be a different solution. That way, you'd have the full power of Safari rendering without needing to tie into a client's firefox or IE. The script would access it's own browser instead of touching system browsers. Is this possible? Is there a way to tell your scripts to load a specific webkit browser? -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] JSSH for Mac Firefox 3.6
Okay, looks like fixing the minversion to 3.6.0 worked for me and the extension works on 3.6. I'm battling with OpenQA's forgot password system to try and get access to the wiki to upload this. On Tue, Mar 9, 2010 at 17:46, Ethan notet...@gmail.com wrote: Yes, I think that I compiled it correctly, just got the version info in the install.rdf wrong. Will check tomorrow. On Tue, Mar 9, 2010 at 15:49, Charley Baker charley.ba...@gmail.comwrote: I think Ethan's compiled extension should work for 32bit systems. The challenge as far as I can see, and I may be wrong is compiling for multiple systems, doesn't work for me in 10.6. I've tried compiling the extension with the prereqs for 64bit systems as well, no dice. Let me know what you guys find. Charley Baker Lead Developer, Watir, http://watir.com QA Architect, Gap Inc Direct On Tue, Mar 9, 2010 at 1:23 PM, Moises Siles moises.si...@gmail.comwrote: I see, well, maybe someone else can help us with that. I'm not sure how to do it :S thanks On Tue, Mar 9, 2010 at 2:19 PM, Joseph Liu fros...@facebook.com wrote: You’ll need to have a complied binary and update the rdf. Joseph *From:* watir-general@googlegroups.com [mailto: watir-gene...@googlegroups.com] *On Behalf Of *Moises Siles *Sent:* Tuesday, March 09, 2010 12:15 PM *To:* watir-general@googlegroups.com *Subject:* Re: [wtr-general] JSSH for Mac Firefox 3.6 to do that we have to compile again or is the same if we just update that line using winrar or something like that? On Tue, Mar 9, 2010 at 12:59 PM, Ethan notet...@gmail.com wrote: Yeah, that minVersion may be wrong. Could try 3.6.0? On Tue, Mar 9, 2010 at 13:54, Moises Siles moises.si...@gmail.com wrote: this is what we have in the rdf ?xml version=1.0? RDF xmlns=http://www.w3.org/1999/02/22-rdf-syntax-ns#http://www.w3.org/1999/02/22-rdf-syntax-ns xmlns:em=http://www.mozilla.org/2004/em-rdf#http://www.mozilla.org/2004/em-rdf Description about=urn:mozilla:install-manifest em:idj...@croczilla.com/em:id em:version0.9/em:version em:type2/em:type em:targetApplication Description em:id{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/em:id !-- firefox -- em:minVersion3.6.*/em:minVersion em:maxVersion3.6.*/em:maxVersion /Description /em:targetApplication em:nameJSSh/em:name em:descriptionJSSh JavaScript Shell Server/em:description em:creatorAlex Fritze (repackaging: Viktor Zigo)/em:creator em:homepageURL/em:homepageURL /Description /RDF On Tue, Mar 9, 2010 at 12:50 PM, Ethan notet...@gmail.com wrote: Yeah, I had updated the version stuff in the rdf, but perhaps I got it wrong. On Tue, Mar 9, 2010 at 13:48, Charley Baker charley.ba...@gmail.com wrote: That's probably as simple as modifying the rdf to include 3.6 and then rezipping it. -c On Tue, Mar 9, 2010 at 11:39 AM, Ethan notet...@gmail.com wrote: okay. will see what's up and fix it tomorrow. On Tue, Mar 9, 2010 at 13:35, Moises Siles moises.si...@gmail.com wrote: I just tried to installed and I got the message Not compatible with Firefox 3.6 I'm using Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 On Tue, Mar 9, 2010 at 12:26 PM, Charley Baker charley.ba...@gmail.com wrote: Yeah, I think it'll work fine on 10.5, just having problems on Snow Leopard which is a bit of a pain. If anyone can test it out, let us know and we can promote that on the install page. Cheers, Charley Baker Lead Developer, Watir, http://watir.com QA Architect, Gap Inc Direct On Tue, Mar 9, 2010 at 11:07 AM, Ethan notet...@gmail.com wrote: I just compiled on 10.5. I don't actually have firefox 3.6 installed and not willing to upgrade right at the moment, so can't test it out, but it seemed to progress smoothly. I've temporarily put it up at: http://unth.net/jssh-3.6.x-OSX.xpi I'll test it out tomorrow, but that might work. On Tue, Mar 9, 2010 at 12:54, Charley Baker charley.ba...@gmail.com wrote: I've actually run through all the mozilla information for compiling and unable to get it compiling correctly on Snow Leopard. Not quite sure why, and I ran out of time and knowledge. I'll likely try again if I can make some time. I did try something similar to those instructions, it did compile successfully but for some reason, still unable to connect to jssh. If anyone has any other bright ideas or success, I'd love to hear them. Charley Baker Lead Developer, Watir, http://watir.com QA Architect, Gap Inc Direct On Tue, Mar 9, 2010 at 9:49 AM, Brian Rosenthal brosent...@facebook.com wrote: Thanks, Haridharan, Will give that a try. Best, Brian On Mar 9, 2010, at 12:25 AM, Haridharan Nattamai Gangadharan wrote: Based on the below steps the extension can be build both intel ppc jssh. 1. Download tar ball from
Re: [wtr-general] JSSH for Mac Firefox 3.6
Okay, I have fought their forgot password system, and the forgot password system won. Can somebody else upload it? It's temporarily hosted at http://unth.net/jssh-3.6-OSX.xpi but that's not a reliable server. On Fri, Mar 12, 2010 at 13:09, Ethan notet...@gmail.com wrote: Okay, looks like fixing the minversion to 3.6.0 worked for me and the extension works on 3.6. I'm battling with OpenQA's forgot password system to try and get access to the wiki to upload this. On Tue, Mar 9, 2010 at 17:46, Ethan notet...@gmail.com wrote: Yes, I think that I compiled it correctly, just got the version info in the install.rdf wrong. Will check tomorrow. On Tue, Mar 9, 2010 at 15:49, Charley Baker charley.ba...@gmail.comwrote: I think Ethan's compiled extension should work for 32bit systems. The challenge as far as I can see, and I may be wrong is compiling for multiple systems, doesn't work for me in 10.6. I've tried compiling the extension with the prereqs for 64bit systems as well, no dice. Let me know what you guys find. Charley Baker Lead Developer, Watir, http://watir.com QA Architect, Gap Inc Direct On Tue, Mar 9, 2010 at 1:23 PM, Moises Siles moises.si...@gmail.comwrote: I see, well, maybe someone else can help us with that. I'm not sure how to do it :S thanks On Tue, Mar 9, 2010 at 2:19 PM, Joseph Liu fros...@facebook.comwrote: You’ll need to have a complied binary and update the rdf. Joseph *From:* watir-general@googlegroups.com [mailto: watir-gene...@googlegroups.com] *On Behalf Of *Moises Siles *Sent:* Tuesday, March 09, 2010 12:15 PM *To:* watir-general@googlegroups.com *Subject:* Re: [wtr-general] JSSH for Mac Firefox 3.6 to do that we have to compile again or is the same if we just update that line using winrar or something like that? On Tue, Mar 9, 2010 at 12:59 PM, Ethan notet...@gmail.com wrote: Yeah, that minVersion may be wrong. Could try 3.6.0? On Tue, Mar 9, 2010 at 13:54, Moises Siles moises.si...@gmail.com wrote: this is what we have in the rdf ?xml version=1.0? RDF xmlns=http://www.w3.org/1999/02/22-rdf-syntax-ns#http://www.w3.org/1999/02/22-rdf-syntax-ns xmlns:em=http://www.mozilla.org/2004/em-rdf#http://www.mozilla.org/2004/em-rdf Description about=urn:mozilla:install-manifest em:idj...@croczilla.com/em:id em:version0.9/em:version em:type2/em:type em:targetApplication Description em:id{ec8030f7-c20a-464f-9b0e-13a3a9e97384}/em:id !-- firefox -- em:minVersion3.6.*/em:minVersion em:maxVersion3.6.*/em:maxVersion /Description /em:targetApplication em:nameJSSh/em:name em:descriptionJSSh JavaScript Shell Server/em:description em:creatorAlex Fritze (repackaging: Viktor Zigo)/em:creator em:homepageURL/em:homepageURL /Description /RDF On Tue, Mar 9, 2010 at 12:50 PM, Ethan notet...@gmail.com wrote: Yeah, I had updated the version stuff in the rdf, but perhaps I got it wrong. On Tue, Mar 9, 2010 at 13:48, Charley Baker charley.ba...@gmail.com wrote: That's probably as simple as modifying the rdf to include 3.6 and then rezipping it. -c On Tue, Mar 9, 2010 at 11:39 AM, Ethan notet...@gmail.com wrote: okay. will see what's up and fix it tomorrow. On Tue, Mar 9, 2010 at 13:35, Moises Siles moises.si...@gmail.com wrote: I just tried to installed and I got the message Not compatible with Firefox 3.6 I'm using Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2) Gecko/20100115 Firefox/3.6 On Tue, Mar 9, 2010 at 12:26 PM, Charley Baker charley.ba...@gmail.com wrote: Yeah, I think it'll work fine on 10.5, just having problems on Snow Leopard which is a bit of a pain. If anyone can test it out, let us know and we can promote that on the install page. Cheers, Charley Baker Lead Developer, Watir, http://watir.com QA Architect, Gap Inc Direct On Tue, Mar 9, 2010 at 11:07 AM, Ethan notet...@gmail.com wrote: I just compiled on 10.5. I don't actually have firefox 3.6 installed and not willing to upgrade right at the moment, so can't test it out, but it seemed to progress smoothly. I've temporarily put it up at: http://unth.net/jssh-3.6.x-OSX.xpi I'll test it out tomorrow, but that might work. On Tue, Mar 9, 2010 at 12:54, Charley Baker charley.ba...@gmail.com wrote: I've actually run through all the mozilla information for compiling and unable to get it compiling correctly on Snow Leopard. Not quite sure why, and I ran out of time and knowledge. I'll likely try again if I can make some time. I did try something similar to those instructions, it did compile successfully but for some reason, still unable to connect to jssh. If anyone has any other bright ideas or success, I'd love to hear them. Charley Baker Lead Developer, Watir, http://watir.com QA Architect, Gap Inc Direct On Tue, Mar 9, 2010 at 9:49 AM, Brian Rosenthal
Re: [wtr-general] JSSH for Mac Firefox 3.6
Thanks, Željko On Fri, Mar 12, 2010 at 13:33, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Fri, Mar 12, 2010 at 7:20 PM, Ethan notet...@gmail.com wrote: Can somebody else upload it? Done: http://wiki.openqa.org/display/WTR/FireWatir+Installation#FireWatirInstallation-ProductionFireWatir Ethan, thanks for the file. Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. You received this message because you are subscribed to http://groups.google.com/group/watir-general To post: watir-general@googlegroups.com To unsubscribe: watir-general+unsubscr...@googlegroups.com