From forum-watir-users at openqa.org Fri Dec 1 00:01:39 2006 From: forum-watir-users at openqa.org (Dhamodharan) Date: Thu, 30 Nov 2006 23:01:39 CST Subject: [Wtr-general] How can i upload an image when i click browse button(input type=File) Message-ID: <47520692.1164949329965.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi friends, I'm Very new to this watir . i want to know how to upload a file in watir. Please send me some examples... hi yaar.. I'm Damu from India .. Working as aQA. Currently i'm working in WATIR tool. I'm New to this tool . Hi i want to know how to upload a file in Watir.. I wiill send u the HTML tag i want to know how to open when i click the browse button? 1.A popup window will open. 2.In that one we will upload the image path . 3. and than click open Please mail me as soon as possible.. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5557&messageID=15482#15482 From forum-watir-users at openqa.org Fri Dec 1 01:12:30 2006 From: forum-watir-users at openqa.org (Dhamodharan) Date: Fri, 01 Dec 2006 00:12:30 CST Subject: [Wtr-general] How can i upload an image when i click browse button(input type=File) In-Reply-To: <47520692.1164949329965.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <44441341.1164953580162.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi friends no i have uploaded .. but i'm getting this error The above file is in valid ie.fileField(:name, "avatar").set("damu"); :- this was the script i have written --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5557&messageID=15483#15483 From angrez at gmail.com Fri Dec 1 01:19:02 2006 From: angrez at gmail.com (Angrez Singh) Date: Fri, 1 Dec 2006 11:49:02 +0530 Subject: [Wtr-general] I want to use Watir to test Firefox and Safari In-Reply-To: <51009756.1164916267478.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <51009756.1164916267478.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Nathan, You can get the code for Firewatir for http://www.code.google.com/p/firewatir/trunk using any sub version client. It works with Firefox 1.5 and above versions. The execution speed which was the problem earlier has been resolved. Now execution speed has improved a lot. Comparable to using Watir with IE. Let me know you exprience/doubts/queries/suggestions regarding the same. Currently it doesn't support forms, frames, table row and table cells. Regards, Angrez On 12/1/06, Nathan wrote: > > Hi, I am an experienced developer/tester and have been using Watir for a > couple of months now. I have read a lot about Selenium also, and have noted > that people are concerned about the need to install Selenium on the server, > because it has to be served from the same location as the web page being > tested. Well I share this concern, but not because it might be difficult, or > because of some other experience reason, rather because it is not good > practice, nor will we ever install third party tools on our production > servers. This causes a problem with using selenium for my company, and that > is that our production environment is generally more stable and better than > our dev or qa environments. So what to do? I've read about FireWatir, but > have not been able to find much on it. I'd prefer not to rebuild Firefox > with that COM-like plugin because that makes it so that I'm not using > exactly the same firefox as the rest of the world, and could produce > different results than the real wor > ld sees, I also am unable to find the plugin for firefox as a separate > program plugin. So I guess I can't test firefox or safari with watir. Does > anybody know of a way to accomplish what I wish with JUST Watir? Please > help, thanks. > > Nathan > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5549&messageID=15431#15431 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061201/68bc6c22/attachment.html From zeljko.filipin at gmail.com Fri Dec 1 04:36:04 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 1 Dec 2006 10:36:04 +0100 Subject: [Wtr-general] How can i upload an image when i click browse button(input type=File) In-Reply-To: <44441341.1164953580162.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <47520692.1164949329965.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <44441341.1164953580162.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 12/1/06, Dhamodharan wrote: > > i'm getting this error > The above file is in valid > ie.fileField(:name, "avatar").set("damu") Hi Damu, File is invalid because windows can not find it. Make sure that you provide full path to file, something like this: ie.fileField(:name, "avatar").set('C:\damu.txt') -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061201/051bb284/attachment.html From forum-watir-users at openqa.org Fri Dec 1 08:49:59 2006 From: forum-watir-users at openqa.org (Fletch) Date: Fri, 01 Dec 2006 07:49:59 CST Subject: [Wtr-general] Skipping Tests Message-ID: <53064730.1164981041536.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello All, I have been looking at using WATIR over the past couple of days, and have designed a couple of tests, however, in certain tests, if an assertion is not true, then I want to jump to another point in my script. Is this possible? Thanks. PMF. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5563&messageID=15496#15496 From phlip2005 at gmail.com Fri Dec 1 09:49:05 2006 From: phlip2005 at gmail.com (Phlip) Date: Fri, 1 Dec 2006 06:49:05 -0800 Subject: [Wtr-general] Skipping Tests References: <53064730.1164981041536.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <037001c71557$da13feb0$81a1b04c@Marley> Fletch wrote: > I have been looking at using WATIR over the past couple of days, and have > designed a couple of tests, however, in certain tests, if an assertion is > not true, then I want to jump to another point in my script. > > Is this possible? Just say if instead of assert. However, terms like "jump", "skipping tests", and "assertion is not true" make us wonder if your tests are narrow, encapsulated, robust, and isolated. If your tests are run-on, if they walk the program thru many of its states, then your tests are not helping to decouple your code. Are most of your tests on the layer under the GUI? -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!! From forum-watir-users at openqa.org Fri Dec 1 09:51:35 2006 From: forum-watir-users at openqa.org (Vince) Date: Fri, 01 Dec 2006 08:51:35 CST Subject: [Wtr-general] Skipping Tests In-Reply-To: <53064730.1164981041536.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <64064341.1164984821911.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> PMF, I'm not sure if I followed the question completely, so straighten me out if I'm off... My first thought here would be to simply use the assertion to set a flag, and drive your others tests off of that flag by wrapping the body of the test in a simple if statement. A cleaner way to do this, though, would be with method calls like this: class SampleTests < Test::Unit::TestCase def test_mytest1 if assert(Something) whentrue else whenfalse end end def whentrue #do stuff when the assertion passes end def whenfalse #do stuff when the assertion fails end end If the method name isn't preceded with "test", then it won't automatically be run and instead will need to be called. This should give you the flexibility you're looking for. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5563&messageID=15498#15498 From forum-watir-users at openqa.org Fri Dec 1 10:16:21 2006 From: forum-watir-users at openqa.org (Fletch) Date: Fri, 01 Dec 2006 09:16:21 CST Subject: [Wtr-general] Skipping Tests In-Reply-To: <53064730.1164981041536.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <54672544.1164986211592.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> That is kind of what I mean, however in my case this would lead to a lot of repeated code. Test1 (if True) Action2 Action3 Action4 Action5 (else) Action4 Action5 I have been thinking about a goto(Action4) which works, but as my code is sequential, it follows Action4 with Action2, Action3, and Action4 again --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5563&messageID=15502#15502 From forum-watir-users at openqa.org Fri Dec 1 10:22:29 2006 From: forum-watir-users at openqa.org (vijay) Date: Fri, 01 Dec 2006 09:22:29 CST Subject: [Wtr-general] Checking whether images inside a table are enabled or disabled Message-ID: <49873969.1164986579868.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello people, I have got to check whether images present in a table are enabled or disabled. I am not even very sure whether they are images. Their "html content: is like the following: Step 1. Details Is there a way that I can check whether this image (or link or label) is enabled or not? Thanks, in advance, Vijay --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5565&messageID=15503#15503 From forum-watir-users at openqa.org Fri Dec 1 10:34:07 2006 From: forum-watir-users at openqa.org (Dave Munns) Date: Fri, 01 Dec 2006 09:34:07 CST Subject: [Wtr-general] setting text field in table In-Reply-To: <37526354.1164841855850.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <38261566.1164987283331.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks Paul. Referencing the text_field by index does indeed work. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5520&messageID=15507#15507 From forum-watir-users at openqa.org Fri Dec 1 10:43:33 2006 From: forum-watir-users at openqa.org (Fletch) Date: Fri, 01 Dec 2006 09:43:33 CST Subject: [Wtr-general] Skipping Tests In-Reply-To: <64064341.1164984821911.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <58438118.1164987843582.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I understand what you mean now. Thanks for the help. When the test fails, I just call one of the later methods, which misses out on all the methods that are used when the test is successful. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5563&messageID=15508#15508 From mail at chriss-baumann.de Fri Dec 1 10:47:12 2006 From: mail at chriss-baumann.de (Christian Baumann) Date: Fri, 01 Dec 2006 16:47:12 +0100 Subject: [Wtr-general] Skipping Tests In-Reply-To: <54672544.1164986211592.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <54672544.1164986211592.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <45704E80.7080103@chriss-baumann.de> Hi Fletch, for Your example: if Test1 == true begin Action2 Action3 end Action4 Action5 The actions 4 & 5 are executed always, no matter if the result of Test1 is true or false... To avoid repeated code: What?s about modularisation? Like methods/functions? Have a look at http://en.wikipedia.org/wiki/Modularity_(programming) or ask google. Regards, Christian Fletch schrieb: > That is kind of what I mean, however in my case this would lead to a lot of repeated code. > > Test1 > (if True) > Action2 > Action3 > Action4 > Action5 > (else) > Action4 > Action5 > > I have been thinking about a goto(Action4) which works, but as my code is sequential, it follows Action4 with Action2, Action3, and Action4 again > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5563&messageID=15502#15502 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From forum-watir-users at openqa.org Fri Dec 1 13:53:29 2006 From: forum-watir-users at openqa.org (Nathan) Date: Fri, 01 Dec 2006 12:53:29 CST Subject: [Wtr-general] I want to use Watir to test Firefox and Safari In-Reply-To: <456F4C7C.50901@tejasconsulting.com> Message-ID: <49316765.1164999242017.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> So I haven't rejected Firewatir, rather I have not been able to find any new info on it, and as far as the site here goes, it appears to have been abandoned. I'd like very much to use it and develop it more if necessary. We would like a good way to test in Firefox and Safari that isn't proprietary, and free if possible. One difficulty in our experience, though it is a good thing, is that only Microsoft products are bound to putting OLE/COM servers in their products, so as Firefox and Safari don't have these things, I'll need to rely on a plugin. I am not opposed to plugins to do the job. Quick Test Pro after all uses a plugin to automate both Firefox and IE, but it has no support for Safari, and it's pretty costly for what we get. Also it doesn't do everything we want it to do. The one thing I want to completely avoid though is recompiling a browser just so we can test on it - a plugin is something everyone can get and use, but recompiling the browser voids our tests in our mind. If it works here or doesn't work here when we've recompiled the browser, then we cannot guarantee even similar results to people who use a precompiled browser. We're a professional business and we need to guarantee our product and have reproducible results. I disagree that automating something "always has the potential to perturb the results" as you put it. If that were indeed the case then automation would not be as common as it is, and more people would be more reluctant to pursue it. Thanks for the insight, Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5549&messageID=15518#15518 From forum-watir-users at openqa.org Fri Dec 1 13:55:56 2006 From: forum-watir-users at openqa.org (Nathan) Date: Fri, 01 Dec 2006 12:55:56 CST Subject: [Wtr-general] I want to use Watir to test Firefox and Safari In-Reply-To: Message-ID: <58496517.1164999386593.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks for the link to the code. I just downloaded it and tried to install jssh to no avail - it doesn't work. First of all the installation doc is completely wrong about what I install, because that's not what I downloaded. So I manually copied those files over to my firefox install directory and I installed the firewatir gem and all of the unittests fail. Any suggestions then? Have you actually used Firewatir, or are you just telling me where to get it? Thanks, need more info, Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5549&messageID=15519#15519 From esjewett at gmail.com Fri Dec 1 14:48:17 2006 From: esjewett at gmail.com (Ethan Jewett) Date: Fri, 1 Dec 2006 13:48:17 -0600 Subject: [Wtr-general] Checking whether images inside a table are enabled or disabled In-Reply-To: <49873969.1164986579868.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <49873969.1164986579868.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <68f4a0e80612011148k4a38c8e2x84e59019dce74375@mail.gmail.com> Vijay, It is hard to tell what, exactly, you are looking for without an example of what an "enabled" object looks like *and* what a "disabled" object looks like. However, it looks to me like Watir 1.5.1.1127 supports the following methods for every object on a web-page: exists? enabled? attribute_value(attribute_name) I think at least one of these can be used to solve your problem. Ethan On 12/1/06, vijay wrote: > Hello people, > > I have got to check whether images present in a table are enabled or disabled. I am not even very sure whether they are images. Their "html content: is like the following: > > > > Step 1. Details > > > Is there a way that I can check whether this image (or link or label) is enabled or not? > > Thanks, in advance, > Vijay > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5565&messageID=15503#15503 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From faught at tejasconsulting.com Fri Dec 1 15:54:20 2006 From: faught at tejasconsulting.com (Danny Faught) Date: Fri, 01 Dec 2006 13:54:20 -0700 Subject: [Wtr-general] I want to use Watir to test Firefox and Safari In-Reply-To: <49316765.1164999242017.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <49316765.1164999242017.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4570967C.6050501@tejasconsulting.com> Nathan wrote: > We would like a good way to test in Firefox and Safari that isn't proprietary, and free if possible. For Safari, the first thing I would try is AppleScript. There's a decent chance that Safari is already scriptable using AppleScript, and any other language that has a bridge to the same interfaces that AppleScript uses. > I disagree that automating something "always has the potential to perturb the results" as you put it. We can reduce our exposure to that potential by being careful about our approach. So there are a good number of automation projects that do succeed, when people are smart about using the tools. -Danny From patslists at gmail.com Fri Dec 1 15:26:14 2006 From: patslists at gmail.com (Pat Mac) Date: Fri, 1 Dec 2006 15:26:14 -0500 Subject: [Wtr-general] Extreme slowdown moving from 1.4.1 to 1.5.1.1127 Message-ID: <212711160612011226i1948fc33mac83f91ad23c2ee8@mail.gmail.com> Hi All, I've read through the archives I could find relating to performance issues related to 1.5 but I didn't see any concrete solutions or reasons why the slowdown is occurring. Running an existing script using the profiler my execution time goes from 170 seconds to 425 seconds. Looking at the profiler output I notice the following: WIN32OLE#each is the top consumer in both profiles. In 1.5 it's taking 70.15seconds vs 59.19 in 1.4. Not a huge jump, but noticeable when running 100+ cases. WIN32OLE#invoke is the number 2 consumer in both profiles taking 64.85seconds in 1.5 but only 25.69 seconds in 1.4. This is obviously quite significant. Beyond the top two, the next highest in 1.4 is Logger#add taking just over 12 seconds. However, in 1.5 I see seven additional methods taking 20 seconds or longer. The biggest hogs are Watir::Element#type at 62.64 seconds, Class#new at 42.49 seconds, Watir::Element#assert_exists at 41.68 seconds and Array#include? at 39.47 seconds. I'm at a loss here. I'm running these tests on the same machine with the same version of Ruby. I originally wanted to upgrade for the click_no_wait functionality and modal dialog functionality but I can't take this kind of a performance hit. Is there something obvious I'm missing? I did notice the slowdown appears to be significant on pages with lots of controls. At this point I'm probably going to backport the click_no_wait and modal dialog functionality to 1.4.1 unless anyone has an idea of what I'm doing wrong here. --Pat -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061201/2e4b955d/attachment.html From ajahns at gmail.com Fri Dec 1 21:16:00 2006 From: ajahns at gmail.com (Alan Jahns) Date: Fri, 1 Dec 2006 18:16:00 -0800 Subject: [Wtr-general] Set focus to original window Message-ID: <11ab23860612011816w615c0df1l90de8cfdc2a62774@mail.gmail.com> Hello, I'm new to watir and scripting in general. The tool is still easy enough that I have automated many testcases already. On to my problem: I have a page where selecting the sign in link opens a new window with the sign in form, I set watir's focus on this new window with the attach command and can fill it out fine and submit. After submission this new window closes and the original window refreshes to reflect the successful sign in with some text showing username etc. My problem is after the sign in info is submitted and the new window closes the script ends. I have some simple if/else statements to check if some text strings are on the original window, but it seems that it no longer sees the original window. How would I make watir switch focus back? Thanks in advance! Alan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061201/d1887c23/attachment-0001.html From faught at tejasconsulting.com Fri Dec 1 22:49:09 2006 From: faught at tejasconsulting.com (Danny Faught) Date: Fri, 01 Dec 2006 20:49:09 -0700 Subject: [Wtr-general] Set focus to original window In-Reply-To: <11ab23860612011816w615c0df1l90de8cfdc2a62774@mail.gmail.com> References: <11ab23860612011816w615c0df1l90de8cfdc2a62774@mail.gmail.com> Message-ID: <4570F7B5.70700@tejasconsulting.com> Alan Jahns wrote: > I have some simple if/else statements to check > if some text strings are on the original window, but it seems that it no > longer sees the original window. How would I make watir switch focus back? One likely mistake is to use the same variable, like "ie", for both the parent and the child window. Make sure to use separate variables for each window that you want to keep track of. -Danny From angrez at gmail.com Sat Dec 2 00:21:53 2006 From: angrez at gmail.com (Angrez Singh) Date: Sat, 2 Dec 2006 10:51:53 +0530 Subject: [Wtr-general] I want to use Watir to test Firefox and Safari In-Reply-To: <58496517.1164999386593.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <58496517.1164999386593.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Nathan, Could you please let me know what difficulty you faced while installing gem and JSSh xpi. I have used the Firewatir code and I currently own the project at Google. I have tested its installation on 3 - 4 machines and didn't have any problems either with XPI or with the Firewatir gem. It currently works only on windows. Let me know what problems you faced? Regards, Angrez On 12/2/06, Nathan wrote: > > Thanks for the link to the code. I just downloaded it and tried to > install jssh to no avail - it doesn't work. First of all the installation > doc is completely wrong about what I install, because that's not what I > downloaded. So I manually copied those files over to my firefox install > directory and I installed the firewatir gem and all of the unittests fail. > > Any suggestions then? > > Have you actually used Firewatir, or are you just telling me where to get > it? > > Thanks, need more info, > > Nathan > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5549&messageID=15519#15519 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061202/7cce2a1f/attachment.html From angrez at gmail.com Sat Dec 2 00:29:39 2006 From: angrez at gmail.com (Angrez Singh) Date: Sat, 2 Dec 2006 10:59:39 +0530 Subject: [Wtr-general] I want to use Watir to test Firefox and Safari In-Reply-To: <49316765.1164999242017.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <456F4C7C.50901@tejasconsulting.com> <49316765.1164999242017.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Nathan, Get the latest code from the following location. http://firewatir.googlecode.com/svn/trunk/Installation/ It contains installation doc, XPI and Firewatir gem. Let me know the problems you have faced. Its still in development and this will help me in generating the help document or installation document more accurately. Regards, Angrez On 12/2/06, Nathan wrote: > > So I haven't rejected Firewatir, rather I have not been able to find any > new info on it, and as far as the site here goes, it appears to have been > abandoned. I'd like very much to use it and develop it more if > necessary. We would like a good way to test in Firefox and Safari that > isn't proprietary, and free if possible. One difficulty in our experience, > though it is a good thing, is that only Microsoft products are bound to > putting OLE/COM servers in their products, so as Firefox and Safari don't > have these things, I'll need to rely on a plugin. I am not opposed to > plugins to do the job. Quick Test Pro after all uses a plugin to automate > both Firefox and IE, but it has no support for Safari, and it's pretty > costly for what we get. Also it doesn't do everything we want it to > do. The one thing I want to completely avoid though is recompiling a > browser just so we can test on it - a plugin is something everyone can get > and use, but recompiling the browser voids our tests i > n our mind. If it works here or doesn't work here when we've recompiled > the browser, then we cannot guarantee even similar results to people who use > a precompiled browser. We're a professional business and we need to > guarantee our product and have reproducible results. I disagree that > automating something "always has the potential to perturb the results" as > you put it. If that were indeed the case then automation would not be as > common as it is, and more people would be more reluctant to pursue it. > > Thanks for the insight, > > Nathan > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5549&messageID=15518#15518 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061202/092d027c/attachment.html From forum-watir-users at openqa.org Sat Dec 2 01:47:12 2006 From: forum-watir-users at openqa.org (Dhamodharan) Date: Sat, 02 Dec 2006 00:47:12 CST Subject: [Wtr-general] how to get dato for a signup module using Class and methods..... Message-ID: <51708180.1165042062181.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi friends , Tell me how to include class and methods in scripts for testing Signup module... I will tell u the steps .. please reply mmediately my friend 1.What are require to srtat? like require watir.... 2.open a site..?? 3.Click signup form.. 4.Enter data's and then submit the form...??? 5.Hi friends please use class and methods to do this example.. it's urgent.. waiting for ur replies --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5576&messageID=15540#15540 From amit.garde at gmail.com Sat Dec 2 02:19:59 2006 From: amit.garde at gmail.com (Amit Garde) Date: Sat, 2 Dec 2006 12:49:59 +0530 Subject: [Wtr-general] I want to use Watir to test Firefox and Safari In-Reply-To: References: <58496517.1164999386593.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <7661e6730612012319g29db186l35e1491098e3652c@mail.gmail.com> On 12/2/06, Angrez Singh wrote: > Could you please let me know what difficulty you faced while installing gem > and JSSh xpi. I have used the Firewatir code and I currently own the project > at Google. I have tested its installation on 3 - 4 machines and didn't have > any problems either with XPI or with the Firewatir gem. > > It currently works only on windows. In more detail: the Firewatir Ruby code hasn't really been tested on non-Windows platforms yet, but, because of the way Firewatir is designed, you should be able to drive Firefox running on any machine and OS, as long as the JSSh extension is installed and enabled. Firewatir sends browser driving JS code to a Firefox instance on a particular socket, so if you want to test with Firefox on Linux for example, you can run a Firefox instance on Linux, have your Firewatir installation and scripts run on Windows, and drive the Firefox instance remotely. This might be a little slower than a complete Firewatir and Firefox combo both running on the same Linux machine, but Firewatir speed has improved quite a bit since the days it was 40X slower than the IE equivalent. There is still work to be done (and under way) but I think Firewatir is quite a viable option for Firefox driven testing (and will get better). Let us know if you need to experiment with remotely driving Firefox and I'll rustle up a document or HOWTO. Amit From amit.garde at gmail.com Sat Dec 2 02:38:09 2006 From: amit.garde at gmail.com (Amit Garde) Date: Sat, 2 Dec 2006 13:08:09 +0530 Subject: [Wtr-general] I want to use Watir to test Firefox and Safari In-Reply-To: <49316765.1164999242017.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <456F4C7C.50901@tejasconsulting.com> <49316765.1164999242017.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <7661e6730612012338t1c7cf734h6009c76c4183aa0e@mail.gmail.com> On 12/2/06, Nathan wrote: >So I haven't rejected Firewatir, rather I have not been able to find any new info on it, and >as far as the site here goes, it appears to have been abandoned. Firewatir moved to Google code as a seprate project because it seemed to be agreed that this best served the needs both of Watir and Firewatir. Firewatir has not been abandoned; site maintenance and code updates have been a little low key, partly because the level of interest in Firewatir (at least as evidenced on this list) doesn't suggest that much breath is being held, and partly because we (primarily Angrez) have been focusing on improving Firewatir performance to bring it being competitive with to what you see with Watir/IE. Early Firewatir versions were very slow (30X to 40X slower than Watir/IE), which made it very frustrating to use it for Firefox testing. The slowness issue should largely have been addressed, though there is much testing, code cleanup, packaging, and documentation to be done. Expect some visible outcome of this in the not too distant future. > I'd like very much to use it and develop it more if necessary. We would like a good way > to test in Firefox and Safari that isn't proprietary, and free if possible. One difficulty in our > experience, though it is a good thing, is that only Microsoft products are bound to putting > OLE/COM servers in their products, so as Firefox and Safari don't have these things, I'll > need to rely on a plugin. I am not opposed to plugins to do the job. Quick Test Pro after > all uses a plugin to automate both Firefox and IE, but it has no support for Safari, and it's > pretty costly for what we get. Also it doesn't do everything we want it to do. The one > thing I want to completely avoid though is recompiling a browser just so we can test on it > - a plugin is something everyone can get and use, but recompiling the browser voids our > tests in our mind. If it works here or doesn't work here when we've recompiled the > browser, then we cannot guarantee even similar results to people who use a precompiled > browser. Firewatir requires an extension to be installed in Firefox. This extension - JSSh - is now available packaged as a .xpi, so you don't have to recompile Firefox to use it. You will however need to install the extension, so you'll need to decide whether Firefox-plus-JSSh-extension-installed counts, for your purposes, as a browser modification at par with recompilation or not. For what it's worth, we are introducing Firewatir into our test suites where I work, and have not thus far encountered anything that would lead us to question the validity of any tests that we run using Firewatir. Amit From zeljko.filipin at gmail.com Sat Dec 2 07:55:48 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Sat, 2 Dec 2006 13:55:48 +0100 Subject: [Wtr-general] how to get dato for a signup module using Class and methods..... In-Reply-To: <51708180.1165042062181.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <51708180.1165042062181.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Take a look at WATIR User Guide ( http://www.openqa.org/watir/watir_user_guide.html). -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061202/aed5311f/attachment.html From zeljko.filipin at gmail.com Sat Dec 2 08:03:26 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Sat, 2 Dec 2006 14:03:26 +0100 Subject: [Wtr-general] I want to use Watir to test Firefox and Safari In-Reply-To: <51009756.1164916267478.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <51009756.1164916267478.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 11/30/06, Nathan wrote: > > So I guess I can't test firefox or safari with watir. > Please forgive me if it is already mentioned in this thread (I could not find it), but there is also SafariWatir (http://safariwatir.rubyforge.org/). -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061202/74d430c3/attachment-0001.html From neridan at paradise.net.nz Sun Dec 3 03:33:53 2006 From: neridan at paradise.net.nz (Neil Daniell) Date: Sun, 03 Dec 2006 21:33:53 +1300 Subject: [Wtr-general] Identifying a tab to click on Message-ID: <45728BF1.7010109@paradise.net.nz> I am trying to use Watir to click on secondTab but cannot seem to get the following to work: $ie = IE.new .... $ie.div(:index, 1).table(:index,1)[1][2].span(:index, 1).click Can someone indicate to me how I can fix this? Is it possible to select an element via the class? Page source:(jsp)

		
<%-- Show the Second Tab --%>
			
		
-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061203/0f001d66/attachment.html -------------- next part -------------- An embedded message was scrubbed... From: "Daniell, Neil" Subject: main.jsp Date: Thu, 30 Nov 2006 17:18:18 +1300 Size: 4399 Url: http://rubyforge.org/pipermail/wtr-general/attachments/20061203/0f001d66/attachment.mht From tester.paul at gmail.com Sun Dec 3 10:20:48 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Sun, 3 Dec 2006 10:20:48 -0500 Subject: [Wtr-general] Identifying a tab to click on In-Reply-To: <45728BF1.7010109@paradise.net.nz> References: <45728BF1.7010109@paradise.net.nz> Message-ID: <37c405480612030720i1c8ae861jbfd99c59471516f@mail.gmail.com> Maybe you're being too specific? Did you try just: $ie.span(:index, 1).click Or, based on the id tag, does this work: $ie.span(:id, 'firstTab').click On 03/12/06, Neil Daniell wrote: > > I am trying to use Watir to click on secondTab but cannot seem to get the following to work: > $ie = IE.new > .... > $ie.div(:index, 1).table(:index,1)[1][2].span(:index, 1).click > Can someone indicate to me how I can fix this? > Is it possible to select an element via the class? > > Page source:(jsp) > >
> > > > > > > >
> onclick="if (PageUI.isLoaded()) selectTab(0);" > onfocus="this.click();" > title="First Tab">

> 		
> <%-- Show the Second Tab --%> > onclick="if (PageUI.isLoaded()) selectTab(1);" > onfocus="this.click();" > title="Second Tab">
			
> 		
>
>
> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061203/69d080f4/attachment.html From ac251404 at ohio.edu Sun Dec 3 12:37:23 2006 From: ac251404 at ohio.edu (Alex Ciarlillo) Date: Sun, 03 Dec 2006 12:37:23 -0500 Subject: [Wtr-general] Editing fields in 'Save As' dialog Message-ID: <45730B53.4060507@ohio.edu> Hi, I am trying to automate the download of a file from a website. I want the user to be able to set the 'Save in:' and 'File Name:' edit boxes but I am not sure how to approach this. I have the following code which gets me as far as the Save As dialog but beyond that I am unsure of what winClicker methods I need to change these text fields. #requires require 'watir' require 'watir/winClicker' #includes include Watir browser = IE.new clicker = WinClicker.new browser.goto( 'http://www.deviantart.com/download/29747336/' ) clicker.clickWindowsButton('File Download', 'Save') After this I tried adding the following: h = clicker.getWindowHandle('Save As') clicker.setTextValueForFileNameField( h , 'test.rar' ) But I got the message 'Unable to obtain handle for filename chooser' Also I need to change the 'Save In:' field but I'm even less sure how to approach the combobox. Any tips or insight on how to accomplish this would be really appreciated. Thanks, -Alex From bret at pettichord.com Sun Dec 3 15:35:27 2006 From: bret at pettichord.com (Bret Pettichord) Date: Sun, 3 Dec 2006 14:35:27 -0600 Subject: [Wtr-general] Automation Workshop to be held Jan 12-14 Message-ID: I am co-hosting a workshop on open-source testing frameworks Jan 12-14 in Austin. This is actually the seventh meeting of the Austin Workshops on Test Automation. I am looking forward to sharing what we've been doing with open-source tools at DataCert, as well as hearing what others have been up to. Workshop attendance will be limited to 25 people. If you would like to come, please take a look at our call for participation: http://awta.wikispaces.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061203/798a636d/attachment.html From forum-watir-users at openqa.org Mon Dec 4 01:27:25 2006 From: forum-watir-users at openqa.org (vijay) Date: Mon, 04 Dec 2006 00:27:25 CST Subject: [Wtr-general] Checking whether images inside a table are enabled or disabled In-Reply-To: <68f4a0e80612011148k4a38c8e2x84e59019dce74375@mail.gmail.com> Message-ID: <55115819.1165213684310.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Ethan, Thanks for your reply and sorry for not explaining the issue clearly. There is a page in our application that contains links like "Instructions", "Step 1. Details", "Step 2. Inventors" etc [These are actually recognized as "TD"s in the 'View -> Source. The table containing this has got an unique id to recognize it]. While entering into our application, all links, other than "Instructions" and "Step 1. Details", should be disabled. This means that one can click on only the above-mentioned two links (Instructions and Step 1. Details). The other links will be grayed out and cannot be clicked on (they will appear as just words with no "hand-pointer" , one which gets displayed when the mouse traverses over a web link). I want to verify this with Watir. I am at a loss about how to do that. A sample html for an enabled link is : Active Element: [A], Frame: [Detail], Index: [35] Step 1. Details) ]. A sample html for a disabled link is: Active Element: [TD], Frame: [Detail], Index: [41] Step 2. Inventors Hope this gives you a clearer picture. Thanks, in advance, for your help. Vijay --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5565&messageID=15596#15596 From forum-watir-users at openqa.org Mon Dec 4 02:04:13 2006 From: forum-watir-users at openqa.org (san) Date: Mon, 04 Dec 2006 01:04:13 CST Subject: [Wtr-general] Can't Control JavaScript PopUp Window.... In-Reply-To: <4440693B7CFF2440ABC2E0BE480DABA10A3640@EX01-2.rl.gov> Message-ID: <65001637.1165215883124.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I'm Using 1.4.1 --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5510&messageID=15597#15597 From forum-watir-users at openqa.org Mon Dec 4 02:08:54 2006 From: forum-watir-users at openqa.org (san) Date: Mon, 04 Dec 2006 01:08:54 CST Subject: [Wtr-general] Can't Control JavaScript PopUp Window.... In-Reply-To: <59161833.1164811809837.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <55593074.1165216164805.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Ya... Of Course Its Useful, But I Don't Need To Click On Any Button, But On Other Page Links That Lies On The Popup Page & After Clicking One Of The Links On The Pop Up It Will Vanish & The Clicked Link Will Be Opened In The Main Window..... How Can I? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5505&messageID=15598#15598 From forum-watir-users at openqa.org Mon Dec 4 03:59:42 2006 From: forum-watir-users at openqa.org (Fletch) Date: Mon, 04 Dec 2006 02:59:42 CST Subject: [Wtr-general] Selecting Links Message-ID: <47751265.1165222850925.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello All, I have a form which has the following layout [u]Link1[/u] Button [u]Link2[/u] Button [u]Link3[/u] Button I want to be able to use WATIR to click the button beside [u]Link2[/u], my thinking is that I want to get the index of the link containing text "Link2" and then use this value to - Button(:index, linkIndex).click Is it possible to return the index of the link? Thanks, PMF. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5594&messageID=15602#15602 From zeljko.filipin at gmail.com Mon Dec 4 04:35:01 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 4 Dec 2006 10:35:01 +0100 Subject: [Wtr-general] Selecting Links In-Reply-To: <47751265.1165222850925.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <47751265.1165222850925.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 12/4/06, Fletch wrote: > > Is it possible to return the index of the link? I have watir 1.5.1.1081 and it is not supported there. irb(main):005:0> ie.link(:text, "link").index NoMethodError: undefined method `index' for # This looks like interesting feature request (maybe newer versions of watir have this already implemented). -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061204/d5825430/attachment-0001.html From zeljko.filipin at gmail.com Mon Dec 4 05:15:40 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 4 Dec 2006 11:15:40 +0100 Subject: [Wtr-general] Checking whether images inside a table are enabled or disabled In-Reply-To: <55115819.1165213684310.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <68f4a0e80612011148k4a38c8e2x84e59019dce74375@mail.gmail.com> <55115819.1165213684310.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: In your case, disabled link is not a link with disabled property (link text), it is a table cell (cell text). This will tell you that "Step 1. Details" is link, not in table cell. irb(main):025:0> ie.link(:text, "Step 1. Details").exists? => true irb(main):026:0> ie.cell(:text, "Step 1. Details").exists? => false This will tell you that "Step 2. Inventors" is in table cell, not link. irb(main):023:0> ie.link(:text, "Step 2. Inventors").exists? => false irb(main):024:0> ie.cell(:text, "Step 2. Inventors").exists? => true You should take a look at http://w3schools.com/html/default.asp, it is good html tutorial. -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061204/8898624c/attachment.html From niegq at nec-as.nec.com.cn Mon Dec 4 05:51:25 2006 From: niegq at nec-as.nec.com.cn (Nie Guoqiang) Date: Mon, 04 Dec 2006 18:51:25 +0800 Subject: [Wtr-general] Selecting Links In-Reply-To: <47751265.1165222850925.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <47751265.1165222850925.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <20061204185024.11A5.NIEGQ@nec-as.nec.com.cn> Yes You can access this links by index. Please refer to ie.show_links() > Hello All, > > I have a form which has the following layout > [u]Link1[/u] Button > [u]Link2[/u] Button > [u]Link3[/u] Button > > I want to be able to use WATIR to click the button beside [u]Link2[/u], my thinking is that I want to get the index of the link containing text "Link2" and then use this value to - Button(:index, linkIndex).click > > Is it possible to return the index of the link? > > Thanks, > > PMF. > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5594&messageID=15602#15602 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From sikander at marlabs.com Mon Dec 4 07:57:26 2006 From: sikander at marlabs.com (sikander) Date: Mon, 4 Dec 2006 18:27:26 +0530 Subject: [Wtr-general] Paramerization in Ruby Message-ID: <007001c717a3$c02a6360$6520a8c0@caseshare.com> Hi All! Here is the my code, for which i need parameterization require 'watir' require 'win32ole' include Watir test_site = 'http://www.google.com' ie = IE.new ie.goto(test_site) ie.text_field(:name, "q").set("pickaxe") ie.button(:name, "btnG").click [Note: In QTP to parameterize the above value, we write the following code Browser("Google").Page("Google").WebEdit("q").Set DataTable("p_Text", dtGlobalSheet) Browser("Google").Page("Google").WebButton("Google Search").Click So can anybody replace the above code with ruby syntax? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061204/c9056ebe/attachment.html From zeljko.filipin at gmail.com Mon Dec 4 08:09:46 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 4 Dec 2006 14:09:46 +0100 Subject: [Wtr-general] ie.minimize broken in watir-1.5.1.1127 In-Reply-To: References: Message-ID: On 11/29/06, Charley Baker wrote: > > The errors from core_tests.rb should be fixed now. The latest xpath > test was getting in the way causing spurious errors. I've looked over > the changes and don't see anything inherently that would cause this > problem. I can't reproduce it personally and I'm stumped. Let me know > if you come up with any additional information. I'll keep poking > around. Charley, I have installed autoit, and now ie.minimize works. You should emphasize in release notes that autoit is required (or is it only in my case)?. I have build gem from the latest build and installed it and now all core tests pass. But, I still have the problem from WTR-108 (file_field.set not working). I do this irb(main):007:0> ie.file_field(:index, 1).set('c:\ruby\ChangeLog.txt') => nil and nothing happens. Really nothing. And all that I get back is nil (file field at that page and file exist). Am I doing something wrong? -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061204/330dfd38/attachment.html From mail at chriss-baumann.de Mon Dec 4 08:22:06 2006 From: mail at chriss-baumann.de (Christian Baumann) Date: Mon, 04 Dec 2006 14:22:06 +0100 Subject: [Wtr-general] Paramerization in Ruby In-Reply-To: <007001c717a3$c02a6360$6520a8c0@caseshare.com> References: <007001c717a3$c02a6360$6520a8c0@caseshare.com> Message-ID: <457420FE.90409@chriss-baumann.de> http://www.rubycentral.com/book/ sikander schrieb: > Hi All! > > Here is the my code, for which i need parameterization > require 'watir' > require 'win32ole' > > include Watir > > test_site = 'http://www.google.com' > ie = IE.new > ie.goto(test_site) > ie.text_field(:name, "q").set("pickaxe") > ie.button(:name, "btnG").click > [Note: In QTP to parameterize the above value, we write the > following code > Browser("Google").Page("Google").WebEdit("q").Set > DataTable("p_Text", dtGlobalSheet) > Browser("Google").Page("Google").WebButton("Google > Search").Click > > So can anybody replace the above code with ruby syntax? > > > ------------------------------------------------------------------------ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061204/24fb7c48/attachment.html From herr.kreutzer at googlemail.com Mon Dec 4 08:30:28 2006 From: herr.kreutzer at googlemail.com (Christian Kreutzer) Date: Mon, 4 Dec 2006 14:30:28 +0100 Subject: [Wtr-general] Paramerization in Ruby In-Reply-To: <007001c717a3$c02a6360$6520a8c0@caseshare.com> References: <007001c717a3$c02a6360$6520a8c0@caseshare.com> Message-ID: Hi Sikander, Google should be your friend on the search for some good ruby tutorials. The archive of this mailing list has always been a good resource for me. Christian On 12/4/06, sikander wrote: > > > > Hi All! > > Here is the my code, for which i need parameterization > require 'watir' > require 'win32ole' > > include Watir > > test_site = 'http://www.google.com' > ie = IE.new > ie.goto(test_site) > > ie.text_field(:name, "q").set("pickaxe") > ie.button(:name, "btnG").click > > [Note: In QTP to parameterize the above value, we write the following code > Browser("Google").Page("Google").WebEdit("q").Set > DataTable("p_Text", dtGlobalSheet) > Browser("Google").Page("Google").WebButton("Google > Search").Click > > So can anybody replace the above code with ruby syntax? > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From dave.hoover at gmail.com Mon Dec 4 08:45:56 2006 From: dave.hoover at gmail.com (Dave Hoover) Date: Mon, 4 Dec 2006 07:45:56 -0600 Subject: [Wtr-general] SafariWatir 0.2.0 Message-ID: <11c8704e0612040545w2ea59152q5c3db37e4211c686@mail.gmail.com> SafariWatir (http://safariwatir.rubyforge.org/) has been updated to use the rb-appscript project (http://rb-appscript.rubyforge.org/) rather than depending on AppleScript to do it's dirty work. This has improved performance dramatically. You can watch SafariWatir executing its test suite in this screencast: http://safariwatir.rubyforge.org/safariwatir_script_0.2.0.mov Here's the test suite source: http://rubyforge.org/viewvc/trunk/safariwatir_script.rb?revision=25&root=safariwatir&view=markup Dave Hoover http://redsquirrel.com/dave/ http://obtiva.com/ From forum-watir-users at openqa.org Mon Dec 4 10:18:08 2006 From: forum-watir-users at openqa.org (Nathan) Date: Mon, 04 Dec 2006 09:18:08 CST Subject: [Wtr-general] I want to use Watir to test Firefox and Safari In-Reply-To: Message-ID: <55243675.1165245567020.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hey Angrez, The problems I experienced were resolved on my own part. First of all the install javascript that you provided in your jsss.xpi.zip file doesn't work on my system, for whatever reason. Also in your installation document you describe installing the jssh.xpi through the Firefox extension installer, but because the plugin isn't in xpi format, it is not installable this way or something else is wrong. I tried dragging the zip over and nothing. Just wanted to let you know. I resolved the problems by unzipping the file and dragging the chrome and other folder (can't remember at the moment what it was called) into my installation directory, and Firewatir works fine. It fails on one unittest but I bet you knew that. Anyway we are now looking into both firewatir and selenium rc. Both provide good solutions for what we want. It will take some time for us to refactor our code to work with either of them as we utilize native ole methods in many cases to control things like sizing the browser, positioning the browser, and getting its hwnd. Thanks for the link. Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5549&messageID=15614#15614 From forum-watir-users at openqa.org Mon Dec 4 11:32:24 2006 From: forum-watir-users at openqa.org (George) Date: Mon, 04 Dec 2006 10:32:24 CST Subject: [Wtr-general] I want to use Watir to test Firefox and Safari In-Reply-To: <55243675.1165245567020.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <55876853.1165250065989.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> >> Also in your installation document you describe installing the jssh.xpi through the Firefox extension installer, but because the plugin isn't in xpi format, it is not installable this way or something else is wrong. I've just installed Firewatir on two XP systems, following the instructions in the installation doc, and both worked fine - except that the unit tests didn't complete. This is the error: 1) Failure: test_simply_attach_to_new_window(TC_NewWindow) [./unittests/attach_to_new_window_test.rb:17]: is not true. 127 tests, 699 assertions, 1 failures, 0 errors By the way, has anyone looked into doing an Operawatir? George --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5549&messageID=15616#15616 From forum-watir-users at openqa.org Mon Dec 4 12:38:17 2006 From: forum-watir-users at openqa.org (Jim Colo) Date: Mon, 04 Dec 2006 11:38:17 CST Subject: [Wtr-general] Problems running any Watir tests Message-ID: <60085481.1165253937584.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I have Ruby (185-21.exe) and Watir (1.4.1.exe) installed. Unsure of the installation order but Watir was probably installed first. No tests are running. Example: C:\watir\unittests>all_tests.rb c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from C:/watir/unittests/../unittests/setup.rb:4 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' from C:/watir/unittests/all_tests.rb:4 Questions: - Do I need to run "gem install watir"? - Should I uninstall all and reinstall Ruby first? Thanks! --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5603&messageID=15621#15621 From ajahns at gmail.com Mon Dec 4 15:25:40 2006 From: ajahns at gmail.com (Alan Jahns) Date: Mon, 4 Dec 2006 12:25:40 -0800 Subject: [Wtr-general] Set focus to original window In-Reply-To: <4570F7B5.70700@tejasconsulting.com> References: <11ab23860612011816w615c0df1l90de8cfdc2a62774@mail.gmail.com> <4570F7B5.70700@tejasconsulting.com> Message-ID: <11ab23860612041225v7526f3f6g1997cfd21f660698@mail.gmail.com> I tried it at first with "ie" for both but then relized that mistake and changed it to "ie2" for the new window. Do I have to I have to use attach to shift focus back to the first window? Could it be that since after submitting the log in credentials the 2nd window closes and the first window takes a few secs to reload? Here is the script, its small so I think its ok to put it up here: ie1 = Watir::IE.new ie1.goto(test_site) ie1.link(:text, "Sign in").click #this click causes the new window to come up # logging in to new pop up window ie2 = Watir::IE.attach(:url, 'http://www.*******.com/check?signin=true') ie2.text_field(:index, 2).set("funkenstein") ie2.text_field(:index, 3).set("1212") ie2.checkbox(:name, "savepassword").clear ie2.button(:value, "Sign In").click NOTE: script just goes to the ELSE statement without giving the first page a chance to reload and display login verification #verify user is signed in if ie1.contains_text("You are signed in as") puts "Test PASSED. Found the test string: You are signed in as" else puts "Test FAILED! Could not find: 'You are signed in as'" end Thanks, Alan Jahns On 12/1/06, Danny Faught wrote: > > Alan Jahns wrote: > > I have some simple if/else statements to check > > if some text strings are on the original window, but it seems that it no > > longer sees the original window. How would I make watir switch focus > back? > > One likely mistake is to use the same variable, like "ie", for both the > parent and the child window. Make sure to use separate variables for > each window that you want to keep track of. > > -Danny > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061204/078e627c/attachment.html From faught at tejasconsulting.com Mon Dec 4 15:43:27 2006 From: faught at tejasconsulting.com (Danny R. Faught) Date: Mon, 04 Dec 2006 14:43:27 -0600 Subject: [Wtr-general] Set focus to original window In-Reply-To: <11ab23860612041225v7526f3f6g1997cfd21f660698@mail.gmail.com> Message-ID: On 12/4/2006, "Alan Jahns" wrote: >Could it be that since after submitting the log in credentials the 2nd >window closes and the first window takes a few secs to reload? Yes, I think that's probably the problem - your code has a race condition. There is a wait function that you normally don't have to call directly, because after an action that you'd want to wait for it to finish, Watir calls it for you. But in this case, since you have one window causing a change in another window, you'd have to take care of the synchronization yourself. Even if you wait until the page finished loading, there's still a race condition, because there's a chance (probably a small one) that you'd call wait before the first page even begins to reload, and the wait would return immediately because it's not loading anything yet. So in addition to the wait, I would recommend putting your "You are signed in as" test in a loop, so it tries several times over the course of several seconds before giving up. I'm not a seasoned Watir developer yet, but hopefully I've hit on the issue here. By the way, I don't think that "focus" is what you're looking for. Unlike many GUI test tools, in many cases IE doesn't actually need focus or to be in the foreground in order for Watir to work. I'd imagine that focus would be something you'd have to worry about if you use Watir's generic GUI automation, though. -Danny From ajahns at gmail.com Mon Dec 4 16:10:13 2006 From: ajahns at gmail.com (Alan Jahns) Date: Mon, 4 Dec 2006 13:10:13 -0800 Subject: [Wtr-general] Set focus to original window In-Reply-To: References: <11ab23860612041225v7526f3f6g1997cfd21f660698@mail.gmail.com> Message-ID: <11ab23860612041310j565eb334ne8afb1f60dc3d32e@mail.gmail.com> Well thanks a lot, you led me to the fix. It does seem to be a timing problem, I started googling to figure out how to do a loop as you suggested and while doing that found the sleep command, so I tried something like: ie2.button(:value, "Sign In").click # take a nap to wait for first page to load sleep(25) and that did the trick, I've added a check to verify the username on the parent page and it picks it up. I'll continue to look for a more robust solution but this will have the script working in the meantime. Thanks! Alan Jahns On 12/4/06, Danny R. Faught wrote: > > On 12/4/2006, "Alan Jahns" wrote: > >Could it be that since after submitting the log in credentials the 2nd > >window closes and the first window takes a few secs to reload? > > Yes, I think that's probably the problem - your code has a race > condition. There is a wait function that you normally don't have to > call directly, because after an action that you'd want to wait for it > to finish, Watir calls it for you. But in this case, since you have one > window causing a change in another window, you'd have to take care of > the synchronization yourself. > > Even if you wait until the page finished loading, there's still a race > condition, because there's a chance (probably a small one) that you'd > call wait before the first page even begins to reload, and the wait > would return immediately because it's not loading anything yet. So in > addition to the wait, I would recommend putting your "You are signed in > as" test in a loop, so it tries several times over the course of > several seconds before giving up. > > I'm not a seasoned Watir developer yet, but hopefully I've hit on the > issue here. By the way, I don't think that "focus" is what you're > looking for. Unlike many GUI test tools, in many cases IE doesn't > actually need focus or to be in the foreground in order for Watir to > work. I'd imagine that focus would be something you'd have to worry > about if you use Watir's generic GUI automation, though. > > -Danny > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061204/cd173114/attachment.html From faught at tejasconsulting.com Mon Dec 4 16:39:09 2006 From: faught at tejasconsulting.com (Danny R. Faught) Date: Mon, 04 Dec 2006 15:39:09 -0600 Subject: [Wtr-general] Set focus to original window In-Reply-To: <11ab23860612041310j565eb334ne8afb1f60dc3d32e@mail.gmail.com> Message-ID: On 12/4/2006, "Alan Jahns" wrote: >Well thanks a lot, you led me to the fix. It does seem to be a timing >problem, I started googling to figure out how to do a loop as you suggested >and while doing that found the sleep command, so I tried something like: > >ie2.button(:value, "Sign In").click > # take a nap to wait for first page to load > sleep(25) I was hoping you wouldn't find that. :-) The hacker in me wants to point out that using sleeps to synchronize are both too slow and still don't technically remove the race condition. But the engineer in me says, hey, great, that will probably work in most or all of the cases you need it for, and the slower it is, the more likely it'll work. You pick which one you want to listen to. :-) Here's pseudocode for how I would approach it - ..child window initiates content change in parent window found = 0 for i in 1..10 ie.wait if desired content found in parent found = 1 break end end if found == 1 hurrah! -Danny From faught at tejasconsulting.com Mon Dec 4 17:33:23 2006 From: faught at tejasconsulting.com (Danny R. Faught) Date: Mon, 04 Dec 2006 16:33:23 -0600 Subject: [Wtr-general] Checking whether images inside a table are enabled or disabled In-Reply-To: <55115819.1165213684310.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 12/4/2006, "vijay" wrote: >T...While entering into our application, all links, other than "Instructions" and "Step 1. Details", should be disabled. ... I want to verify this with Watir. I am at a loss about how to do that. I would recommend looping through ie.links (or the appropriate frame) and making sure that nothing appears that's supposed to be disabled, by matching on the link text, e.g. match using /Step [2-6]/ etc. -Danny From ajahns at gmail.com Mon Dec 4 17:39:50 2006 From: ajahns at gmail.com (Alan Jahns) Date: Mon, 4 Dec 2006 14:39:50 -0800 Subject: [Wtr-general] Set focus to original window In-Reply-To: References: <11ab23860612041310j565eb334ne8afb1f60dc3d32e@mail.gmail.com> Message-ID: <11ab23860612041439t380d461ch4cba77af3930d667@mail.gmail.com> Thanks for the outline in the pseudocode, I do want to do something better than just make it sleep, its one of those hurry up and get it to work right now so bosses are happy, then make it work better afterwards kind of situations. Alan On 12/4/06, Danny R. Faught wrote: > > On 12/4/2006, "Alan Jahns" wrote: > >Well thanks a lot, you led me to the fix. It does seem to be a timing > >problem, I started googling to figure out how to do a loop as you > suggested > >and while doing that found the sleep command, so I tried something like: > > > >ie2.button(:value, "Sign In").click > > # take a nap to wait for first page to load > > sleep(25) > > I was hoping you wouldn't find that. :-) The hacker in me wants to > point out that using sleeps to synchronize are both too slow and still > don't technically remove the race condition. > > But the engineer in me says, hey, great, that will probably work in most > or all of the cases you need it for, and the slower it is, the more > likely it'll work. > > You pick which one you want to listen to. :-) Here's pseudocode for > how I would approach it - > > ..child window initiates content change in parent window > found = 0 > for i in 1..10 > ie.wait > if desired content found in parent > found = 1 > break > end > end > if found == 1 > hurrah! > > -Danny > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061204/d04844d8/attachment-0001.html From charley.baker at gmail.com Mon Dec 4 17:53:11 2006 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 4 Dec 2006 15:53:11 -0700 Subject: [Wtr-general] Checking whether images inside a table are enabled or disabled In-Reply-To: References: <55115819.1165213684310.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: You can also take a look at the user contributions for a way to extend Watir, this method checks for visibility: http://wiki.openqa.org/pages/viewpage.action?pageId=1119 -Charley On 12/4/06, Danny R. Faught wrote: > > On 12/4/2006, "vijay" wrote: > >T...While entering into our application, all links, other than > "Instructions" and "Step 1. Details", should be disabled. ... I want to > verify this with Watir. I am at a loss about how to do that. > > I would recommend looping through ie.links (or the appropriate frame) and > making sure that nothing appears that's supposed to be disabled, by > matching on the link text, e.g. match using /Step [2-6]/ etc. > > -Danny > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061204/fb3c11b4/attachment.html From paul.rogers at shaw.ca Mon Dec 4 17:58:15 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 04 Dec 2006 15:58:15 -0700 Subject: [Wtr-general] Checking whether images inside a table are enabled or disabled In-Reply-To: References: <55115819.1165213684310.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: but are they really disabled links, or just text that happens to look like a link to maintain the appearance of the page? -------------- next part -------------- You can also take a look at the user contributions for a way to extend Watir, this method checks for visibility: http://wiki.openqa.org/pages/viewpage.action?pageId=1119 -Charley On 12/4/06, Danny R. Faught wrote: > > On 12/4/2006, "vijay" wrote: > >T...While entering into our application, all links, other than > "Instructions" and "Step 1. Details", should be disabled. ... I want to > verify this with Watir. I am at a loss about how to do that. > > I would recommend looping through ie.links (or the appropriate frame) and > making sure that nothing appears that's supposed to be disabled, by > matching on the link text, e.g. match using /Step [2-6]/ etc. > > -Danny > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061204/15cc3d18/attachment.html -------------- next part -------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From forum-watir-users at openqa.org Mon Dec 4 19:34:57 2006 From: forum-watir-users at openqa.org (Jim Colo) Date: Mon, 04 Dec 2006 18:34:57 CST Subject: [Wtr-general] Problems running any Watir tests In-Reply-To: <60085481.1165253937584.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <45250050.1165278927141.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Run: gem install watir --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5603&messageID=15641#15641 From angrez at gmail.com Tue Dec 5 00:27:21 2006 From: angrez at gmail.com (Angrez Singh) Date: Tue, 5 Dec 2006 10:57:21 +0530 Subject: [Wtr-general] I want to use Watir to test Firefox and Safari In-Reply-To: <55876853.1165250065989.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <55243675.1165245567020.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <55876853.1165250065989.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi George, The error that you are facing is because Firefox is not opening a new window; instead its opening a new tab. Or Firefox is blocking the pop up. Run the test alone and you'll be able to find out the cause. Will document this thing so that people do this before running the test cases. Your comments/suggestions will be really appreciated. Regards, Angrez On 12/4/06, George wrote: > > >> Also in your installation document you describe installing the jssh.xpithrough the Firefox extension installer, but because the plugin isn't in xpi > format, it is not installable this way or something else is wrong. > > I've just installed Firewatir on two XP systems, following the > instructions in the installation doc, and both worked fine - except that the > unit tests didn't complete. This is the error: > > 1) Failure: > test_simply_attach_to_new_window(TC_NewWindow) > [./unittests/attach_to_new_window_test.rb:17]: > is not true. > > 127 tests, 699 assertions, 1 failures, 0 errors > > By the way, has anyone looked into doing an Operawatir? > > George > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5549&messageID=15616#15616 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061205/d9ccab4e/attachment.html From angrez at gmail.com Tue Dec 5 00:34:44 2006 From: angrez at gmail.com (Angrez Singh) Date: Tue, 5 Dec 2006 11:04:44 +0530 Subject: [Wtr-general] I want to use Watir to test Firefox and Safari In-Reply-To: <55243675.1165245567020.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <55243675.1165245567020.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Nathan, If you have downloaded the xpi from http://people.mozilla.com/~davel/jssh/then it would save it as .zip you need to manually change the extension to .xpi and then follow the installation instructions for XPI. If you have downloaded from http://code.google.com/p/firewatir/trunk/Installation/JSShxpi/ then it shouldn't be a problem. I'll document this also. Are there any other problems that you are facing Firewatir? Your feedback/suggestions are welcomed. Regards, Angrez On 12/4/06, Nathan wrote: > > Hey Angrez, > > The problems I experienced were resolved on my own part. First of all the > install javascript that you provided in your jsss.xpi.zip file doesn't > work on my system, for whatever reason. Also in your installation document > you describe installing the jssh.xpi through the Firefox extension > installer, but because the plugin isn't in xpi format, it is not installable > this way or something else is wrong. I tried dragging the zip over and > nothing. Just wanted to let you know. I resolved the problems by unzipping > the file and dragging the chrome and other folder (can't remember at the > moment what it was called) into my installation directory, and Firewatir > works fine. It fails on one unittest but I bet you knew that. Anyway we > are now looking into both firewatir and selenium rc. Both provide good > solutions for what we want. It will take some time for us to refactor our > code to work with either of them as we utilize native ole methods in many > cases to control things like sizin > g the browser, positioning the browser, and getting its hwnd. Thanks for > the link. > > Nathan > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5549&messageID=15614#15614 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061205/e3790abe/attachment.html From zeljko.filipin at gmail.com Tue Dec 5 02:15:43 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 5 Dec 2006 08:15:43 +0100 Subject: [Wtr-general] Problems running any Watir tests In-Reply-To: <60085481.1165253937584.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <60085481.1165253937584.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 12/4/06, Jim Colo wrote: > > - Do I need to run "gem install watir"? > - Should I uninstall all and reinstall Ruby first? Yes, reinstall ruby and then type "gem install watir" in command prompt. -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061205/83d561d4/attachment.html From forum-watir-users at openqa.org Tue Dec 5 03:12:19 2006 From: forum-watir-users at openqa.org (Ankur Gupta) Date: Tue, 05 Dec 2006 02:12:19 CST Subject: [Wtr-general] Click on a pixel location Message-ID: <43344480.1165306369578.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Using watir is it possible to click on a location that can be specified with x and y coordinate (pixels) I am trying to automate JD Edwards screens using Watir, i am stuck at a portion where the object is not being identified. The textbox which i have to type also cant be reached by using Keyboard Tab. Any other workarounds? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5614&messageID=15651#15651 From forum-watir-users at openqa.org Tue Dec 5 04:36:50 2006 From: forum-watir-users at openqa.org (George) Date: Tue, 05 Dec 2006 03:36:50 CST Subject: [Wtr-general] I want to use Watir to test Firefox and Safari In-Reply-To: Message-ID: <43817165.1165311440382.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> >> Or Firefox is blocking the pop up. Thanks Angrez, that was my problem. All the tests pass now. George --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5549&messageID=15657#15657 From forum-watir-users at openqa.org Tue Dec 5 06:40:34 2006 From: forum-watir-users at openqa.org (Fletch) Date: Tue, 05 Dec 2006 05:40:34 CST Subject: [Wtr-general] Excel Or Text File? Message-ID: <47102279.1165318864440.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello Again, I have currently got a WATIR Script running, and use a text file to hold all the constants. However I have had a request to change this text file to a Spreadsheet - does it make sense to use a spreadsheet to hold all the constants? From what I have seen, I would have to call the cell directly, rather than being able to give the field a proper and relevant name. Thanks for any advice you can give me, PMF. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5619&messageID=15669#15669 From forum-watir-users at openqa.org Tue Dec 5 09:34:50 2006 From: forum-watir-users at openqa.org (vijay) Date: Tue, 05 Dec 2006 08:34:50 CST Subject: [Wtr-general] "abnormal program termination" error message while playing back a script In-Reply-To: Message-ID: <41033281.1165329320743.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks Charley for your info. Now I have installed Ruby 1.82 (from the RubyForge site) after uninstalling Ruby 1.85. But now I am unable to install a watir gem. With Ruby 1.85, I would go to the directory where the gem (say 1.5.1.1127) was downloaded and type "gem install watir-1[1].5.1.1127.gem" (watir-1[1].5.1.1127.gem is the name of the gem file) to install the gem. But now, when I try to install the 1127 gem in the same way, I get an error message saying, "watir-1[1].5.1.1127.gem". Is this not the way that a watir gem should be installed over Ruby 1.82? Can you guide me on how to install 1127 gem over Ruby 1.82? Many thanks, Vijay. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5509&messageID=15673#15673 From zeljko.filipin at gmail.com Tue Dec 5 10:08:33 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Tue, 5 Dec 2006 16:08:33 +0100 Subject: [Wtr-general] "abnormal program termination" error message while playing back a script In-Reply-To: <41033281.1165329320743.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <41033281.1165329320743.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 12/5/06, vijay wrote: > > Can you guide me on how to install 1127 gem over Ruby 1.82? > Download watir gem to any folder. Open command prompt and go to that folder. Type gem install watir Make sure that gem name is watir-1.5.1.1127.gem (not watir-1[1].5.1.1127.gem). -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061205/3572a569/attachment.html From charley.baker at gmail.com Tue Dec 5 10:53:13 2006 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 5 Dec 2006 08:53:13 -0700 Subject: [Wtr-general] Excel Or Text File? In-Reply-To: <47102279.1165318864440.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <47102279.1165318864440.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Here's an excellent page on scripting Excel through Ruby: http://wiki.rubygarden.org/Ruby/page/show/ScriptingExcel You could have a column with your constants and the next column over be the values and iterate through the rows assigning those to a constant Hash or something of the sort. There are a variety of ways to set up your constants, you really shouldn't be losing any flexibility, it might just be a matter of reorganizing. -Charley On 12/5/06, Fletch wrote: > > Hello Again, > > I have currently got a WATIR Script running, and use a text file to hold > all the constants. > However I have had a request to change this text file to a Spreadsheet - > does it make sense to use a spreadsheet to hold all the constants? From what > I have seen, I would have to call the cell directly, rather than being able > to give the field a proper and relevant name. > > Thanks for any advice you can give me, > > PMF. > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5619&messageID=15669#15669 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061205/2b044d7b/attachment.html From faught at tejasconsulting.com Tue Dec 5 11:40:36 2006 From: faught at tejasconsulting.com (Danny R. Faught) Date: Tue, 05 Dec 2006 10:40:36 -0600 Subject: [Wtr-general] "abnormal program termination" error message while playing back a script In-Reply-To: <41033281.1165329320743.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 12/5/2006, "vijay" wrote: >Thanks Charley for your info. Now I have installed Ruby 1.82 (from the RubyForge site) after uninstalling Ruby 1.85. Thanks from me too. I'm now running Watir with Ruby 1.8.2 on XP Embedded, and showing how much slower this supposed "thin client" application is on slow hardware. :-) Who needs a load test tool when a single user already can't get good performance. -Danny From lisa.crispin at gmail.com Tue Dec 5 15:58:25 2006 From: lisa.crispin at gmail.com (Lisa Crispin) Date: Tue, 5 Dec 2006 13:58:25 -0700 Subject: [Wtr-general] Windows Vista / IE 7 "RPC Server is Unavailable" Message-ID: <63915d6a0612051258j464b2154t2909af171b812f79@mail.gmail.com> Hi, I've searched the mailing list for this error but I'm not finding much that helps me. Admittedly, I am over my head with this. We have customers using IE7 so we'd like to run Watir tests on IE7. We set up a machine with Windows Vista and IE7 (Why Windows Vista? Just because it was there, I guess). I installed Ruby 1.8.5 with the one click installer and used gem to install Watir 1.4.1. I can attach to an IE window fine with irb and click buttons and so on in irb. However, the scripts fail with errors like the ones below. They invoke the site URL fine, but then another window seems to be trying to open, just hanging. When I close it, I get the errors below. We tried turning off the tabs in IE7, that didn't help. I tried some troubleshooting I found for older versions of windows with the RPC Server error but nothing helps. I can manually use the app just fine from this machine with IE7. We have other Windows machines set up the same way as this one network-wise but they are XP. Is anyone else using Windows Vista? The only problem I've seen on this mailing list for IE7 is the modal dialog popup title being different. We are not getting anywhere close to our modal dialog popups! The scripts can't seem to click anything once they invoke the site (although I can do it with irb). Thanks Lisa EE Finished in 84.735 seconds. 1) Error: test_login(TC_Login): WIN32OLERuntimeError: unknown property or method `document' HRESULT error code:0x800706ba The RPC server is unavailable. c:/ruby/lib/ruby/gems/1.8/gems/watir- 1.4.1/./watir.rb:1336:in `method_missin g' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1336:in `document' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:899:in `getLink' c:/ruby/lib/ruby/gems/1.8/gems/watir- 1.4.1/./watir.rb:2830:in `initialize' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:570:in `new' c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:570:in `link' C:/Java/workspace/eplan/src/watir/scripts/simple/Login/../../../lib/Login/lo gin.rb:56:in `login' C:/Java/workspace/eplan/src/watir/scripts/simple/Login/../../../lib/Login/lo gin.rb:78:in `fast401k_login' C:/Java/workspace/eplan/src/watir/scripts/simple/Login/tc_login.rb:109:in `t est_login' 2) Error: test_login(TC_Login): WIN32OLERuntimeError: unknown property or method `hWnd' HRESULT error code:0x800706ba The RPC server is unavailable. C:/Java/workspace/eplan/src/watir/scripts/simple/Login/../../../lib/Utility/ ie_tools.rb:10:in `method_missing' C:/Java/workspace/eplan/src/watir/scripts/simple/Login/../../../lib/Utility/ ie_tools.rb:10:in `stop_ie' C:/Java/workspace/eplan/src/watir/scripts/simple/Login/tc_login.rb:115:in `t eardown' 1 tests, 0 assertions, 0 failures, 2 errors -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061205/f1202a47/attachment.html From forum-watir-users at openqa.org Tue Dec 5 16:06:01 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Tue, 05 Dec 2006 15:06:01 CST Subject: [Wtr-general] Excel Or Text File? In-Reply-To: <47102279.1165318864440.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <36169008.1165352791358.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> If these are just a couple of simple constants why not make it a ruby file? require a file somewhere in your scripts and do something like $name = 'name' $password = 'password' $url = 'url' its easy to figure out, and no need to parse anything. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5619&messageID=15692#15692 From forum-watir-users at openqa.org Wed Dec 6 04:11:47 2006 From: forum-watir-users at openqa.org (san) Date: Wed, 06 Dec 2006 03:11:47 CST Subject: [Wtr-general] Can Watir Open Pages Containing Only PDF Link? Message-ID: <48680086.1165396337443.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I Tried This.... ie = Watir::IE.start('http://www.surgeongeneral.gov/tobacco/smconsumr.pdf') But Adobe Reader v8 Pops Up And Says "You Can't View PDF File In A web Browser" or Something Like That. So Is There Any Solution To Open These Links & Save The PDF? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5633&messageID=15706#15706 From forum-watir-users at openqa.org Wed Dec 6 06:14:28 2006 From: forum-watir-users at openqa.org (san) Date: Wed, 06 Dec 2006 05:14:28 CST Subject: [Wtr-general] How To Manage Cookies? Message-ID: <63370846.1165403698960.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Well I Don't Know How To Access Cookies In Watir, Searched A Lot But No Result... Can Someone Help Me With Some Codes To Access & Fetch Informations Within Cookies, Such As The URL, Name etc Of The Cookie... Is There Any Kind Of Tutorial? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5635&messageID=15709#15709 From forum-watir-users at openqa.org Wed Dec 6 06:21:58 2006 From: forum-watir-users at openqa.org (Dhamodharan) Date: Wed, 06 Dec 2006 05:21:58 CST Subject: [Wtr-general] Can anyone solve this problem..??????? Message-ID: <46166959.1165404148397.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> # you were trying to use an undefined local variable in your test method # here is an example that uses an instance variable for IE # the test runs, but fails -- I don't know what you are looking for :-) require 'watir' require 'test/unit' require 'test/unit/ui/console/testrunner' require 'watir/testUnitAddons' class TC_Fields < Test::Unit::TestCase include Watir def setup puts "Set URL variable" test_site = 'http://www.yahoo.com' puts "Start New Browser" @ie = IE.new puts "Setup: go to the test site: " + test_site @ie.goto(test_site) #puts "Assertion Test in Position A" #assert(@ie.text_field(:id, "v1").exists?) end def test1 puts "Assertion Test in Position B" assert(@ie.text_field(:id, "v1").exists?) end end ------------------------------------------------------------------------------ Hi i got thi error .. Can anyone solve this .. Loaded suite C:/Apps/PowerSeller Test Scripts/carl_textfields_test Started Set URL variable Start New Browser Setup: go to the test site: http://www.yahoo.com Assertion Test in Position B E Finished in 1.082 seconds. 1) Error: test1(TC_Fields): NameError: undefined local variable or method `ie' for # C:/Apps/PowerSeller Test Scripts/carl_textfields_test.rb:33:in `test1' 1 tests, 0 assertions, 0 failures, 1 errors My gut is telling me it is something with my development environment. If someone has a moment please copy and execute this script in your environment. thanks and regards , M.Dhamodharan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5636&messageID=15712#15712 From mail at chriss-baumann.de Wed Dec 6 06:35:31 2006 From: mail at chriss-baumann.de (Christian Baumann) Date: Wed, 06 Dec 2006 12:35:31 +0100 Subject: [Wtr-general] How To Manage Cookies? In-Reply-To: <63370846.1165403698960.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <63370846.1165403698960.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4576AB03.3030204@chriss-baumann.de> Hello san, maybe the "cookie manager" mentioned here may help You: http://www.mail-archive.com/wtr-general at rubyforge.org/msg05595.html Other suggestion: Cookies are simple textfiles, why don?t You handle them with the normal ruby-functionalities? Regards, Christian san schrieb: > Well I Don't Know How To Access Cookies In Watir, Searched A Lot But No Result... Can Someone Help Me With Some Codes To Access & Fetch Informations Within Cookies, Such As The URL, Name etc Of The Cookie... Is There Any Kind Of Tutorial? > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5635&messageID=15709#15709 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From forum-watir-users at openqa.org Wed Dec 6 06:42:33 2006 From: forum-watir-users at openqa.org (san) Date: Wed, 06 Dec 2006 05:42:33 CST Subject: [Wtr-general] Can Watir Open Pages Containing Only PDF Link? In-Reply-To: <48680086.1165396337443.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <63395010.1165405383384.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Ooooops My Mistake... Adobe Was Not Properly Installed...Sorry. :) --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5633&messageID=15715#15715 From forum-watir-users at openqa.org Wed Dec 6 07:20:56 2006 From: forum-watir-users at openqa.org (vijay) Date: Wed, 06 Dec 2006 06:20:56 CST Subject: [Wtr-general] Error while calling a function in Watir 1.5 Message-ID: <60591876.1165407686457.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello people, I have written a small function to check for the presence or absence of a few values within a table. Sometimes, Watir executes the function properly and gives the intended output (telling whether those values are present or not). But, at times, it is throwing one of the following error messages (after giving a few lines of output): 1. "Ruby.exe has generated errors and will be closed by windows. You will need to restart the program" in a small window with a title "Program Error" 2. [Bug] Segmentation Fault 3. Abnormal Program Termination I am using Ruby 1.85 and Watir gem 1.5.1.1127. Previuosly, when I told about the first error in a different message, Charley Baker told me to use Ruby 1.82 instead of 1.85. Are all the three error messages caused due to Ruby 1.85 or there could be a problem with my code (the function is a straight-forward function with little complications)?. Also I am unable to install Watir gem 1.5.1.1127 over Ruby 1.82. After uninstalling Ruby 1.85 and installing Ruby 1.82, when I give the command, "gem install watir 1.5.1.1127.gem" or "gem install watir" in the command prompt, Windows is giving out an error message saying, "gem is not a recognizable command or a batch file" (the error message that comes when we type in a non-existant command in DOS). Does "gem" needs to be installed separately before using the command "gem install..."? I used to install Watir 1.5.1.1127 over Ruby 1.85 in the above-mentioned way and it perfectly installs the Watir gem. Please help me. Thanks, Vijay. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5638&messageID=15717#15717 From forum-watir-users at openqa.org Wed Dec 6 07:23:36 2006 From: forum-watir-users at openqa.org (vijay) Date: Wed, 06 Dec 2006 06:23:36 CST Subject: [Wtr-general] "abnormal program termination" error message while playing back a script In-Reply-To: Message-ID: <50937882.1165407846865.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I am still unable to install Watir gem 1.5.1.1127 over Ruby 1.82. After uninstalling Ruby 1.85 and installing Ruby 1.82, when I give the command, "gem install watir 1.5.1.1127.gem" or "gem install watir" in the folder where the watir gem was downloaded, Windows is giving out an error message saying, "gem is not a recognizable command or a batch file" (the error message that comes when we type in a non-existant command in DOS). Does "gem" needs to be installed separately before using the command "gem install..."? I used to install Watir 1.5.1.1127 over Ruby 1.85 in the above-mentioned way and it perfectly installs the Watir gem. Thanks, Vijay. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5509&messageID=15718#15718 From forum-watir-users at openqa.org Wed Dec 6 07:31:14 2006 From: forum-watir-users at openqa.org (Udo Fröhling) Date: Wed, 06 Dec 2006 06:31:14 CST Subject: [Wtr-general] Error while calling a function in Watir 1.5 In-Reply-To: <60591876.1165407686457.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <56997883.1165408304940.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> > Previuosly, when I told about the first error in a > different message, Charley Baker told me to use Ruby > 1.82 instead of 1.85. I agree with that, my segementation faults are gone since i downdated to 1.82 Udo --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5638&messageID=15720#15720 From forum-watir-users at openqa.org Wed Dec 6 08:08:01 2006 From: forum-watir-users at openqa.org (vijay) Date: Wed, 06 Dec 2006 07:08:01 CST Subject: [Wtr-general] Error while calling a function in Watir 1.5 In-Reply-To: <56997883.1165408304940.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <45625459.1165410511153.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Good to hear it. But do you know how to install Watir 1.5.1.1127.gem over Ruby 1.82. When I give the command "gem install Watir-1.5.1.1127" in the folder where the gem was downloaded to, Windows says "gem is not a recognizable command or a batch file" (the error message that comes when a wrong command is keyed in DOS) Thanks, Vijay --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5638&messageID=15722#15722 From esjewett at gmail.com Wed Dec 6 09:11:24 2006 From: esjewett at gmail.com (Ethan Jewett) Date: Wed, 6 Dec 2006 08:11:24 -0600 Subject: [Wtr-general] "abnormal program termination" error message while playing back a script In-Reply-To: <50937882.1165407846865.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <50937882.1165407846865.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <68f4a0e80612060611k2b1ffc08je5f4913629f234e1@mail.gmail.com> Vijay, Gem should be in whatever folder Ruby is in. It sounds like the ruby/bin/ folder is not in your path. At the command prompt, you can't run "gem" or "ruby -h". Can you run these commands with their full paths, like "C:\ruby\bin\gem"? Ethan On 12/6/06, vijay wrote: > I am still unable to install Watir gem 1.5.1.1127 over Ruby 1.82. After uninstalling Ruby 1.85 and installing Ruby 1.82, when I give the command, "gem install watir 1.5.1.1127.gem" or "gem install watir" in the folder where the watir gem was downloaded, Windows is giving out an error message saying, "gem is not a recognizable command or a batch file" (the error message that comes when we type in a non-existant command in DOS). Does "gem" needs to be installed separately before using the command "gem install..."? I used to install Watir 1.5.1.1127 over Ruby 1.85 in the above-mentioned way and it perfectly installs the Watir gem. > > Thanks, > Vijay. > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5509&messageID=15718#15718 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From faught at tejasconsulting.com Wed Dec 6 10:14:11 2006 From: faught at tejasconsulting.com (Danny Faught) Date: Wed, 06 Dec 2006 08:14:11 -0700 Subject: [Wtr-general] "abnormal program termination" error message while playing back a script In-Reply-To: <50937882.1165407846865.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <50937882.1165407846865.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4576DE43.5030507@tejasconsulting.com> vijay wrote: > I am still unable to install Watir gem 1.5.1.1127 over Ruby 1.82. After uninstalling Ruby 1.85 and installing Ruby 1.82, when I give the command, "gem install watir 1.5.1.1127.gem" or "gem install watir" in the folder where the watir gem was downloaded, Windows is giving out an error message saying, "gem is not a recognizable command or a batch file" (the error message that comes when we type in a non-existant command in DOS). The most common cause for this error is that c:\ruby\bin is not in your PATH environment variable. Try starting a new DOS shell, and that should pick up the environment that was set up by the latest Ruby install. You can also try typing the full path - c:\ruby\bin\gem if I remember correctly (I'm on Linux at the moment), or c:/ruby/bin/gem.bat under Cygwin. -Danny From forum-watir-users at openqa.org Wed Dec 6 10:08:43 2006 From: forum-watir-users at openqa.org (Nathan) Date: Wed, 06 Dec 2006 09:08:43 CST Subject: [Wtr-general] Can anyone solve this problem..??????? In-Reply-To: <46166959.1165404148397.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <59038162.1165417780781.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Yeah, the reason why you're having that error is that you have only defined @ie in your first method. That makes that a local instance to that method. Because of this, when you try and use it in your second method it returns nil or in your case 'undefined'. If you want to use the @ie variable globally then you might do one of two things. 1) Define the variable outside of your methods but inside of your class as a class variable or member that can be accessed by all of your methods, or 2) define @ie as a global variable (I'm not sure if you can keep the '@' part in this case) by calling it $ie. The $ tells Ruby to treat the variable like a global variable no matter where you define it. Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5636&messageID=15734#15734 From forum-watir-users at openqa.org Wed Dec 6 10:19:30 2006 From: forum-watir-users at openqa.org (vijay) Date: Wed, 06 Dec 2006 09:19:30 CST Subject: [Wtr-general] "abnormal program termination" error message while playing back a script In-Reply-To: <4576DE43.5030507@tejasconsulting.com> Message-ID: <56314063.1165418400226.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks everyone for your help. I put the watir gem in the 'C:\ruby\bin' folder and installed watir from there. Now the function, which used to throw a series of error messages like "Program error - ruby.exe has created problems, segmentation fault and abnormal program termination, seems to run properly and give the intended output. Thanks, once again. That was a great help. Vijay --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5509&messageID=15735#15735 From forum-watir-users at openqa.org Wed Dec 6 10:21:27 2006 From: forum-watir-users at openqa.org (vijay) Date: Wed, 06 Dec 2006 09:21:27 CST Subject: [Wtr-general] Error while calling a function in Watir 1.5 In-Reply-To: <45625459.1165410511153.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <40850461.1165418517814.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks Charley and Udof for your help. After installing Ruby 1.82, I put the watir gem in the 'C:\ruby\bin' folder and installed watir from there. Now the function, which used to throw a series of error messages like "Program error - ruby.exe has created problems, segmentation fault and abnormal program termination, seems to run properly and give the intended output. Thanks, once again. That was a great help. Vijay --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5638&messageID=15737#15737 From forum-watir-users at openqa.org Wed Dec 6 11:26:24 2006 From: forum-watir-users at openqa.org (Fletch) Date: Wed, 06 Dec 2006 10:26:24 CST Subject: [Wtr-general] Excel Or Text File? In-Reply-To: <36169008.1165352791358.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <37724181.1165422414352.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> That is what I have at the minute, but I am under pressure to use a Spreadsheet. I thought that the text file was a much better and more simple idea. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5619&messageID=15745#15745 From michael.a.bolton at gmail.com Wed Dec 6 11:38:41 2006 From: michael.a.bolton at gmail.com (Michael Bolton) Date: Wed, 6 Dec 2006 11:38:41 -0500 Subject: [Wtr-general] Excel Or Text File? In-Reply-To: <37724181.1165422414352.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <00c201c71954$fdc100a0$6501a8c0@Koko> Using a spreadsheet is pretty straightforward, especially for the simpler functions, if you use the link that Charley cited earlier. Fancy stuff requires a little more effort with the (very, very strange) Excel object model. I've found good hints on how to do this in VB books and by using the Object Browser (which you can get to via Excel's Tools/Macro/Edit, and then when you're in the VB editor, hitting F2). ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Fletch Sent: December 6, 2006 11:26 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Excel Or Text File? That is what I have at the minute, but I am under pressure to use a Spreadsheet. I thought that the text file was a much better and more simple idea. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5619&messageID=15745#15745 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From christopher.mcmahon at gmail.com Wed Dec 6 11:38:32 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 6 Dec 2006 08:38:32 -0800 Subject: [Wtr-general] Excel Or Text File? In-Reply-To: <37724181.1165422414352.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <36169008.1165352791358.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <37724181.1165422414352.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70612060838p6025507aj34954590182e7234@mail.gmail.com> On 12/6/06, Fletch wrote: > > That is what I have at the minute, but I am under pressure to use a > Spreadsheet. I thought that the text file was a much better and more simple > idea. There is a fair amount in the archives on this subject. My own opinion is to use a spreadsheet when: a) Stakeholders who are not in the code itself need to be made happy. This sounds like where you are right now. b) Data in the spreadsheet will be subject to substantial manipulation by non-programmers. c) Some feature of the spreadsheet software (i.e. macros) is important. Have you considered the possibility of a delimited file that can be manipulated by Excel? (I assume you're using Excel). A delimited file gives you a lot of the presentation goodness of Excel, but is still easier to program than a real Excel spreadsheet. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061206/ca7c2d0f/attachment.html From charley.baker at gmail.com Wed Dec 6 11:50:01 2006 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 6 Dec 2006 09:50:01 -0700 Subject: [Wtr-general] Excel Or Text File? In-Reply-To: <72799cd70612060838p6025507aj34954590182e7234@mail.gmail.com> References: <36169008.1165352791358.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <37724181.1165422414352.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <72799cd70612060838p6025507aj34954590182e7234@mail.gmail.com> Message-ID: Chris has some salient points. Another advantage of using a delimited file that you can use through Excel is version control. Using a delimited file makes it easier to diff and/or merge through Subversion or whatever your SCM tool might be as opposed to using an Excel file. -Charley On 12/6/06, Chris McMahon wrote: > > > > On 12/6/06, Fletch wrote: > > > > That is what I have at the minute, but I am under pressure to use a > > Spreadsheet. I thought that the text file was a much better and more simple > > idea. > > > There is a fair amount in the archives on this subject. > > My own opinion is to use a spreadsheet when: > > a) Stakeholders who are not in the code itself need to be made happy. > This sounds like where you are right now. > b) Data in the spreadsheet will be subject to substantial manipulation by > non-programmers. > c) Some feature of the spreadsheet software (i.e. macros) is important. > > Have you considered the possibility of a delimited file that can be > manipulated by Excel? (I assume you're using Excel). A delimited file > gives you a lot of the presentation goodness of Excel, but is still easier > to program than a real Excel spreadsheet. > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061206/2f34ed4e/attachment.html From faught at tejasconsulting.com Wed Dec 6 12:53:52 2006 From: faught at tejasconsulting.com (Danny Faught) Date: Wed, 06 Dec 2006 10:53:52 -0700 Subject: [Wtr-general] Excel Or Text File? In-Reply-To: <37724181.1165422414352.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <37724181.1165422414352.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <457703B0.2030702@tejasconsulting.com> Fletch wrote: > That is what I have at the minute, but I am under pressure to use a Spreadsheet. I thought that the text file was a much better and more simple idea. A comma-delimited (comma-separated-value / csv) file is a great compromise, as was mentioned earlier. A spreadsheet application can read and write it, and it's a text file that's simple to parse in Ruby. You won't get Excel features like functions and macros, but you will get a GUI interface for non-technical people to enter flat data. Your users will need to know that they need to save the files in .csv format, not .xls. -Danny From charley.baker at gmail.com Wed Dec 6 13:17:17 2006 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 6 Dec 2006 11:17:17 -0700 Subject: [Wtr-general] Click on a pixel location In-Reply-To: <43344480.1165306369578.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <43344480.1165306369578.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: There are many ways to access controls, does the textbox have any attributes? id, name, etc? If it does then you can use the standard set method: ie.text_field(:name, "username").set("admin") Are you getting errors accessing it? If so what errors? If the text field doesn't have any identifiable attributes, you can also use index: ie.text_field(:index, 3).set("admin") There may be a way to pixel click, but I wouldn't recommend it as it's subject to breaking pretty quickly. The above options should work. If not, post some of the html code and more information. -Charley On 12/5/06, Ankur Gupta wrote: > > Using watir is it possible to click on a location that can be specified > with x and y coordinate (pixels) > > I am trying to automate JD Edwards screens using Watir, i am stuck at a > portion where the object is not being identified. The textbox which i have > to type also cant be reached by using Keyboard Tab. > > Any other workarounds? > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5614&messageID=15651#15651 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061206/c3f40f80/attachment.html From forum-watir-users at openqa.org Wed Dec 6 13:45:59 2006 From: forum-watir-users at openqa.org (Ankur Gupta) Date: Wed, 06 Dec 2006 12:45:59 CST Subject: [Wtr-general] Click on a pixel location In-Reply-To: <43344480.1165306369578.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <44359413.1165430789804.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> pixel click is subject to break easily and not the recommended way, but that seems to me to be the only way to go in the situation i am stuck right now :-( --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5614&messageID=15765#15765 From mail at chriss-baumann.de Wed Dec 6 13:58:48 2006 From: mail at chriss-baumann.de (Christian Baumann) Date: Wed, 06 Dec 2006 19:58:48 +0100 Subject: [Wtr-general] Click on a pixel location In-Reply-To: <44359413.1165430789804.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <44359413.1165430789804.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <457712E8.5010003@chriss-baumann.de> Hi, what about showing us Your html-code as Charley mentioned? Regards, Christian Ankur Gupta schrieb: > pixel click is subject to break easily and not the recommended way, but that seems to me to be the only way to go in the situation i am stuck right now :-( > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5614&messageID=15765#15765 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From philipreedtech at gmail.com Wed Dec 6 14:01:22 2006 From: philipreedtech at gmail.com (philip reed) Date: Wed, 6 Dec 2006 14:01:22 -0500 Subject: [Wtr-general] Click on a pixel location In-Reply-To: <44359413.1165430789804.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <43344480.1165306369578.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <44359413.1165430789804.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Just curious, would Watir be able to handle the following cases: - if the form were part of a Java applet? - if the form were generated by Javascript? - if the form were generated by Flash? I don't know anything about the JD Edwards app, and I know less than I wish about Watir. Just asking to learn, but perhaps it's helpful to brainstorm reasons why a form showing up in a somewhat standard browser config might not be Watir-accessible.... Thanks, Philip On 12/6/06, Ankur Gupta wrote: > pixel click is subject to break easily and not the recommended way, but that seems to me to be the only way to go in the situation i am stuck right now :-( > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5614&messageID=15765#15765 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -- Philip Reed, Web developer http://philipreedtech.com Web. Made simple. From charley.baker at gmail.com Wed Dec 6 14:03:13 2006 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 6 Dec 2006 12:03:13 -0700 Subject: [Wtr-general] Click on a pixel location In-Reply-To: <457712E8.5010003@chriss-baumann.de> References: <44359413.1165430789804.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <457712E8.5010003@chriss-baumann.de> Message-ID: A snippet or use the IE developer toolbar to see what attributes in the generated DOM you might have access to: http://www.microsoft.com/downloads/details.aspx?familyid=e59c3964-672d-4511-bb3e-2d5e1db91038&displaylang=en -Charley On 12/6/06, Christian Baumann wrote: > > Hi, > > what about showing us Your html-code as Charley mentioned? > > Regards, > Christian > > > Ankur Gupta schrieb: > > pixel click is subject to break easily and not the recommended way, but > that seems to me to be the only way to go in the situation i am stuck right > now :-( > > --------------------------------------------------------------------- > > Posted via Jive Forums > > http://forums.openqa.org/thread.jspa?threadID=5614&messageID=15765#15765 > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061206/3f8f0068/attachment.html From charley.baker at gmail.com Wed Dec 6 15:20:13 2006 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 6 Dec 2006 13:20:13 -0700 Subject: [Wtr-general] Click on a pixel location In-Reply-To: References: <43344480.1165306369578.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <44359413.1165430789804.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hey Philip, Java applet - no, Flash - no. These are embedded objects which IE really has no insight into. Form generated by Javascript - yes. This is what Watir deals with....the generated DOM. I'm not yet convinced there's no way to access the form elements in this particular scenario. -Charley On 12/6/06, philip reed wrote: > > Just curious, would Watir be able to handle the following cases: > > - if the form were part of a Java applet? > - if the form were generated by Javascript? > - if the form were generated by Flash? > > I don't know anything about the JD Edwards app, and I know less than I > wish about Watir. Just asking to learn, but perhaps it's helpful to > brainstorm reasons why a form showing up in a somewhat standard > browser config might not be Watir-accessible.... > > Thanks, > > Philip > > On 12/6/06, Ankur Gupta wrote: > > pixel click is subject to break easily and not the recommended way, but > that seems to me to be the only way to go in the situation i am stuck right > now :-( > > --------------------------------------------------------------------- > > Posted via Jive Forums > > http://forums.openqa.org/thread.jspa?threadID=5614&messageID=15765#15765 > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > -- > Philip Reed, Web developer > > http://philipreedtech.com > > Web. Made simple. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061206/d7da8cf0/attachment-0001.html From paul.rogers at shaw.ca Wed Dec 6 15:27:44 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 06 Dec 2006 13:27:44 -0700 Subject: [Wtr-general] Click on a pixel location In-Reply-To: References: <43344480.1165306369578.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <44359413.1165430789804.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: java applet - no, but might be possible with autoit or winclicker javascript - yep - the form exists as part of the DOM, so watir can get at it Flash - see java applet ----- Original Message ----- From: philip reed Date: Wednesday, December 6, 2006 12:01 pm Subject: Re: [Wtr-general] Click on a pixel location > Just curious, would Watir be able to handle the following cases: > > - if the form were part of a Java applet? > - if the form were generated by Javascript? > - if the form were generated by Flash? > > I don't know anything about the JD Edwards app, and I know less > than I > wish about Watir. Just asking to learn, but perhaps it's helpful to > brainstorm reasons why a form showing up in a somewhat standard > browser config might not be Watir-accessible.... > > Thanks, > > Philip > > On 12/6/06, Ankur Gupta wrote: > > pixel click is subject to break easily and not the recommended > way, but that seems to me to be the only way to go in the > situation i am stuck right now :-( > > ----------------------------------------------------------------- > ---- > > Posted via Jive Forums > > > http://forums.openqa.org/thread.jspa?threadID=5614&messageID=15765#15765> _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > -- > Philip Reed, Web developer > > http://philipreedtech.com > > Web. Made simple. > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From paul.rogers at shaw.ca Wed Dec 6 15:29:38 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 06 Dec 2006 13:29:38 -0700 Subject: [Wtr-general] Click on a pixel location In-Reply-To: References: <43344480.1165306369578.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: if i remember, there is a method in IE called something like element_at( x, y) it might be possible to use that to do what you need. But as others have said, this is a very fragile way of doing automation Paul -------------- next part -------------- There are many ways to access controls, does the textbox have any attributes? id, name, etc? If it does then you can use the standard set method: ie.text_field(:name, "username").set("admin") Are you getting errors accessing it? If so what errors? If the text field doesn't have any identifiable attributes, you can also use index: ie.text_field(:index, 3).set("admin") There may be a way to pixel click, but I wouldn't recommend it as it's subject to breaking pretty quickly. The above options should work. If not, post some of the html code and more information. -Charley On 12/5/06, Ankur Gupta wrote: > > Using watir is it possible to click on a location that can be specified > with x and y coordinate (pixels) > > I am trying to automate JD Edwards screens using Watir, i am stuck at a > portion where the object is not being identified. The textbox which i have > to type also cant be reached by using Keyboard Tab. > > Any other workarounds? > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5614&messageID=15651#15651 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061206/c219a0bf/attachment.html -------------- next part -------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Wed Dec 6 15:31:53 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 06 Dec 2006 13:31:53 -0700 Subject: [Wtr-general] Click on a pixel location In-Reply-To: References: <43344480.1165306369578.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: if i remember, there is a method in IE called something like element_at( x, y) it might be possible to use that to do what you need. But as others have said, this is a very fragile way of doing automation Paul -------------- next part -------------- There are many ways to access controls, does the textbox have any attributes? id, name, etc? If it does then you can use the standard set method: ie.text_field(:name, "username").set("admin") Are you getting errors accessing it? If so what errors? If the text field doesn't have any identifiable attributes, you can also use index: ie.text_field(:index, 3).set("admin") There may be a way to pixel click, but I wouldn't recommend it as it's subject to breaking pretty quickly. The above options should work. If not, post some of the html code and more information. -Charley On 12/5/06, Ankur Gupta wrote: > > Using watir is it possible to click on a location that can be specified > with x and y coordinate (pixels) > > I am trying to automate JD Edwards screens using Watir, i am stuck at a > portion where the object is not being identified. The textbox which i have > to type also cant be reached by using Keyboard Tab. > > Any other workarounds? > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5614&messageID=15651#15651 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061206/ac31dbc9/attachment.html -------------- next part -------------- _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From forum-watir-users at openqa.org Wed Dec 6 16:40:34 2006 From: forum-watir-users at openqa.org (Dave Munns) Date: Wed, 06 Dec 2006 15:40:34 CST Subject: [Wtr-general] Memory access errors In-Reply-To: <50962147.1160777568740.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <49341610.1165441264537.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Reinstalling IE6 fixed the problem. It appears that an install of QTP6 affected some critical dlls. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=4779&messageID=15781#15781 From forum-watir-users at openqa.org Wed Dec 6 16:44:35 2006 From: forum-watir-users at openqa.org (Dave Munns) Date: Wed, 06 Dec 2006 15:44:35 CST Subject: [Wtr-general] Modal Dialog dismissal launching Javascript alert window In-Reply-To: <44340380.1161383652126.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <51561893.1165441505717.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Managed to get this working, using click within modal_dialog and the recommended javascript alert window processing code. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=4892&messageID=15782#15782 From forum-watir-users at openqa.org Wed Dec 6 16:46:47 2006 From: forum-watir-users at openqa.org (Dave Munns) Date: Wed, 06 Dec 2006 15:46:47 CST Subject: [Wtr-general] Deeply Nested html from Microsoft Report Server Viewer In-Reply-To: <54238101.1162328460224.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <39757824.1165441637617.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Using irb, flashing areas of the report window, and following html links eventually gets to answers. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5041&messageID=15783#15783 From christopher.mcmahon at gmail.com Wed Dec 6 16:51:25 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 6 Dec 2006 13:51:25 -0800 Subject: [Wtr-general] Memory access errors In-Reply-To: <49341610.1165441264537.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <50962147.1160777568740.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <49341610.1165441264537.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70612061351lc0b466dvb0cf053bd9a731cf@mail.gmail.com> On 12/6/06, Dave Munns wrote: > > Reinstalling IE6 fixed the problem. It appears that an install of QTP6 > affected some critical dlls. If that's really true, that's an awful ugly thing for a *test tool* to do. -C -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061206/7202ac83/attachment.html From christopher.mcmahon at gmail.com Wed Dec 6 16:56:26 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 6 Dec 2006 13:56:26 -0800 Subject: [Wtr-general] Deeply Nested html from Microsoft Report Server Viewer In-Reply-To: <39757824.1165441637617.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <54238101.1162328460224.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <39757824.1165441637617.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70612061356m4241799ck983a5e874a12ff67@mail.gmail.com> On 12/6/06, Dave Munns wrote: > > Using irb, flashing areas of the report window, and following html links > eventually gets to answers. Let us repeat that in all caps. :) -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061206/d3c3c5b0/attachment.html From charley.baker at gmail.com Wed Dec 6 17:13:03 2006 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 6 Dec 2006 15:13:03 -0700 Subject: [Wtr-general] Windows Vista / IE 7 "RPC Server is Unavailable" In-Reply-To: <63915d6a0612051258j464b2154t2909af171b812f79@mail.gmail.com> References: <63915d6a0612051258j464b2154t2909af171b812f79@mail.gmail.com> Message-ID: Hi Lisa, I haven't worked with Vista and IE7, I'm trying to get a box set up with that now. Your report gave me a nudge to set it up. The rpc server errors you're seeing are due to closing the browser, which unfortunately doesn't give a good indication of what's going wrong. I don't think the problem is with Vista and IE7. The fact that it's working in irb and not in the scripts, points to a possible problem with the scripts. Can you send some snippets of code from the failing scripts or more information? Even though you haven't gotten this far: Watir 1.4.1 won't work with modal dialogs, you'd need to use the latest development gem for 1.5.1: http://wiki.openqa.org/display/WTR/Development+Builds And Ruby 1.8.2 to work with the modified version of win32ole.so. -Charley On 12/5/06, Lisa Crispin wrote: > > Hi, > I've searched the mailing list for this error but I'm not finding much > that helps me. Admittedly, I am over my head with this. > > We have customers using IE7 so we'd like to run Watir tests on IE7. We > set up a machine with Windows Vista and IE7 (Why Windows Vista? Just > because it was there, I guess). I installed Ruby 1.8.5 with the one click > installer and used gem to install Watir 1.4.1. I can attach to an IE > window fine with irb and click buttons and so on in irb. However, the > scripts fail with errors like the ones below. They invoke the site URL > fine, but then another window seems to be trying to open, just hanging. > When I close it, I get the errors below. We tried turning off the tabs in > IE7, that didn't help. > > I tried some troubleshooting I found for older versions of windows with > the RPC Server error but nothing helps. I can manually use the app just > fine from this machine with IE7. We have other Windows machines set up the > same way as this one network-wise but they are XP. > > Is anyone else using Windows Vista? The only problem I've seen on this > mailing list for IE7 is the modal dialog popup title being different. We > are not getting anywhere close to our modal dialog popups! The scripts > can't seem to click anything once they invoke the site (although I can do > it with irb). > > Thanks > Lisa > > EE > Finished in 84.735 seconds. > > 1) Error: > test_login(TC_Login): > WIN32OLERuntimeError: unknown property or method `document' > HRESULT error code:0x800706ba > The RPC server is unavailable. > c:/ruby/lib/ruby/gems/1.8/gems/watir- 1.4.1/./watir.rb:1336:in > `method_missin > g' > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1336:in > `document' > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:899:in `getLink' > c:/ruby/lib/ruby/gems/1.8/gems/watir- 1.4.1/./watir.rb:2830:in > `initialize' > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:570:in `new' > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:570:in `link' > > C:/Java/workspace/eplan/src/watir/scripts/simple/Login/../../../lib/Login/lo > > gin.rb:56:in `login' > > C:/Java/workspace/eplan/src/watir/scripts/simple/Login/../../../lib/Login/lo > gin.rb:78:in `fast401k_login' > > C:/Java/workspace/eplan/src/watir/scripts/simple/Login/tc_login.rb:109:in `t > > est_login' > > 2) Error: > test_login(TC_Login): > WIN32OLERuntimeError: unknown property or method `hWnd' > HRESULT error code:0x800706ba > The RPC server is unavailable. > > C:/Java/workspace/eplan/src/watir/scripts/simple/Login/../../../lib/Utility/ > > ie_tools.rb:10:in `method_missing' > > C:/Java/workspace/eplan/src/watir/scripts/simple/Login/../../../lib/Utility/ > ie_tools.rb:10:in `stop_ie' > > C:/Java/workspace/eplan/src/watir/scripts/simple/Login/tc_login.rb:115:in `t > > eardown' > > 1 tests, 0 assertions, 0 failures, 2 errors > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061206/6fb2fb5a/attachment-0001.html From forum-watir-users at openqa.org Wed Dec 6 20:17:00 2006 From: forum-watir-users at openqa.org (Doug Burt) Date: Wed, 06 Dec 2006 19:17:00 CST Subject: [Wtr-general] Unit test failures Message-ID: <51012970.1165454250798.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I see some of these symptoms overlap other threads but I'm just too new to make use of them yet. I?m trying to get started learning to use Watir but the unit tests don?t run cleanly. I?m under some time pressure to evaluate this tool and move on so if someone can recognize these symptoms and provide a quick answer to what?s going wrong I would appreciate it very much. My base system is Windows XP, Internet Explorer 7.0. I installed ruby 1.8.5-21 and watir 1.4.1. The unit tests output summary said 182 tests, 63 assertions, 3 failures, 163 errors. Error text always included: WIN32OLERuntimeError: unknown property or method ?navigate HRESULT error code: 0x800706ba The RPC server is unavailable To check if there were issues with the operating system I set up a VMWare virtual machine running Windows 2000 and Internet Explorer 6.0, installed the same versions of ruby and watir. Here the unit test summary was 182 tests, 1033 assertions, 8 failures, 2 errors. The text of the first error was test_save_local_image(TC_Images): Watir::Exception::NavigationException: Cannot find server or DNS Error c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1160:in `check_for_http_error' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1141:in `set_defaults' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1436:in `call' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1436:in `run_error_checks' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in `each' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1435:in `run_error_checks' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1419:in `wait' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1254:in `goto' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2797:in `save' C:/Program Files/Watir/unittests/../unittests/images_test.rb:160:in `safe_file_block' C:/Program Files/Watir/unittests/../unittests/images_test.rb:160:in `each' C:/Program Files/Watir/unittests/../unittests/images_test.rb:160:in `safe_file_block' C:/Program Files/Watir/unittests/../unittests/images_test.rb:143:in `test_save_local_image' Second error was the same for test_save_local_image_returns_original_page(TC_Images) Some of the failures were: 3) Failure: test_imageHasLoaded(TC_Images) [C:/Program Files/Watir/unittests/../unittests/images_test.rb:76]: is not true. 4) Failure: test_image_properties(TC_Images) [C:/Program Files/Watir/unittests/../unittests/images_test.rb:104]: <"88"> expected but was <"30">. 8) Failure: test_confirm(TC_PopUps) [C:/Program Files/Watir/unittests/../unittests/popups_test.rb:32]: is not true. 9) Failure: test_links_and_images_in_table(TC_Tables) [C:/Program Files/Watir/unittests/../unittests/table_test.rb:165]: <"106"> expected but was <"28">. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5655&messageID=15793#15793 From forum-watir-users at openqa.org Wed Dec 6 22:05:44 2006 From: forum-watir-users at openqa.org (Ankur Gupta) Date: Wed, 06 Dec 2006 21:05:44 CST Subject: [Wtr-general] Click on a pixel location In-Reply-To: <43344480.1165306369578.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <38823214.1165460774448.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> the screenshot can be seen http://flickr.com/photos/ankur_gupta10/316125738/ When i run the ruby script, then after the execution finishes i get this error- W, [06-Dec-2006 13:34:20#1868] WARN -- : frame error in waitunknown property or method `9' HRESULT error code:0x80020006 Unknown name. c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1405:in `[]' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1405:in `wait' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1404:in `wait' c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2014:in `click' fa1.rb:35 Does this error has anything to do with not recognizing the objects...? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5614&messageID=15795#15795 From forum-watir-users at openqa.org Wed Dec 6 22:14:24 2006 From: forum-watir-users at openqa.org (Ankur Gupta) Date: Wed, 06 Dec 2006 21:14:24 CST Subject: [Wtr-general] Click on a pixel location In-Reply-To: Message-ID: <45566692.1165461295210.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks for taking time out paul,,,but There is no method like element_at .. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5614&messageID=15796#15796 From paul.rogers at shaw.ca Wed Dec 6 23:23:11 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 06 Dec 2006 21:23:11 -0700 Subject: [Wtr-general] Click on a pixel location References: <45566692.1165461295210.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <022301c719b7$67d684d0$6400a8c0@laptop> this is what I was thinking of http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/elementfrompoint.asp?frame=true its called elementFromPoint. Youd have to write your own watir methods to actually create the watir element Paul ----- Original Message ----- From: "Ankur Gupta" To: Sent: Wednesday, December 06, 2006 8:14 PM Subject: Re: [Wtr-general] Click on a pixel location > Thanks for taking time out paul,,,but There is no method like element_at > .. > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5614&messageID=15796#15796 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Thu Dec 7 00:50:34 2006 From: forum-watir-users at openqa.org (Dhamodharan) Date: Wed, 06 Dec 2006 23:50:34 CST Subject: [Wtr-general] Can anyone solve this problem..??????? In-Reply-To: <59038162.1165417780781.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <49160060.1165470664060.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> thanks for your reply.. Hi my friend, If i use 2 tests in one class it opens two new explorer for each testa..?? How to do all the tests in one single window --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5636&messageID=15801#15801 From forum-watir-users at openqa.org Thu Dec 7 00:56:11 2006 From: forum-watir-users at openqa.org (Dhamodharan) Date: Wed, 06 Dec 2006 23:56:11 CST Subject: [Wtr-general] How to avoid opening two explorer when we tests?????? Message-ID: <52583704.1165471011302.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi friend, I will tell u my code first Code: class TC_myTest < Test::Unit::TestCase include Watir def setup() @ie=Watir::IE.new @ie.goto("http://192.168.1.12/~lawson/collaboration/src") # assert_match /Welcome Guest/, browser.div(:id, "banner").text end def test_search assert(@ie.text_field(:name, "textfield").exists?) @ie.text_field(:name, "textfield").set("Watir World") @ie.button(:value, "Search").click if @ie.contains_text("Watir world") puts"Observed result" puts "Test Passed. Found the test string: 'Watir world'. actual Results match Expected Results." else puts" " puts"Observed result" puts " Test Failed! Could not find: 'Watir world'" end end def test_login assert(exists?{@ie.link(:text, "Login")}) @ie.link(:text,"Login").click assert(@ie.text_field(:name, "user_name").exists?) @ie.text_field(:name,"user_name").set("lawson") assert(@ie.text_field(:name, "password").exists?) @ie.text_field(:name,"password").set("lawson123") @ie.button(:value,"login").click end *. Hey here it opens two Explorer in which two tests are running seperately. Here test_login runs first, test_search next.. but I have mentioned teset_search at first... *.For test_loin it opens a window explorer after completing that test_search it opens another.. How to avoid opening 2 Explorer at a time.. reply me, M.Dhamodharan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5658&messageID=15802#15802 From forum-watir-users at openqa.org Thu Dec 7 00:57:14 2006 From: forum-watir-users at openqa.org (Dhamodharan) Date: Wed, 06 Dec 2006 23:57:14 CST Subject: [Wtr-general] Can anyone solve this problem..??????? In-Reply-To: <46166959.1165404148397.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <54554375.1165471064057.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Ya its correct and useful for me --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5636&messageID=15803#15803 From zeljko.filipin at gmail.com Thu Dec 7 02:27:32 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 7 Dec 2006 08:27:32 +0100 Subject: [Wtr-general] How to avoid opening two explorer when we tests?????? In-Reply-To: <52583704.1165471011302.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <52583704.1165471011302.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: "setup [...] will be called before [...] each test method that is run" (from http://www.ruby-doc.org/stdlib/libdoc/test/unit/rdoc/classes/Test/Unit.html) There is @ie=Watir::IE.new in setup method and it is called two times, before test_search and test_login. That causes two browser windows to open. -- Zeljko Filipin http://zeljkofilipin.com/2006/12/05/tests-and-how-to-documents-2/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061207/4b695bbc/attachment.html From forum-watir-users at openqa.org Thu Dec 7 06:04:56 2006 From: forum-watir-users at openqa.org (Udo Fröhling) Date: Thu, 07 Dec 2006 05:04:56 CST Subject: [Wtr-general] Windows Vista / IE 7 "RPC Server is Unavailable" In-Reply-To: <63915d6a0612051258j464b2154t2909af171b812f79@mail.gmail.com> Message-ID: <48093423.1165489526665.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Do you have a teardown defined in which your browser is closed? In my case it was called after the first test and in the second test the browser window was closed. I renamed the teardown to test_99_teardown and it was executed at the end of my test case --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5654&messageID=15806#15806 From matt.makins at studylink.com Thu Dec 7 07:23:59 2006 From: matt.makins at studylink.com (Matt Makins) Date: Thu, 7 Dec 2006 12:23:59 -0000 Subject: [Wtr-general] pop up box Message-ID: <200612071218.GGZ60360@c2bthomr04.btconnect.com> Hi, I have a pop up box that appears on a web page, just a IE window with a 'OK' button. How do I access the pop up box and click the 'OK' button. I have tried WinClicker. Thanks, Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061207/6431685b/attachment.html From forum-watir-users at openqa.org Thu Dec 7 11:58:25 2006 From: forum-watir-users at openqa.org (Nathan) Date: Thu, 07 Dec 2006 10:58:25 CST Subject: [Wtr-general] How does one access a web page element by its css class? Message-ID: <40627873.1165510822062.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hey everybody! I just came across something that I had never before thought to be a problem. The solution seems obvious, but it isn't and so here I am, looking for answers. The problem is that I am trying to access an element by its css class. For example: <img class="btn_viewResults"> But when I use ie.image(:class, "btn_viewResults").click (this is a button image that I want to click on), I get an error back saying, "Watir::Exception::UnknownObjectException: Unable to locate object, using class and btn_viewResults." Besides the index there is no other property that I have to click on this button, and I don't know yet what the index of this image is. I'll need to go through 41 images to figure it out. So does anybody know how to access a web page element by its css class? Also when I do this: ie.images[0].class I get: Watir::Image That's actually what I expected, just don't have any idea how to get what I want. Thanks. Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5661&messageID=15809#15809 From forum-watir-users at openqa.org Thu Dec 7 12:31:53 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Thu, 07 Dec 2006 11:31:53 CST Subject: [Wtr-general] How does one access a web page element by its css class? In-Reply-To: <40627873.1165510822062.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <47714550.1165512743903.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> While I can't answer the exact question, I can explain how I would solve it. Find the 'nearest' containing element that you can use (a table, div, span - whatever). Then use that element AND the index of the image. This helps you narrow it down. So say you had Table :id 'table_one' row row .image (this is the image you wanted) row Then you could do $ie.table(:index, 'table_one')[3][1].image(:index, 1) --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5661&messageID=15810#15810 From forum-watir-users at openqa.org Thu Dec 7 12:49:47 2006 From: forum-watir-users at openqa.org (Nathan) Date: Thu, 07 Dec 2006 11:49:47 CST Subject: [Wtr-general] How does one access a web page element by its css class? In-Reply-To: <47714550.1165512743903.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <43249955.1165513825041.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank you Jlolis. That does help me. I was trying to do that, because I'd seen other people do it. Here's the problem that I've come up against with doing that. The containing web element is a div, and when I do this: ie.div(:id, "viewResultsButton").images I get an error: NoMethodError: undefined method 'document' for #. Then when I try: ie.div(:id, "viewResultsButton")[1].image(:index, 1).click I also get an error: NoMethodError: undefined method '[]' for #. I pretty much already knew that would be the case. I'm not dumb, and the first error told me already, "forget about it!" So how woulld one accomplish this with a div!? thanks, Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5661&messageID=15811#15811 From forum-watir-users at openqa.org Thu Dec 7 13:12:40 2006 From: forum-watir-users at openqa.org (Avinash) Date: Thu, 07 Dec 2006 12:12:40 CST Subject: [Wtr-general] Warnings: already initialized constant when executing watir scripts Message-ID: <55046880.1165515261113.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I am running the following versions: ruby 1.8.5 (2006-08-25) [i386-mswin32] watir 1.5.1.1081 I was running an older version of ruby but uninstalled it before installing the current version, using the windows one-click installer. When I execute watir scripts, I get the following blurb of warnings. This seems to have no effect on any functionality. I also tried reinstalling watir and ruby from scratch but I still get the warnings. c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:203: warning: already initialized constant ATTACHER c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:214: warning: already initialized constant NAVIGATION_CHECKER c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:275: warning: already initialized constant GetUnknown c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:276: warning: already initialized constant User32 c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:277: warning: already initialized constant FindWindowEx c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:279: warning: already initialized constant GetWindow c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:282: warning: already initialized constant GW_HWNDFIRST c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:283: warning: already initialized constant GW_HWNDLAST c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:284: warning: already initialized constant GW_HWNDNEXT c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:285: warning: already initialized constant GW_HWNDPREV c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:286: warning: already initialized constant GW_OWNER c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:287: warning: already initialized constant GW_CHILD c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:288: warning: already initialized constant GW_ENABLEDPOPUP c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:289: warning: already initialized constant GW_MAX c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:1364: warning: already initialized constant REVISION_STRING c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:1366: warning: already initialized constant REVISION c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:1369: warning: already initialized constant VERSION_SHORT c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:1370: warning: already initialized constant VERSION c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:1373: warning: already initialized constant READYSTATE_COMPLE TE c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:1378: warning: already initialized constant DEFAULT_TYPING_SP EED c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:1381: warning: already initialized constant DEFAULT_SLEEP_TIM E c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:1384: warning: already initialized constant DEFAULT_HIGHLIGHT _COLOR c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:2322: warning: already initialized constant TO_S_SIZE c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:3033: warning: already initialized constant TAG c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:3037: warning: already initialized constant TAG c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:3043: warning: already initialized constant TAG c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:3048: warning: already initialized constant TAG c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:3053: warning: already initialized constant TAG c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:3639: warning: already initialized constant INPUT_TYPES c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:3794: warning: already initialized constant INPUT_TYPES c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:3800: warning: already initialized constant INPUT_TYPES c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:3967: warning: already initialized constant INPUT_TYPES c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1081/./Watir.rb:3991: warning: already initialized constant INPUT_TYPES --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5662&messageID=15813#15813 From forum-watir-users at openqa.org Thu Dec 7 13:54:27 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Thu, 07 Dec 2006 12:54:27 CST Subject: [Wtr-general] Warnings: already initialized constant when executing watir scripts In-Reply-To: <55046880.1165515261113.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <62590486.1165517697868.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> shot in the dark here, did you by chance "require 'Watir'" twice? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5662&messageID=15816#15816 From esjewett at gmail.com Thu Dec 7 13:59:03 2006 From: esjewett at gmail.com (Ethan Jewett) Date: Thu, 7 Dec 2006 12:59:03 -0600 Subject: [Wtr-general] How does one access a web page element by its css class? In-Reply-To: <43249955.1165513825041.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <47714550.1165512743903.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <43249955.1165513825041.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <68f4a0e80612071059x2f41463cn949f6310842aca13@mail.gmail.com> Nathan, I believe that in 1.5.1127, you can also loop through images and check the "class" attribute. @ie = Watir::IE.new @ie.goto(http://somepage.com) @ie.images.each do |image| if image.attribute_value("class") == "btn_viewResults" # Image found else # This image isn't the one end end I don't think it does regular expression matches, but maybe someone can correct me if I'm wrong. Ethan On 12/7/06, Nathan wrote: > Thank you Jlolis. That does help me. I was trying to do that, because I'd seen other people do it. Here's the problem that I've come up against with doing that. The containing web element is a div, and when I do this: > > ie.div(:id, "viewResultsButton").images > > I get an error: NoMethodError: undefined method 'document' for #. Then when I try: > > ie.div(:id, "viewResultsButton")[1].image(:index, 1).click > > I also get an error: NoMethodError: undefined method '[]' for #. I pretty much already knew that would be the case. I'm not dumb, and the first error told me already, "forget about it!" So how woulld one accomplish this with a div!? > > thanks, > > Nathan > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5661&messageID=15811#15811 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From esjewett at gmail.com Thu Dec 7 14:01:13 2006 From: esjewett at gmail.com (Ethan Jewett) Date: Thu, 7 Dec 2006 13:01:13 -0600 Subject: [Wtr-general] How does one access a web page element by its css class? In-Reply-To: <68f4a0e80612071059x2f41463cn949f6310842aca13@mail.gmail.com> References: <47714550.1165512743903.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <43249955.1165513825041.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <68f4a0e80612071059x2f41463cn949f6310842aca13@mail.gmail.com> Message-ID: <68f4a0e80612071101h6760f05dkef80d3b74982d635@mail.gmail.com> Actually, of course it does regular expression matches, they're just regular Ruby regular expressions because there's no need to do a regular expression match in the .attribute_value method call. On 12/7/06, Ethan Jewett wrote: > Nathan, > > I believe that in 1.5.1127, you can also loop through images and check > the "class" attribute. > > @ie = Watir::IE.new > @ie.goto(http://somepage.com) > @ie.images.each do |image| > if image.attribute_value("class") == "btn_viewResults" > # Image found > else > # This image isn't the one > end > end > > I don't think it does regular expression matches, but maybe someone > can correct me if I'm wrong. > > Ethan > > On 12/7/06, Nathan wrote: > > Thank you Jlolis. That does help me. I was trying to do that, because I'd seen other people do it. Here's the problem that I've come up against with doing that. The containing web element is a div, and when I do this: > > > > ie.div(:id, "viewResultsButton").images > > > > I get an error: NoMethodError: undefined method 'document' for #. Then when I try: > > > > ie.div(:id, "viewResultsButton")[1].image(:index, 1).click > > > > I also get an error: NoMethodError: undefined method '[]' for #. I pretty much already knew that would be the case. I'm not dumb, and the first error told me already, "forget about it!" So how woulld one accomplish this with a div!? > > > > thanks, > > > > Nathan > > --------------------------------------------------------------------- > > Posted via Jive Forums > > http://forums.openqa.org/thread.jspa?threadID=5661&messageID=15811#15811 > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > From forum-watir-users at openqa.org Thu Dec 7 14:24:15 2006 From: forum-watir-users at openqa.org (Avinash) Date: Thu, 07 Dec 2006 13:24:15 CST Subject: [Wtr-general] Warnings: already initialized constant when executing watir scripts In-Reply-To: <62590486.1165517697868.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <57641785.1165519485579.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> No, I have these lines on top of my script: require 'watir' include Watir as described here: http://wtr.rubyforge.org/example_testcase.html I am starting to get my hands dirty with Watir, hence I might be doing something silly here... --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5662&messageID=15823#15823 From forum-watir-users at openqa.org Thu Dec 7 15:55:43 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Thu, 07 Dec 2006 14:55:43 CST Subject: [Wtr-general] Warnings: already initialized constant when executing watir scripts In-Reply-To: <57641785.1165519485579.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <56174621.1165524973215.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> just for fun i opened up the irb and did the following irb: require 'Watir' and that happend. I wouldn't worry about it :) --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5662&messageID=15830#15830 From charley.baker at gmail.com Thu Dec 7 16:09:51 2006 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 7 Dec 2006 14:09:51 -0700 Subject: [Wtr-general] Warnings: already initialized constant when executing watir scripts In-Reply-To: <56174621.1165524973215.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <57641785.1165519485579.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <56174621.1165524973215.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Shouldn't happen if you type require 'watir' Note the casing. require should load files once, if, however, you change the casing then you will load the same file multiple times. -Charley On 12/7/06, John Lolis wrote: > > just for fun i opened up the irb and did the following > > irb: require 'Watir' > > and that happend. I wouldn't worry about it :) > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5662&messageID=15830#15830 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061207/e8ac5a65/attachment.html From forum-watir-users at openqa.org Thu Dec 7 23:46:23 2006 From: forum-watir-users at openqa.org (Avinash) Date: Thu, 07 Dec 2006 22:46:23 CST Subject: [Wtr-general] Warnings: already initialized constant when executing watir scripts In-Reply-To: Message-ID: <37741568.1165553213201.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank you. That did it. Fixed the casing (require 'watir') and all is well. So why does the casing matter? While we are on this topic, what is the difference between include and require? -- Avinash --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5662&messageID=15840#15840 From zeljko.filipin at gmail.com Fri Dec 8 03:36:48 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 8 Dec 2006 09:36:48 +0100 Subject: [Wtr-general] How does one access a web page element by its css class? In-Reply-To: <40627873.1165510822062.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <40627873.1165510822062.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 12/7/06, Nathan wrote: > > ie.images[0].class > > I get: > > Watir::Image Try ie.images[0].class_name -- Zeljko Filipin http://zeljkofilipin.com/2006/12/05/tests-and-how-to-documents-2/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061208/1e91e64c/attachment-0001.html From forum-watir-users at openqa.org Fri Dec 8 04:24:42 2006 From: forum-watir-users at openqa.org (Fletch) Date: Fri, 08 Dec 2006 03:24:42 CST Subject: [Wtr-general] Excel Or Text File? In-Reply-To: <457703B0.2030702@tejasconsulting.com> Message-ID: <49965343.1165569912234.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks for all your replies. I will look in to using the CSV files - sounds like the solution I was looking for. PMF --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5619&messageID=15858#15858 From matt.makins at studylink.com Fri Dec 8 05:03:35 2006 From: matt.makins at studylink.com (Matt Makins) Date: Fri, 8 Dec 2006 10:03:35 -0000 Subject: [Wtr-general] FW: pop up box Message-ID: <200612080957.GJY08321@c2bthomr03.btconnect.com> Anybody? Hi, I have a pop up box that appears on a web page, just a IE window with a 'OK' button. How do I access the pop up box and click the 'OK' button. I have tried WinClicker. Thanks, Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061208/4844f53d/attachment.html From mail at chriss-baumann.de Fri Dec 8 05:20:45 2006 From: mail at chriss-baumann.de (Christian Baumann) Date: Fri, 08 Dec 2006 11:20:45 +0100 Subject: [Wtr-general] FW: pop up box In-Reply-To: <200612080957.GJY08321@c2bthomr03.btconnect.com> References: <200612080957.GJY08321@c2bthomr03.btconnect.com> Message-ID: <45793C7D.6080400@chriss-baumann.de> Hi Matt! What?s about trying to find a solution on Your own initiative? For example using google? (That not only adressed to You Matt! ;) ) Just search for "watir OK button", I?ve checked only the first three results, but each of them should help You to solve Your problem! Regards, Christian Matt Makins schrieb: > > Anybody? > > > > > > Hi, > > > > I have a pop up box that appears on a web page, just a IE window with > a 'OK' button. > > How do I access the pop up box and click the 'OK' button. > > > > I have tried WinClicker. > > > > Thanks, > > Matt > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061208/b2bc5401/attachment.html From zeljko.filipin at gmail.com Fri Dec 8 05:23:50 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 8 Dec 2006 11:23:50 +0100 Subject: [Wtr-general] FW: pop up box In-Reply-To: <200612080957.GJY08321@c2bthomr03.btconnect.com> References: <200612080957.GJY08321@c2bthomr03.btconnect.com> Message-ID: This does not work? http://wiki.openqa.org/display/WTR/FAQ#FAQ-HandlingJavaScriptPopUpWindows -- Zeljko Filipin http://zeljkofilipin.com/2006/12/05/tests-and-how-to-documents-2/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061208/dc703fa7/attachment.html From charley.baker at gmail.com Fri Dec 8 10:43:31 2006 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 8 Dec 2006 08:43:31 -0700 Subject: [Wtr-general] Warnings: already initialized constant when executing watir scripts In-Reply-To: <37741568.1165553213201.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <37741568.1165553213201.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Ruby's require is case sensitive. Whether that's a good thing or not, it's something to be aware of when requiring files. Require will load a file into your ruby space once whether it's a ruby file or a dll or other binary library, load is another method that will pull the file in everytime it's called, and include is a way to pull in a namespace. require 'watir' # <- pull in watir.rb include Watir # <- add the Watir namespace defined in watir.rb as module Watir # so that now you can say ie = IE.new instead of qualifying # the module where IE lives -- Watir::IE There are good descriptions of these basics in the Ruby pickaxe book: http://www.rubycentral.com/book/tut_modules.html and on the Ruby faq site: http://www.rubycentral.com/faq/rubyfaq.html -Charley On 12/7/06, Avinash wrote: > > Thank you. That did it. Fixed the casing (require 'watir') and all is > well. > > So why does the casing matter? While we are on this topic, what is the > difference between include and require? > -- > Avinash > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5662&messageID=15840#15840 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061208/ceccdf35/attachment.html From forum-watir-users at openqa.org Fri Dec 8 12:21:14 2006 From: forum-watir-users at openqa.org (Parv) Date: Fri, 08 Dec 2006 11:21:14 CST Subject: [Wtr-general] Switching from Watir 1.4.1 (one click) to Watir 1.5.1. gem Message-ID: <64160624.1165598505435.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi all, I have switched from Watir 1.4.1 (one click) to 1.5.1 gem, do i need to make any changes to my existing watir scripts (written in watir 1.4.1)? Thanks in advance for your help. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5673&messageID=15878#15878 From forum-watir-users at openqa.org Fri Dec 8 12:51:11 2006 From: forum-watir-users at openqa.org (Parv) Date: Fri, 08 Dec 2006 11:51:11 CST Subject: [Wtr-general] Switching from Watir 1.4.1 (one click) to Watir 1.5.1. gem In-Reply-To: <64160624.1165598505435.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <38987137.1165600301595.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I found out that you have to insert: require 'rubygems' before require 'watir' in your scripts if you switched from ruby 1.8.4 to ruby 1.8.5. is there a way to avoid having to insert "require 'rubygems'" in your script? Thanks. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5673&messageID=15879#15879 From charley.baker at gmail.com Fri Dec 8 13:09:15 2006 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 8 Dec 2006 11:09:15 -0700 Subject: [Wtr-general] Switching from Watir 1.4.1 (one click) to Watir 1.5.1. gem In-Reply-To: <64160624.1165598505435.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <64160624.1165598505435.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: You should be able to set up a system enviroment variable in Windows: RUBYOPT=rubygems -Charley On 12/8/06, Parv wrote: > > Hi all, > I have switched from Watir 1.4.1 (one click) to 1.5.1 gem, do i need to > make any changes to my existing watir scripts (written in watir 1.4.1)? > > Thanks in advance for your help. > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5673&messageID=15878#15878 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061208/623c2828/attachment.html From christopher.mcmahon at gmail.com Fri Dec 8 20:43:08 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 8 Dec 2006 17:43:08 -0800 Subject: [Wtr-general] OT: manipulate headers on HTTP GET? Message-ID: <72799cd70612081743q4c88ddefyac8555c06638293e@mail.gmail.com> Hi... As usual, thanks for the tolerance of this OT stuff. I posted to the soap4r list (the soap4r guy Hiroshi Nakamura also wrote the best net/http), but I thought someone here might have an idea: I have a little script require 'net/http' Net::HTTP.start('host') do |http| response = http.get('/tt?name=chris') end The headers that come across (shown in WireShark form) are Hypertext Transfer Protocol GET /tt?name=chris HTTP/1.1\r\n Request Method: GET Request URI: /tt?name=chris Request Version: HTTP/1.1 Accept: */*\r\n Host: host\r\n \r\n I would like to be able to emulate a useragent that produces these header values: Hypertext Transfer Protocol GET /tt?name=chris HTTP/1.1\r\n Request Method: GET Request URI: /tt?name=chris Request Version: HTTP/1.1 Host: host\r\n User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0\r\n Accept: image/png,*/*;q=0.5\r\n Accept-Language: en-us,en;q=0.5\r\n Accept-Encoding: gzip,deflate\r\n Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n Keep-Alive: 300\r\n Connection: keep-alive\r\n Referer: http://chrismcmahonsblog.blogspot.com/\r\n Cookie: messageid=170118; memberid=1007\r\n Authorization: Basic YWRxyzabc25tbA==\r\n \r\n of particular interest are Referer: http://chrismcmahonsblog.blogspot.com/\r\n Cookie: messageid=170118; memberid=1007\r\n I've done this a bit with the SOAP protocols, but now I need to do with a simple GET, and I'm not finding much for examples. Any pointers would be appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061208/e84b56c3/attachment-0001.html From forum-watir-users at openqa.org Fri Dec 8 21:32:03 2006 From: forum-watir-users at openqa.org (Lou Wilson) Date: Fri, 08 Dec 2006 20:32:03 CST Subject: [Wtr-general] Can I attach to an open Excel session? Message-ID: <57151377.1165631553756.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I currently use Excel macros to generate Ruby/Watir scripts and execute them. One of the things I'd like to do is have the Ruby/Watir script write to the open Excel file. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5687&messageID=15903#15903 From christopher.mcmahon at gmail.com Fri Dec 8 21:36:05 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 8 Dec 2006 18:36:05 -0800 Subject: [Wtr-general] OT: manipulate headers on HTTP GET? In-Reply-To: <72799cd70612081743q4c88ddefyac8555c06638293e@mail.gmail.com> References: <72799cd70612081743q4c88ddefyac8555c06638293e@mail.gmail.com> Message-ID: <72799cd70612081836l1db59a52qad4c86498a3c9857@mail.gmail.com> Hah! Pretty easy in Perl with Mechanize: use warnings; use strict; use WWW::Mechanize; my $url = "http://host/tt?name=chris"; my $mech = WWW::Mechanize->new(); $mech->add_header( Referer => "http://chrismcmahonsblog.blogspot.com" ); $mech->add_header( Cookie => "messageid=170118; memberid=1007"); $mech->get($url) On 12/8/06, Chris McMahon wrote: > > > > Hi... > > As usual, thanks for the tolerance of this OT stuff. > > I posted to the soap4r list (the soap4r guy Hiroshi Nakamura also wrote > the best net/http), but I thought someone here might have an idea: > > I have a little script > > require 'net/http' > Net::HTTP.start('host') do |http| > response = http.get('/tt?name=chris') > end > > > The headers that come across (shown in WireShark form) are > > Hypertext Transfer Protocol > GET /tt?name=chris HTTP/1.1\r\n > Request Method: GET > Request URI: /tt?name=chris > Request Version: HTTP/1.1 > Accept: */*\r\n > Host: host\r\n > \r\n > > I would like to be able to emulate a useragent that produces these header > values: > > Hypertext Transfer Protocol > GET /tt?name=chris HTTP/1.1\r\n > Request Method: GET > Request URI: /tt?name=chris > Request Version: HTTP/1.1 > Host: host\r\n > User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) > Gecko/20061010 Firefox/2.0\r\n > Accept: image/png,*/*;q=0.5\r\n > Accept-Language: en-us,en;q=0.5\r\n > Accept-Encoding: gzip,deflate\r\n > Accept-Charset: ISO-8859-1,utf-8;q=0.7 ,*;q=0.7\r\n > Keep-Alive: 300\r\n > Connection: keep-alive\r\n > Referer: http://chrismcmahonsblog.blogspot.com/\r\n > Cookie: messageid=170118; memberid=1007\r\n > Authorization: Basic YWRxyzabc25tbA==\r\n > \r\n > > of particular interest are > Referer: http://chrismcmahonsblog.blogspot.com/\r\n > Cookie: messageid=170118; memberid=1007\r\n > > I've done this a bit with the SOAP protocols, but now I need to do with a > simple GET, and I'm not finding much for examples. Any pointers would be > appreciated. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061208/4cfd4527/attachment.html From christopher.mcmahon at gmail.com Fri Dec 8 22:48:13 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Fri, 8 Dec 2006 19:48:13 -0800 Subject: [Wtr-general] Can I attach to an open Excel session? In-Reply-To: <57151377.1165631553756.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <57151377.1165631553756.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70612081948k7a05764erd7e3cd5aeedd532d@mail.gmail.com> On 12/8/06, Lou Wilson wrote: > > I currently use Excel macros to generate Ruby/Watir scripts and execute > them. One of the things I'd like to do is have the Ruby/Watir script write > to the open Excel file. @path = File.expand_path("wholefile.xls") @excel = WIN32OLE::new('excel.Application') @excel['Visible'] = true @workbook = @excel.Workbooks.Open("#{@path}") @worksheet = @workbook.Worksheets(1) @worksheet.Select begin assert(data1==data2) @worksheet.Range("#{column}11").Interior['ColorIndex'] = 4 #green @worksheet.Range("#{column}11")['Value'] = ['PASS'] rescue => e @worksheet.Range("#{column}11").Interior['ColorIndex'] = 3 #red @worksheet.Range("#{column}11")['Value'] = ['FAIL'] end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061208/66ee6068/attachment.html From a.premkumar at gmail.com Fri Dec 8 23:55:29 2006 From: a.premkumar at gmail.com (Prem) Date: Sat, 9 Dec 2006 10:25:29 +0530 Subject: [Wtr-general] Can I attach to an open Excel session? In-Reply-To: <57151377.1165631553756.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <57151377.1165631553756.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 12/9/06, Lou Wilson wrote: > > I currently use Excel macros to generate Ruby/Watir scripts and execute > them. One of the things I'd like to do is have the Ruby/Watir script write > to the open Excel file. > Hi Lou, Could you share the macro? Would like to learn how to do it. -- - Prem I spent a minute looking at my own code by accident. I was thinking "What the hell is this guy doing?" ---------------------------------------------------- Prem Kumar Aparanji M: 00919845226618 [Bangalore, KA, INDIA] http://scorpfromhell.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061209/1ad25966/attachment.html From forum-watir-users at openqa.org Sat Dec 9 10:13:52 2006 From: forum-watir-users at openqa.org (Lou Wilson) Date: Sat, 09 Dec 2006 09:13:52 CST Subject: [Wtr-general] Can I attach to an open Excel session? In-Reply-To: <72799cd70612081948k7a05764erd7e3cd5aeedd532d@mail.gmail.com> Message-ID: <48692901.1165677262501.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> While that's nice and is using stuff I hadn't thought of, it still doesn't answer the question. Assume now that I ALREADY have the .xls file open. Remember, it was the file whose macro generated the ruby code that's running. Of course, the ruby code is calling functions from other static ruby files... but all the variables are put in place by the excel sheet. Tester fills data out on sheet Tester hits "Go" button Excel sheet reads data from the column the tester's in into ruby code Excel sheet saves and executes ruby code Watir runs tests on a web page using data it reads from other spreadsheets maintained remotely Web page saves its results to a SQL Server table Ruby shuts down Tester hits "Results" button on Excel sheet Excel sheet reads results from SQL Server table into spreadsheet. My idea is to get Ruby/Watir to write those results directly from the table to the OPEN spreadsheet, saving the tester the extra step of hitting the "Results" button. (Am I coddling the testers too much here?) --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5687&messageID=15915#15915 From christopher.mcmahon at gmail.com Sat Dec 9 11:02:44 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Sat, 9 Dec 2006 08:02:44 -0800 Subject: [Wtr-general] Can I attach to an open Excel session? In-Reply-To: <48692901.1165677262501.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <72799cd70612081948k7a05764erd7e3cd5aeedd532d@mail.gmail.com> <48692901.1165677262501.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70612090802m2e92be9x981993395e003a65@mail.gmail.com> > > Excel sheet saves and executes ruby code This is kind of an odd arrangement. My idea is to get Ruby/Watir to write those results directly from the table > to the OPEN spreadsheet, saving the tester the extra step of hitting the > "Results" button. (Am I coddling the testers too much here?) Try this: Open a spreadsheet in Excel. Now start another Excel process and try to open the file. What happens? I get a message "file is locked for editing...". What do you think the Ruby process is going to encounter when it tries to open the file and write to it? I would strongly suggest that you not use Excel to generate code and launch processes. Excel is not designed for that, and I believe that this is only the first of many problems you'll encounter if you keep down this path. I could be wrong of course, but the normal way to do this is to have programs read and write to and from Excel, not to attempt to have Excel push data into and out of programs. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061209/1c9e16e0/attachment.html From forum-watir-users at openqa.org Sun Dec 10 02:39:56 2006 From: forum-watir-users at openqa.org (Lou Wilson) Date: Sun, 10 Dec 2006 01:39:56 CST Subject: [Wtr-general] Can I attach to an open Excel session? In-Reply-To: <48692901.1165677262501.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <62756927.1165736426661.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Good point about the open excel file being seen as locked. However, look at other testing languages, how they can punch in on the UI of a running program and access the objects on that application. Excel is no different a target in that way. If I write a c# or vb program that uses Win32API calls, and if I know the hWnd handle of the target application, I can send commands to the objects in that application, even if it's already open. I suspect some people are already doing that with Ruby. So I might have answered my own question here. I will start another thread asking about Win32API in Ruby. And as far as creating code in Excel with VBA from within the spreadsheet, try it. You might like it. The code my macros create does not do the main work of the ruby/watir code: I have functions written in Ruby files already, and called as includes. The VBA script writes out the header and variables to a ruby file, then fires up the file. There are controls on the face of the spreadsheet that let the user choose whether to fire up ruby directly, or execute it in SCITE for debugging purposes. As far as having trouble is concerned, consider this: I started on this job last year. The previous tester that was manually testing this one process, took a whole day to do the test case. My process with Excel / Ruby / Watir executes 430 instances of the process in an overnight run. And I can let a non-programmer tester do the setup and fire off the test while I'm gone. We are also running Silk in the house, and my Excel/Ruby hybrid outperforms the Silk Test version of one of the same tests seven ways from sunday, especially in speed of execution, maintainability of the code, and ability to have non-programmers use the Excel interface. Incidentally, I am using varients of the same VBA code to generate some of the Silk Test scripts for the Silk programmers where I work. For tests that have already been developed in Silk, but use some of the data I store on the Excel sheets for my test area, I have an option on the sheets that allows the target script to be written in Silk instead of Ruby. So your opinion about using Excel to write and launch Ruby code is falling on deaf ears here. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5687&messageID=15929#15929 From esjewett at gmail.com Sun Dec 10 09:35:31 2006 From: esjewett at gmail.com (Ethan Jewett) Date: Sun, 10 Dec 2006 08:35:31 -0600 Subject: [Wtr-general] Can I attach to an open Excel session? In-Reply-To: <62756927.1165736426661.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <48692901.1165677262501.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <62756927.1165736426661.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <68f4a0e80612100635i9cf1054o9a342dd224c1ebaf@mail.gmail.com> Lou, Here, Google is your friend. "ruby excel" yields: http://wiki.rubygarden.org/Ruby/page/show/ScriptingExcel Check out the section called "Some further stuff that I learned so far". It illustrates the method used to do exactly what you want to do, which is attach to a running excel session. For future reference, the win32ole section of the documentation for the ruby standard library is located here: http://www.ruby-doc.org/stdlib/libdoc/win32ole/rdoc/index.html Ethan On 12/10/06, Lou Wilson wrote: > Good point about the open excel file being seen as locked. > However, look at other testing languages, how they can punch in on the UI of a running program and access the objects on that application. Excel is no different a target in that way. If I write a c# or vb program that uses Win32API calls, and if I know the hWnd handle of the target application, I can send commands to the objects in that application, even if it's already open. I suspect some people are already doing that with Ruby. So I might have answered my own question here. I will start another thread asking about Win32API in Ruby. > > And as far as creating code in Excel with VBA from within the spreadsheet, try it. You might like it. The code my macros create does not do the main work of the ruby/watir code: I have functions written in Ruby files already, and called as includes. The VBA script writes out the header and variables to a ruby file, then fires up the file. There are controls on the face of the spreadsheet that let the user choose whether to fire up ruby directly, or execute it in SCITE for debugging purposes. > > As far as having trouble is concerned, consider this: I started on this job last year. The previous tester that was manually testing this one process, took a whole day to do the test case. My process with Excel / Ruby / Watir executes 430 instances of the process in an overnight run. And I can let a non-programmer tester do the setup and fire off the test while I'm gone. > > We are also running Silk in the house, and my Excel/Ruby hybrid outperforms the Silk Test version of one of the same tests seven ways from sunday, especially in speed of execution, maintainability of the code, and ability to have non-programmers use the Excel interface. > > Incidentally, I am using varients of the same VBA code to generate some of the Silk Test scripts for the Silk programmers where I work. For tests that have already been developed in Silk, but use some of the data I store on the Excel sheets for my test area, I have an option on the sheets that allows the target script to be written in Silk instead of Ruby. > > So your opinion about using Excel to write and launch Ruby code is falling on deaf ears here. > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5687&messageID=15929#15929 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From christopher.mcmahon at gmail.com Sun Dec 10 21:01:23 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Sun, 10 Dec 2006 18:01:23 -0800 Subject: [Wtr-general] Can I attach to an open Excel session? In-Reply-To: <62756927.1165736426661.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <48692901.1165677262501.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <62756927.1165736426661.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70612101801m1567f3d3s3fd4b1ebdac8a0ba@mail.gmail.com> > > So your opinion about using Excel to write and launch Ruby code is falling > on deaf ears here. Please let us know how it comes out. Ethan's recommendation of http://wiki.rubygarden.org/Ruby/page/show/ScriptingExcel is right on. I admit to a bias: I don't like Excel much, and the second article I ever wrote for Better Software was a lightweight analysis, mostly based on my own experience, of the many, many ways things can go horribly wrong when you use Excel for things other than just pure Excel-only spreadsheet functions. I still maintain that Excel is primarily intended as a repository for data, and that the best automation design will (cautiously) use Excel in that way. I realize that Excel has tons of other features shoehorned into it, but it still sounds sketchy from here. For my own amusement awhile back, I built a little Fit-like test automation framework based on Excel (so I'm not completely ignorant on the subject), but I've never met anyone who wanted to use it. On the other hand, you sound like you know what you're doing, so I really am interested in how it works out. I might change my mind. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061210/802a6b1a/attachment.html From forum-watir-users at openqa.org Mon Dec 11 02:40:08 2006 From: forum-watir-users at openqa.org (Lou Wilson) Date: Mon, 11 Dec 2006 01:40:08 CST Subject: [Wtr-general] Can I attach to an open Excel session? In-Reply-To: <68f4a0e80612100635i9cf1054o9a342dd224c1ebaf@mail.gmail.com> Message-ID: <38851318.1165822838355.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Ethan wrote: >Here, Google is your friend. "ruby excel" yields: >http://wiki.rubygarden.org/Ruby/page/show/ScriptingExcel >Check out the section called "Some further stuff that I learned so far". It illustrates the method used to do exactly what you want to do, which is attach to a running excel session. > >For future reference, the win32ole section of the documentation for the ruby standard library is located here: >http://www.ruby-doc.org/stdlib/libdoc/win32ole/rdoc/index.html >Ethan Ethan, I found that page to be totally excellent, and built up quite a bit of code over the last year based on it. The "further stuff" section mainly talks about Win32Ole, and while it's pretty good stuff, I prefer to use Watir for that functionality. What I was looking for is if anyone has built up anything built up on the Win32API functionality. I am particularly interested in how to start implementing stuff like: FindWindow FindWindowEx SendMessage ... and the other Windows API things that one finds in user32.dll. Building up that set of functions, one can start testing full Windows applications and not just ones that we can reach with Win32Ole. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5687&messageID=15963#15963 From forum-watir-users at openqa.org Mon Dec 11 02:54:14 2006 From: forum-watir-users at openqa.org (ahwhwl) Date: Mon, 11 Dec 2006 01:54:14 CST Subject: [Wtr-general] Can I attach to an open Excel session? In-Reply-To: <72799cd70612081948k7a05764erd7e3cd5aeedd532d@mail.gmail.com> Message-ID: <51260577.1165823684528.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> " -The true and evil monster second kill free exchange evil monster world to order card, need of come in quickly!!! http://www.power4game.com --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5687&messageID=15966#15966 From WKruse at multichoice.co.za Mon Dec 11 02:58:39 2006 From: WKruse at multichoice.co.za (Walter Kruse) Date: Mon, 11 Dec 2006 09:58:39 +0200 Subject: [Wtr-general] Can I attach to an open Excel session? In-Reply-To: <38851318.1165822838355.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: We need the Win32 GUI test library... http://rubyforge.org/projects/guitest/ >What I was looking for is if anyone has built up anything built up on the >Win32API functionality. I am particularly interested in how to start >implementing stuff like: >FindWindow >FindWindowEx >SendMessage >... and the other Windows API things that one finds in user32.dll. >Building up that set of functions, one can start testing full Windows >applications and not just ones that we can reach with Win32Ole. ************************************************************************************************************************** Everything in this e-mail and attachments relating to the official business of MultiChoice Africa is proprietary to the company. Any view or opinion expressed in this message may be the view of the individual and should not automatically be ascribed to the company. If you are not the intended recipient, you may not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify the sender immediately by email, facsimile or telephone and destroy the original message. ************************************************************************************************************************** From forum-watir-users at openqa.org Mon Dec 11 03:31:08 2006 From: forum-watir-users at openqa.org (Lou Wilson) Date: Mon, 11 Dec 2006 02:31:08 CST Subject: [Wtr-general] Can I attach to an open Excel session? In-Reply-To: <72799cd70612101801m1567f3d3s3fd4b1ebdac8a0ba@mail.gmail.com> Message-ID: <47122428.1165825899117.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> cmcmahon wrote: >I realize that Excel has tons of other features shoehorned into it Funny, from my point of view, Excel is an instance of VBA that has a spreadsheet shoehorned onto it :) I decided to save the 1000 word Essay On The Merits Of My Excel Sheet That Codes In Ruby and Silk for another time. Suffice it to say, I'd rather not spend my day developing endless variations on the same code, but let Ruby includes handle the bulk of the work and let Excel generate the pieces of the code that need to extract and track a lot of data for the testers. And it has saved hundreds of hours in the last year. This doesn't always produce ecstatic results. Because my group got finished a month earlier than expected on the current project, we now have inherited other work that is more than "filling the time alloted". The hero gets to fight the bigger monsters, I guess. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5687&messageID=15967#15967 From forum-watir-users at openqa.org Mon Dec 11 08:05:58 2006 From: forum-watir-users at openqa.org (Ashish Kumar Harsh) Date: Mon, 11 Dec 2006 07:05:58 CST Subject: [Wtr-general] How to verify text on Popup? Message-ID: <60385832.1165842443624.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi All, Scenario : I have a page with three input fields and one submit button.if I press Submit without entering in any thing in field 1. I should get a javascript alert "Please enter details in field1", My question is can we capture the text available in popup box? So that we can verify error messages available on Popup box. Thanx in advance for any suggestions. Ashish --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5710&messageID=15973#15973 From forum-watir-users at openqa.org Mon Dec 11 09:15:08 2006 From: forum-watir-users at openqa.org (vijay) Date: Mon, 11 Dec 2006 08:15:08 CST Subject: [Wtr-general] how to access an element whose html tag is Message-ID: <57042234.1165846538673.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello people, I do not know how to access an element whose html tag is . There is a link, named 'Step 1. Details'. According to its View Source, it is present in the following hierachy: frame -> form -> div -> table and then that element but its html shows as " Thanks, in Advance. Vijay --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5711&messageID=15977#15977 From Mark_Cain at RL.gov Mon Dec 11 10:41:48 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Mon, 11 Dec 2006 07:41:48 -0800 Subject: [Wtr-general] Extreme slowdown moving from 1.4.1 to 1.5.1.1127 Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A364B@EX01-2.rl.gov> Are you running your tests from inside and IDE? I saw the same slowness moving from 1.4.x to 1.5.x when I ran (the same tests) from Komodo 3.5. It was less apparent from Eclipse though... --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Pat Mac Sent: Friday, December 01, 2006 12:26 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Extreme slowdown moving from 1.4.1 to 1.5.1.1127 Hi All, I've read through the archives I could find relating to performance issues related to 1.5 but I didn't see any concrete solutions or reasons why the slowdown is occurring. Running an existing script using the profiler my execution time goes from 170 seconds to 425 seconds. Looking at the profiler output I notice the following: WIN32OLE#each is the top consumer in both profiles. In 1.5 it's taking 70.15 seconds vs 59.19 in 1.4. Not a huge jump, but noticeable when running 100+ cases. WIN32OLE#invoke is the number 2 consumer in both profiles taking 64.85 seconds in 1.5 but only 25.69 seconds in 1.4. This is obviously quite significant. Beyond the top two, the next highest in 1.4 is Logger#add taking just over 12 seconds. However, in 1.5 I see seven additional methods taking 20 seconds or longer. The biggest hogs are Watir::Element#type at 62.64 seconds, Class#new at 42.49 seconds, Watir::Element#assert_exists at 41.68 seconds and Array#include? at 39.47 seconds. I'm at a loss here. I'm running these tests on the same machine with the same version of Ruby. I originally wanted to upgrade for the click_no_wait functionality and modal dialog functionality but I can't take this kind of a performance hit. Is there something obvious I'm missing? I did notice the slowdown appears to be significant on pages with lots of controls. At this point I'm probably going to backport the click_no_wait and modal dialog functionality to 1.4.1 unless anyone has an idea of what I'm doing wrong here. --Pat -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061211/f9894a01/attachment-0001.html From Mark_Cain at RL.gov Mon Dec 11 10:45:10 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Mon, 11 Dec 2006 07:45:10 -0800 Subject: [Wtr-general] Editing fields in 'Save As' dialog Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A364C@EX01-2.rl.gov> This is pretty obscure but try adding an '&' to 'Save': clicker.clickWindowsButton('File Download', '&Save') --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Alex Ciarlillo Sent: Sunday, December 03, 2006 9:37 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] Editing fields in 'Save As' dialog Hi, I am trying to automate the download of a file from a website. I want the user to be able to set the 'Save in:' and 'File Name:' edit boxes but I am not sure how to approach this. I have the following code which gets me as far as the Save As dialog but beyond that I am unsure of what winClicker methods I need to change these text fields. #requires require 'watir' require 'watir/winClicker' #includes include Watir browser = IE.new clicker = WinClicker.new browser.goto( 'http://www.deviantart.com/download/29747336/' ) clicker.clickWindowsButton('File Download', 'Save') After this I tried adding the following: h = clicker.getWindowHandle('Save As') clicker.setTextValueForFileNameField( h , 'test.rar' ) But I got the message 'Unable to obtain handle for filename chooser' Also I need to change the 'Save In:' field but I'm even less sure how to approach the combobox. Any tips or insight on how to accomplish this would be really appreciated. Thanks, -Alex _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From Mark_Cain at RL.gov Mon Dec 11 11:10:41 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Mon, 11 Dec 2006 08:10:41 -0800 Subject: [Wtr-general] Excel Or Text File? Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A364D@EX01-2.rl.gov> Also there is a datahandler class that comes with Watir watir/datahandler.rb that works pretty well. There a usage section at the beginning of the file that should get you started. If you want something more robust, I have been using FasterCSV and it work well as is faster then the standard CSV that comes with Ruby. --Mark -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Fletch Sent: Friday, December 08, 2006 1:25 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Excel Or Text File? Thanks for all your replies. I will look in to using the CSV files - sounds like the solution I was looking for. PMF --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5619&messageID=15858#15858 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From paul.rogers at shaw.ca Mon Dec 11 11:21:25 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Mon, 11 Dec 2006 09:21:25 -0700 Subject: [Wtr-general] Can I attach to an open Excel session? In-Reply-To: References: <38851318.1165822838355.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: this was something I looked at a year or so ago, http://raa.ruby-lang.org/project/win32-guitest/ . It wasnt complete, and had a few problems, but Im sure it can be fixed if needed the winclicker also uses lots of the win api stuff, although the code in that is real ugly Paul ----- Original Message ----- From: Walter Kruse Date: Monday, December 11, 2006 0:58 am Subject: Re: [Wtr-general] Can I attach to an open Excel session? > We need the Win32 GUI test library... > http://rubyforge.org/projects/guitest/ > > > >What I was looking for is if anyone has built up anything built > up on > the >Win32API functionality. I am particularly interested in how to > start >implementing stuff like: > >FindWindow > >FindWindowEx > >SendMessage > >... and the other Windows API things that one finds in user32.dll. > >Building up that set of functions, one can start testing full Windows > >applications and not just ones that we can reach with Win32Ole. > ************************************************************************************************************************** > Everything in this e-mail and attachments relating to the official > business of MultiChoice Africa is proprietary to > the company. Any view or opinion expressed in this message may be > the view of the individual and should not automatically > be ascribed to the company. If you are not the intended > recipient, you may not peruse, use, disseminate, distribute or > copy this message. If you have received this message in error, > please notify the sender immediately by email, facsimile > or telephone and destroy the original message. > ************************************************************************************************************************** > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From Mark_Cain at RL.gov Mon Dec 11 11:24:59 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Mon, 11 Dec 2006 08:24:59 -0800 Subject: [Wtr-general] pop up box Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A364F@EX01-2.rl.gov> Did you get this solved? --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Matt Makins Sent: Thursday, December 07, 2006 4:24 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] pop up box Hi, I have a pop up box that appears on a web page, just a IE window with a 'OK' button. How do I access the pop up box and click the 'OK' button. I have tried WinClicker. Thanks, Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061211/5a34215e/attachment.html From matt.makins at studylink.com Mon Dec 11 11:50:40 2006 From: matt.makins at studylink.com (Matt Makins) Date: Mon, 11 Dec 2006 16:50:40 -0000 Subject: [Wtr-general] pop up box In-Reply-To: <4440693B7CFF2440ABC2E0BE480DABA10A364F@EX01-2.rl.gov> Message-ID: <200612111645.CCO09376@c2bthomr13.btconnect.com> Thanks, it's on hold at the moment. I used the winclicker clickJSDialogue method and ran it has a separate process, however it didn't seem to find the window. I'll have to give it some more time. Cheers, Matt _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: 11 December 2006 16:25 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] pop up box Did you get this solved? --Mark _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Matt Makins Sent: Thursday, December 07, 2006 4:24 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] pop up box Hi, I have a pop up box that appears on a web page, just a IE window with a 'OK' button. How do I access the pop up box and click the 'OK' button. I have tried WinClicker. Thanks, Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061211/d54d0d76/attachment.html From Mark_Cain at RL.gov Mon Dec 11 12:21:52 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Mon, 11 Dec 2006 09:21:52 -0800 Subject: [Wtr-general] pop up box Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A3650@EX01-2.rl.gov> When you get back to it try using this (you will need to use the newest gem if Watir): require 'watir\contrib\enabled_popup' def startClicker( button , waitTime=9, user_input=nil) hwnd = $ie.enabled_popup(waitTime) # get a handle if one exists if (hwnd) # yes there is a popup w = WinClicker.new if ( user_input ) w.setTextValueForFileNameField(hwnd, "#{user_input}") end sleep 3 # I put this in to see the text being input it is not necessary to work w.clickWindowsButton_hwnd(hwnd, "#{button}") # "OK" or whatever the name on the button is w=nil # this is just cleanup end end $ie=Watir::IE.start("c:\test.htm") $ie.image(:id,'3').click_no_wait startClicker("OK", 7, "User Input") # 3rd parameter is optional. Hope this helps --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Matt Makins Sent: Monday, December 11, 2006 8:51 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] pop up box Thanks, it's on hold at the moment. I used the winclicker clickJSDialogue method and ran it has a separate process, however it didn't seem to find the window. I'll have to give it some more time. Cheers, Matt ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: 11 December 2006 16:25 To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] pop up box Did you get this solved? --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Matt Makins Sent: Thursday, December 07, 2006 4:24 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] pop up box Hi, I have a pop up box that appears on a web page, just a IE window with a 'OK' button. How do I access the pop up box and click the 'OK' button. I have tried WinClicker. Thanks, Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061211/86e58315/attachment-0001.html From forum-watir-users at openqa.org Mon Dec 11 14:50:50 2006 From: forum-watir-users at openqa.org (Nathan) Date: Mon, 11 Dec 2006 13:50:50 CST Subject: [Wtr-general] How does one access a web page element by its css class? In-Reply-To: <40627873.1165510822062.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <40749496.1165866793951.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I just answered my question using the supplied 1.5 answers and my knowledge of Watir 1.4.1 and some Ruby/OLE hacking skills I've acquired since using Watir. So I tried using Watir 1.5, and for what I needed that worked, but Watir 1.5 crashed on my previous script, so it wasn't really a viable solution in the long run. I didn't expect it not to crash though since it's still in development. So I decided to see if I could do some patch work. I diffed the watir.rb file visually for 1.5 with the one for 1.4.1 and found that 1.5 simply wraps more native OLE object properties for the element(s) in question (mine was Image or <img>). Then I noticed that in 1.4.1 sometimes element attributes were gotten using @o.invoke("propertyName"), but there wasn't one for className or class_name. So I pulled out irb, typed in some lines to get my browser and Watir 1.4 going (I had uninstalled Watir 1.5 at this point) and played with the following idea: className or class_name must by an attribute that I can get via getOLEObject.invoke. Here's what I came up with: ie.images.each { |img| tempImage = img x = tempImage.getOLEObject if x.invoke("className") == "btn_viewResults" # Click on the image associated with the class name "btn_viewResults" tempImage.click end # End: if x.invoke("className") == "btn_viewResults" } Thanks for all of your help. I'm glad I can hack it! ;) Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5661&messageID=16004#16004 From forum-watir-users at openqa.org Mon Dec 11 14:55:14 2006 From: forum-watir-users at openqa.org (Nathan) Date: Mon, 11 Dec 2006 13:55:14 CST Subject: [Wtr-general] how to access an element whose html tag is In-Reply-To: <57042234.1165846538673.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <43010075.1165866948206.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> So if I understand you correctly, you have an HTML tag on your page that looks something like <.>[i]some text here[/i]</.> --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5711&messageID=16005#16005 From lisa.crispin at gmail.com Mon Dec 11 18:17:03 2006 From: lisa.crispin at gmail.com (Lisa Crispin) Date: Mon, 11 Dec 2006 16:17:03 -0700 Subject: [Wtr-general] Vista / IE7 Message-ID: <63915d6a0612111517l45e6c430v4fc4c58ebc714509@mail.gmail.com> I apologize in advance for not being any kind of programmer and asking such unintelligent questions. We have a huge suite of Watir tests, most of which were written by a former coworker. It's a huge investment which we are trying to maintain. I realize that Watir isn't intended for use by people who aren't Ruby programmers (and believe me, I've been working hard for more than a year to learn Ruby in my vast amounts of spare time). But I'm hoping some of you nice and helpful people might be able to give me a direction to go in. We have customers using IE7 so we wanted to start testing there. I asked our sys admin for a PC with IE7 on it. Our sys admin didn't have a Windows XP license, but he did have a Vista license, so he built a machine with Vista. I haven't been able to get the Watir tests working there at all, although Watir does work in irb. I've installed Watir 1.5.1 (using the gem), copied the win32ole.so as directed, changed the title bar text for the modal dialog in WinClicker.rband in our code to say "Windows Internet Explorer", and am on to different problems with Vista / IE7 than I started out with. In fact I'm not getting as far as I was before with Watir 1.4.1. Just about all our scripts include a login.rb module which contains an include for a mixin 'ModalDialog' which handles clicking the modal dialog popups. I'll copy in the code for it below. When I try to run a script I get the following error, which is on the line which does the 'include ModalDialog'. C:/Java/workspace/eplan/src /watir/scripts/simple/product/../../../lib/login/logi n.rb:8:in `include': wrong argument type Class (expected Module) (TypeError) from C:/Java/workspace/eplan/src/watir/scripts/simple/product/../../../l ib/login/login.rb:8 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `ge m_original_require' from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re quire' from C:/Java/workspace/eplan/src/watir/scripts/simple/product/tc_login_a ll_products.rb:40 I have other problems as well. For example, I get errors when I try to use command line options. I thought the support for that was built into Ruby so I don't understand the errors. I feel like there must be some basic thing I am missing about this new version of Watir, or about installing it as a gem, or installing it in Vista, or something. I have added the environment variable "RUBYOPT=rubygems". I've searched both the Watir and Ruby mailing lists. Can anyone help me? If not, I'm going to have to throw in the towel on Vista anyway, and maybe eventually on Watir. Thanks Lisa Here's that mixin: module ModalDialog # Convenience method to click the OK button def click_modal_ok_button(sleep_time=4, timeout=20) click_modal_button('OK', sleep_time, timeout) end # Convenience method to click the Cancel button def click_modal_cancel_button(sleep_time=4, timeout=20) click_modal_button('Cancel', sleep_time, timeout) end # Main method to click a modal dialog button. def click_modal_button(type='OK', sleep_time=4, timeout=20) Thread.new { sleep sleep_time w = WinClicker.new w.clickWindowsButton('Microsoft Internet Explorer', "#{type}", timeout) } end def check_for_popups autoit = WIN32OLE.new('AutoItX3.Control') # # Do forever - assumes popups could occur anywhere/anytime in your application. loop do # Look for window with given title. Give up after 1 second. ret = autoit.WinWait('Microsoft Internet Explorer', '', 1) # # If window found, send appropriate keystroke (e.g. {enter}, {Y}, {N}). if (ret==1) then puts("Found window, now trying to activate") autoit.WinActivate('Microsoft Internet Explorer','') active = autoit.WinActive('Microsoft Internet Explorer','') if (active == 1) then puts("Activated the Window I found") autoit.Send('{enter}') puts("Found a window to click") end # autoit.Send('{enter}') # puts("Found a window to click") end # # Take a rest to avoid chewing up cycles and give another thread a go. # Then resume the loop. sleep(3) end end end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061211/cbc02176/attachment.html From christopher.mcmahon at gmail.com Mon Dec 11 19:28:40 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 11 Dec 2006 16:28:40 -0800 Subject: [Wtr-general] Vista / IE7 In-Reply-To: <63915d6a0612111517l45e6c430v4fc4c58ebc714509@mail.gmail.com> References: <63915d6a0612111517l45e6c430v4fc4c58ebc714509@mail.gmail.com> Message-ID: <72799cd70612111628v7625da0el6dee99221974dec3@mail.gmail.com> > > Just about all our scripts include a login.rb module which contains an > include for a mixin 'ModalDialog' which handles clicking the modal dialog > popups. I'll copy in the code for it below. When I try to run a script I > get the following error, which is on the line which does the 'include > ModalDialog'. > > C:/Java/workspace/eplan/src > /watir/scripts/simple/product/../../../lib/login/logi > n.rb:8:in `include': wrong argument type Class (expected Module) > (TypeError) > from > C:/Java/workspace/eplan/src/watir/scripts/simple/product/../../../l > ib/login/login.rb:8 > You can see an example of this in C:\ruby\lib\ruby\gems\1.8\gems\watir- 1.5.0.945\watir.rb Most of the example scripts start out #################### require 'watir include Watir ##################### on line 187 (in 1.5.0.945) is the line module Watir . In the source code you're accessing, I am pretty sure that somewhere you have a line class ModalDialog that is causing this error. Hope that helps. Here's a little grep replacement that might help you find the offending file: require "find" Find.find("C:\\source\\repository") do |f| begin x = File.open(f) while line = x.gets if line =~ /ModalDialog/i puts f puts line end #if end #while rescue end # end #do -C -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061211/593903b9/attachment.html From michael.a.bolton at gmail.com Mon Dec 11 23:50:00 2006 From: michael.a.bolton at gmail.com (Michael Bolton) Date: Mon, 11 Dec 2006 23:50:00 -0500 Subject: [Wtr-general] Can I attach to an open Excel session? In-Reply-To: <48692901.1165677262501.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <05fb01c71da8$fc906060$4401020a@Koko> What problems are you trying to recognize using this procedure? That is, what is this procedure testing, and what are its oracles? ---Michael B. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Lou Wilson Sent: December 9, 2006 10:14 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Can I attach to an open Excel session? While that's nice and is using stuff I hadn't thought of, it still doesn't answer the question. Assume now that I ALREADY have the .xls file open. Remember, it was the file whose macro generated the ruby code that's running. Of course, the ruby code is calling functions from other static ruby files... but all the variables are put in place by the excel sheet. Tester fills data out on sheet Tester hits "Go" button Excel sheet reads data from the column the tester's in into ruby code Excel sheet saves and executes ruby code Watir runs tests on a web page using data it reads from other spreadsheets maintained remotely Web page saves its results to a SQL Server table Ruby shuts down Tester hits "Results" button on Excel sheet Excel sheet reads results from SQL Server table into spreadsheet. My idea is to get Ruby/Watir to write those results directly from the table to the OPEN spreadsheet, saving the tester the extra step of hitting the "Results" button. (Am I coddling the testers too much here?) --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5687&messageID=15915#15915 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From forum-watir-users at openqa.org Tue Dec 12 05:34:03 2006 From: forum-watir-users at openqa.org (san) Date: Tue, 12 Dec 2006 04:34:03 CST Subject: [Wtr-general] How To Stop IE & Retry Again If The Page Doesn't Load For A Period? Message-ID: <44021936.1165919673311.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Suppose I want To Do... [i]require 'watir' ie = Watir::IE.start('http://pro.edgar-online.com/') ....... etc etc...... ie.close[/i] But If The Very First Page Or In Between The Process Any Page Doesn't Open In 10-20 Seconds Due To IE Problem(Crash), Then I Want To Retry It... So Is There Any Kind Of Time Check That The Page Is Perfectly Loaded Or IE Is Alright... Help Please... --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5739&messageID=16043#16043 From forum-watir-users at openqa.org Tue Dec 12 05:52:26 2006 From: forum-watir-users at openqa.org (Devesh) Date: Tue, 12 Dec 2006 04:52:26 CST Subject: [Wtr-general] Does Watir support a .Net webbased application? Message-ID: <56959799.1165920804016.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Can Watir be used for testing a .Net based web application ? On running showAllObjects() function on an .net based web application, no objects are displayed. Is there any method by which i can automate the page. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5740&messageID=16044#16044 From forum-watir-users at openqa.org Tue Dec 12 06:14:59 2006 From: forum-watir-users at openqa.org (Ankur Gupta) Date: Tue, 12 Dec 2006 05:14:59 CST Subject: [Wtr-general] Does Watir support a .Net webbased application? In-Reply-To: <56959799.1165920804016.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <43651961.1165922129741.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> IMHO-The programming language will not impact the way Watir works. Can you do view source and see all the objects there? Install IE developer toolbar and checkout the DOM for the page. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5740&messageID=16045#16045 From forum-watir-users at openqa.org Tue Dec 12 06:17:38 2006 From: forum-watir-users at openqa.org (Ankur Gupta) Date: Tue, 12 Dec 2006 05:17:38 CST Subject: [Wtr-general] How To Stop IE & Retry Again If The Page Doesn't Load For A Period? In-Reply-To: <44021936.1165919673311.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <57302428.1165922288605.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Put an assertion, and based on the response do a refresh. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5739&messageID=16046#16046 From forum-watir-users at openqa.org Tue Dec 12 06:33:47 2006 From: forum-watir-users at openqa.org (Devesh) Date: Tue, 12 Dec 2006 05:33:47 CST Subject: [Wtr-general] Does Watir support a .Net webbased application? In-Reply-To: <43651961.1165922129741.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <42735406.1165923257262.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> yes..i can view source and see all the objects.. the page contains javascript, but i don't think it should affect working of Watir --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5740&messageID=16048#16048 From forum-watir-users at openqa.org Tue Dec 12 07:46:20 2006 From: forum-watir-users at openqa.org (san) Date: Tue, 12 Dec 2006 06:46:20 CST Subject: [Wtr-general] How To Stop IE & Retry Again If The Page Doesn't Load For A Period? In-Reply-To: <57302428.1165922288605.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <50549688.1165927610569.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Sorry, I Don't Understand Properly... How Do I Put an assertion? I'm Almost New To Watir.. Can You Please Explain More, May Be With A Few Line Of Codes... Thank You For Your Response... --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5739&messageID=16049#16049 From tester.paul at gmail.com Tue Dec 12 09:37:41 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 12 Dec 2006 09:37:41 -0500 Subject: [Wtr-general] how to access an element whose html tag is In-Reply-To: <57042234.1165846538673.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <57042234.1165846538673.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <37c405480612120637n42e37340lf49ce00f14a356e1@mail.gmail.com> Unless I'm mistaken, Click Here is a link. Did you try the ie.link method? On 11/12/06, vijay wrote: > > Hello people, > > I do not know how to access an element whose html tag is . There is a > link, named 'Step 1. Details'. According to its View Source, it is present > in the following hierachy: > > frame -> form -> div -> table and then that element but its html shows as > > I want to know whether this element is enabled or disabled and want to > click it, if enabled. > > Similarly, there are six other elements, 'Step 2. Details', 'Step 3. > Contacts' etc. These elements will be disabled at the start. I want to > confirm that. How do I do these two things? > > I tried a command, "if ie.frame("Detail").form(:name,"header").div(:id,"header").table(:id,"cIDFTabstripTable").element(:text,/Contacts/).enabled? == > true then ....", but Watir says "undefined method `element' for > #" > > Thanks, in Advance. > Vijay > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061212/8d662c03/attachment.html From tester.paul at gmail.com Tue Dec 12 09:45:33 2006 From: tester.paul at gmail.com (Paul Carvalho) Date: Tue, 12 Dec 2006 09:45:33 -0500 Subject: [Wtr-general] Does Watir support a .Net webbased application? In-Reply-To: <56959799.1165920804016.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <56959799.1165920804016.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <37c405480612120645t179c6bb7n43cff5fc89bf201d@mail.gmail.com> I have been using Watir to test our .Net web app for almost a year now. Did you check to see if there were any frames in your window? On 12/12/06, Devesh wrote: > > Can Watir be used for testing a .Net based web application ? > On running showAllObjects() function on an .net based web application, no > objects are displayed. Is there any method by which i can automate the page. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061212/45ed57ec/attachment.html From forum-watir-users at openqa.org Tue Dec 12 09:45:55 2006 From: forum-watir-users at openqa.org (Nathan) Date: Tue, 12 Dec 2006 08:45:55 CST Subject: [Wtr-general] How To Stop IE & Retry Again If The Page Doesn't Load For A Period? In-Reply-To: <44021936.1165919673311.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <43908362.1165934903538.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Sandeb, I worked on a similar situation using Watir. We wanted to know when a page took longer than 45 seconds to load. So I did some research and Ruby supports a timeout block. The timeout block allows one to give an operation or set of operations a specific time to complete, and if it doesn't complete within that time it throws an exception. This exception can then be caught with a begin...rescue block. I will show you here. For example, let's say you want to load some page like Amazon.com, that might be a little graphics intensive, or your page, like shown here: require "watir" # Start IE with a blank web page ie = Watir::IE.start("about:blank") # Try and browse to a page, timeout after 20 seconds, and retry if we timed out while true # Loop continuously     begin # Start a begin...rescue block         timeout(20) do # Begin timeout block             # Go to pro.edgar-online.com website             ie.goto("http://pro.edgar-online.com/")         end # End timeout block         # Exit out of the while loop because we got to the site within 20 seconds         break # Exit infinite while loop     rescue TimeoutError # Catch a timeout exception         redo # Retry the last operation     end # End begin...rescue block end # End: while true ---------------------------------- So what happens here is first I have put everything into an infinite while loop because that's the easiest way I can think of to make something "retry-able". Next I put a timeout block around a goto action, and give it 20 seconds because that's how long I think it should take to get there. If it takes longer then there's some problem. After the timeout block I place a break statement to break out of the infinite while loop in case I do load the page before 20 seconds. I put the timeout block in a begin...rescue(...end) block and catch a TimeoutError which will be thrown if a timeout occurs, which will occur after 20 seconds if the webpage didn't load. I hope this is making some sense. If not let me know. If you have questions about what I've written here, let me know, thanks. This is better than an assertion by the way and it keeps your script from crashing. You have more control. Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5739&messageID=16054#16054 From forum-watir-users at openqa.org Tue Dec 12 15:44:15 2006 From: forum-watir-users at openqa.org (Ana Maria) Date: Tue, 12 Dec 2006 14:44:15 CST Subject: [Wtr-general] Wtr-general Message-ID: <46623502.1165956285798.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Extracting data from a web table into a spreadsheet (Excel) --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5749&messageID=16076#16076 From forum-watir-users at openqa.org Tue Dec 12 15:49:08 2006 From: forum-watir-users at openqa.org (Ana Maria) Date: Tue, 12 Dec 2006 14:49:08 CST Subject: [Wtr-general] Extracting a web table into a spreadsheet (Excel) Message-ID: <59108587.1165956578448.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> This might be part of the code: excel = WIN32OLE::new('excel.Application') workbook = excel.Workbooks.Open('C:\Data\Mes documents\Watir\result.xls') ws = workbook.Worksheets(1) ws.select ..... .... workbook.save excel.quit --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5750&messageID=16077#16077 From forum-watir-users at openqa.org Wed Dec 13 00:43:38 2006 From: forum-watir-users at openqa.org (san) Date: Tue, 12 Dec 2006 23:43:38 CST Subject: [Wtr-general] How To Stop IE & Retry Again If The Page Doesn't Load For A Period? In-Reply-To: <43908362.1165934903538.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <50702026.1165988648127.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks For The Details... But As Its An Infinite Loop, If The Page Never Open In 20 Secs Then Its Going To Be A Mess In An Infinite Loop... So I Want To try It For 5 Times Say & Then If Not Succeeded Want To Close IE... & One More Think If The Page Doesn't Open In 20 Secs, Then ie.close Will Not Work & The Program Will Stop After Throwing Error... --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5739&messageID=16104#16104 From forum-watir-users at openqa.org Wed Dec 13 01:14:17 2006 From: forum-watir-users at openqa.org (san) Date: Wed, 13 Dec 2006 00:14:17 CST Subject: [Wtr-general] How To Stop IE & Retry Again If The Page Doesn't Load For A Period? In-Reply-To: <50702026.1165988648127.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <53023028.1165990487158.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Well Solved The 1st One By A Counter.... :) --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5739&messageID=16105#16105 From forum-watir-users at openqa.org Wed Dec 13 08:36:01 2006 From: forum-watir-users at openqa.org (Akash) Date: Wed, 13 Dec 2006 07:36:01 CST Subject: [Wtr-general] Error when trying to attach to a modal window. In-Reply-To: Message-ID: <55005629.1166017028659.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I am using ruby version 1.8.2 and watir version 1.5.1.1127 still i am getting this error. undefined method `connect_unknown' for WIN32OLE:Class (NoMethodError) can u please give any solution for it. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5018&messageID=16123#16123 From bret at pettichord.com Wed Dec 13 11:47:55 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 13 Dec 2006 10:47:55 -0600 Subject: [Wtr-general] Extreme slowdown moving from 1.4.1 to 1.5.1.1127 In-Reply-To: <212711160612011226i1948fc33mac83f91ad23c2ee8@mail.gmail.com> References: <212711160612011226i1948fc33mac83f91ad23c2ee8@mail.gmail.com> Message-ID: <45802EBB.6020502@pettichord.com> Pat Mac wrote: > > Hi All, I've read through the archives I could find relating to > performance issues related to 1.5 but I didn't see any concrete > solutions or reasons why the slowdown is occurring. Running an > existing script using the profiler my execution time goes from 170 > seconds to 425 seconds. Looking at the profiler output I notice the > following: > > WIN32OLE#each is the top consumer in both profiles. In 1.5 it's taking > 70.15 seconds vs 59.19 in 1.4. Not a huge jump, but noticeable when > running 100+ cases. > > WIN32OLE#invoke is the number 2 consumer in both profiles taking 64.85 > seconds in 1.5 but only 25.69 seconds in 1.4. This is obviously quite > significant. > > Beyond the top two, the next highest in 1.4 is Logger#add taking just > over 12 seconds. However, in 1.5 I see seven additional methods taking > 20 seconds or longer. The biggest hogs are Watir::Element#type at > 62.64 seconds, Class#new at 42.49 seconds, > Watir::Element#assert_exists at 41.68 seconds and Array#include? at > 39.47 seconds. > > I'm at a loss here. I'm running these tests on the same machine with > the same version of Ruby. I originally wanted to upgrade for the > click_no_wait functionality and modal dialog functionality but I can't > take this kind of a performance hit. Is there something obvious I'm > missing? I did notice the slowdown appears to be significant on pages > with lots of controls. At this point I'm probably going to backport > the click_no_wait and modal dialog functionality to 1.4.1 unless > anyone has an idea of what I'm doing wrong here. > Pat, Thank you for your detailed report. You raise many valid issues in your email. But first, i must ask about your numbers. You say your suite takes 140 seconds with 1.4 but 425 seconds with 1.5. Is this elapsed time or cpu time? Pat, you probably know this, but let me elaborate for the benefit of those reading on. Elapsed time is "human time" and is what is reported by test-unit. CPU time only counts time where the CPU is running Watir/Ruby code. I have found that most of the elapsed time running tests is taken up waiting for pages to load. Yet this time is not logged by the profiler. I have periodically tuned both Watir and my test suites to improve performance. For example, Watir 1.4 includes performance improvements to both CPU time and elapsed time, although your figures suggest the CPU time improvements have been offset by other additions. One of the Watir performance improvements was simply to reduce some of the polling intervals. These actually had a fairly dramatic impact on the time it took to run our unit test suite. By polling for page load completion more frequently, we are likely to shave time off the elapsed wait time, but we do increase the CPU time because of the increased number of calls that are made while we are waiting. Users will see this as an improvement although it will lead the profiler to report that various calls consume more CPU time. Some simple things you can do to improve your tests performance is to use fast mode, and to look into using TextField.value= instead of TextField.set. I'm willing to look more closely into the facts you present, but my experience has been that this is not the best place to start. An additional complication for discussing this matter is that we are comparing our experiences running different, non-public test suites. What we really need is a public test suite for a non-trivial application. Hmm. Maybe we should look at the Instiki test suite... Bret From bret at pettichord.com Wed Dec 13 11:19:14 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 13 Dec 2006 10:19:14 -0600 Subject: [Wtr-general] ie.minimize broken in watir-1.5.1.1127 In-Reply-To: References: Message-ID: <45802802.4090102@pettichord.com> ?eljko Filipin wrote: > I have installed autoit, and now ie.minimize works. You should > emphasize in release notes that autoit is required (or is it only in > my case)?. > I have build gem from the latest build and installed it and now all > core tests pass. Manually installing autoit should not be required. Please log this problem in jira, with the workaround. The intent is that autoit is bundled in the gem and automatically installed. It's unclear from your report whether this is a general problem, or specific to your environment. In order to properly test this, you need to uninstall (unregister) AutoIt and then verify Watir. There is a unit test (send_keys_test.rb) that validates this automatic installation process. Let us know if you can get this test to fail. Bret From bret at pettichord.com Wed Dec 13 12:12:39 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 13 Dec 2006 11:12:39 -0600 Subject: [Wtr-general] Error when trying to attach to a modal window. In-Reply-To: <55005629.1166017028659.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <55005629.1166017028659.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <45803487.3090200@pettichord.com> Akash wrote: > Hi, I am using ruby version 1.8.2 and watir version 1.5.1.1127 still i am getting this error. undefined method `connect_unknown' for WIN32OLE:Class (NoMethodError) > > can u please give any solution for it. Make sure you DONT DO THIS: require 'win32ole' require 'watir' but instead DO THIS: require 'watir' require 'win32ole' From bret at pettichord.com Wed Dec 13 15:27:34 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 13 Dec 2006 14:27:34 -0600 Subject: [Wtr-general] WET at FOSS In-Reply-To: <981948.10961.qm@web31714.mail.mud.yahoo.com> References: <981948.10961.qm@web31714.mail.mud.yahoo.com> Message-ID: <45806236.8080402@pettichord.com> sathya shankar wrote: > WET has been selected as a talk at FOSS.in conference > in Bangalore. Raghu Venkataramana will be talking > about WET on 26th November 2006 at 11:00 am. > Interested guys can join and can have talk about the > related topics after the conf. And few other guys are > talking about ruby too :-) > > For further information about foss /registrations : > http://foss.in > I hope the presentation went well. I took a look at the slides (found here: https://foss.in/2006/cfp/slides/WET.pdf) and have a question for you or Raghu. * What do you mean by "Test run in batch mode consistently". You said that WET does this but Watir doesn't. This sounds like something pretty important that Watir should be doing. What did you do to fix this in WET? I also noticed that you provide commercial support for WET, and that you all indicated that no one provides commercial support for Watir. This is, as far as I know, true. Does any one on this list know of any one who does this for Watir? Is there a need for it? Bret From roei at opentext.com Wed Dec 13 15:57:33 2006 From: roei at opentext.com (Richard Oei) Date: Wed, 13 Dec 2006 15:57:33 -0500 Subject: [Wtr-general] Issue WTR-108 - file_field.set not working Message-ID: Hi all, I'm currently running 1.5.1.1127 and am exhibiting the problem. The seems to be a variety of workarounds posted on the net from changing the setComboBoxText def in the winClicker.rb file to swapping out the win32ole within the water/win32ole with the one in the ruby distribution, etc. Has anyone gotten this to work for 1.5.1.1127 and if so could you please list the exact steps for the workaround. Thanks, Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061213/34294799/attachment.html From Mark_Cain at RL.gov Wed Dec 13 16:41:48 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Wed, 13 Dec 2006 13:41:48 -0800 Subject: [Wtr-general] Issue WTR-108 - file_field.set not working In-Reply-To: Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A3659@EX01-2.rl.gov> Please tell us what the problem is? Does it hang? Does is error out? Show us the does you are using. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Richard Oei Sent: Wednesday, December 13, 2006 12:58 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Issue WTR-108 - file_field.set not working Hi all, I'm currently running 1.5.1.1127 and am exhibiting the problem. The seems to be a variety of workarounds posted on the net from changing the setComboBoxText def in the winClicker.rb file to swapping out the win32ole within the water/win32ole with the one in the ruby distribution, etc. Has anyone gotten this to work for 1.5.1.1127 and if so could you please list the exact steps for the workaround. Thanks, Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061213/b2e92eef/attachment.html From roei at opentext.com Wed Dec 13 16:52:25 2006 From: roei at opentext.com (Richard Oei) Date: Wed, 13 Dec 2006 16:52:25 -0500 Subject: [Wtr-general] Issue WTR-108 - file_field.set not working Message-ID: The line of code that I'm trying to execute is: ie.fileField(:name, "fileone").set("file://c:/mytext.txt"). When this is done, there are no errors routed to standard out; however, nothing happens, i.e. the "Choose file" dialogue box does not even appear. Richard ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Wednesday, December 13, 2006 4:42 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Issue WTR-108 - file_field.set not working Please tell us what the problem is? Does it hang? Does is error out? Show us the does you are using. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Richard Oei Sent: Wednesday, December 13, 2006 12:58 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Issue WTR-108 - file_field.set not working Hi all, I'm currently running 1.5.1.1127 and am exhibiting the problem. The seems to be a variety of workarounds posted on the net from changing the setComboBoxText def in the winClicker.rb file to swapping out the win32ole within the water/win32ole with the one in the ruby distribution, etc. Has anyone gotten this to work for 1.5.1.1127 and if so could you please list the exact steps for the workaround. Thanks, Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061213/c4b5be42/attachment-0001.html From Leon.Ouretski at au.ey.com Wed Dec 13 17:15:20 2006 From: Leon.Ouretski at au.ey.com (Leon.Ouretski at au.ey.com) Date: Thu, 14 Dec 2006 09:15:20 +1100 Subject: [Wtr-general] Segmentation fault. Message-ID: This email is to be read subject to the disclaimer below. Hi, I'm getting the following error when running a large number of tests: ---------------------------------------------------------------------------------------------------------------- >ruby TestContainer.rb Loaded suite TestContainer Started c:/program files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1100/./watir.rb:350: [BUG] Segmentation fault ruby 1.8.4 (2006-04-14) [i386-mswin32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. >Process failed to respond; forcing abrupt termination...>Exit code: 3 ---------------------------------------------------------------------------------------------------------------- Using Watir version 1.5.1.1100 Ruby 1.8.4 (2006-04-14) [i386-mswin32] Thanks Leon Ouretski -------------------- NOTICE - This communication contains information which is confidential and the copyright of Ernst & Young or a third party. If you are not the intended recipient of this communication please delete and destroy all copies and telephone Ernst & Young on 1800 655 717 immediately. If you are the intended recipient of this communication you should not copy, disclose or distribute this communication without the authority of Ernst & Young. Any views expressed in this Communication are those of the individual sender, except where the sender specifically states them to be the views of Ernst & Young. Except as required at law, Ernst & Young does not represent, warrant and/or guarantee that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference. Liability limited by a scheme approved under Professional Standards Legislation. -------------------- If this communication is a "commercial electronic message" (as defined in the Spam Act 2003) and you do not wish to receive communications such as this, please forward this communication to unsubscribe at au.ey.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061214/47afd147/attachment.html From Mark_Cain at RL.gov Wed Dec 13 17:37:54 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Wed, 13 Dec 2006 14:37:54 -0800 Subject: [Wtr-general] Issue WTR-108 - file_field.set not working In-Reply-To: Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A365A@EX01-2.rl.gov> Can you send the html for that portion? --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Richard Oei Sent: Wednesday, December 13, 2006 1:52 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Issue WTR-108 - file_field.set not working The line of code that I'm trying to execute is: ie.fileField(:name, "fileone").set("file://c:/mytext.txt"). When this is done, there are no errors routed to standard out; however, nothing happens, i.e. the "Choose file" dialogue box does not even appear. Richard ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Wednesday, December 13, 2006 4:42 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Issue WTR-108 - file_field.set not working Please tell us what the problem is? Does it hang? Does is error out? Show us the does you are using. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Richard Oei Sent: Wednesday, December 13, 2006 12:58 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Issue WTR-108 - file_field.set not working Hi all, I'm currently running 1.5.1.1127 and am exhibiting the problem. The seems to be a variety of workarounds posted on the net from changing the setComboBoxText def in the winClicker.rb file to swapping out the win32ole within the water/win32ole with the one in the ruby distribution, etc. Has anyone gotten this to work for 1.5.1.1127 and if so could you please list the exact steps for the workaround. Thanks, Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061213/6e9a6e40/attachment.html From bret at pettichord.com Wed Dec 13 17:50:15 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 13 Dec 2006 16:50:15 -0600 Subject: [Wtr-general] Segmentation fault. In-Reply-To: References: Message-ID: <458083A7.4050101@pettichord.com> The simplest way to avoid this error is to use Ruby 1.8.2. Leon.Ouretski at au.ey.com wrote: > This email is to be read subject to the disclaimer below. > > > Hi, > > I'm getting the following error when running a large number of tests: > > ---------------------------------------------------------------------------------------------------------------- > > >ruby TestContainer.rb > Loaded suite TestContainer > Started > c:/program > files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1100/./watir.rb:350: > [BUG] Segmentation fault > ruby 1.8.4 (2006-04-14) [i386-mswin32] > > > This application has requested the Runtime to terminate it in an > unusual way. > Please contact the application's support team for more information. > > >Process failed to respond; forcing abrupt termination...>Exit code: 3 > ---------------------------------------------------------------------------------------------------------------- > > > Using Watir version 1.5.1.1100 > Ruby 1.8.4 (2006-04-14) [i386-mswin32] > > Thanks > > Leon Ouretski > > -------------------- > NOTICE - This communication contains information which is confidential > and the copyright of Ernst & Young or a third party. > > If you are not the intended recipient of this communication please > delete and destroy all copies and telephone Ernst & Young on 1800 655 > 717 immediately. If you are the intended recipient of this > communication you should not copy, disclose or distribute this > communication without the authority of Ernst & Young. > > Any views expressed in this Communication are those of the individual > sender, except where the sender specifically states them to be the > views of Ernst & Young. > > Except as required at law, Ernst & Young does not represent, warrant > and/or guarantee that the integrity of this communication has been > maintained nor that the communication is free of errors, virus, > interception or interference. > > Liability limited by a scheme approved under Professional Standards > Legislation. > -------------------- > > > If this communication is a "commercial electronic message" (as defined > in the Spam Act 2003) and you do not wish to receive communications > such as this, please forward this communication to unsubscribe at au.ey.com > ------------------------------------------------------------------------ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general From herr.kreutzer at googlemail.com Wed Dec 13 17:51:17 2006 From: herr.kreutzer at googlemail.com (Christian Kreutzer) Date: Wed, 13 Dec 2006 23:51:17 +0100 Subject: [Wtr-general] Can I attach to an open Excel session? In-Reply-To: <72799cd70612101801m1567f3d3s3fd4b1ebdac8a0ba@mail.gmail.com> References: <48692901.1165677262501.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <62756927.1165736426661.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <72799cd70612101801m1567f3d3s3fd4b1ebdac8a0ba@mail.gmail.com> Message-ID: <4F128175-CC52-4E26-8738-7167119ED447@googlemail.com> > For my own amusement awhile back, I built a little Fit-like test > automation framework based on Excel (so I'm not completely ignorant > on the subject), but I've never met anyone who wanted to use it. well doesn't sound that bad. I wouldnt mind to have a look at it... for many non programmer testers Excel is one of the tools they use most for their daily work. For that reason Excel is a very nice way to include those testers into the process of test automatio. I'm no big fan of Excel myself but as i said people i work with make heavy use of it... Christian From philipreedtech at gmail.com Wed Dec 13 18:27:05 2006 From: philipreedtech at gmail.com (philip reed) Date: Wed, 13 Dec 2006 18:27:05 -0500 Subject: [Wtr-general] Best practices for structuring GUI models? Message-ID: My "due diligence" has been rather sketchy -- just trying a couple of listserv queries and skimming the User Guide for the first time in a while -- so if this is answered elsewhere feel free to gently rebuke me and point me in that direction. :) I'll seize on a simple example of something I'm working on to illustrate a bigger best practices question. I'm writing some tests for a client's installation of Sendcard . Obviously it would be desirable to keep knowledge of the "guts" of the GUI separate from my high-level tests. In other words, details like the form to send a card having the following inputs: - Text field with name "to[0]" - Text field with name "to_email[0]" - Text field with name "from" - Text field with name "from_email" ... - Submit button with name "preview" don't belong in high-level test code. But where do they belong? I would imagine that somewhere some class should have a method send_card that takes a card object, and that card object should contain all this constituent data. When I sit down to implement this my perfectionism gets all caught up in questions like, "Do I need a separate class for my client's specific site and another for the Sendcard UI in general?" (so that other sendcard sites can easily reuse the same code) or stuff like that. Anyway, I guess I just need some examples of best practices for setting up Watir tests to on an object level of abstraction. The unit tests appear to have all the input names embedded in the test code which is certainly simpler and probably OK for a test, but it strikes me as unneccessarily coupling the UI and the tests. This internal argument with myself over how best to implement Watir has caused me to use Watir less than I intend to. :) -- Philip Reed, Web developer http://philipreedtech.com Web. Made simple. From christopher.mcmahon at gmail.com Wed Dec 13 18:42:44 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 13 Dec 2006 15:42:44 -0800 Subject: [Wtr-general] Best practices for structuring GUI models? In-Reply-To: References: Message-ID: <72799cd70612131542y64c592cfx9d0c824effcfd16d@mail.gmail.com> In other words, details like > the form to send a card having the following inputs: > > - Text field with name "to[0]" > - Text field with name "to_email[0]" > - Text field with name "from" > - Text field with name "from_email" > ... > - Submit button with name "preview" > > don't belong in high-level test code. > > But where do they belong? I'm going plug (yes, again!) Kevin Lawrence's article: http://www.developertesting.com/archives/month200508/20050824-Grow-your-harness.html Read it, understand it, then read it again. Then write us back. :) For myself, I set out writing a purely procedural script. After a while (50-80 lines or so) I've probably got several different code areas that should really be in their own methods. I probably have some code duplication I can extract into methods. After another 50 lines or so, I might need to put my methods in a lib and require them from a controller script. I don't do much OO, it's usually overkill for the things I need to do. I treat methods as if they were subroutines, which generally gets me where I need to go. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061213/144b6951/attachment.html From roei at opentext.com Wed Dec 13 21:15:44 2006 From: roei at opentext.com (Richard Oei) Date: Wed, 13 Dec 2006 21:15:44 -0500 Subject: [Wtr-general] Issue WTR-108 - file_field.set not working Message-ID: I've attached all the applicable files. The easiest way to do this is to simply download all three files to the root of drive C and then execute testme.rb. The script works flawlessly with Watir 1.5.1.1081 however does not work at all with 1.5.1.1127. Richard ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Wednesday, December 13, 2006 5:38 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Issue WTR-108 - file_field.set not working Can you send the html for that portion? --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Richard Oei Sent: Wednesday, December 13, 2006 1:52 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Issue WTR-108 - file_field.set not working The line of code that I'm trying to execute is: ie.fileField(:name, "fileone").set("file://c:/mytext.txt"). When this is done, there are no errors routed to standard out; however, nothing happens, i.e. the "Choose file" dialogue box does not even appear. Richard ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Cain, Mark Sent: Wednesday, December 13, 2006 4:42 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Issue WTR-108 - file_field.set not working Please tell us what the problem is? Does it hang? Does is error out? Show us the does you are using. --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Richard Oei Sent: Wednesday, December 13, 2006 12:58 PM To: wtr-general at rubyforge.org Subject: [Wtr-general] Issue WTR-108 - file_field.set not working Hi all, I'm currently running 1.5.1.1127 and am exhibiting the problem. The seems to be a variety of workarounds posted on the net from changing the setComboBoxText def in the winClicker.rb file to swapping out the win32ole within the water/win32ole with the one in the ruby distribution, etc. Has anyone gotten this to work for 1.5.1.1127 and if so could you please list the exact steps for the workaround. Thanks, Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061213/028e78f1/attachment.html -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: mytext.txt Url: http://rubyforge.org/pipermail/wtr-general/attachments/20061213/028e78f1/attachment.txt -------------- next part -------------- A non-text attachment was scrubbed... Name: testme.rb Type: application/octet-stream Size: 140 bytes Desc: testme.rb Url : http://rubyforge.org/pipermail/wtr-general/attachments/20061213/028e78f1/attachment.obj -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061213/028e78f1/attachment-0001.html From bret at pettichord.com Wed Dec 13 23:51:30 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 13 Dec 2006 22:51:30 -0600 Subject: [Wtr-general] Segmentation fault. In-Reply-To: <458083A7.4050101@pettichord.com> References: <458083A7.4050101@pettichord.com> Message-ID: <4580D852.6080401@pettichord.com> Bret Pettichord wrote: > The simplest way to avoid this error is to use Ruby 1.8.2. > Or to use the latest development version (HEAD) of Watir, to which i just committed a fix for this problem. Bret From bret at pettichord.com Thu Dec 14 00:00:59 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 13 Dec 2006 23:00:59 -0600 Subject: [Wtr-general] Best practices for structuring GUI models? In-Reply-To: References: Message-ID: <4580DA8B.6040205@pettichord.com> philip reed wrote: > When I sit down to implement this my perfectionism gets all caught up > in questions like, "Do I need a separate class for my client's > specific site and another for the Sendcard > UI in general?" (so that other sendcard sites can easily reuse the > same code) or stuff like that. > I used to have the exact same problem. Now i test-drive all my "gui models" and testing frameworks with simple tests. These help me clarify the syntax i want to use and then once they work i can tweak them and the libraries until i get something that not only works, but is also elegant. The stuff i use a lot gets refactored a lot until i am happy with the design. The stuff that i don't use much retains a certain cruftyness. To specifically address your dilemma, You should hard-code my tests to work with your client's site and then only generalize the code when you also need to get it to work with the Sendcard UI. One thing at a time. In other words, I agree with everything Chris said. The only problem I have with Kevin's article is that it is written somewhat from the perspective of developer-testing. I would love to see a similar article directed more on testers. Perhaps Chris can write it. Bret From bret at pettichord.com Thu Dec 14 00:11:27 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 13 Dec 2006 23:11:27 -0600 Subject: [Wtr-general] list of "watir" commands In-Reply-To: <55866145.1164814198384.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <55866145.1164814198384.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4580DCFF.60907@pettichord.com> vijay wrote: > I have got a small doubt. Is there some place where one can find the list of commands that are available in Watir. When I went through this forum searching for some issue, I found a lot of new commands like clickWindowsButton, clickWindowsButton_hwnd, ie.enabled_popup(5) etc. If there a repository for all these available commands, then it would be greatly helpful. > Have you looked in the Watir rdoc? That includes the supported methods. Many of the specific methods you ask about are not documented, and therefore are being moved to watir-contrib. Bret From christopher.mcmahon at gmail.com Thu Dec 14 00:58:46 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Wed, 13 Dec 2006 21:58:46 -0800 Subject: [Wtr-general] Best practices for structuring GUI models? In-Reply-To: <4580DA8B.6040205@pettichord.com> References: <4580DA8B.6040205@pettichord.com> Message-ID: <72799cd70612132158h46836e1co46485bff7ba0fe8f@mail.gmail.com> > The stuff i use a lot gets refactored a > lot until i am happy with the design. Actually, Bret refactors to the point where I find his code a little difficult to parse in my head. :) > One thing at a time. Amen. In other words, I agree with everything Chris said. The only problem I > have with Kevin's article is that it is written somewhat from the > perspective of developer-testing. I would love to see a similar article > directed more on testers. Perhaps Chris can write it. That's why every time I plug this article I mention that it bears re-reading. Read it once and you'll get a some ideas to use. Use them. Then read it again, and you'll get more ideas. Repeat until you've finally figured out what he was actually saying. He hasn't written that much about it, but Jonathan Kohl is also really good at this kind of larger-scale test automation design. He's probably a better candidate than me to write the Definitive Article on the subject. One thing we pretty much all agree on is the agile formula: make it work; then make it good; then make it fast. Your first pass is not going to be pretty. That's OK. My first pass is procedural; Bret's first pass is crazy OOP or something; I don't know what Jonathan's first pass is like, but I gather it has a lot of code duplication. However you can get it to work. The point being that lots of testers are in your boat, and information about your situation is floating around unorganized at the moment. But it's coming, slowly. You're on the right track. Keep going, keep asking questions, and keep us posted. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061213/853700a0/attachment.html From Leon.Ouretski at au.ey.com Thu Dec 14 01:46:35 2006 From: Leon.Ouretski at au.ey.com (Leon.Ouretski at au.ey.com) Date: Thu, 14 Dec 2006 17:46:35 +1100 Subject: [Wtr-general] Failed to allocate memory error. Message-ID: This email is to be read subject to the disclaimer below. Hi, I've resolved the Segmentation fault error by installing Ruby 1.8.2, however I now get a new error (although it is much further into the run than before): [FATAL] failed to allocate memory Anyone? Thanks Leon Ouretski -------------------- NOTICE - This communication contains information which is confidential and the copyright of Ernst & Young or a third party. If you are not the intended recipient of this communication please delete and destroy all copies and telephone Ernst & Young on 1800 655 717 immediately. If you are the intended recipient of this communication you should not copy, disclose or distribute this communication without the authority of Ernst & Young. Any views expressed in this Communication are those of the individual sender, except where the sender specifically states them to be the views of Ernst & Young. Except as required at law, Ernst & Young does not represent, warrant and/or guarantee that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference. Liability limited by a scheme approved under Professional Standards Legislation. -------------------- If this communication is a "commercial electronic message" (as defined in the Spam Act 2003) and you do not wish to receive communications such as this, please forward this communication to unsubscribe at au.ey.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061214/5b4e42ff/attachment.html From forum-watir-users at openqa.org Thu Dec 14 01:52:32 2006 From: forum-watir-users at openqa.org (kavitha) Date: Thu, 14 Dec 2006 00:52:32 CST Subject: [Wtr-general] How to Find count for the text_field with same names Message-ID: <41072349.1166079182471.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi friends, can any one help on this: Say for eg., HTML page has 4 pop buttons with same name and value. So, if I ask watir to click the button with name or value, by defaults it takes the first button. How to access the 2 and so on buttons. [b]Note:[/b] I have used send_keys to click those buttons, but the problem is, i am not able to attach the pop up (that raised on clicking the buttons) even with the exact title. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5774&messageID=16167#16167 From forum-watir-users at openqa.org Thu Dec 14 01:52:58 2006 From: forum-watir-users at openqa.org (Akash) Date: Thu, 14 Dec 2006 00:52:58 CST Subject: [Wtr-general] Error when trying to attach to a modal window. In-Reply-To: <45803487.3090200@pettichord.com> Message-ID: <45759626.1166079208052.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks a lot. It's working now :) --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5018&messageID=16168#16168 From mail at chriss-baumann.de Thu Dec 14 03:49:49 2006 From: mail at chriss-baumann.de (Christian Baumann) Date: Thu, 14 Dec 2006 09:49:49 +0100 Subject: [Wtr-general] How to Find count for the text_field with same names In-Reply-To: <41072349.1166079182471.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <41072349.1166079182471.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4581102D.10905@chriss-baumann.de> Just check out the WATIR User Guide (http://wtr.rubyforge.org/watir_user_guide.html) for "Access Element Using Index" kavitha schrieb: > Hi friends, > > can any one help on this: > > Say for eg., HTML page has 4 pop buttons with same name and value. So, if I ask watir to click the button with name or value, by defaults it takes the first button. How to access the 2 and so on buttons. > > [b]Note:[/b] I have used send_keys to click those buttons, but the problem is, i am not able to attach the pop up (that raised on clicking the buttons) even with the exact title. > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5774&messageID=16167#16167 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From bret at pettichord.com Thu Dec 14 08:44:25 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 14 Dec 2006 07:44:25 -0600 Subject: [Wtr-general] Best practices for structuring GUI models? In-Reply-To: <72799cd70612132158h46836e1co46485bff7ba0fe8f@mail.gmail.com> References: <4580DA8B.6040205@pettichord.com> <72799cd70612132158h46836e1co46485bff7ba0fe8f@mail.gmail.com> Message-ID: <45815539.20703@pettichord.com> Chris McMahon wrote: > Your first pass is not going to be pretty. That's OK. My first pass > is procedural; Bret's first pass is crazy OOP or something; I don't > know what Jonathan's first pass is like, but I gather it has a lot of > code duplication. However you can get it to work. Actually, my first is typically to write another method in the test class. This is the reason that test methods have to start with the word "test": this allows you to write other methods (that don't start with "test") that your test methods can use. Once my test, using this method, is passing, then i start my "Crazy OOP" stuff (mostly use simple design patterns, actually). Bret From forum-watir-users at openqa.org Thu Dec 14 08:53:55 2006 From: forum-watir-users at openqa.org (Akash) Date: Thu, 14 Dec 2006 07:53:55 CST Subject: [Wtr-general] How to handle javascript pop ups from drop down lists Message-ID: <59507143.1166104465643.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, I am getting a javascript pop up after i select a value from some drop down list using the select_list method. Since i can not use click_no_wait for a list, how am i supposed to handle the pop up. Moreover this pop up generates from a modal window and that has added to my woes. Can anyone please provide a solution for it. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5778&messageID=16178#16178 From esjewett at gmail.com Thu Dec 14 09:28:10 2006 From: esjewett at gmail.com (Ethan Jewett) Date: Thu, 14 Dec 2006 08:28:10 -0600 Subject: [Wtr-general] How to handle javascript pop ups from drop down lists In-Reply-To: <59507143.1166104465643.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <59507143.1166104465643.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <68f4a0e80612140628o4f842cb4xae6b256c3b9644c1@mail.gmail.com> Akash, Hopefully someone has a simpler solution, but my solution was to mixin (using a module) a new method to the offending class (in your case "SelectList") called select_no_wait(item). The contents of this method would be the same as the select(item) method, but without the @container.wait. My problem was with the IE.goto method, not with list selection, so the execution won't be quite the same, but the idea is there. I don't have much time right now, but if no one responds with another fix within the next 12 hours or so, I'll try to post the code that should do that job. Ethan On 12/14/06, Akash wrote: > Hi, > I am getting a javascript pop up after i select a value from some drop down list using the select_list method. Since i can not use click_no_wait for a list, how am i supposed to handle the pop up. > Moreover this pop up generates from a modal window and that has added to my woes. > Can anyone please provide a solution for it. > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5778&messageID=16178#16178 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Thu Dec 14 09:39:45 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 14 Dec 2006 08:39:45 -0600 Subject: [Wtr-general] Memory access errors In-Reply-To: <72799cd70612061351lc0b466dvb0cf053bd9a731cf@mail.gmail.com> References: <50962147.1160777568740.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <49341610.1165441264537.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <72799cd70612061351lc0b466dvb0cf053bd9a731cf@mail.gmail.com> Message-ID: <45816231.2060105@pettichord.com> Chris McMahon wrote: > > On 12/6/06, *Dave Munns* > wrote: > > Reinstalling IE6 fixed the problem. It appears that an install of > QTP6 affected some critical dlls. > > > If that's really true, that's an awful ugly thing for a *test tool* to > do. Actually almost all the test tools do this. This is why complaining about FireWatir's plugin is unfair: the commercial tools do the same thing, only they have a more automated install, so users aren't aware of what is actually happening. Bret From zeljko.filipin at gmail.com Thu Dec 14 09:43:43 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 14 Dec 2006 15:43:43 +0100 Subject: [Wtr-general] Best practices for structuring GUI models? In-Reply-To: <4580DA8B.6040205@pettichord.com> References: <4580DA8B.6040205@pettichord.com> Message-ID: On 12/14/06, Bret Pettichord wrote: > > Now i test-drive all my "gui models" and testing frameworks with simple > tests. Test first watir scirpts? Would you post a sample? I am very interested. -- Zeljko Filipin http://zeljkofilipin.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061214/185c7cb9/attachment-0001.html From zeljko.filipin at gmail.com Thu Dec 14 09:52:01 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 14 Dec 2006 15:52:01 +0100 Subject: [Wtr-general] Best practices for structuring GUI models? In-Reply-To: <45815539.20703@pettichord.com> References: <4580DA8B.6040205@pettichord.com> <72799cd70612132158h46836e1co46485bff7ba0fe8f@mail.gmail.com> <45815539.20703@pettichord.com> Message-ID: On 12/14/06, Bret Pettichord wrote: > > Once my test, using this method, is passing, then i start my "Crazy OOP" > stuff (mostly use simple design patterns, actually). Would you also post which "simple design patterns" are you using? I am very interested to see what others are doing. -- Zeljko Filipin http://zeljkofilipin.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061214/fcb37cfc/attachment.html From Mark_Cain at RL.gov Thu Dec 14 10:21:27 2006 From: Mark_Cain at RL.gov (Cain, Mark) Date: Thu, 14 Dec 2006 07:21:27 -0800 Subject: [Wtr-general] Issue WTR-108 - file_field.set not working In-Reply-To: Message-ID: <4440693B7CFF2440ABC2E0BE480DABA10A365B@EX01-2.rl.gov> I ran this locally and it worked for me. require 'watir' require 'watir\contrib\enabled_popup' include Watir def startClicker( button , waitTime=9, user_input=nil) hwnd = $ie.enabled_popup(waitTime) # get a handle if one exists if (hwnd) # yes there is a popup w = WinClicker.new if ( user_input ) w.setTextValueForFileNameField(hwnd, "#{user_input}") end sleep 3 # I put this in to see the text being input it is not necessary to work w.clickWindowsButton_hwnd(hwnd, "#{button}") # "OK" or whatever the name on the button is w=nil # this is just cleanup end end $ie = IE.new() $ie.goto("C:\\fileupload.html") $ie.fileField(:name, "fileone").click_no_wait fPath = "file://C:\\mytext.txt" startClicker("&Open", 7, fPath ) # 3rd parameter is optional. Hope this helps, --Mark ________________________________ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Richard Oei Sent: Wednesday, December 13, 2006 6:16 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Issue WTR-108 - file_field.set not working I've attached all the applicable files. The easiest way to do this is to simply download all three files to the root of drive C and then execute testme.rb. The script works flawlessly with Watir 1.5.1.1081 however does not work at all with 1.5.1.1127. Richard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061214/38c2a851/attachment.html From forum-watir-users at openqa.org Thu Dec 14 11:41:00 2006 From: forum-watir-users at openqa.org (Dave Munns) Date: Thu, 14 Dec 2006 10:41:00 CST Subject: [Wtr-general] How to Find count for the text_field with same names In-Reply-To: <41072349.1166079182471.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <53906784.1166114501215.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> That's where accessing an object by index may work. Try something like: ie.frame('ifyouhaveaframe').button(:index,2).html to see if it is accessing the correct object, then .click it. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5774&messageID=16189#16189 From bret at pettichord.com Thu Dec 14 11:45:47 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 14 Dec 2006 10:45:47 -0600 Subject: [Wtr-general] A special `method_missing': In-Reply-To: <53142117.1164677603902.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <53142117.1164677603902.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <45817FBB.3090806@pettichord.com> Allen Zhou wrote: > Sorry for spam. I just found out the same issue as me, it is a defect of Watir. > More details please refer the following thread. > http://www.mail-archive.com/wtr-general at rubyforge.org/msg05037.html > This is a known defect: http://jira.openqa.org/browse/WTR-94 I just posted this workaround: require 'watir' ie = Watir::IE.new ie.disable_checker(Watir::NAVIGATION_CHECKER) ie.goto('http://cnn.com') Unless someone provides a fix to the NAVIGATION_CHECKER, i'm inclined to stop adding it automatically when initializing IE objects. Bret From christopher.mcmahon at gmail.com Thu Dec 14 11:51:26 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 14 Dec 2006 08:51:26 -0800 Subject: [Wtr-general] Failed to allocate memory error. In-Reply-To: References: Message-ID: <72799cd70612140851m64790931h4668aa9e63949401@mail.gmail.com> > > Hi, I've resolved the Segmentation fault error by installing Ruby 1.8.2, > however I now get a new error (although it is much further into the run than > before): > > [FATAL] failed to allocate memory I'll bet it's a *lot* further into the run. Watch Task Manager and see how much memory your Ruby process is allocating. Look through your code for something like my_big_array = [] my string = "foo" 1.upto 1000000 my_big_array << my_string end -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061214/12c5c436/attachment.html From mrussell at inpses.co.uk Thu Dec 14 11:53:53 2006 From: mrussell at inpses.co.uk (Max Russell) Date: Thu, 14 Dec 2006 16:53:53 -0000 Subject: [Wtr-general] Storing shorthand variables in a module Message-ID: Hi- I've been trying to store a list of nodes as variables, accessible from a module, but don't think it is suitable: tt_choose_patient = ie.frame("left").link(:index, 3) tt_diabetes = ie.frame("left").link(:index, 6) (etc) The reason being that there are a load of these nodes and accessing them through the index is brittle. What I 'd like is for scripts to be able to access the node without having to specify right down to the level of the node- that way if the nodes changed, I can do one update and all the test scripts remain ok. I want to be able to include the module and do something like tt_choose_patient.click Any suggestions? Max Russell Test Analyst. INPS Tel: 01382 223900 Fax: 01382 204488 Visit our Web site at www.inps.co.uk The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of In Practice Systems Limited or any of its affiliates. If you are not the intended recipient please contact is.helpdesk at inps.co.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061214/d4307078/attachment.html From raghu at qantom.com Thu Dec 14 13:11:54 2006 From: raghu at qantom.com (Raghu Venkataramana) Date: Thu, 14 Dec 2006 23:41:54 +0530 Subject: [Wtr-general] WET at FOSS In-Reply-To: <45806236.8080402@pettichord.com> References: <981948.10961.qm@web31714.mail.mud.yahoo.com> <45806236.8080402@pettichord.com> Message-ID: <458193EA.6030009@qantom.com> Bret Pettichord wrote: > sathya shankar wrote: > >> WET has been selected as a talk at FOSS.in conference >> in Bangalore. Raghu Venkataramana will be talking >> about WET on 26th November 2006 at 11:00 am. >> Interested guys can join and can have talk about the >> related topics after the conf. And few other guys are >> talking about ruby too :-) >> >> For further information about foss /registrations : >> http://foss.in >> >> > I hope the presentation went well. I took a look at the slides (found > here: https://foss.in/2006/cfp/slides/WET.pdf) and have a question for > you or Raghu. > > * What do you mean by "Test run in batch mode consistently". You said > that WET does this but Watir doesn't. This sounds like something pretty > important that Watir should be doing. What did you do to fix this in WET? > A combination of two things - a) Test definitions to describe a test completely. The test definitions include preconditions and teardowns which ensure that a test's dependencies can be called before the test itself. b) BatchRunner to define the order in which tests are executed - Without these we found that tests were being run in an alphabetical order rather than the order in which tests were defined. Many a time, execution of a test depends on the fact that previous tests have been run and this was causing tests to break when run in a batch mode. That's when we invented the 'preconditions / teardowns' support + the batch mode of execution > I also noticed that you provide commercial support for WET, and that you > all indicated that no one provides commercial support for Watir. This > is, as far as I know, true. Does any one on this list know of any one > who does this for Watir? Is there a need for it? > Actually Qantom doesn't provide commercial support but our sister associates, Thwameva Technologies provides commercial support for WET. Now, Thwameva is also working towards adding commercial support for Watir. We keep getting enquiries about Watir support - mostly training for Watir and therefore Thwameva has began to offer Training Programs for Watir and with time will add other support models for Watir. > Bret > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > Regards, Raghu Venkataramana /Director/ *Qantom Software Private Limited* 72/1B, 2nd Floor, K.H. Plaza, Kanakapura Road, Bangalore-78 Phone : 26655216, Telefax : 26799269 SQA partners for your products www.qantom.com The future of test tools is open source www.wet.qantom.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061214/3771ceb5/attachment.html From arkie at compli.com Thu Dec 14 13:23:47 2006 From: arkie at compli.com (Alan Ark) Date: Thu, 14 Dec 2006 12:23:47 -0600 Subject: [Wtr-general] Storing shorthand variables in a module In-Reply-To: Message-ID: <7F2DAB1053EC4D47B821DA0A7BA5E3EB0127517D@mail-21ps.atlarge.net> I?ve been trying to store a list of nodes as variables, accessible from a module, but don?t think it is suitable: tt_choose_patient = ie.frame("left").link(:index, 3) tt_diabetes = ie.frame("left").link(:index, 6) (etc) [Arkie] Without having some source to look at, I would have to ask if there is some type of immutable attribute available that you can reference instead? Id?s or name or even href might be good choices. Using a regex might be useful as well. The reason being that there are a load of these nodes and accessing them through the index is brittle. What I ?d like is for scripts to be able to access the node without having to specify right down to the level of the node- that way if the nodes changed, I can do one update and all the test scripts remain ok. I want to be able to include the module and do something like tt_choose_patient.click Any suggestions? -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.409 / Virus Database: 268.15.18/586 - Release Date: 12/13/2006 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.409 / Virus Database: 268.15.18/586 - Release Date: 12/13/2006 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061214/51c42df5/attachment-0001.html From paul.rogers at shaw.ca Thu Dec 14 14:38:04 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 14 Dec 2006 12:38:04 -0700 Subject: [Wtr-general] A special `method_missing': References: <53142117.1164677603902.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <45817FBB.3090806@pettichord.com> Message-ID: <00b301c71fb7$5fb76840$6400a8c0@laptop> I encountered the same problem. I have a fix, I just havent got as far as checking it in. ----- Original Message ----- From: "Bret Pettichord" To: Sent: Thursday, December 14, 2006 9:45 AM Subject: Re: [Wtr-general] A special `method_missing': > Allen Zhou wrote: >> Sorry for spam. I just found out the same issue as me, it is a defect of >> Watir. >> More details please refer the following thread. >> http://www.mail-archive.com/wtr-general at rubyforge.org/msg05037.html >> > This is a known defect: http://jira.openqa.org/browse/WTR-94 > > I just posted this workaround: > > require 'watir' > > ie = Watir::IE.new > ie.disable_checker(Watir::NAVIGATION_CHECKER) > ie.goto('http://cnn.com') > > Unless someone provides a fix to the NAVIGATION_CHECKER, i'm inclined to > stop adding it automatically when initializing IE objects. > > Bret > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From forum-watir-users at openqa.org Thu Dec 14 13:58:22 2006 From: forum-watir-users at openqa.org (Lou Wilson) Date: Thu, 14 Dec 2006 12:58:22 CST Subject: [Wtr-general] Can I attach to an open Excel session? In-Reply-To: <47122428.1165825899117.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <58643051.1166122732171.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> cmcmahon wrote: >>On the other hand, you sound like you know what you're doing, so I really am interested in how it works out. I might change my mind. Same back at you. I'm considering changing the VBA/Excel code to write out to .INI files instead of .RB files, considering that all they are writing is variables and assignments and then calling a main .RB to act on them. Probably works as well either way, but might be a little cleaner as .INI files. Also, I can use the same .INI files in other environments (such as the SILK tests another department uses). You got me started thinking about how non-standard my way was, and I thank you. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5687&messageID=16200#16200 From forum-watir-users at openqa.org Thu Dec 14 15:07:25 2006 From: forum-watir-users at openqa.org (Lou Wilson) Date: Thu, 14 Dec 2006 14:07:25 CST Subject: [Wtr-general] Storing shorthand variables in a module In-Reply-To: Message-ID: <61625577.1166126875665.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Alan, you need to edit your answer. It came across as empty. You can edit it on http://forums.openqa.org instead of the mail list. -Lou from Unicru --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5785&messageID=16206#16206 From christopher.mcmahon at gmail.com Thu Dec 14 16:36:10 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 14 Dec 2006 13:36:10 -0800 Subject: [Wtr-general] Can I attach to an open Excel session? In-Reply-To: <58643051.1166122732171.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <47122428.1165825899117.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <58643051.1166122732171.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70612141336y50519cefx1ff8fe3bb93046d0@mail.gmail.com> On 12/14/06, Lou Wilson wrote: > > cmcmahon wrote: > >>On the other hand, you sound like you know what you're doing, so I > really am interested in how it works out. I might change my mind. > > Same back at you. I'm considering changing the VBA/Excel code to write > out to .INI files instead of .RB files, considering that all they are > writing is variables and assignments and then calling a main .RB to act on > them. Probably works as well either way, but might be a little cleaner as > .INI files. Also, I can use the same .INI files in other environments (such > as the SILK tests another department uses). You got me started thinking > about how non-standard my way was, and I thank you. This makes a lot more sense to me. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061214/6218267a/attachment.html From dara.lillis at kiodex.com Thu Dec 14 16:36:05 2006 From: dara.lillis at kiodex.com (Lillis, Dara) Date: Thu, 14 Dec 2006 13:36:05 -0800 Subject: [Wtr-general] modal dialogs and remote desktop Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E01B6064B@ehost011-27.exch011.intermedia.net> I have a strange problem with using the modal dialog code (I'm using watir development gem 1.5.1.1017) while running tests on a remote machine via remote desktop. When I am rdesktop-ed to a machine and run some code that uses modal dialogs (see below for code), it works fine when I am looking at the remote desktop, but if I minimise the remote desktop or close it and leave the program running, my test hangs and never clicks on the modal dialog. here's the code I am using: browser.link(:text, link_text).click_no_wait dialog = Watir::Dialog.new dialog.exists? dialog.button(dialog_text).click any ideas? Dara Lillis * Testing - Team Lead * SunGard * Kiodex * 628 Broadway, Suite 501, New York, NY 10012 Tel 646-437-2627 * Fax 646-437-3910 * http://www.sungard.com/Kiodex -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061214/a3939f3a/attachment.html From christopher.mcmahon at gmail.com Thu Dec 14 18:35:12 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 14 Dec 2006 15:35:12 -0800 Subject: [Wtr-general] Failed to allocate memory error. In-Reply-To: <72799cd70612140851m64790931h4668aa9e63949401@mail.gmail.com> References: <72799cd70612140851m64790931h4668aa9e63949401@mail.gmail.com> Message-ID: <72799cd70612141535o103b2da4ud0916ac5d8af3b3a@mail.gmail.com> I just got test_select_members.rb:55:in `<<': failed to allocate memory (NoMemoryError) trying to put the contents of a large SQL table into an array. On 12/14/06, Chris McMahon wrote: > > > > > Hi, I've resolved the Segmentation fault error by installing Ruby 1.8.2, > > however I now get a new error (although it is much further into the run than > > before): > > > > [FATAL] failed to allocate memory > > > > I'll bet it's a *lot* further into the run. Watch Task Manager and see > how much memory your Ruby process is allocating. Look through your code for > something like > > my_big_array = [] > my string = "foo" > 1.upto 1000000 > my_big_array << my_string > end > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061214/a4ec39d7/attachment.html From forum-watir-users at openqa.org Fri Dec 15 01:37:04 2006 From: forum-watir-users at openqa.org (rajitha) Date: Fri, 15 Dec 2006 00:37:04 CST Subject: [Wtr-general] Unable to use click_no_wait in a modal Message-ID: <56150224.1166164654386.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Unable to use click_no_wait in modal. say i ahve a modal_dialog,in that if i click on save that modal will close and another modal will open.for save button iam unable to use click_no_wait.if i use its getting hang after some time it is give some error message. can any one help on this --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5793&messageID=16224#16224 From forum-watir-users at openqa.org Fri Dec 15 02:29:23 2006 From: forum-watir-users at openqa.org (Lou Wilson) Date: Fri, 15 Dec 2006 01:29:23 CST Subject: [Wtr-general] Can I attach to an open Excel session? In-Reply-To: <72799cd70612141336y50519cefx1ff8fe3bb93046d0@mail.gmail.com> Message-ID: <56344844.1166167793646.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> The other thing I like about using the Excel macro to write the INI file and fire off a ruby script: I can compile the main ruby script and hand the Excel pages and the ruby executable to a tester who doesn't have ruby installed on his machine. With Excel generating a ruby script, he DOES have to have it installed. --Lou --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5687&messageID=16225#16225 From christopher.mcmahon at gmail.com Fri Dec 15 02:45:23 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 14 Dec 2006 23:45:23 -0800 Subject: [Wtr-general] Can I attach to an open Excel session? In-Reply-To: <56344844.1166167793646.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <72799cd70612141336y50519cefx1ff8fe3bb93046d0@mail.gmail.com> <56344844.1166167793646.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70612142345h43ccaf66k85997f033ce2f66f@mail.gmail.com> On 12/14/06, Lou Wilson wrote: > > The other thing I like about using the Excel macro to write the INI file > and fire off a ruby script: I can compile the main ruby script and hand the > Excel pages and the ruby executable to a tester who doesn't have ruby > installed on his machine. With Excel generating a ruby script, he DOES have > to have it installed. > > --Lo I might be stretching here, but it seems to me that with the INI files, you also get a generic set of "test data" or "environment data" or "test information" or something instead of "Ruby code", which is probably a gain for you. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061214/a8dc2dcf/attachment.html From zeljko.filipin at gmail.com Fri Dec 15 06:22:45 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 15 Dec 2006 12:22:45 +0100 Subject: [Wtr-general] ie.minimize broken in watir-1.5.1.1127 In-Reply-To: <45802802.4090102@pettichord.com> References: <45802802.4090102@pettichord.com> Message-ID: On 12/13/06, Bret Pettichord wrote: > > It's unclear from your report whether this is a general problem, or > specific to your environment. In order to properly test this, you need > to uninstall (unregister) AutoIt and then verify Watir. > > There is a unit test (send_keys_test.rb) that validates this automatic > installation process. Let us know if you can get this test to fail. I have uninstalled autoit, uninstalled watir-1.5.1.1081.gem (the last gem that works for me), installed watir 1.5.1.1127, ruby is 1.8.5 (2006-08-25) [i386-mswin32], internet explorer is 7. C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.1.1127\unittests>send_keys_test.rb Loaded suite C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127 /unittests/send_keys_test Started FEE Finished in 1.515 seconds. 1) Failure: test_autoregistration(TC_Fields) [C:/ruby/lib/ruby/gems/1.8/gems/watir- 1.5.1.1127/unittests/send_keys_test.rb:31]: Exception raised: Class: Message: <"Unknown OLE server: `AutoItX3.Control'\n HRESULT error code:0x800401f3\n Invalid class string"> ---Backtrace--- C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/unittests/../watir.rb:4356:in `initialize' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/unittests/../watir.rb:4356:in `new' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/unittests/../watir.rb:4356:in `autoit' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/unittests/../watir.rb:1644:in `autoit' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/unittests/../watir.rb:1652:in `send_keys' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/unittests/send_keys_test.rb:31:in `test_autoregistration' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/unittests/send_keys_test.rb:31:in `test_autoregistration' --------------- 2) Error: test_enter(TC_Fields): WIN32OLERuntimeError: Unknown OLE server: `AutoItX3.Control' HRESULT error code:0x800401f3 Invalid class string C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/unittests/../watir.rb:4356:in `initialize' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/unittests/../watir.rb:4356:in `new' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/unittests/../watir.rb:4356:in `autoit' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/unittests/../watir.rb:1644:in `autoit' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/unittests/../watir.rb:1652:in `send_keys' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/unittests/send_keys_test.rb:23:in `test_enter' 3) Error: test_tabbing(TC_Fields): WIN32OLERuntimeError: Unknown OLE server: `AutoItX3.Control' HRESULT error code:0x800401f3 Invalid class string C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/unittests/../watir.rb:4356:in `initialize' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/unittests/../watir.rb:4356:in `new' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/unittests/../watir.rb:4356:in `autoit' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/unittests/../watir.rb:1644:in `autoit' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/unittests/../watir.rb:1652:in `send_keys' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/unittests/send_keys_test.rb:16:in `test_tabbing' 3 tests, 2 assertions, 1 failures, 2 errors -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061215/febb8874/attachment-0001.html From cooldudevamsee at gmail.com Fri Dec 15 06:41:46 2006 From: cooldudevamsee at gmail.com (Vamsee Krishna M) Date: Fri, 15 Dec 2006 17:11:46 +0530 Subject: [Wtr-general] Alternative for getElementsByClassName Message-ID: <30e8443d0612150341t7ece357bkeb4714e99f8849eb@mail.gmail.com> Hi, I am using water nightly build(watir-1.5.1.1127). I have an Ajax app with more than 500kb of DOM in size. I need to get a bunch of table cells with specified class name. And I can't find any method equivalent of getElementsByClassName in watir. I tried to do the stuff with XPATH but As far as I know I can get only one element at a time using the method cell (:xpath, ). I also tried a last cruel method using regex since because of my apps DOM is very large Its not practical to roam around the entire dom. So If anybody have any solution please reply me with your solution. Thanks. Regards, Vamsee Krishna -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061215/3c9c3c9b/attachment.html From zeljko.filipin at gmail.com Fri Dec 15 07:02:04 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 15 Dec 2006 13:02:04 +0100 Subject: [Wtr-general] ie.minimize broken in watir-1.5.1.1127 In-Reply-To: <45802802.4090102@pettichord.com> References: <45802802.4090102@pettichord.com> Message-ID: On 12/13/06, Bret Pettichord wrote: > > Manually installing autoit should not be required. I have found the reason why autoit is not installed. I am usually logged on as limited user, I only switch to administrator when needed (I have listened too much of Security Now! podcast, http://www.grc.com/securitynow.htm). So, I installed watir as limited user. It seems that autoit can not be installed (or used) unless you are administrator. send_keys_test.rb fails even if administrator installs watir and then limited user executes test. It works fine when I run that test as administrator. I logged this in jira (http://jira.openqa.org/browse/WTR-120). -- Zeljko Filipin http://zeljkofilipin.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061215/3a1bd95d/attachment.html From zeljko.filipin at gmail.com Fri Dec 15 07:07:20 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 15 Dec 2006 13:07:20 +0100 Subject: [Wtr-general] Alternative for getElementsByClassName In-Reply-To: <30e8443d0612150341t7ece357bkeb4714e99f8849eb@mail.gmail.com> References: <30e8443d0612150341t7ece357bkeb4714e99f8849eb@mail.gmail.com> Message-ID: If you have link that looks like this link you can click it with this ie.link(:class_name, "myclass").click -- Zeljko Filipin http://zeljkofilipin.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061215/b4686c0c/attachment.html From forum-watir-users at openqa.org Fri Dec 15 07:47:45 2006 From: forum-watir-users at openqa.org (Akash) Date: Fri, 15 Dec 2006 06:47:45 CST Subject: [Wtr-general] How to handle javascript pop ups from drop down In-Reply-To: <68f4a0e80612140628o4f842cb4xae6b256c3b9644c1@mail.gmail.com> Message-ID: <49759191.1166186895691.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Ethan, If you have time,kindly send me the piece of code that you have written to overcome this type of problem.I am new to ruby and watir so it would be helpful if u could explain how to tweak it to suit my needs.I would greatly appreciate the help. Thanks, Akash > Akash, > > Hopefully someone has a simpler solution, but my > solution was to mixin > (using a module) a new method to the offending class > (in your case > "SelectList") called select_no_wait(item). The > contents of this > method would be the same as the select(item) method, > but without the > @container.wait. > > My problem was with the IE.goto method, not with list > selection, so > the execution won't be quite the same, but the idea > is there. > > I don't have much time right now, but if no one > responds with another > fix within the next 12 hours or so, I'll try to post > the code that > should do that job. > > Ethan > > On 12/14/06, Akash > wrote: > > Hi, > > I am getting a javascript pop up after i select a > value from some drop down list using the select_list > method. Since i can not use click_no_wait for a list, > how am i supposed to handle the pop up. > > Moreover this pop up generates from a modal window > and that has added to my woes. > > Can anyone please provide a solution for it. > > > ------------------------------------------------------ > --------------- > > Posted via Jive Forums > > > http://forums.openqa.org/thread.jspa?threadID=5778&mes > sageID=16178#16178 > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5778&messageID=16240#16240 From esjewett at gmail.com Fri Dec 15 09:26:00 2006 From: esjewett at gmail.com (Ethan Jewett) Date: Fri, 15 Dec 2006 08:26:00 -0600 Subject: [Wtr-general] How to handle javascript pop ups from drop down lists In-Reply-To: <68f4a0e80612140628o4f842cb4xae6b256c3b9644c1@mail.gmail.com> References: <59507143.1166104465643.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <68f4a0e80612140628o4f842cb4xae6b256c3b9644c1@mail.gmail.com> Message-ID: <68f4a0e80612150626s5d8b96e1vad63c963341f3880@mail.gmail.com> This is what I did to the goto method: File Name: watir_mixin.rb ***************************** module WatirMixin def goto_no_wait(url) # These are the contents of the Watir::goto method, without the "wait" call @ie.navigate(url) # I also left of the explicit return value because I don't use it end end ***************************** Then, in my test case: ***************************** require '../../watir_mixin.rb' require 'watir' include Watir class IE include WatirMixin end class Watir::Frame include WatirMixin end ie = Watir::IE.new ie.goto_no_wait("http://site_with_popup_during_load.com") **************************** I think you can do almost the same thing with a mixin module for the SelectList class: Find the class in the watir.rb file. Find the select(item) method (which calls another method, to complicate things). Copy the contents of the method with the guts of select(item). In your mixin module, define a new method called select_no_wait(item) or something similar. Paste in the contents from the previous paragraph. Delete the @container.wait line. And you should be good to go. Past results are no guarantee of future performance, etc. Also, using mixins like this, I believe you run a risk of getting stepped on by methods added to future releases of Watir that happen to have the same name as methods you have defined in mixins. Questions for the list: 1) Is there an easier way to do this? 2) If not, what with the growing popularity of javascript events triggered by such things as list selection, button clicking, etc, would it be a popular idea to start defining a framework for alternate behaviors like "no_wait" of action methods like click, goto, select, etc? One suggestion: All action methods take an optional hash as a parameter, allowing for click(:no_wait => true) to have the same behavior as click_no_wait. In Akash's case, he could use select(item, :no_wait => true). I'd be happy to contribute some test cases if this sounds like a decent approach. Ethan On 12/14/06, Ethan Jewett wrote: > Akash, > > Hopefully someone has a simpler solution, but my solution was to mixin > (using a module) a new method to the offending class (in your case > "SelectList") called select_no_wait(item). The contents of this > method would be the same as the select(item) method, but without the > @container.wait. > > My problem was with the IE.goto method, not with list selection, so > the execution won't be quite the same, but the idea is there. > > I don't have much time right now, but if no one responds with another > fix within the next 12 hours or so, I'll try to post the code that > should do that job. > > Ethan > > On 12/14/06, Akash wrote: > > Hi, > > I am getting a javascript pop up after i select a value from some drop down list using the select_list method. Since i can not use click_no_wait for a list, how am i supposed to handle the pop up. > > Moreover this pop up generates from a modal window and that has added to my woes. > > Can anyone please provide a solution for it. > > --------------------------------------------------------------------- > > Posted via Jive Forums > > http://forums.openqa.org/thread.jspa?threadID=5778&messageID=16178#16178 > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > From forum-watir-users at openqa.org Fri Dec 15 11:29:05 2006 From: forum-watir-users at openqa.org (Doyle) Date: Fri, 15 Dec 2006 10:29:05 CST Subject: [Wtr-general] Issue WTR-108 - file_field.set not working In-Reply-To: Message-ID: <38432060.1166200175675.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Similar problem. Here are the requisite fragments: HTML Title
File :    *
WATIR $ie2 = Watir::IE.attach(:title, 'Title') $ie2.fileField(:name, "fileUpload").set("C:/setup.log") I ran the unit tests that came with Watir and they demonstrated a similar error. The text box is just not populating. Thanks, mypetrock --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5766&messageID=16244#16244 From forum-watir-users at openqa.org Fri Dec 15 15:28:10 2006 From: forum-watir-users at openqa.org (Nathan) Date: Fri, 15 Dec 2006 14:28:10 CST Subject: [Wtr-general] modal dialogs and remote desktop In-Reply-To: <35AF30C7B5EBFA4DBC854B5B9DF66B0E01B6064B@ehost011-27.exch011.intermedia.net> Message-ID: <51126366.1166214520664.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Dara, this doesn't seem right. We use remote desktop often to start tests on various machines at my company, and they never hang or break when we close the remote desktop connection (or minimize it). Have you attempted to run the test by going to the physical machine you are trying to run it on? It may help to know whether or not it runs without using remote desktop. Are you doing anything unusual like trying to access tests across a network, or something else like that? thanks, Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5789&messageID=16249#16249 From forum-watir-users at openqa.org Fri Dec 15 16:24:13 2006 From: forum-watir-users at openqa.org (Mark) Date: Fri, 15 Dec 2006 15:24:13 CST Subject: [Wtr-general] How do I click the "OK" button on a java alert? Message-ID: <41922599.1166218145437.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi all, I am new to ruby, and have searched these forums for answers, but have not found anything that seems to work or help me. (including links to FAQ's which do not appear to be available anymore) [u]Situation:[/u] I am writing ruby/watir scripts to automate tests against a website/application. On one page there is a "Help" button that when clicked opens a java alert dialog. The dialog has an "OK" button on it. [u]Problem:[/u] I am unable to gain access to the java alert dialog to gain control of the button and click it. The modal dialog does not have a :title, so my normal means of @ie.attach will not work. So my tests "hang" while it waits for the button to be clicked before it can continue on. I also do not have access to the webcode (java code) to change it, but I know that the dialog is simply invoked with 'alert("")'. [u][i]Things I have tried (with no success...)[/i][/u] @ie.button(:value, "OK").flash @ie.button("OK").click_no_wait @ie.modal_dialog.button(:value, 'OK').click [u]Versions:[/u] ruby 1.8.4 watir 1.5.1.1127 ie 6 any help would be most appreciative. Thanks. Please PM me (in addition to posting) as I may not be able to check the forums on a timely manner. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5802&messageID=16250#16250 From dara.lillis at kiodex.com Fri Dec 15 16:32:18 2006 From: dara.lillis at kiodex.com (Lillis, Dara) Date: Fri, 15 Dec 2006 13:32:18 -0800 Subject: [Wtr-general] modal dialogs and remote desktop In-Reply-To: <51126366.1166214520664.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <35AF30C7B5EBFA4DBC854B5B9DF66B0E01B6080A@ehost011-27.exch011.intermedia.net> Nathan, This problem ONLY happens with the modal dialog code. Other tests that don't use modal dialog code do not have this problem. Do any of your tests use modal dialog? If not, then you wouldn't see my problem. All test code running is on the local machine. The test runs fine on the console. So, the problem is only with modal dialog code, and only with a minimized/closed remote desktop session. thanks, -Dara -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Nathan Sent: Friday, December 15, 2006 3:28 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] modal dialogs and remote desktop Hi Dara, this doesn't seem right. We use remote desktop often to start tests on various machines at my company, and they never hang or break when we close the remote desktop connection (or minimize it). Have you attempted to run the test by going to the physical machine you are trying to run it on? It may help to know whether or not it runs without using remote desktop. Are you doing anything unusual like trying to access tests across a network, or something else like that? thanks, Nathan --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5789&messageID=16249#16249 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From forum-watir-users at openqa.org Fri Dec 15 16:59:31 2006 From: forum-watir-users at openqa.org (Mark) Date: Fri, 15 Dec 2006 15:59:31 CST Subject: [Wtr-general] How do I click the "OK" button on a java alert? In-Reply-To: <41922599.1166218145437.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <57567278.1166220001747.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I managed to get around the "hang", however, It would be nice to know how to get ahold of this window to do some validating against it. The way I got around the "Hang" was to put '.click_no_wait' on the call to click the help button. this way it clicks the help button (which produces the dialog window), but doesnt wait for the dialog to be "dismissed" to continue execution with my @IE still connected to my browser. The problem with this, is that the alert dialog has not been dismissed, and technically I have not verified that the Dialog even appeared, I just validated that I can "click" the help button. If there is a way to gain control or "identify" that the dialog is there and a way to actually click the "OK" button, then that would validate that the alert dialog window came up (and I would be able to dismiss it, for future dialogs). again, thanks for any help or pointing to places that will help me understand/fix my issue. qaos. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5802&messageID=16252#16252 From forum-watir-users at openqa.org Fri Dec 15 20:20:27 2006 From: forum-watir-users at openqa.org (Lou Wilson) Date: Fri, 15 Dec 2006 19:20:27 CST Subject: [Wtr-general] Can I attach to an open Excel session? In-Reply-To: <72799cd70612142345h43ccaf66k85997f033ce2f66f@mail.gmail.com> Message-ID: <26597536.1166232057728.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Not stretching at all. Going in the same direction of making the data useful to more people, of course, would be to just write everything to tables. One table is lots easier to query than sorting through hundreds of ini files. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5687&messageID=16263#16263 From angrez at gmail.com Sat Dec 16 02:39:03 2006 From: angrez at gmail.com (Angrez Singh) Date: Sat, 16 Dec 2006 13:09:03 +0530 Subject: [Wtr-general] Alternative for getElementsByClassName In-Reply-To: <30e8443d0612150341t7ece357bkeb4714e99f8849eb@mail.gmail.com> References: <30e8443d0612150341t7ece357bkeb4714e99f8849eb@mail.gmail.com> Message-ID: Hi, You can use elements_by_xpath to get all the elements that map to a given xpath query. element_by_xpath will return you only the first element that map to the xpath query. Regards, Angrez On 12/15/06, Vamsee Krishna M wrote: > > Hi, > > I am using water nightly build(watir-1.5.1.1127). I have an Ajax app with > more than 500kb of DOM in size. I need to get a bunch of table cells with > specified class name. And I can't find any method equivalent of > getElementsByClassName in watir. I tried to do the stuff with XPATH but As > far as I know I can get only one element at a time using the method cell > (:xpath, ). I also tried a last cruel method using regex since > because of my apps DOM is very large Its not practical to roam around the > entire dom. > > So If anybody have any solution please reply me with your solution. > > Thanks. > > Regards, > Vamsee Krishna > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061216/79e05283/attachment.html From Leon.Ouretski at au.ey.com Sun Dec 17 17:23:58 2006 From: Leon.Ouretski at au.ey.com (Leon.Ouretski at au.ey.com) Date: Mon, 18 Dec 2006 09:23:58 +1100 Subject: [Wtr-general] Failed to allocate memory error. In-Reply-To: Message-ID: This email is to be read subject to the disclaimer below. I've been watching the task manager as sudgested, and it does in fact show continual grouth in mem. usage. Is there anaything I can do to resolve this problem? Thanks Leon Ouretski wtr-general-request at rubyforge.org Sent by: wtr-general-bounces at rubyforge.org 15/12/2006 10:23 PM Please respond to wtr-general at rubyforge.org All email is logged and may be reviewed - Refer policy FP206 To wtr-general at rubyforge.org cc Subject Wtr-general Digest, Vol 37, Issue 26 Message: 6 Date: Thu, 14 Dec 2006 15:35:12 -0800 From: "Chris McMahon" Subject: Re: [Wtr-general] Failed to allocate memory error. To: wtr-general at rubyforge.org Message-ID: <72799cd70612141535o103b2da4ud0916ac5d8af3b3a at mail.gmail.com> Content-Type: text/plain; charset="iso-8859-1" I just got test_select_members.rb:55:in `<<': failed to allocate memory (NoMemoryError) trying to put the contents of a large SQL table into an array. On 12/14/06, Chris McMahon wrote: > > > > > Hi, I've resolved the Segmentation fault error by installing Ruby 1.8.2, > > however I now get a new error (although it is much further into the run than > > before): > > > > [FATAL] failed to allocate memory > > > > I'll bet it's a *lot* further into the run. Watch Task Manager and see > how much memory your Ruby process is allocating. Look through your code for > something like > > my_big_array = [] > my string = "foo" > 1.upto 1000000 > my_big_array << my_string > end > > > > -------------------- NOTICE - This communication contains information which is confidential and the copyright of Ernst & Young or a third party. If you are not the intended recipient of this communication please delete and destroy all copies and telephone Ernst & Young on 1800 655 717 immediately. If you are the intended recipient of this communication you should not copy, disclose or distribute this communication without the authority of Ernst & Young. Any views expressed in this Communication are those of the individual sender, except where the sender specifically states them to be the views of Ernst & Young. Except as required at law, Ernst & Young does not represent, warrant and/or guarantee that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference. Liability limited by a scheme approved under Professional Standards Legislation. -------------------- If this communication is a "commercial electronic message" (as defined in the Spam Act 2003) and you do not wish to receive communications such as this, please forward this communication to unsubscribe at au.ey.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061218/23378921/attachment.html From christopher.mcmahon at gmail.com Sun Dec 17 17:48:58 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Sun, 17 Dec 2006 14:48:58 -0800 Subject: [Wtr-general] Failed to allocate memory error. In-Reply-To: References: Message-ID: <72799cd70612171448u4fe6e68dged66db5d545e693d@mail.gmail.com> On 12/17/06, Leon.Ouretski at au.ey.com wrote: > > This email is to be read subject to the disclaimer below. > > > I've been watching the task manager as sudgested, and it does in fact show > continual grouth in mem. usage. Is there anaything I can do to resolve this > problem? Write your program to not use so much memory. Or get more RAM for your computer. Sorry I can't be more specific. -C -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061217/54aaa679/attachment.html From vikashkumar051 at yahoo.co.in Mon Dec 18 04:02:25 2006 From: vikashkumar051 at yahoo.co.in (VIKASH KUMAR) Date: Mon, 18 Dec 2006 14:32:25 +0530 (IST) Subject: [Wtr-general] problem in entering values in span field Message-ID: <20061218090225.46709.qmail@web7802.mail.in.yahoo.com> I am using watir version 1.5.1.1100. I am trying to enter value in span field, here is the relevant snippet of html: I am using code require 'watir' test_site='C:\\aa.htm' ie=Watir::IE.start(test_site) ie.span(:id,"tradeDate").text_field(:value,"12/18/2006").set("01/01/2000") though it enters value in the field but after entering values in the field give error message which breaks my code, here is the error message: NoMethodError: undefined method `fireEvent' for nil:NilClass from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1100/./watir.rb:3843:in `set' from (irb):5 from :0 Here, is the relevant code from watir.rb which is generating error message: def set(setThis) assert_enabled assert_not_readonly highlight(:set) @o.scrollIntoView @o.focus @o.select @o.fireEvent("onSelect") @o.value = "" @o.fireEvent("onKeyPress") doKeyPress(setThis) highlight(:clear) @o.fireEvent("onChange") @o.fireEvent("onBlur") end Please help me out from this. Thanks in advance Vikash Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download Now! http://messenger.yahoo.com/download.php -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061218/e30d3311/attachment.html From patslists at gmail.com Mon Dec 18 08:56:25 2006 From: patslists at gmail.com (Pat Mac) Date: Mon, 18 Dec 2006 08:56:25 -0500 Subject: [Wtr-general] Extreme slowdown moving from 1.4.1 to 1.5.1.1127 In-Reply-To: <45802EBB.6020502@pettichord.com> References: <212711160612011226i1948fc33mac83f91ad23c2ee8@mail.gmail.com> <45802EBB.6020502@pettichord.com> Message-ID: <212711160612180556n5b290918ic4e2729e547347cb@mail.gmail.com> On 12/13/06, Bret Pettichord wrote: > > Pat Mac wrote: > > > > Hi All, I've read through the archives I could find relating to > > performance issues related to 1.5 but I didn't see any concrete > > solutions or reasons why the slowdown is occurring. Running an > > existing script using the profiler my execution time goes from 170 > > seconds to 425 seconds. Looking at the profiler output I notice the > > following: > > > > WIN32OLE#each is the top consumer in both profiles. In 1.5 it's taking > > 70.15 seconds vs 59.19 in 1.4. Not a huge jump, but noticeable when > > running 100+ cases. > > > > WIN32OLE#invoke is the number 2 consumer in both profiles taking 64.85 > > seconds in 1.5 but only 25.69 seconds in 1.4. This is obviously quite > > significant. > > > > Beyond the top two, the next highest in 1.4 is Logger#add taking just > > over 12 seconds. However, in 1.5 I see seven additional methods taking > > 20 seconds or longer. The biggest hogs are Watir::Element#type at > > 62.64 seconds, Class#new at 42.49 seconds, > > Watir::Element#assert_exists at 41.68 seconds and Array#include? at > > 39.47 seconds. > > > > I'm at a loss here. I'm running these tests on the same machine with > > the same version of Ruby. I originally wanted to upgrade for the > > click_no_wait functionality and modal dialog functionality but I can't > > take this kind of a performance hit. Is there something obvious I'm > > missing? I did notice the slowdown appears to be significant on pages > > with lots of controls. At this point I'm probably going to backport > > the click_no_wait and modal dialog functionality to 1.4.1 unless > > anyone has an idea of what I'm doing wrong here. > > > Pat, > > Thank you for your detailed report. > > You raise many valid issues in your email. But first, i must ask about > your numbers. You say your suite takes 140 seconds with 1.4 but 425 > seconds with 1.5. Is this elapsed time or cpu time? > > Pat, you probably know this, but let me elaborate for the benefit of > those reading on. Elapsed time is "human time" and is what is reported > by test-unit. CPU time only counts time where the CPU is running > Watir/Ruby code. I have found that most of the elapsed time running > tests is taken up waiting for pages to load. Yet this time is not logged > by the profiler. > > I have periodically tuned both Watir and my test suites to improve > performance. For example, Watir 1.4 includes performance improvements to > both CPU time and elapsed time, although your figures suggest the CPU > time improvements have been offset by other additions. One of the Watir > performance improvements was simply to reduce some of the polling > intervals. These actually had a fairly dramatic impact on the time it > took to run our unit test suite. By polling for page load completion > more frequently, we are likely to shave time off the elapsed wait time, > but we do increase the CPU time because of the increased number of calls > that are made while we are waiting. Users will see this as an > improvement although it will lead the profiler to report that various > calls consume more CPU time. > > Some simple things you can do to improve your tests performance is to > use fast mode, and to look into using TextField.value= instead of > TextField.set. > > I'm willing to look more closely into the facts you present, but my > experience has been that this is not the best place to start. An > additional complication for discussing this matter is that we are > comparing our experiences running different, non-public test suites. > What we really need is a public test suite for a non-trivial > application. Hmm. Maybe we should look at the Instiki test suite... > > Bret > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > Thanks for the reply Bret. The first thing I noticed from your email is that I missed the new IE set_fast_speed method so perhaps that will bring the execution time back in line. I agree that it's nearly impossible to debug these kinds of issues without a public test suite. I am getting killed at work right now but I will look into adding some timing tests and running some 1.4 to 1.5 comparisions with the Instiki test suite hopefully around the first of the year. --Pat -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061218/05df9b34/attachment-0001.html From carl.l.shaulis at convergys.com Mon Dec 18 04:52:27 2006 From: carl.l.shaulis at convergys.com (carl.l.shaulis at convergys.com) Date: Mon, 18 Dec 2006 03:52:27 -0600 Subject: [Wtr-general] Carl L Shaulis is out of the office. Message-ID: I will be out of the office starting 12/18/2006 and will not return until 12/26/2006. If you need immediate assistance please try Cari Spruiell or my cell phone at 512-560-5773. Thanks! -- "NOTICE: The information contained in this electronic mail transmission is intended by Convergys Corporation for the use of the named individual or entity to which it is directed and may contain information that is privileged or otherwise confidential. If you have received this electronic mail transmission in error, please delete it from your system without copying or forwarding it, and notify the sender of the error by reply email or by telephone (collect), so that the sender's address records can be corrected." From rafael.torres at peopleadmin.com Mon Dec 18 11:55:49 2006 From: rafael.torres at peopleadmin.com (Rafael Torres) Date: Mon, 18 Dec 2006 10:55:49 -0600 Subject: [Wtr-general] Integrating TUnit with Excel Message-ID: Hello guys, I'm trying to have my ruby code read Watir test results reported by the TUnit framework to be able to report them into an excel sheet along with the traditional console report. I am able to utilize the Win32OLE library to build my XL interface, but I have to give it the ability to read test results from TUnit to know what to report on the sheet (i.e., passed, failed, print out any errors/failures for each test case, etc.). I tried to look at the Reporter tool designed by Alexey Verkhovsky (http://test-report.rubyforge.org/) - which builds an xml or html report off of TUnit - to see if I could understand his logic to build my XL report, but I'm still unable to accomplish it. Based on my research, and trial/error attempts, it seems to me that what I have to do is create my own test runner - although it's proving to be a little cumbersome to me (I'm having a hard time understanding how TUnit does its internal magic). I'm wondering if there's an easier way to accomplish my goal, or if there's any other idea that can help me on this. Any feedback is appreciated. Thanks in advance, R. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061218/ed39e7df/attachment.html From mike.busse at eplanservices.com Mon Dec 18 12:00:10 2006 From: mike.busse at eplanservices.com (Mike Busse) Date: Mon, 18 Dec 2006 10:00:10 -0700 Subject: [Wtr-general] goto in IE7 on Vista Message-ID: <20061218170014.903E02F0210@mail.firstlink.com> goto (Watir::IE) is launching a new browser with IE7 on a vista machine. I have tried all combinations within Internet Options to launch the new url in the same browser or tab and have watir 1.5.1.1127 installed. Attaching to the new browser allows our scripts to work but I would prefer to avoid this exercise. Code: Ie = IE.new Ie.goto(url) Any thoughts? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061218/5aad82c8/attachment.html From charley.baker at gmail.com Mon Dec 18 12:45:17 2006 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 18 Dec 2006 09:45:17 -0800 Subject: [Wtr-general] problem in entering values in span field In-Reply-To: <20061218090225.46709.qmail@web7802.mail.in.yahoo.com> References: <20061218090225.46709.qmail@web7802.mail.in.yahoo.com> Message-ID: Try this: require 'watir' test_site='C:\\aa.htm' ie=Watir::IE.start(test_site) ie.span(:id,"tradeDate").text_field(:index,2).set("01/01/2000") The confusion lies in trying to set a text field among two that have the same value, one being hidden. -Charley On 12/18/06, VIKASH KUMAR wrote: > > I am using watir version 1.5.1.1100. > > I am trying to enter value in span field, here is the relevant snippet of > html: > style="DISPLAY: inline; VERTICAL-ALIGN: middle; WIDTH: 110px" > value="12/18/2006" autocomplete="off" size="20"> > > I am using code > require 'watir' > test_site='C:\\aa.htm' > ie=Watir::IE.start(test_site) > ie.span(:id,"tradeDate").text_field(:value,"12/18/2006").set("01/01/2000") > > though it enters value in the field but after entering values in the field > give error message which breaks my code, here is the error message: > > NoMethodError: undefined method `fireEvent' for nil:NilClass > from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1100/./watir.rb:3843:in > `set' > from (irb):5 > from :0 > > Here, is the relevant code from watir.rb which is generating error > message: > def set(setThis) > assert_enabled > assert_not_readonly > > highlight(:set) > @o.scrollIntoView > @o.focus > @o.select > @o.fireEvent("onSelect") > @o.value = "" > @o.fireEvent("onKeyPress") > doKeyPress(setThis) > highlight(:clear) > @o.fireEvent("onChange") > @o.fireEvent("onBlur") > end > > Please help me out from this. > > Thanks in advance > Vikash > > > Send free SMS to your Friends on Mobile from your Yahoo! Messenger. > Download Now! http://messenger.yahoo.com/download.php > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061218/3163f884/attachment.html From charley.baker at gmail.com Mon Dec 18 13:51:07 2006 From: charley.baker at gmail.com (Charley Baker) Date: Mon, 18 Dec 2006 10:51:07 -0800 Subject: [Wtr-general] Integrating TUnit with Excel In-Reply-To: References: Message-ID: Hi Rafael, I'm using the test report library you mention to integrate the xml results into Cruise Control for our continuous integration server. Not sure what advantage Excel gives you. However, if you must, the simplest path I can think of would be to use the xml generated by test report and parse it with Rexml, then dump the results into a spreadsheet. All of the data points you're looking for are in the xml file. Otherwise, instead of writing your own runner, you could look at how Alexey has set up his formatters, htmlformatter, xmlformatter, etc and extend out test report to write your own formatter for Excel. -Charley On 12/18/06, Rafael Torres wrote: > > Hello guys, > > > > I'm trying to have my ruby code read Watir test results reported by the > TUnit framework to be able to report them into an excel sheet along with the > traditional console report. I am able to utilize the Win32OLE library to > build my XL interface, but I have to give it the ability to read test > results from TUnit to know what to report on the sheet (i.e., passed, > failed, print out any errors/failures for each test case, etc.). I tried to > look at the Reporter tool designed by Alexey Verkhovsky ( > http://test-report.rubyforge.org/) ? which builds an xml or html report > off of TUnit ? to see if I could understand his logic to build my XL report, > but I'm still unable to accomplish it. > > > > Based on my research, and trial/error attempts, it seems to me that what I > have to do is create my own test runner ? although it's proving to be a > little cumbersome to me (I'm having a hard time understanding how TUnit does > its internal magic). I'm wondering if there's an easier way to accomplish my > goal, or if there's any other idea that can help me on this. Any feedback is > appreciated. > > > > Thanks in advance, > > > > R. > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061218/b7345c0e/attachment.html From forum-watir-users at openqa.org Mon Dec 18 19:11:11 2006 From: forum-watir-users at openqa.org (yourfullname) Date: Mon, 18 Dec 2006 18:11:11 CST Subject: [Wtr-general] Skipping Tests In-Reply-To: <64064341.1164984821911.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <31529585.1166487101585.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> would this work for a mac as well? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5563&messageID=16301#16301 From paul_hammer at hotmail.com Mon Dec 18 19:56:49 2006 From: paul_hammer at hotmail.com (Paul Hammer) Date: Tue, 19 Dec 2006 00:56:49 +0000 Subject: [Wtr-general] hi and help with some javascript Message-ID: Hi All, I'm new to this forum, and I'm glad to be here. I've written a few tests and tools in Watir, and have run into a situation which is new to me. Please excuse me if this issue has already been addressed here. The following code represent a button I want to click which shows (according to the UI folks) "an in page modal dialog using AJAX". Is there some way I can use WATIR to click this and then access the info that comes up? Paul

Select Connections

 
_________________________________________________________________ Visit MSN Holiday Challenge for your chance to win up to $50,000 in Holiday cash from MSN today! http://www.msnholidaychallenge.com/index.aspx?ocid=tagline&locale=en-us From paul_hammer at hotmail.com Mon Dec 18 19:56:49 2006 From: paul_hammer at hotmail.com (Paul Hammer) Date: Tue, 19 Dec 2006 00:56:49 +0000 Subject: [Wtr-general] hi and help with some javascript Message-ID: Hi All, I'm new to this forum, and I'm glad to be here. I've written a few tests and tools in Watir, and have run into a situation which is new to me. Please excuse me if this issue has already been addressed here. The following code represent a button I want to click which shows (according to the UI folks) "an in page modal dialog using AJAX". Is there some way I can use WATIR to click this and then access the info that comes up? Paul

Select Connections

 
_________________________________________________________________ Fixing up the home? Live Search can help http://imagine-windowslive.com/search/kits/default.aspx?kit=improve&locale=en-US&source=hmemailtaglinenov06&FORM=WLMTAG From christopher.mcmahon at gmail.com Mon Dec 18 20:40:00 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Mon, 18 Dec 2006 17:40:00 -0800 Subject: [Wtr-general] ie.new vs. ie.goto() Re: goto in IE7 on Vista Message-ID: <72799cd70612181740i165e640cvf73cb51b31077e@mail.gmail.com> > Attaching to the new browser allows our scripts to work but I would prefer > to avoid this exercise. > > Code: > > Ie = IE.new > > Ie.goto(url) > We just did an experiment: ie = IE.new ie.goto('http://foo') For IE6, this is one window. For IE7, this is 2 windows. Some bit of magic that keeps goto() in the right window has gone haywire for IE7. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061218/f07b7942/attachment.html From forum-watir-users at openqa.org Mon Dec 18 21:14:58 2006 From: forum-watir-users at openqa.org (Vince) Date: Mon, 18 Dec 2006 20:14:58 CST Subject: [Wtr-general] Skipping Tests In-Reply-To: <31529585.1166487101585.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <22465682.1166494528838.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> > would this work for a mac as well? Though I have not personally verified this, so long as you have a similar install base on your Mac, there is no reason why the above should not work. Are you having a problem using the above that you'd like someone else's eyes on? If you are, post your OS, ruby version, and a snippet of where you're having an issue. And, for the record, you've just given me the justification to install ruby and watir on my Mac. Not sure how I'll make practical use (Mac users account for exactly 0% of our customer base), but it can't hurt. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5563&messageID=16305#16305 From forum-watir-users at openqa.org Mon Dec 18 22:04:16 2006 From: forum-watir-users at openqa.org (Vince) Date: Mon, 18 Dec 2006 21:04:16 CST Subject: [Wtr-general] hi and help with some javascript In-Reply-To: Message-ID: <36171004.1166497486054.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Paul, We've got a few of these in one of our products, and they are more trouble than you may have realized... Now, you may have to tinker a bit, as there is not a single implementation of modals with AJAX, but the way the AJAX modal boxes work in general is by making a hidden div visible, or vice versa. The links and inputs within those divs are always on the page, meaning that you cannot simply assume that if the input "exists?" that the button has successfully been clicked exposing the modal. Because you didn't have enough to worry about, the asynchronous AJAX calls also circumvent Watir's wait() method, meaning that you will have to look for other indicators to tell you if the postback has returned yet. A sample of the asp.net implementation of this modal type can be found here: http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx The quickest and most effective way I was able to create tests for pages that utilize these modals was to have some help from the devs, and to make a lot of assumptions. This is pretty new territory for everyone, so good luck, and do share any tricks you come up with. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5830&messageID=16306#16306 From ftorres10 at comcast.net Mon Dec 18 23:37:34 2006 From: ftorres10 at comcast.net (ftorres10 at comcast.net) Date: Mon, 18 Dec 2006 23:37:34 -0500 Subject: [Wtr-general] www.croczilla.com/jssh is down what does it mean ? In-Reply-To: References: Message-ID: <45876C8E.3030707@comcast.net> To all www.croczilla.com and www.croczilla.com/jssh are down and also today I found a post on the internet where the author was looking for somebody to replace him as he left the mozilla fundation. (I cannot find the post anymore). If I did not make any mistake what does it mean for FireWatir ? I also find this comment from Angrez Singh at http://semanticvoid.com/blog/2006/11/09/interview-with-angrez-singh-developer-of-firewatir/ I started working on SafariWatir few months ago, but due to lack of resources now (don?t have access to Mac machine) it has came to halt now I am not able to do much on this project. What does it mean for SafariWatir ? Thanks. Fred. From amit.garde at gmail.com Tue Dec 19 01:02:44 2006 From: amit.garde at gmail.com (Amit Garde) Date: Tue, 19 Dec 2006 11:32:44 +0530 Subject: [Wtr-general] www.croczilla.com/jssh is down what does it mean ? In-Reply-To: <45876C8E.3030707@comcast.net> References: <45876C8E.3030707@comcast.net> Message-ID: <7661e6730612182202l6a8aded9hb8c49641db24f990@mail.gmail.com> On 12/19/06, ftorres10 at comcast.net wrote: > To all > > www.croczilla.com and www.croczilla.com/jssh are down and also today I > found a post on the internet > where the author was looking for somebody to replace him as he left the > mozilla fundation. (I cannot find the post anymore). > > If I did not make any mistake what does it mean for FireWatir ? It shouldn't mean anything bad or different in the long term - we will see if we can take over maintenance and further development of JSSh or implement an alternative. There might be a short term impact as things get sorted out. > I also find this comment from Angrez Singh at > > http://semanticvoid.com/blog/2006/11/09/interview-with-angrez-singh-developer-of-firewatir/ > > I started working on SafariWatir few months ago, but due to lack of > resources now (don't have access to Mac machine) it has came to halt now > I am not able to do much on this project. > > > What does it mean for SafariWatir ? My understanding is that SafariWatir is Dave Hoover's project at http://safariwatir.rubyforge.org/ which is completely separate from Angrez's work, so there should be no implication for SafariWatir either. Amit From forum-watir-users at openqa.org Tue Dec 19 02:12:42 2006 From: forum-watir-users at openqa.org (Lou Wilson) Date: Tue, 19 Dec 2006 01:12:42 CST Subject: [Wtr-general] Skipping Tests In-Reply-To: <22465682.1166494528838.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <33785882.1166512392257.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Correct me if I'm wrong, but IIRC, since Watir is using WinOLE32 calls to drive IE, it might be a problem using it on a Mac. In addition, the Mac's version of IE stopped development at version 5. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5563&messageID=16307#16307 From vikashkumar051 at yahoo.co.in Tue Dec 19 03:55:42 2006 From: vikashkumar051 at yahoo.co.in (VIKASH KUMAR) Date: Tue, 19 Dec 2006 08:55:42 +0000 (GMT) Subject: [Wtr-general] problem in handling javascript pop up from drop down lists Message-ID: <20061219085543.72667.qmail@web7804.mail.in.yahoo.com> I am getting a javascript pop up after I select a value from some drop down list using the select_list method. Since I can not use click_no_wait for a list, how am I supposed to handle the pop up. Can anyone please provide a solution for it. I am using the following code to assess a select list, I am using Watir Version 1.5.1.1100 The code is as follows : require 'watir' # the watir controller require 'watir/winClicker.rb' require 'watir\contrib\enabled_popup' require 'Enter_on_inputbox' enter_on_inputboxObj = Enter_on_inputbox.new instance = "c:\\aa.htm" ie=Watir::IE.start(instance) #THIS PART IS WORKING, using click_no_wait ie.image(:index,'4').click_no_wait enter_on_inputboxObj.startClicker(ie, $hwnd, "OK", 7, "Good") ############################### ie.select_list(:name, "trx").select("First") # Here too a javascript box is coming, but I am unable to click on the OK button I have defined a class name Enter_on_inputbox require 'watir/winClicker.rb' class Enter_on_inputbox def initialize end def startClicker( ie, hwnd, button , waitTime, user_input) hwnd = ie.enabled_popup(waitTime) # get a handle if one exists w = WinClicker.new if (hwnd) # yes there is a popup w = WinClicker.new if ( user_input ) print(user_input) $stdout.flush w.setTextValueForFileNameField(hwnd, "#{user_input}") end sleep 3 # I put this in to see the text being input it is not necessary to work w.clickWindowsButton_hwnd(hwnd, "#{button}") # "OK" or whatever the name on the button is w=nil # this is just cleanup end end end After it select the value from list, a javascript pop up comes asking for OK or Cancel, here my code get stops until I click manually on OK or Cancel Button, please help me out from this. Thanks in advance Vikash Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download Now! http://messenger.yahoo.com/download.php -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061219/a856a36a/attachment.html From Malcolm.Beaton at conchango.com Tue Dec 19 08:43:38 2006 From: Malcolm.Beaton at conchango.com (Beaton, Malcolm) Date: Tue, 19 Dec 2006 13:43:38 -0000 Subject: [Wtr-general] ie.new vs. ie.goto() Re: goto in IE7 on Vista References: <72799cd70612181740i165e640cvf73cb51b31077e@mail.gmail.com> Message-ID: Probably a little hacky but I cant test it as I'm still on XP and watir 1.4 (Lazy I know) try this ie = IE.new.goto(' http://foo' ) Might fool it into keeping the same window Malcolm ________________________________ From: wtr-general-bounces at rubyforge.org on behalf of Chris McMahon Sent: Tue 12/19/2006 1:40 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] ie.new vs. ie.goto() Re: goto in IE7 on Vista Attaching to the new browser allows our scripts to work but I would prefer to avoid this exercise. Code: Ie = IE.new Ie.goto(url) We just did an experiment: ie = IE.new ie.goto(' http://foo' ) For IE6, this is one window. For IE7, this is 2 windows. Some bit of magic that keeps goto() in the right window has gone haywire for IE7. _____________________________________________________________________ This e-mail has been scanned for viruses by MessageLabs. The information contained in this message is confidential and is intended for the addressee only. If you have received this message in error, please notify Conchango plc as soon as possible. The unauthorised use, disclosure, copying or alteration of this message is prohibited and may be unlawful. The internet cannot guarantee the integrity of this message and therefore Conchango plc will not be liable for the message if modified. Reg. Heritage House, Church Road, Egham, Surrey, TW20 9QD T 44 (0) 1784 222 222 F 44 (0) 1784 222 200 E talktous at conchango.com No. 2598884 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/ms-tnef Size: 4669 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20061219/581d0cd7/attachment-0001.bin From dave at obtiva.com Tue Dec 19 08:52:46 2006 From: dave at obtiva.com (Dave Hoover) Date: Tue, 19 Dec 2006 07:52:46 -0600 Subject: [Wtr-general] www.croczilla.com/jssh is down what does it mean ? In-Reply-To: <7661e6730612182202l6a8aded9hb8c49641db24f990@mail.gmail.com> References: <45876C8E.3030707@comcast.net> <7661e6730612182202l6a8aded9hb8c49641db24f990@mail.gmail.com> Message-ID: <11c8704e0612190552j5ea7bd34u1a49af2656d3aac7@mail.gmail.com> > > What does it mean for SafariWatir ? > > My understanding is that SafariWatir is Dave Hoover's project at > http://safariwatir.rubyforge.org/ which is completely separate from > Angrez's work, so there should be no implication for SafariWatir > either. That is correct. SafariWatir is alive and well. SafariWatir has no dependency on JSSh or FireWatir, it uses the rb-appscript Apple event bridge to inject JavaScript into Safari to work its magic. I just spoke with Angrez a few days ago, helping him test a FireWatir gem on my Mac. As far as I know, he's still working on it. Dave Hoover http://obtiva.com/ From rafael.torres at peopleadmin.com Tue Dec 19 09:30:56 2006 From: rafael.torres at peopleadmin.com (Rafael Torres) Date: Tue, 19 Dec 2006 08:30:56 -0600 Subject: [Wtr-general] Integrating TUnit with Excel Message-ID: Thanks for the feedback Charley. To answer your question, some of our developers want to be able to run some functional tests in their local hosts before checking in code. This also gives them the advantage of being able to check for some fixes before the build is made (time saving). So I figured they could do this by selecting tests from our pool through an XL sheet and have Watir run them. In this case I would want to show the results in the same sheet. Besides this, we also run tests on the trunk/branch builds, in which case xml/html reports make sense. As far as my problem, I was able to figure out a solution (although it may not be the most elegant one). In case anyone needs a similar solution in the future - I found out Test::Unit::UI::Console::TestRunner#finished gets called at the very end of a TUnit test case, so by overriding it and reading TestRunner's @faults and @result instance variables I am able to determine whether a test passed/failed and what errors/failures were generated (if any). Then, I would just have to add logic to update my XL sheet based on these results. Of course, on my TUnit tests I would call my new test runner (which inherits from TestRunner) a-la reporter tool. R. _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Charley Baker Sent: Monday, December 18, 2006 12:51 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Integrating TUnit with Excel Hi Rafael, I'm using the test report library you mention to integrate the xml results into Cruise Control for our continuous integration server. Not sure what advantage Excel gives you. However, if you must, the simplest path I can think of would be to use the xml generated by test report and parse it with Rexml, then dump the results into a spreadsheet. All of the data points you're looking for are in the xml file. Otherwise, instead of writing your own runner, you could look at how Alexey has set up his formatters, htmlformatter, xmlformatter, etc and extend out test report to write your own formatter for Excel. -Charley On 12/18/06, Rafael Torres wrote: Hello guys, I'm trying to have my ruby code read Watir test results reported by the TUnit framework to be able to report them into an excel sheet along with the traditional console report. I am able to utilize the Win32OLE library to build my XL interface, but I have to give it the ability to read test results from TUnit to know what to report on the sheet (i.e., passed, failed, print out any errors/failures for each test case, etc.). I tried to look at the Reporter tool designed by Alexey Verkhovsky (http://test-report.rubyforge.org/) - which builds an xml or html report off of TUnit - to see if I could understand his logic to build my XL report, but I'm still unable to accomplish it. Based on my research, and trial/error attempts, it seems to me that what I have to do is create my own test runner - although it's proving to be a little cumbersome to me (I'm having a hard time understanding how TUnit does its internal magic). I'm wondering if there's an easier way to accomplish my goal, or if there's any other idea that can help me on this. Any feedback is appreciated. Thanks in advance, R. _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061219/bc0534ba/attachment.html From forum-watir-users at openqa.org Tue Dec 19 10:29:26 2006 From: forum-watir-users at openqa.org (Vince) Date: Tue, 19 Dec 2006 09:29:26 CST Subject: [Wtr-general] ie.new vs. ie.goto() Re: goto in IE7 on Vista In-Reply-To: <72799cd70612181740i165e640cvf73cb51b31077e@mail.gmail.com> Message-ID: <34442022.1166542196566.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Actually, nothing has gone wrong in IE7 from IE6... this is a security feature (you can't make this stuff up). IE7 has been set such that any time a link it executed for a domain other than the one that the browser is currently located at, this will open in a new window. This is to prevent many phishing attempts by preventing a third party from creating what looks like a login portal to your page which then redirects to the true page... It's annoying, but you shouldn't count on it going away. One thing that you can try is setting the homepage of your browser to a URL at the same domain as the tests site that will be utilized. Option #2 would be to use a system call to fire IE, and pass a URL as a command line param. This gets tricky with cross browser code, though, so again is not ideal. >From where I stand, the method is going to require a rewrite to handle this in the future (I'll check out the source). ~Vince --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5831&messageID=16322#16322 From forum-watir-users at openqa.org Tue Dec 19 11:25:51 2006 From: forum-watir-users at openqa.org (Vince) Date: Tue, 19 Dec 2006 10:25:51 CST Subject: [Wtr-general] How do I click the "OK" button on a java alert? In-Reply-To: <41922599.1166218145437.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <32359632.1166545613367.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Qaos, Well, there's a very good reason that you cannot attach to the modal box - it's not an actual browser window. IE modal dialogs, because Microsoft hates us, are actually javascript dialogs that the browser handles. These are an IE only thing, and have been a problem in Watir from the beginning... The current version of Watir utilized AutoIT to handle these, and depending on the specific usage will give you an option or two in validating and dealing with your modal. You can check out AutoIT at http://www.autoitscript.com/, but it comes with the more recent Watir builds so you shouldn't need to download anything. ~Vince --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5802&messageID=16324#16324 From forum-watir-users at openqa.org Tue Dec 19 12:34:35 2006 From: forum-watir-users at openqa.org (Vince) Date: Tue, 19 Dec 2006 11:34:35 CST Subject: [Wtr-general] Skipping Tests In-Reply-To: <33785882.1166512392257.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <33369088.1166549705909.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Correct, though the above conversation pertained to test/unit testing, not any functionality of IE. Perhaps my affirmative response was a bit too general... --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5563&messageID=16326#16326 From paul_hammer at hotmail.com Tue Dec 19 13:56:04 2006 From: paul_hammer at hotmail.com (Paul Hammer) Date: Tue, 19 Dec 2006 18:56:04 +0000 Subject: [Wtr-general] hi and help with some javascript In-Reply-To: <36171004.1166497486054.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Vince, Thanks for responding. Actually, I didn't think there was an easy answer to this. I want to make sure I understand what you are saying here. Your statement: "The links and inputs within those divs are always on the page, ..." Could you really have meant to write: "The links and inputs within those divs are NOT always on the page, ..." In our situation (as I understand), check boxes are placed in the modal box AFTER the button is clicked, and info comes back from the server, which means the elements aren't always on the page. Paul >From: Vince >Reply-To: wtr-general at rubyforge.org >To: wtr-general at rubyforge.org >Subject: Re: [Wtr-general] hi and help with some javascript >Date: Mon, 18 Dec 2006 21:04:16 CST > >Paul, > >We've got a few of these in one of our products, and they are more trouble >than you may have realized... > >Now, you may have to tinker a bit, as there is not a single implementation >of modals with AJAX, but the way the AJAX modal boxes work in general is by >making a hidden div visible, or vice versa. The links and inputs within >those divs are always on the page, meaning that you cannot simply assume >that if the input "exists?" that the button has successfully been clicked >exposing the modal. > >Because you didn't have enough to worry about, the asynchronous AJAX calls >also circumvent Watir's wait() method, meaning that you will have to look >for other indicators to tell you if the postback has returned yet. > >A sample of the asp.net implementation of this modal type can be found >here: http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx > >The quickest and most effective way I was able to create tests for pages >that utilize these modals was to have some help from the devs, and to make >a lot of assumptions. This is pretty new territory for everyone, so good >luck, and do share any tricks you come up with. >--------------------------------------------------------------------- >Posted via Jive Forums >http://forums.openqa.org/thread.jspa?threadID=5830&messageID=16306#16306 >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _________________________________________________________________ Get free, personalized online radio with MSN Radio powered by Pandora http://radio.msn.com/?icid=T002MSN03A07001 From forum-watir-users at openqa.org Tue Dec 19 14:56:41 2006 From: forum-watir-users at openqa.org (Vince) Date: Tue, 19 Dec 2006 13:56:41 CST Subject: [Wtr-general] hi and help with some javascript In-Reply-To: Message-ID: <31578466.1166558231035.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Paul, > Could you really have meant to write: > > "The links and inputs within those divs are NOT always on the page, ..." I really wish that was the case, but alas it is not. Using the sample AJAX modal box page that I mentioned in my first reply, you can "find" the buttons from the modal long before you click the link to fire up the box. This is because the div that we are calling a modal box is always on the page, but not always visible. See for yourself: require 'watir' ie = Watir::IE.new ie.goto("http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx") puts "Button 1: #{ie.buttons[1].name}" puts "Button 2: #{ie.buttons[2].name}" If you only have one on the page, you should have no problem clicking the button, setting the modal, and submitting it. If you have multiple and need to validate that the correct one is showing (as I do), than you have a long day ahead of you... --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5830&messageID=16328#16328 From Thomas.Vaughan at usitc.gov Tue Dec 19 15:34:34 2006 From: Thomas.Vaughan at usitc.gov (Thomas.Vaughan at usitc.gov) Date: Tue, 19 Dec 2006 15:34:34 -0500 Subject: [Wtr-general] Automating the running & reporting of watir tests Message-ID: Hi, I just started using WATIR and fell in love at first sight. I'm sure what I'm trying to do has been done before, so I thought I'd throw a net out here and see what I catch... Our dev team is building a half-dozen different apps (WARs) that, as a whole, will eventually replace a legacy application. We've started writing WATIR tests to check some of the individual WARs, but what I'm hoping to do is get some advise on: 1) How do people schedule automatic execution of a bunch of different WATIR tests, similar to Continuum might do. Is everyone out there writing their own cron + scripts? 2) Is there are pre-built "watir-harness" that will email someone when a test doesn't run as expected? 3) Do people typically source control their WATIR tests along side the code that's under test? Or do they typically group all their WATIR tests together in a separate project for ease-of-reuse/ease-of-discovery purposes? Thanks in advance! Tom Vaughan From forum-watir-users at openqa.org Tue Dec 19 15:56:31 2006 From: forum-watir-users at openqa.org (Dave Munns) Date: Tue, 19 Dec 2006 14:56:31 CST Subject: [Wtr-general] Simulate CNTRL-LEFT CLICK In-Reply-To: <42913869.1164750868797.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <37936449.1166561841006.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I have seen examples that double click on an object ( fire_event("onDblClick") ), but have been unable to simulate a Control-Left Click. Any ideas? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5490&messageID=16331#16331 From bret at pettichord.com Tue Dec 19 16:38:56 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 15:38:56 -0600 Subject: [Wtr-general] How to handle javascript pop ups from drop down lists In-Reply-To: <68f4a0e80612140628o4f842cb4xae6b256c3b9644c1@mail.gmail.com> References: <59507143.1166104465643.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <68f4a0e80612140628o4f842cb4xae6b256c3b9644c1@mail.gmail.com> Message-ID: <45885BF0.3020508@pettichord.com> Ethan Jewett wrote: > Akash, > > Hopefully someone has a simpler solution, but my solution was to mixin > (using a module) a new method to the offending class (in your case > "SelectList") called select_no_wait(item). The contents of this > method would be the same as the select(item) method, but without the > @container.wait. > > My problem was with the IE.goto method, not with list selection, so > the execution won't be quite the same, but the idea is there. > > I don't have much time right now, but if no one responds with another > fix within the next 12 hours or so, I'll try to post the code that > should do that job. > > Ethan > I don't think that will be enough. Take a look at the click_no_wait code. def click_no_wait assert_enabled highlight(:set) object = "#{self.class}.new(self, :unique_number, #{self.unique_number})" @page_container.eval_in_spawned_process(object + ".click!") highlight(:clear) end The key issue is not so much avoiding the wait, but spawning a separate process to execute the method. In your case it will need to be the select method instead of "click!". Technically, click_no_block would be a more accurate name for this method. It seems like Watir needs a more general syntax for these kinds of methods... Bret From bret at pettichord.com Tue Dec 19 16:39:13 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 15:39:13 -0600 Subject: [Wtr-general] How to handle javascript pop ups from drop down lists In-Reply-To: <68f4a0e80612140628o4f842cb4xae6b256c3b9644c1@mail.gmail.com> References: <59507143.1166104465643.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <68f4a0e80612140628o4f842cb4xae6b256c3b9644c1@mail.gmail.com> Message-ID: <45885C01.7070607@pettichord.com> Ethan Jewett wrote: > Akash, > > Hopefully someone has a simpler solution, but my solution was to mixin > (using a module) a new method to the offending class (in your case > "SelectList") called select_no_wait(item). The contents of this > method would be the same as the select(item) method, but without the > @container.wait. > > My problem was with the IE.goto method, not with list selection, so > the execution won't be quite the same, but the idea is there. > > I don't have much time right now, but if no one responds with another > fix within the next 12 hours or so, I'll try to post the code that > should do that job. > > Ethan > I don't think that will be enough. Take a look at the click_no_wait code. def click_no_wait assert_enabled highlight(:set) object = "#{self.class}.new(self, :unique_number, #{self.unique_number})" @page_container.eval_in_spawned_process(object + ".click!") highlight(:clear) end The key issue is not so much avoiding the wait, but spawning a separate process to execute the method. In your case it will need to be the select method instead of "click!". Technically, click_no_block would be a more accurate name for this method. It seems like Watir needs a more general syntax for these kinds of methods... Bret From bret at pettichord.com Tue Dec 19 16:39:27 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 15:39:27 -0600 Subject: [Wtr-general] How to handle javascript pop ups from drop down lists In-Reply-To: <68f4a0e80612140628o4f842cb4xae6b256c3b9644c1@mail.gmail.com> References: <59507143.1166104465643.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <68f4a0e80612140628o4f842cb4xae6b256c3b9644c1@mail.gmail.com> Message-ID: <45885C0F.10601@pettichord.com> Ethan Jewett wrote: > Akash, > > Hopefully someone has a simpler solution, but my solution was to mixin > (using a module) a new method to the offending class (in your case > "SelectList") called select_no_wait(item). The contents of this > method would be the same as the select(item) method, but without the > @container.wait. > > My problem was with the IE.goto method, not with list selection, so > the execution won't be quite the same, but the idea is there. > > I don't have much time right now, but if no one responds with another > fix within the next 12 hours or so, I'll try to post the code that > should do that job. > > Ethan > I don't think that will be enough. Take a look at the click_no_wait code. def click_no_wait assert_enabled highlight(:set) object = "#{self.class}.new(self, :unique_number, #{self.unique_number})" @page_container.eval_in_spawned_process(object + ".click!") highlight(:clear) end The key issue is not so much avoiding the wait, but spawning a separate process to execute the method. In your case it will need to be the select method instead of "click!". Technically, click_no_block would be a more accurate name for this method. It seems like Watir needs a more general syntax for these kinds of methods... Bret From bret at pettichord.com Tue Dec 19 16:40:31 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 15:40:31 -0600 Subject: [Wtr-general] modal dialogs and remote desktop In-Reply-To: <35AF30C7B5EBFA4DBC854B5B9DF66B0E01B6064B@ehost011-27.exch011.intermedia.net> References: <35AF30C7B5EBFA4DBC854B5B9DF66B0E01B6064B@ehost011-27.exch011.intermedia.net> Message-ID: <45885C4F.2030501@pettichord.com> Lillis, Dara wrote: > > I have a strange problem with using the modal dialog code (I'm using > watir development gem 1.5.1.1017) while running tests on a remote > machine via remote desktop. > > When I am rdesktop-ed to a machine and run some code that uses modal > dialogs (see below for code), it works fine when I am looking at the > remote desktop, but if I minimise the remote desktop or close it and > leave the program running, my test hangs and never clicks on the modal > dialog. > > here's the code I am using: > > browser.link(:text, link_text).click_no_wait > dialog = Watir::Dialog.new > dialog.exists? > dialog.button(dialog_text).click > > any ideas? > I suggest removing the call to "dialog.exists?" and see if this makes a difference. Bret From bret at pettichord.com Tue Dec 19 16:40:42 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 15:40:42 -0600 Subject: [Wtr-general] Storing shorthand variables in a module In-Reply-To: References: Message-ID: <45885C5A.3020900@pettichord.com> Max Russell wrote: > > tt_choose_patient = ie.frame("left").link(:index, 3) > > I want to be able to include the module and do something like > > tt_choose_patient.click > def tt_choose_patient @ie.frame("left").link(:index, 3) end tt_choose_patient.click From bret at pettichord.com Tue Dec 19 16:40:54 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 15:40:54 -0600 Subject: [Wtr-general] Click on a pixel location In-Reply-To: <38823214.1165460774448.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <38823214.1165460774448.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <45885C66.7020500@pettichord.com> Ankur Gupta wrote: > the screenshot can be seen http://flickr.com/photos/ankur_gupta10/316125738/ > OK. Now click View DOM, then click Select Element by Click and then click the text box in question. Then post a new screen shot so we can see it. Or just post the html, which really is easier for us. Bret > When i run the ruby script, then after the execution finishes i get this error- > > > W, [06-Dec-2006 13:34:20#1868] WARN -- : frame error in waitunknown property or method `9' > > HRESULT error code:0x80020006 > > Unknown name. > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1405:in `[]' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1405:in `wait' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1404:in `wait' > > c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2014:in `click' > > fa1.rb:35 > > Does this error has anything to do with not recognizing the objects...? > No From bret at pettichord.com Tue Dec 19 16:41:10 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 15:41:10 -0600 Subject: [Wtr-general] How to handle javascript pop ups from drop down lists In-Reply-To: <68f4a0e80612150626s5d8b96e1vad63c963341f3880@mail.gmail.com> References: <59507143.1166104465643.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <68f4a0e80612140628o4f842cb4xae6b256c3b9644c1@mail.gmail.com> <68f4a0e80612150626s5d8b96e1vad63c963341f3880@mail.gmail.com> Message-ID: <45885C76.7070407@pettichord.com> Ethan Jewett wrote: Thanks for sharing your code. > 1) Is there an easier way to do this? > You created a method in a mixin and then added the mixin to the class. It would be simpler to just add the method directly to the class and forget about the mixin. > 2) If not, what with the growing popularity of javascript events > triggered by such things as list selection, button clicking, etc, > would it be a popular idea to start defining a framework for alternate > behaviors like "no_wait" of action methods like click, goto, select, > etc? > First, i have to say that your solution will not help the OP. The click_no_wait doesn't wait, but it also executes the click method in a separately spawned Ruby process. This is necessary because modal dialogs block the process that trigger them. So we create sacrificial process that we don't need care about (it could wait, for all we care, and originally did -- this was changed simply to avoid benign error messages that sometimes occurred.) Speaking only with regards to Ajax support, i agree that we need a general solution for the problems you've run into, packaged with Watir. > One suggestion: All action methods take an optional hash as a > parameter, allowing for click(:no_wait => true) to have the same > behavior as click_no_wait. In Akash's case, he could use select(item, > :no_wait => true). I'd be happy to contribute some test cases if this > sounds like a decent approach. > Another suggestion: We use class_variables wrapped by class_methods to control whether a wait will occur automatically with certain methods. Thus: Button.wait_after_click = false # "global" setting affects all buttons ie.button(:index, 1).click # would not wait I suspect that you might even want to configure Watir so that no waits are automatic and you have to code them all explicitly... Bret From bret at pettichord.com Tue Dec 19 16:41:29 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 15:41:29 -0600 Subject: [Wtr-general] activeElement error. In-Reply-To: <01e001c713de$664cb8c0$3700a8c0@dbrblackcompaq> References: <01e001c713de$664cb8c0$3700a8c0@dbrblackcompaq> Message-ID: <45885C89.9070608@pettichord.com> Does this work? $ie.link(:id, "ID_OPEN_POPUP1").fire_event("onmouseover") $ie.link(:id, "ID_OPEN_POPUP1").fire_event("onclick") From bret at pettichord.com Tue Dec 19 16:41:51 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 15:41:51 -0600 Subject: [Wtr-general] modal dialogs and remote desktop In-Reply-To: <35AF30C7B5EBFA4DBC854B5B9DF66B0E01B6064B@ehost011-27.exch011.intermedia.net> References: <35AF30C7B5EBFA4DBC854B5B9DF66B0E01B6064B@ehost011-27.exch011.intermedia.net> Message-ID: <45885C9F.6010502@pettichord.com> Lillis, Dara wrote: > > I have a strange problem with using the modal dialog code (I'm using > watir development gem 1.5.1.1017) while running tests on a remote > machine via remote desktop. > > When I am rdesktop-ed to a machine and run some code that uses modal > dialogs (see below for code), it works fine when I am looking at the > remote desktop, but if I minimise the remote desktop or close it and > leave the program running, my test hangs and never clicks on the modal > dialog. > > here's the code I am using: > > browser.link(:text, link_text).click_no_wait > dialog = Watir::Dialog.new > dialog.exists? > dialog.button(dialog_text).click > > any ideas? > We use remote desktop and modal dialogs. I haven't tried to reproduce your exact scenario, but we have no reports of this kind of problem. I suggest removing your "dialog.exists?". I'm not so sure that actually works anyway (i.e. it won't return false when a dialog doesn't exist), and in your example, it serves no purpose anyway. Bret From bret at pettichord.com Tue Dec 19 16:42:03 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 15:42:03 -0600 Subject: [Wtr-general] ie.minimize broken in watir-1.5.1.1127 In-Reply-To: References: <45802802.4090102@pettichord.com> Message-ID: <45885CAB.4030509@pettichord.com> ?eljko Filipin wrote: > I have found the reason why autoit is not installed. > > I am usually logged on as limited user, I only switch to administrator > when needed (I have listened too much of Security Now! podcast, > http://www.grc.com/securitynow.htm). So, I installed watir as limited > user. It seems that autoit can not be installed (or used) unless you > are administrator. > > send_keys_test.rb fails even if administrator installs watir and then > limited user executes test. > > It works fine when I run that test as administrator. > > I logged this in jira (http://jira.openqa.org/browse/WTR-120). This is a great catch. I'm sure this explains the various reports we've had of problems with autoit, and it certainly justifies why it would be wise for us to stop using it. Let me clarify one point. AutoIt needs to be registered before it can be used. The dll is packaged with the Gem, and what Watir does is that it automatically registers the dll if necessary. If you manually install AutoIt this shouldn't be necessary. That test unregisters AutoIt and then verifies Watir's registration mechanism. I still suspect, however, that if you manually install AutoIt, then the Watir/Autoit calls (except for the registration call) should work. In other words, all the tests, except send_keys_test.rb will pass (until you run send_keys_test -- because it uninstalls AutoIt). Can you manually install AutoIt and then successfully run minmax_test.rb as a limited user? Bret From bret at pettichord.com Tue Dec 19 16:42:14 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 15:42:14 -0600 Subject: [Wtr-general] Identifying a tab to click on In-Reply-To: <45728BF1.7010109@paradise.net.nz> References: <45728BF1.7010109@paradise.net.nz> Message-ID: <45885CB6.8060409@pettichord.com> Neil Daniell wrote: > use Watir to click on secondTab but cannot seem to get the following to work: > $ie = IE.new > .... > $ie.div(:index, 1).table(:index,1)[1][2].span(:index, 1).click > Can someone indicate to me how I can fix this? > Is it possible to select an element via the class? > Using Watir 1.5, you can do $ie.div(:class, 'TabGroup') ... > Page source:(jsp) > >
> > From bret at pettichord.com Tue Dec 19 16:42:26 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 15:42:26 -0600 Subject: [Wtr-general] Integrating TUnit with Excel In-Reply-To: References: Message-ID: <45885CC2.9010505@pettichord.com> Rafael Torres wrote: > > I?m trying to have my ruby code read Watir test results reported by > the TUnit framework to be able to report them into an excel sheet > along with the traditional console report. I am able to utilize the > Win32OLE library to build my XL interface, but I have to give it the > ability to read test results from TUnit to know what to report on the > sheet (i.e., passed, failed, print out any errors/failures for each > test case, etc.). I tried to look at the Reporter tool designed by > Alexey Verkhovsky (http://test-report.rubyforge.org/) ? which builds > an xml or html report off of TUnit ? to see if I could understand his > logic to build my XL report, but I?m still unable to accomplish it. > > Based on my research, and trial/error attempts, it seems to me that > what I have to do is create my own test runner ? although it?s proving > to be a little cumbersome to me (I?m having a hard time understanding > how TUnit does its internal magic). I?m wondering if there?s an easier > way to accomplish my goal, or if there?s any other idea that can help > me on this. Any feedback is appreciated. > Are you looking to have something that is updated in real time as the tests run. If so, i think you are on the right track. If not, you might find it easier to just parse the XML from Test Reporter and generate the spreadsheet from that. I've been doing something similar to what you've been doing and am happy to try and answer test-unit questions. Bret From bret at pettichord.com Tue Dec 19 16:42:38 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 15:42:38 -0600 Subject: [Wtr-general] A special `method_missing': In-Reply-To: <00b301c71fb7$5fb76840$6400a8c0@laptop> References: <53142117.1164677603902.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <45817FBB.3090806@pettichord.com> <00b301c71fb7$5fb76840$6400a8c0@laptop> Message-ID: <45885CCE.80003@pettichord.com> So what is the next step? I'm happy to remove the navigation checker so that people will stop getting this error. Or were you going to checking in the fix soon? Bret Paul Rogers wrote: > I encountered the same problem. I have a fix, I just havent got as far as > checking it in. > > ----- Original Message ----- > From: "Bret Pettichord" > To: > Sent: Thursday, December 14, 2006 9:45 AM > Subject: Re: [Wtr-general] A special `method_missing': > > > >> Allen Zhou wrote: >> >>> Sorry for spam. I just found out the same issue as me, it is a defect of >>> Watir. >>> More details please refer the following thread. >>> http://www.mail-archive.com/wtr-general at rubyforge.org/msg05037.html >>> >>> >> This is a known defect: http://jira.openqa.org/browse/WTR-94 >> >> I just posted this workaround: >> >> require 'watir' >> >> ie = Watir::IE.new >> ie.disable_checker(Watir::NAVIGATION_CHECKER) >> ie.goto('http://cnn.com') >> >> Unless someone provides a fix to the NAVIGATION_CHECKER, i'm inclined to >> stop adding it automatically when initializing IE objects. >> >> Bret >> >> _______________________________________________ >> Wtr-general mailing list >> Wtr-general at rubyforge.org >> http://rubyforge.org/mailman/listinfo/wtr-general >> >> > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Tue Dec 19 16:42:51 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 15:42:51 -0600 Subject: [Wtr-general] Excel Or Text File? In-Reply-To: References: <36169008.1165352791358.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <37724181.1165422414352.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <72799cd70612060838p6025507aj34954590182e7234@mail.gmail.com> Message-ID: <45885CDB.3030401@pettichord.com> Charley Baker wrote: > Chris has some salient points. Another advantage of using a delimited > file that you can use through Excel is version control. Using a > delimited file makes it easier to diff and/or merge through Subversion > or whatever your SCM tool might be as opposed to using an Excel file. Personally, i've switched over to using Excel's XML format. Excel reads and writes these files just like XLS files, except that you may need to create a file association for them. But the code is pure XML and you can easily diff your changes. In Excel, select Save As XML Spreadsheet. I don't like CSV files. They do not retain column widths and therefore usually look crappy when you first open them. I've been developing a set of spreadsheet abstractions that makes reading them pretty simple. I will work towards publishing them so that others may use them. But first, there are Watir 1.5 bugs to fix... Bret From bret at pettichord.com Tue Dec 19 16:43:02 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 15:43:02 -0600 Subject: [Wtr-general] ie.new vs. ie.goto() Re: goto in IE7 on Vista In-Reply-To: <34442022.1166542196566.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <34442022.1166542196566.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <45885CE6.8070102@pettichord.com> Vince wrote: > One thing that you can try is setting the homepage of your browser to a URL at the same domain as the tests site that will be utilized. > Or have a blank home page. This also makes your tests faster. From bret at pettichord.com Tue Dec 19 16:43:17 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 15:43:17 -0600 Subject: [Wtr-general] WET at FOSS In-Reply-To: <458193EA.6030009@qantom.com> References: <981948.10961.qm@web31714.mail.mud.yahoo.com> <45806236.8080402@pettichord.com> <458193EA.6030009@qantom.com> Message-ID: <45885CF5.1040302@pettichord.com> Raghu Venkataramana wrote: > >> * What do you mean by "Test run in batch mode consistently". You said >> that WET does this but Watir doesn't. This sounds like something pretty >> important that Watir should be doing. What did you do to fix this in WET? >> > A combination of two things - > a) Test definitions to describe a test completely. The test > definitions include preconditions > and teardowns which ensure that a test's dependencies can be called > before the test itself. > > b) BatchRunner to define the order in which tests are executed - > > Without these we found that tests were being run in an alphabetical > order rather than the order > in which tests were defined. Many a time, execution of a test depends > on the fact that previous tests > have been run and this was causing tests to break when run in a batch > mode. That's when we invented > the 'preconditions / teardowns' support + the batch mode of execution Thanks for the clarification. I agree that WET is providing a feature that Watir doesn't have. Strictly speaking Watir has been only a GUI Driver, and what you are criticizing is Test::Unit, but that in fact is the test harness that comes bundled with Ruby and which we have encouraged users to use. As you note, there are problems with using it for System testing, since it was designed for unit testing. I guess i would label this feature "System Testing Test Harness". Of course, I recently bundled Watir::TestCase. This solves part of the alphabeticization problem. These tests will run their test methods in the order defined, rather than alphabetically. Bret From charley.baker at gmail.com Tue Dec 19 16:46:14 2006 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 19 Dec 2006 14:46:14 -0700 Subject: [Wtr-general] Automating the running & reporting of watir tests In-Reply-To: References: Message-ID: Yes, no, maybe. :) Simple answer. I'm using Watir tests, and running them through Cruise Control, so that they're continuous integration tests, reports generated through http://test-report.rubyforge.org/. xml reports, cruise picks them up since they're xunit style and publishes them out. Cruise emails the reports out. Where to locate it in svn is a good question. We currently have our FAT in it's own location. We also have a ruby install in svn, for better or worse, which is able to be run in ci and on any workstation, and able to easily update for shared libraries. -Charley On 12/19/06, Thomas.Vaughan at usitc.gov wrote: > > Hi, > > I just started using WATIR and fell in love at first sight. I'm sure > what I'm trying to do has been done before, so I thought I'd throw a net > out here and see what I catch... > > Our dev team is building a half-dozen different apps (WARs) that, as a > whole, will eventually replace a legacy application. We've started > writing WATIR tests to check some of the individual WARs, but what I'm > hoping to do is get some advise on: > > 1) How do people schedule automatic execution of a bunch of > different WATIR tests, similar to Continuum might do. Is everyone out > there writing their own cron + scripts? > > 2) Is there are pre-built "watir-harness" that will email > someone when a test doesn't run as expected? > > 3) Do people typically source control their WATIR tests along > side the code that's under test? Or do they typically group all their > WATIR tests together in a separate project for > ease-of-reuse/ease-of-discovery purposes? > > Thanks in advance! > Tom Vaughan > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061219/a4b9eefe/attachment.html From charley.baker at gmail.com Tue Dec 19 17:47:55 2006 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 19 Dec 2006 15:47:55 -0700 Subject: [Wtr-general] Simulate CNTRL-LEFT CLICK In-Reply-To: <37936449.1166561841006.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <42913869.1164750868797.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <37936449.1166561841006.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Do you need to control left click or simply go to a new url? I'm going to new urls for a lot of the dropdowns in one of my apps, skipping the click. -c On 12/19/06, Dave Munns wrote: > > I have seen examples that double click on an object ( > fire_event("onDblClick") ), > but have been unable to simulate a Control-Left Click. Any ideas? > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5490&messageID=16331#16331 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061219/2d8e7776/attachment.html From forum-watir-users at openqa.org Tue Dec 19 18:22:16 2006 From: forum-watir-users at openqa.org (Dave Munns) Date: Tue, 19 Dec 2006 17:22:16 CST Subject: [Wtr-general] Simulate CNTRL-LEFT CLICK In-Reply-To: <42913869.1164750868797.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <40059708.1166570571258.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> The control left click on a specific object will invoke a frame with a list of data. No url's involved... --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5490&messageID=16357#16357 From bret at pettichord.com Tue Dec 19 19:30:30 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 18:30:30 -0600 Subject: [Wtr-general] Syntax for relative attributes Message-ID: <45888426.1050407@pettichord.com> I am in the process of adding a new feature to Watir and have a question. Consider this code: headline = $ie.div(:text, 'Pragmatic Version Control') link = $ie.link(:class => 'addtocart', :after? => headline) Would you assume that link was after headline, or headline after link? I can make it work either way. Which is more intuitive? Or is it confusing no matter what? Bret From bret at pettichord.com Tue Dec 19 20:42:22 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 19:42:22 -0600 Subject: [Wtr-general] Extreme slowdown moving from 1.4.1 to 1.5.1.1127 In-Reply-To: <212711160612180556n5b290918ic4e2729e547347cb@mail.gmail.com> References: <212711160612011226i1948fc33mac83f91ad23c2ee8@mail.gmail.com> <45802EBB.6020502@pettichord.com> <212711160612180556n5b290918ic4e2729e547347cb@mail.gmail.com> Message-ID: <458894FE.4080309@pettichord.com> Pat Mac wrote: > Thanks for the reply Bret. The first thing I noticed from your email > is that I missed the new IE set_fast_speed method so perhaps that will > bring the execution time back in line. That makes a big difference. That feature is also found in 1.4. There is a command line switch that can be used to turn it on. > I agree that it's nearly impossible to debug these kinds of issues > without a public test suite. I am getting killed at work right now > but I will look into adding some timing tests and running some 1.4 to > 1.5 comparisions with the Instiki test suite hopefully around the > first of the year. I was thinking about the details of your analysis while looking through the code and I realized that there was a simple change that could be made to improve performance. This code is attached below as a patch. I found that this change provided a 4% improvement when running the core watir unit tests, but a 16% improvement in one of the tests i've been working with recently for my company's application. It will provide the biggest improvement when (1) the application has a DOM with lots of elements and (2) you make repeated use of elements stored in variables. name = ie.text_field(:id, 'name') name.set(name) if name.exists? What the change does is cache the reference for the second call. Although all the unit tests passed with this change, there are likely to be uses out there this would break, so i am reluctant to add this code to Watir without putting some kind of guard on it. Bret Index: C:/_workspace/watir/watir.rb =================================================================== --- C:/_workspace/watir/watir.rb (revision 1132) +++ C:/_workspace/watir/watir.rb (working copy) @@ -2306,6 +2306,7 @@ public def assert_exists + return ole_object if ole_object locate if defined?(locate) unless ole_object raise UnknownObjectException.new("Unable to locate object, using #{@how} and #{@what}") From phlip2005 at gmail.com Tue Dec 19 21:19:16 2006 From: phlip2005 at gmail.com (Phlip) Date: Tue, 19 Dec 2006 18:19:16 -0800 Subject: [Wtr-general] Syntax for relative attributes References: <45888426.1050407@pettichord.com> Message-ID: <00dd01c723dd$42f908b0$81a1b04c@Marley> Bret Pettichord wrote: >I am in the process of adding a new feature to Watir and have a question. > > Consider this code: > > headline = $ie.div(:text, 'Pragmatic Version Control') > link = $ie.link(:class => 'addtocart', :after? => headline) > > Would you assume that link was after headline, or headline after link? > I can make it work either way. Which is more intuitive? Or is it > confusing no matter what? 'after' is reflexive when used as a question. Is link after headline? It reflects its target to before its subject. 'after' is transitive when used imperatively. "Link! After link, headline!" So Ruby's silly ? and ! markers make more sense than we thought. "Whaddaya mean you can write anything and it doesn't check if you are really doing a query without side-effects inside a ? function?? I'm going back to a paranoid language with static typing and everything!" Now I just have to figure out how to stop adding get_ and I'm there. Who wants to write a tiny book /Elements of Ruby Style/ ? -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!! From forum-watir-users at openqa.org Tue Dec 19 21:31:12 2006 From: forum-watir-users at openqa.org (liucongying) Date: Tue, 19 Dec 2006 20:31:12 CST Subject: [Wtr-general] how to install watir-1[1].5.1.1127.gem Message-ID: <41604859.1166581902897.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I am a new watirer,I want to know how to install watir-1[1].5.1.1127.gem I have already install ruby185-21 and watir-1[1].5.0.945.exe, I want to handle js-popup problem,please help me,thanks --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5851&messageID=16363#16363 From lyi at manpower.com.au Tue Dec 19 22:18:00 2006 From: lyi at manpower.com.au (Yi, Lawrence) Date: Wed, 20 Dec 2006 11:18:00 +0800 Subject: [Wtr-general] Syntax for relative attributes Message-ID: <7C7F202323219D4698E0861AD71588B8218B8C@gsd3w050c.CORP.ROOT.GLOBAL> I would see that as link after headline. Wonder what other people think .... Cheers, Lawrence. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Wednesday, 20 December 2006 11:31 To: wtr-general at rubyforge.org Subject: [Wtr-general] Syntax for relative attributes I am in the process of adding a new feature to Watir and have a question. Consider this code: headline = $ie.div(:text, 'Pragmatic Version Control') link = $ie.link(:class => 'addtocart', :after? => headline) Would you assume that link was after headline, or headline after link? I can make it work either way. Which is more intuitive? Or is it confusing no matter what? Bret _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From vikashkumar051 at yahoo.co.in Tue Dec 19 22:45:34 2006 From: vikashkumar051 at yahoo.co.in (VIKASH KUMAR) Date: Wed, 20 Dec 2006 03:45:34 +0000 (GMT) Subject: [Wtr-general] unable to click on popup when selecting an item in select list changes Message-ID: <20061220034534.51764.qmail@web7814.mail.in.yahoo.com> I am getting a javascript pop up after I select a value from some drop down list using the select_list method. Since I can not use click_no_wait for a list, how am I supposed to handle the pop up. Can anyone please provide a solution for it. I am using the following code to assess a select list, I am using Watir Version 1.5.1.1100 The code is as follows : require 'watir' # the watir controller require 'watir/winClicker.rb' require 'watir\contrib\enabled_popup' require 'Enter_on_inputbox' enter_on_inputboxObj = Enter_on_inputbox.new instance = "c:\\aa.htm" ie=Watir::IE.start(instance) #THIS PART IS WORKING, using click_no_wait ie.image(:index,'4').click_no_wait enter_on_inputboxObj.startClicker(ie, $hwnd, "OK", 7, "Good") ############################### ie.select_list(:name, "trx").select("First") # Here too a javascript box is coming, but I am unable to click on the OK button I have defined a class name Enter_on_inputbox require 'watir/winClicker.rb' class Enter_on_inputbox def initialize end def startClicker( ie, hwnd, button , waitTime, user_input) hwnd = ie.enabled_popup(waitTime) # get a handle if one exists w = WinClicker.new if (hwnd) # yes there is a popup w = WinClicker.new if ( user_input ) print(user_input) $stdout.flush w.setTextValueForFileNameField(hwnd, "#{user_input}") end sleep 3 # I put this in to see the text being input it is not necessary to work w.clickWindowsButton_hwnd(hwnd, "#{button}") # "OK" or whatever the name on the button is w=nil # this is just cleanup end end end After it select the value from list, a javascript pop up comes asking for OK or Cancel, here my code get stops until I click manually on OK or Cancel Button, please help me out from this. Thanks in advance Vikash Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download Now! http://messenger.yahoo.com/download.php -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061220/7ee51dff/attachment.html From bret at pettichord.com Tue Dec 19 23:57:57 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 22:57:57 -0600 Subject: [Wtr-general] Syntax for relative attributes In-Reply-To: <7C7F202323219D4698E0861AD71588B8218B8C@gsd3w050c.CORP.ROOT.GLOBAL> References: <7C7F202323219D4698E0861AD71588B8218B8C@gsd3w050c.CORP.ROOT.GLOBAL> Message-ID: <4588C2D5.1020802@pettichord.com> Yi, Lawrence wrote: > I would see that as link after headline. > > That was my original intention. Is this clearer? link = $ie.link(:class => 'addtocart', :is_after? => headline) Bret From bret at pettichord.com Wed Dec 20 00:24:29 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 19 Dec 2006 23:24:29 -0600 Subject: [Wtr-general] How to capture screenshots when your tests fail. Message-ID: <4588C90D.9030104@pettichord.com> Aslak Hellosoy provides detailed instructions on how to automatically save both the HTML of the browser and a screenshot whenever Watir tests fail, and then automatically include links to these files in an HTML test report. http://blog.aslakhellesoy.com/articles/2006/12/02/getting-screenshots-from-watir And he shows you how to do this on both Windows and a Mac (using Safari Watir). I'm still digesting it all. Bret From forum-watir-users at openqa.org Wed Dec 20 00:54:41 2006 From: forum-watir-users at openqa.org (Lou Wilson) Date: Tue, 19 Dec 2006 23:54:41 CST Subject: [Wtr-general] Excel Or Text File? In-Reply-To: <45885CDB.3030401@pettichord.com> Message-ID: <31803610.1166594111777.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> In another thread I described how I handle that problem. I maintain the constants and variables in an Excel sheet. But I have a macro on the sheet that writes those out to another file. You have a choice at that point: to have the macro write all or part of your .RB file and execute it, as I am doing, or have it export to an .ini file and then read the .ini file from your .RB file. The second is probably more standard, and it can also be used by other environments if it ever comes around to that. Let's say you have 3 constants on the Excel page, laid out vertically: ---A--- ---B--- xyzzy 345 plugh gopher razzle .28951 your macro would do the following: open a text file write the var and val to it for each of the items close the text file That might look something like this (I use the older style .VB code for writing to files) f=freefile open "c:\yourpath\yourfile.ini" for output as #f for a = 1 to 3 print #f, cells(a,1) & "=" & cells(a,2) next a close #f This will produce a file that looks like: xyzzy=345 plugh=gopher razzle=.28951 At this point you have your .ini file, and the data can be read easily by any script, including your ruby script. AND you still have the data in a spreadsheet format that your stakeholders can use. The other way to do the same thing is to use the .rb code to open and extract the cells from the spreadsheet. That way you don't have to have a macro in the spreadsheet, which may bother some people. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5619&messageID=16369#16369 From forum-watir-users at openqa.org Wed Dec 20 02:44:45 2006 From: forum-watir-users at openqa.org (vikash) Date: Wed, 20 Dec 2006 01:44:45 CST Subject: [Wtr-general] clicking on popup after selecting an item in select list Message-ID: <37572682.1166600715944.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I am getting a javascript pop up after I select a value from some drop down list using the select_list method. Since I can not use click_no_wait for a list, how am I supposed to handle the pop up. Can anyone please provide a solution for it. I am using the following code to assess a select list, I am using Watir Version 1.5.1.1100 The code is as follows : require 'watir' # the watir controller require 'watir/winClicker.rb' require 'watir\contrib\enabled_popup' require 'Enter_on_inputbox' enter_on_inputboxObj = Enter_on_inputbox.new instance = "c:\\aa.htm" ie=Watir::IE.start(instance) #THIS PART IS WORKING, using click_no_wait ie.image(:index,'4').click_no_wait enter_on_inputboxObj.startClicker(ie, $hwnd, "OK", 7, "Good") ############################### ie.select_list(:name, "trx").select("First") # Here too a javascript box is coming, but I am unable to click on the OK button I have defined a class name Enter_on_inputbox require 'watir/winClicker.rb' class Enter_on_inputbox def initialize end def startClicker( ie, hwnd, button , waitTime, user_input) hwnd = ie.enabled_popup(waitTime) # get a handle if one exists w = WinClicker.new if (hwnd) # yes there is a popup w = WinClicker.new if ( user_input ) print(user_input) $stdout.flush w.setTextValueForFileNameField(hwnd, "#{user_input}") end sleep 3 # I put this in to see the text being input it is not necessary to work w.clickWindowsButton_hwnd(hwnd, "#{button}") # "OK" or whatever the name on the button is w=nil # this is just cleanup end end end After it select the value from list, a javascript pop up comes asking for OK or Cancel, here my code get stops until I click manually on OK or Cancel Button, please help me out from this. Thanks in advance Vikash --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5857&messageID=16375#16375 From herr.kreutzer at googlemail.com Wed Dec 20 04:38:23 2006 From: herr.kreutzer at googlemail.com (Christian Kreutzer) Date: Wed, 20 Dec 2006 10:38:23 +0100 Subject: [Wtr-general] Syntax for relative attributes In-Reply-To: <4588C2D5.1020802@pettichord.com> References: <7C7F202323219D4698E0861AD71588B8218B8C@gsd3w050c.CORP.ROOT.GLOBAL> <4588C2D5.1020802@pettichord.com> Message-ID: i can't see much difference between :after? and :is_after?. i would read both versions as link after headline Christian On 12/20/06, Bret Pettichord wrote: > Yi, Lawrence wrote: > > I would see that as link after headline. > > > > > That was my original intention. > > Is this clearer? > > link = $ie.link(:class => 'addtocart', :is_after? => headline) > > > Bret > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From welch_stephen at hotmail.com Wed Dec 20 05:19:53 2006 From: welch_stephen at hotmail.com (Stephen Welch) Date: Wed, 20 Dec 2006 10:19:53 +0000 Subject: [Wtr-general] Overriding UserAgent values in IE control Message-ID: Is there any way to override, or append values to the user-agent setting over the watir ie com object? Regards, Stephen _________________________________________________________________ Be one of the first to try Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d From forum-watir-users at openqa.org Wed Dec 20 05:46:16 2006 From: forum-watir-users at openqa.org (Parvathy) Date: Wed, 20 Dec 2006 04:46:16 CST Subject: [Wtr-general] Wait functionality in Watir ..need help Message-ID: <35295556.1166611606086.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I am trying to automate a web based application. IN the last step of the navigation through the website, when i click a button, it refreshes the page and displays a progress bar, and when the progress bar is finished, it again refreshes and gives the last page. If a write a Watir code without wait, it simply stops after clicking the button, without waiting fro the last page to come. I want the code include wait statement that waits for some attribute in the last page, so that the script goes to the last page before saying that script is complete. Please help on this. I tried putting sleep statement. That works. But sometimes it requries more time for the page to laod nad it fails. can anyone suggest better way. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5860&messageID=16386#16386 From forum-watir-users at openqa.org Wed Dec 20 05:46:29 2006 From: forum-watir-users at openqa.org (Parvathy) Date: Wed, 20 Dec 2006 04:46:29 CST Subject: [Wtr-general] Wait functionality in Watir ..need help Message-ID: <33583373.1166611619315.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I am trying to automate a web based application. IN the last step of the navigation through the website, when i click a button, it refreshes the page and displays a progress bar, and when the progress bar is finished, it again refreshes and gives the last page. If a write a Watir code without wait, it simply stops after clicking the button, without waiting fro the last page to come. I want the code include wait statement that waits for some attribute in the last page, so that the script goes to the last page before saying that script is complete. Please help on this. I tried putting sleep statement. That works. But sometimes it requries more time for the page to laod nad it fails. can anyone suggest better way. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5861&messageID=16387#16387 From mrussell at inpses.co.uk Wed Dec 20 06:32:03 2006 From: mrussell at inpses.co.uk (Max Russell) Date: Wed, 20 Dec 2006 11:32:03 -0000 Subject: [Wtr-general] Executing javascript in 1.5 Message-ID: Has the support for executing javascript changed in 1.5? A method I used previously: def run_script(js) ie.Document.parentWindow.execScript(js) end calling the execScript method no longer seems to work.... Max Russell Test Analyst. INPS Tel: 01382 223900 Fax: 01382 204488 Visit our Web site at www.inps.co.uk The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of In Practice Systems Limited or any of its affiliates. If you are not the intended recipient please contact is.helpdesk at inps.co.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061220/f464101b/attachment.html From forum-watir-users at openqa.org Wed Dec 20 07:17:27 2006 From: forum-watir-users at openqa.org (vijay) Date: Wed, 20 Dec 2006 06:17:27 CST Subject: [Wtr-general] how to access an element whose html tag is In-Reply-To: <57042234.1165846538673.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <33987913.1166617077993.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks for your suggestion. All the 7 elements in the page are recognized as "links" when they are in "enabled" states and in that situation, I am able to click all of them using 'ie.link' commands similar to the one given below: ie.frame("Detail").link(:text,"Step 2. Inventors").click But, when the web page first loads, only one (it is displayed as "Step 1. Details") out of the existant 7 elements is enabled and so only this element is recognized as a link by Watir. The status of this element can be checked by the following command: object_enabled = ie.frame("Detail").link(:text,"Step 1. Details").enabled? The above command returns "True" to say that the element, "Step 1. Details", is enabled. But I am not sure how to check the statuses of other elements as Watir does not recognize them as links because they are disabled. If a similar statement is used to check the element, "Step 2. Inventors" (which is in a disabled state), Watir says that it is "unable to find out the object using text and Step 2. Inventors". The reason behind this, I believe, is that the element, "Step 2. Inventors" is not identifed as a link as it is in a disabled state (it is not categorized as a link because it cannot be clicked). So I am unable to find out the statuses of other elements because I am not sure what word to put instead of the word "link" in the following checking statement, object_enabled = ie.frame("Detail").link(:text,"Step 2. Inventors").enabled? If I use the word, "element" instead of the word "link" in the above statement, Watir says "Undefined method 'element' for Watir Frame" The 'html' of all the disabled items are present as: Active Element: [TD], Frame: [Detail], Index: [41] Thanks, in Advance, Vijay. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5711&messageID=16393#16393 From zeljko.filipin at gmail.com Wed Dec 20 07:33:36 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 20 Dec 2006 13:33:36 +0100 Subject: [Wtr-general] Simulate CNTRL-LEFT CLICK In-Reply-To: <40059708.1166570571258.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <42913869.1164750868797.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <40059708.1166570571258.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 12/20/06, Dave Munns wrote: > > The control left click on a specific object will invoke a frame with a > list of data. No url's involved... > Look at your html source (or send it to us). You probably should do something like fire_event("ControlLeftClick") -- Zeljko Filipin http://zeljkofilipin.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061220/5e92465c/attachment.html From zeljko.filipin at gmail.com Wed Dec 20 08:14:44 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 20 Dec 2006 14:14:44 +0100 Subject: [Wtr-general] Syntax for relative attributes In-Reply-To: <4588C2D5.1020802@pettichord.com> References: <7C7F202323219D4698E0861AD71588B8218B8C@gsd3w050c.CORP.ROOT.GLOBAL> <4588C2D5.1020802@pettichord.com> Message-ID: On 12/20/06, Bret Pettichord wrote: > > link = $ie.link(:class => 'addtocart', :is_after? => headline) This would make sense to me (no question mark) link = $ie.link(:class => 'addtocart', :after => headline) "By convention, methods that answer questions (i.e. Array#empty? returns * true* if the receiver is empty) end in question marks." ( http://www.ruby-lang.org/en/documentation/ruby-from-other-languages/) This is not a method, but this convention really makes sense to me, so I expect anything that ends with question mark to return true or false. Why did you use question mark? -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061220/f2ce3b2a/attachment.html From zeljko.filipin at gmail.com Wed Dec 20 08:24:29 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 20 Dec 2006 14:24:29 +0100 Subject: [Wtr-general] Wait functionality in Watir ..need help In-Reply-To: <33583373.1166611619315.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <33583373.1166611619315.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: while true break unless ie.text.include?("loading") sleep 1 end You can replace ie.text.include?("loading") with anything that is appropriate, like ie.checkbox(:id, "1").exists? -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061220/4df0a76d/attachment-0001.html From zeljko.filipin at gmail.com Wed Dec 20 08:32:35 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 20 Dec 2006 14:32:35 +0100 Subject: [Wtr-general] how to access an element whose html tag is In-Reply-To: <33987913.1166617077993.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <57042234.1165846538673.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <33987913.1166617077993.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Vijay, I have already replied to your question in another thread. This does not work for you? This will tell you that "Step 1. Details" is link, not in table cell. irb(main):025:0> ie.link(:text, "Step 1. Details").exists? => true irb(main):026:0> ie.cell(:text, "Step 1. Details").exists? => false This will tell you that "Step 2. Inventors" is in table cell, not link. irb(main):023:0> ie.link(:text, "Step 2. Inventors").exists? => false irb(main):024:0> ie.cell(:text, "Step 2. Inventors").exists? => true -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061220/6176b11b/attachment.html From zeljko.filipin at gmail.com Wed Dec 20 08:38:11 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 20 Dec 2006 14:38:11 +0100 Subject: [Wtr-general] how to install watir-1[1].5.1.1127.gem In-Reply-To: <41604859.1166581902897.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <41604859.1166581902897.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 12/20/06, liucongying wrote: > > I am a new watirer,I want to know how to install watir-1[1].5.1.1127.gem > I have already install ruby185-21 and watir-1[1].5.0.945.exe, I want > to handle js-popup problem,please help me,thanks > You will find 1.5.1.1127 gem and installation help here http://wiki.openqa.org/display/WTR/Development+Builds Just make sure that after you download gem, it is named watir-1.5.1.1127.gem, not watir-1[1].5.1.1127.gem (remove "[1]" from file name if necessary). -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061220/53103623/attachment.html From forum-watir-users at openqa.org Wed Dec 20 08:42:30 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Wed, 20 Dec 2006 07:42:30 CST Subject: [Wtr-general] Wait functionality in Watir ..need help In-Reply-To: <33583373.1166611619315.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <39178845.1166622180705.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> You have the right idea, wanting to wait until the bar is done, but you are approaching it slightly wrong. I would first try to understand why *you* know the progress bar is done. Is it because the bar gets to the end and its full? Is it because something says 'complete'? How do you know it failed? Once you gathered these answers you will probably find you are waiting for a certain event to occur. This event doesn't always happen X seconds after you click something, it happens when its done (it also will probably fail at some point). So to start, we need to find that 'anchor' in the future. This is some page element that lets the user know that its done. Lets pretend this is an image. So we want to wait at most, lets say, 20 seconds (this depends on your app) or until some image exists. I'm going to give you some code I'm just thinking up, this should be used to help illustrate my idea and maybe inspire a solution from you. I'm sure you will think up something much better on your own. # Note the below code should not be used, its just an idea of how you might do this wait_max = 20 wait_increment = .1 wait = 0 while wait < wait_max .if ie.image(*whatever*).exists? #this is the event, it could be anything ..# Found it, do the next part .else ..wait += wait_increment end --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5861&messageID=16400#16400 From forum-watir-users at openqa.org Wed Dec 20 09:15:10 2006 From: forum-watir-users at openqa.org (Balaji) Date: Wed, 20 Dec 2006 08:15:10 CST Subject: [Wtr-general] CRITICAL---Clicking Image Button in Application Message-ID: <32192013.1166624153561.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi all, I am trying to click on this image button with the following codes but none worked: This image button saves all the data entered in the current form and navigate to the next page. 1. ie.button(:src,/btn_save_continue/).click 2. ie.button(:src,/agent/btn_save_continue/).click Please someone help me. Its really urgent. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5866&messageID=16406#16406 From forum-watir-users at openqa.org Wed Dec 20 09:16:27 2006 From: forum-watir-users at openqa.org (Balaji) Date: Wed, 20 Dec 2006 08:16:27 CST Subject: [Wtr-general] CRITICAL---Clicking Image Button in Application Message-ID: <39734818.1166624217749.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> """" Hi all, I am trying to click on this image button with the following codes but none worked: This image button saves all the data entered in the current form and navigate to the next page. 1. ie.button(:src,/btn_save_continue/).click 2. ie.button(:src,/agent/btn_save_continue/).click Please someone help me. Its really urgent. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5867&messageID=16407#16407 From forum-watir-users at openqa.org Wed Dec 20 09:16:52 2006 From: forum-watir-users at openqa.org (Balaji) Date: Wed, 20 Dec 2006 08:16:52 CST Subject: [Wtr-general] CRITICAL---Clicking Image Button in Application Message-ID: <41788329.1166624242752.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> ""IMG SRC='/images/agent/btn_save_continue.gif' BORDER=0 STYLE='cursor: pointer' onClick='change_has_been_handled = true; if (!this.clicked) {document.the_form.submit();; this.clicked = true;}'"" Hi all, I am trying to click on this image button with the following codes but none worked: This image button saves all the data entered in the current form and navigate to the next page. 1. ie.button(:src,/btn_save_continue/).click 2. ie.button(:src,/agent/btn_save_continue/).click Please someone help me. Its really urgent. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5868&messageID=16408#16408 From rafael.torres at peopleadmin.com Wed Dec 20 09:48:17 2006 From: rafael.torres at peopleadmin.com (Rafael Torres) Date: Wed, 20 Dec 2006 08:48:17 -0600 Subject: [Wtr-general] CRITICAL---Clicking Image Button in Application Message-ID: Try replacing 'button' with 'image' on the first line. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Balaji Sent: Wednesday, December 20, 2006 8:15 AM To: wtr-general at rubyforge.org Subject: [Wtr-general] CRITICAL---Clicking Image Button in Application Hi all, I am trying to click on this image button with the following codes but none worked: This image button saves all the data entered in the current form and navigate to the next page. 1. ie.button(:src,/btn_save_continue/).click 2. ie.button(:src,/agent/btn_save_continue/).click Please someone help me. Its really urgent. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5866&messageID=16406#16406 _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From zeljko.filipin at gmail.com Wed Dec 20 09:52:28 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 20 Dec 2006 15:52:28 +0100 Subject: [Wtr-general] CRITICAL---Clicking Image Button in Application In-Reply-To: <32192013.1166624153561.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <32192013.1166624153561.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Balaji, Try this ie.image(:src,/btn_save_continue/).click -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061220/f620a927/attachment.html From forum-watir-users at openqa.org Wed Dec 20 09:58:38 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Wed, 20 Dec 2006 08:58:38 CST Subject: [Wtr-general] CRITICAL---Clicking Image Button in Application In-Reply-To: <41788329.1166624242752.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <41837606.1166626748197.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> have you tried .fire_event('onClick')? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5868&messageID=16411#16411 From paul.rogers at shaw.ca Wed Dec 20 11:11:18 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 20 Dec 2006 09:11:18 -0700 Subject: [Wtr-general] Overriding UserAgent values in IE control In-Reply-To: References: Message-ID: it can be done via the registry http://www.winguides.com/registry/display.php/799/ ----- Original Message ----- From: Stephen Welch Date: Wednesday, December 20, 2006 3:19 am Subject: [Wtr-general] Overriding UserAgent values in IE control > > Is there any way to override, or append values to the user-agent > setting over the watir ie com object? > > > Regards, > > Stephen > > > _________________________________________________________________ > Be one of the first to try Windows Live Mail. > http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161- > 4314-9b0e-4911fb2b2e6d > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From charley.baker at gmail.com Wed Dec 20 11:36:27 2006 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 20 Dec 2006 09:36:27 -0700 Subject: [Wtr-general] Executing javascript in 1.5 In-Reply-To: References: Message-ID: You're calling straight into the document ole object, Watir shouldn't be doing anything but passing the call on to IE. What error are you getting? Are you running the scripts on the same box with different version of Watir and seeing it fail? -Charley On 12/20/06, Max Russell wrote: > > Has the support for executing javascript changed in 1.5? > > > > A method I used previously: > > > > def run_script(js) > > ie.Document.parentWindow.execScript(js) > > end > > > > calling the execScript method no longer seems to work?. > > > > *Max Russell* > > *Test Analyst.* > > *INPS* > > * * > > *Tel: 01382 223900* > > *Fax: 01382 204488* > > * * > > *Visit our Web site at www.inps.co.uk* > > * * > > *The information in this internet email is confidential and is intended > solely for the addressee. Access, copying or re-use of information in it by > anyone else is not authorised. Any views or opinions presented are solely > those of the author and do not necessarily represent those of In Practice > Systems Limited or any of its affiliates. If you are not the intended > recipient please contact is.helpdesk at inps.co.uk* > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061220/e0f1809b/attachment-0001.html From mrussell at inpses.co.uk Wed Dec 20 11:59:45 2006 From: mrussell at inpses.co.uk (Max Russell) Date: Wed, 20 Dec 2006 16:59:45 -0000 Subject: [Wtr-general] Executing javascript in 1.5 Message-ID: I'm running the code on the same machine as I'm developing it... The error I'm seeing is like this: test_drag_and_drop(TestWatir): NoMethodError: undefined method `run_script' for # dragdrophacking.rbw:40:in `test_drag_and_drop' The code I'm trying to work is one I've posted before on this list, based on the zbarzone.blogspot.com/ example. I don't expect it to complete the drag, but previously it would actually select the div. class Watir::IE def run_script(js) ie.Document.parentWindow.execScript(js) end end class TestWatir < Test::Unit::TestCase def test_drag_and_drop ie = Watir::IE.start('http://everestcf/CV_Tay_Test/home/Index.cfm') #ie.maximize ie.frame("main").text_field(:name, "username").set("ltanner") ie.frame("main").text_field(:name, "password").set("password9") ie.frame("main").select_list(:name, "ldapDir").select("SARAGON") ie.frame("main").button(:name, "Login").click #expand the admin node ie.frame("left").link(:index, 35).click #click on the data management link ie.frame("left").link(:index, 54).click #Enter a search string into the search field. ie.frame("main").text_field(:id, "Search_box").set("Batchelor") #Click to search ie.frame("main").button(:id, "btn_search").click #insert a sleep #sleep(5) #Guessing at the path to the searched item... ie.frame("main").div(:id, "10439,10439").flash #accessing through the div id. Pretty Brittle for now, but can wrap this.... widget = ie.frame("main").div(:id, "10439,10439") #sleep(10) #ie.frame("main").run_script("alert(document.getElementById('10439,10439 ').id)") #~ #THIS SECTION USES THE SCRIPTACULOUS DRAG/DROP ie.frame("main").run_script("document.blah = document.createEventObject(); document.blah.button = 1") ie.frame("main").run_script("document.getElementById('#{widget}').fireEv ent('onmousedown', document.blah)") ie.frame("main").run_script("document.blah = document.createEventObject(); document.blah.clientX = document.getElementById('search_results'); document.blah.clientY = document.getElementById('drop_p1_toolbar')")#.offsetLeft .offsetTop search_results ie.frame("main").run_script("document.getElementById('#{widget}').fireEv ent('onmousemove', document.blah)") ie.frame("main").run_script("document.getElementById('#{widget}').fireEv ent('onmouseup', document.blah)") #~ sleep(20) end end I know the dragdrop hacking stuff is slightly outwith the scope of Watir, but for me it's about the one thing that could really improve testing with Watir. Max Russell Test Analyst. INPS Tel: 01382 223900 Fax: 01382 204488 Visit our Web site at www.inps.co.uk The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of In Practice Systems Limited or any of its affiliates. If you are not the intended recipient please contact is.helpdesk at inps.co.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061220/ed995146/attachment.html From charley.baker at gmail.com Wed Dec 20 12:35:08 2006 From: charley.baker at gmail.com (Charley Baker) Date: Wed, 20 Dec 2006 10:35:08 -0700 Subject: [Wtr-general] Executing javascript in 1.5 In-Reply-To: References: Message-ID: Ah, you're adding it to the IE class, which in Watir 1.4.1 was a super of Frame. In 1.5.1, Frame doesn't inherit from IE, but does include Container and PageContainer as mixins. You'll want to change your run_script method to the Container namespace: module Watir::Container def run_script .... end end -Charley On 12/20/06, Max Russell wrote: > > I'm running the code on the same machine as I'm developing it? > > > > The error I'm seeing is like this: > > > > > > test_drag_and_drop(TestWatir): > > NoMethodError: undefined method `run_script' for # > > dragdrophacking.rbw:40:in `test_drag_and_drop' > > > > > > The code I'm trying to work is one I've posted before on this list, based > on the zbarzone.blogspot.com/ example. > > I don't expect it to complete the drag, but previously it would actually > select the div. > > > > class Watir::IE > > def run_script(js) > > ie.Document.parentWindow.execScript(js) > > end > > end > > > > class TestWatir < Test::Unit::TestCase > > def test_drag_and_drop > > ie = Watir::IE.start('http://everestcf/CV_Tay_Test/home/Index.cfm' > ) > > #ie.maximize > > ie.frame("main").text_field(:name, "username").set("ltanner") > > ie.frame("main").text_field(:name, > "password").set("password9") > > ie.frame("main").select_list(:name, > "ldapDir").select("SARAGON") > > ie.frame("main").button(:name, "Login").click > > > > #expand the admin node > > ie.frame("left").link(:index, 35).click > > #click on the data management link > > ie.frame("left").link(:index, 54).click > > > > #Enter a search string into the search field. > > ie.frame("main").text_field(:id, > "Search_box").set("Batchelor") > > #Click to search > > ie.frame("main").button(:id, "btn_search").click > > > > #insert a sleep > > #sleep(5) > > > > #Guessing at the path to the searched item... > > ie.frame("main").div(:id, "10439,10439").flash #accessing > through the div id. Pretty Brittle for now, but can wrap this.... > > > > widget = ie.frame("main").div(:id, "10439,10439") > > #sleep(10) > > #ie.frame("main").run_script("alert(document.getElementById > ('10439,10439').id)") > > #~ #THIS SECTION USES THE SCRIPTACULOUS DRAG/DROP > > ie.frame("main").run_script("document.blah = > document.createEventObject(); document.blah.button = 1") > > ie.frame("main").run_script("document.getElementById('#{widget}').fireEvent('onmousedown', > document.blah)") > > ie.frame("main").run_script("document.blah = > document.createEventObject(); document.blah.clientX = > document.getElementById('search_results'); document.blah.clientY = > document.getElementById('drop_p1_toolbar')")#.offsetLeft .offsetTop > search_results > > ie.frame("main").run_script("document.getElementById('#{widget}').fireEvent('onmousemove', > document.blah)") > > ie.frame("main").run_script("document.getElementById('#{widget}').fireEvent('onmouseup', > document.blah)") > > #~ sleep(20) > > end > > end > > > > > > I know the dragdrop hacking stuff is slightly outwith the scope of Watir, > but for me it's about the one thing that could really improve testing with > Watir. > > > > > > *Max Russell* > > *Test Analyst.* > > *INPS* > > * * > > *Tel: 01382 223900* > > *Fax: 01382 204488* > > * * > > *Visit our Web site at www.inps.co.uk* > > * * > > *The information in this internet email is confidential and is intended > solely for the addressee. Access, copying or re-use of information in it by > anyone else is not authorised. Any views or opinions presented are solely > those of the author and do not necessarily represent those of In Practice > Systems Limited or any of its affiliates. If you are not the intended > recipient please contact is.helpdesk at inps.co.uk* > > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061220/e09c54d3/attachment-0001.html From welch_stephen at hotmail.com Wed Dec 20 13:25:40 2006 From: welch_stephen at hotmail.com (Stephen Welch) Date: Wed, 20 Dec 2006 18:25:40 +0000 Subject: [Wtr-general] Overriding UserAgent values in IE control Message-ID: Paul, Yes I've seen that, however I'd like to change it on the fly as part of the tests, without having too rely on the test machine(s) having this preconfigured. Regards, Stephen ---------------------------------------- > Date: Wed, 20 Dec 2006 09:11:18 -0700 > From: paul.rogers at shaw.ca > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] Overriding UserAgent values in IE control > > it can be done via the registry > > http://www.winguides.com/registry/display.php/799/ > > > > ----- Original Message ----- > From: Stephen Welch > Date: Wednesday, December 20, 2006 3:19 am > Subject: [Wtr-general] Overriding UserAgent values in IE control > > > > > Is there any way to override, or append values to the user-agent > > setting over the watir ie com object? > > > > > > Regards, > > > > Stephen > > > > > > _________________________________________________________________ > > Be one of the first to try Windows Live Mail. > > http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161- > > 4314-9b0e-4911fb2b2e6d > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general _________________________________________________________________ Be one of the first to try Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d From paul.rogers at shaw.ca Wed Dec 20 15:08:31 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Wed, 20 Dec 2006 13:08:31 -0700 Subject: [Wtr-general] Overriding UserAgent values in IE control In-Reply-To: References: Message-ID: take a look at the win32/registry package - its installed as part of ruby, its easy to use, and you should be able to set the user agent before starting IE Paul ----- Original Message ----- From: Stephen Welch Date: Wednesday, December 20, 2006 11:25 am Subject: Re: [Wtr-general] Overriding UserAgent values in IE control > > Paul, > > Yes I've seen that, however I'd like to change it on the fly as > part of the tests, without having too rely on the test machine(s) > having this preconfigured. > > > Regards, > > Stephen > > > > ---------------------------------------- > > Date: Wed, 20 Dec 2006 09:11:18 -0700 > > From: paul.rogers at shaw.ca > > To: wtr-general at rubyforge.org > > Subject: Re: [Wtr-general] Overriding UserAgent values in IE control > > > > it can be done via the registry > > > > http://www.winguides.com/registry/display.php/799/ > > > > > > > > ----- Original Message ----- > > From: Stephen Welch > > Date: Wednesday, December 20, 2006 3:19 am > > Subject: [Wtr-general] Overriding UserAgent values in IE control > > > > > > > > Is there any way to override, or append values to the user- > agent > > > setting over the watir ie com object? > > > > > > > > > Regards, > > > > > > Stephen > > > > > > > > > _________________________________________________________________ > > > Be one of the first to try Windows Live Mail. > > > http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161- > > > 4314-9b0e-4911fb2b2e6d > > > _______________________________________________ > > > Wtr-general mailing list > > > Wtr-general at rubyforge.org > > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > _________________________________________________________________ > Be one of the first to try Windows Live Mail. > http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161- > 4314-9b0e-4911fb2b2e6d > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > From bret at pettichord.com Wed Dec 20 15:45:00 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 20 Dec 2006 14:45:00 -0600 Subject: [Wtr-general] Wait functionality in Watir ..need help In-Reply-To: References: <33583373.1166611619315.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4589A0CC.5060705@pettichord.com> ?eljko Filipin wrote: > while true > break unless ie.text.include?("loading") > sleep 1 > end This is a more concise way of doing the same thing: while (ie.text.include? 'loading') {sleep 1} From bret at pettichord.com Wed Dec 20 16:00:17 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 20 Dec 2006 15:00:17 -0600 Subject: [Wtr-general] Syntax for relative attributes In-Reply-To: References: <7C7F202323219D4698E0861AD71588B8218B8C@gsd3w050c.CORP.ROOT.GLOBAL> <4588C2D5.1020802@pettichord.com> Message-ID: <4589A461.8080707@pettichord.com> ?eljko Filipin wrote: > This would make sense to me (no question mark) > > link = $ie.link(:class => 'addtocart', :after => headline) > > "By convention, methods that answer questions (i.e. Array#empty? > returns *true* if the receiver is empty) end in question marks." > (http://www.ruby-lang.org/en/documentation/ruby-from-other-languages/ > ) > > This is not a method, but this convention really makes sense to me, so > I expect anything that ends with question mark to return true or > false. Why did you use question mark? Actually it is a method, but not obviously so. A major structural change between Watir 1.4 and Watir 1.5 is that in 1.5, these 'conventions' actually are methods. In other words, there is a deep similarity between link = ($ie.links.collect {|l| l.class_name == 'addtocart'))[0] and link = $ie.link(:class_name => 'addtocart') (In the case of :class, we map it to the Element#class_name method because Object#class is already taken.) In other words, my proposal implicitly includes adding a method Element#after? that returns true or false based on the relation ship between self and the argument. That is why it has a question mark. But i can see that retaining the question mark in the attribute syntax may be confusing and will make it work without it too. Bret From forum-watir-users at openqa.org Wed Dec 20 16:37:34 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Wed, 20 Dec 2006 15:37:34 CST Subject: [Wtr-general] Syntax for relative attributes In-Reply-To: <45888426.1050407@pettichord.com> Message-ID: <39780875.1166650684310.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> headline = $ie.div(:text, 'Pragmatic Version Control') link = $ie.link(:class => 'addtocart', :after? => headline) Is this saying you want the link that comes after headline? Is there a before? :) *if* thats the case, my only problem with it is that it seems to not follow the standard syntax of Watir (as i understand it). how about ie.link(:class,'addtocard').after(ie.div(:text,'Pragmatic Version Control')) --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5849&messageID=16433#16433 From gmaralina at beingpresent.org Wed Dec 20 17:29:31 2006 From: gmaralina at beingpresent.org (Galina Maralina) Date: Wed, 20 Dec 2006 14:29:31 -0800 Subject: [Wtr-general] Commiting action on the objects with same tags. Message-ID: <20061220222936.ADFF3D12FF94@gollum.o1.com> Hello, I am trying to implement something suggested in Watir FAQ for clicking on the second link/image with same name. I get same error whatever I try. This is Watir 1.4. ie.image(:src => /arrows_round/, index => 2).click NameError: undefined local variable or method `index' for main:Object ie.link(:id => /ID_OPEN_/, index => 2).click NameError: undefined local variable or method `index' for main:Object Can anyone help me? Galina. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061220/49daa4bd/attachment.html From bret at pettichord.com Wed Dec 20 17:31:50 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 20 Dec 2006 16:31:50 -0600 Subject: [Wtr-general] Syntax for relative attributes In-Reply-To: <39780875.1166650684310.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <39780875.1166650684310.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4589B9D6.3020500@pettichord.com> John Lolis wrote: > headline = $ie.div(:text, 'Pragmatic Version Control') > link = $ie.link(:class => 'addtocart', :after? => headline) > > Is this saying you want the link that comes after headline? Is there a before? :) > Yes, there would also be a 'before' option, plus some others > *if* thats the case, my only problem with it is that it seems to not follow the standard syntax of Watir (as i understand it). > > how about ie.link(:class,'addtocard').after(ie.div(:text,'Pragmatic Version Control')) > This couldn't quite work. Well, it would "work" but what it would do is return true or false based on whether the link was after the div. However the following could be implemented, and in fact was a proposal that i had considered earlier: link = ie.div(:text, 'Pragmatic Version Control').after.link(:class, 'addtocard') I think this is less intuitive and it would be somewhat harder to implement. That's why i came up with the other proposal, above. Bret From bret at pettichord.com Wed Dec 20 17:57:57 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 20 Dec 2006 16:57:57 -0600 Subject: [Wtr-general] how to access an element whose html tag is In-Reply-To: <33987913.1166617077993.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <33987913.1166617077993.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <4589BFF5.6040507@pettichord.com> Can you show us the HTML for a link that is disabled? Bret From forum-watir-users at openqa.org Wed Dec 20 18:29:14 2006 From: forum-watir-users at openqa.org (Brad) Date: Wed, 20 Dec 2006 17:29:14 CST Subject: [Wtr-general] How to verify if SPAN is visible Message-ID: <36782797.1166657479535.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I'm a newbie and have been searching on how to verify if a SPAN element is visible. I tried different things without success. Here is the HTML code for when visible. Here it is when hidden. How do you check the 'visibility' parameter of 'style'? Thanks, Brad --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5879&messageID=16440#16440 From bret at pettichord.com Wed Dec 20 18:55:30 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 20 Dec 2006 17:55:30 -0600 Subject: [Wtr-general] Commiting action on the objects with same tags. In-Reply-To: <20061220222936.ADFF3D12FF94@gollum.o1.com> References: <20061220222936.ADFF3D12FF94@gollum.o1.com> Message-ID: <4589CD72.8090403@pettichord.com> > > ie.link(:id => /ID_OPEN_/, index => 2).click > > NameError: undefined local variable or method `index' for main:Object > This syntax only works with Watir 1.5 From paul_hammer at hotmail.com Wed Dec 20 19:11:41 2006 From: paul_hammer at hotmail.com (Paul Hammer) Date: Thu, 21 Dec 2006 00:11:41 +0000 Subject: [Wtr-general] hi and help with some javascript In-Reply-To: <31578466.1166558231035.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Vince, I tried placing this line of code in my test, just to see what it would show: puts "Button 1: #{@ie.buttons[0].name}" Below is the result. It seems This item somehow isn't considerred a button. Paul Started E Finished in 20.889 seconds. 1) Error: test_CreateQuestion_1_1(TestAYN): Watir::Exception::UnknownObjectException: Unable to locate object, using index a nd 0 c:/Program Files/ruby/lib/ruby/gems/1.8/gems/watir-1.4.1/./watir.rb:1928:in `assert_exists' (eval):2:in `name' C:/cvs/server-qa/qa_tests/ruby/TestAYNAjax.rb:77:in `test_CreateQuestion_1_1 ' 1 tests, 0 assertions, 0 failures, 1 errors >From: Vince >Reply-To: wtr-general at rubyforge.org >To: wtr-general at rubyforge.org >Subject: Re: [Wtr-general] hi and help with some javascript >Date: Tue, 19 Dec 2006 13:56:41 CST > >Paul, > > > Could you really have meant to write: > > > > "The links and inputs within those divs are NOT always on the page, ..." > >I really wish that was the case, but alas it is not. Using the sample AJAX >modal box page that I mentioned in my first reply, you can "find" the >buttons from the modal long before you click the link to fire up the box. >This is because the div that we are calling a modal box is always on the >page, but not always visible. > >See for yourself: > >require 'watir' >ie = Watir::IE.new >ie.goto("http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx") >puts "Button 1: #{ie.buttons[1].name}" >puts "Button 2: #{ie.buttons[2].name}" > >If you only have one on the page, you should have no problem clicking the >button, setting the modal, and submitting it. If you have multiple and need >to validate that the correct one is showing (as I do), than you have a long >day ahead of you... >--------------------------------------------------------------------- >Posted via Jive Forums >http://forums.openqa.org/thread.jspa?threadID=5830&messageID=16328#16328 >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _________________________________________________________________ Visit MSN Holiday Challenge for your chance to win up to $50,000 in Holiday cash from MSN today! http://www.msnholidaychallenge.com/index.aspx?ocid=tagline&locale=en-us From paul_hammer at hotmail.com Wed Dec 20 19:12:30 2006 From: paul_hammer at hotmail.com (Paul Hammer) Date: Thu, 21 Dec 2006 00:12:30 +0000 Subject: [Wtr-general] hi and help with some javascript In-Reply-To: <31578466.1166558231035.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Vince, Also, I think this page only has one modal, so I'm not facing the situation you had. Paul >From: Vince >Reply-To: wtr-general at rubyforge.org >To: wtr-general at rubyforge.org >Subject: Re: [Wtr-general] hi and help with some javascript >Date: Tue, 19 Dec 2006 13:56:41 CST > >Paul, > > > Could you really have meant to write: > > > > "The links and inputs within those divs are NOT always on the page, ..." > >I really wish that was the case, but alas it is not. Using the sample AJAX >modal box page that I mentioned in my first reply, you can "find" the >buttons from the modal long before you click the link to fire up the box. >This is because the div that we are calling a modal box is always on the >page, but not always visible. > >See for yourself: > >require 'watir' >ie = Watir::IE.new >ie.goto("http://ajax.asp.net/ajaxtoolkit/ModalPopup/ModalPopup.aspx") >puts "Button 1: #{ie.buttons[1].name}" >puts "Button 2: #{ie.buttons[2].name}" > >If you only have one on the page, you should have no problem clicking the >button, setting the modal, and submitting it. If you have multiple and need >to validate that the correct one is showing (as I do), than you have a long >day ahead of you... >--------------------------------------------------------------------- >Posted via Jive Forums >http://forums.openqa.org/thread.jspa?threadID=5830&messageID=16328#16328 >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _________________________________________________________________ Visit MSN Holiday Challenge for your chance to win up to $50,000 in Holiday cash from MSN today! http://www.msnholidaychallenge.com/index.aspx?ocid=tagline&locale=en-us From paul_hammer at hotmail.com Wed Dec 20 19:30:39 2006 From: paul_hammer at hotmail.com (Paul Hammer) Date: Thu, 21 Dec 2006 00:30:39 +0000 Subject: [Wtr-general] Automating the running & reporting of watir tests In-Reply-To: Message-ID: Hi Thomas, I too am fairly new at using WATIR. The approach I'm using is pretty simple to begin with: 1) I'm running on XP calling multiple WATIR tests from a batch file, where the output of each test is redirected and appended to a .log file. 2) I'm then using a RUBY class I copied off the web (and modified) that emails the contents of the .log file to interested parties. Any errors are in the .log files. 3) Here the web site source code and the WATIR/ruby code are stored separately in source control because different people write the product code and test code (engineering vrs. QA). Paul >From: >Reply-To: wtr-general at rubyforge.org >To: >Subject: [Wtr-general] Automating the running & reporting of watir tests >Date: Tue, 19 Dec 2006 15:34:34 -0500 > >Hi, > >I just started using WATIR and fell in love at first sight. I'm sure >what I'm trying to do has been done before, so I thought I'd throw a net >out here and see what I catch... > >Our dev team is building a half-dozen different apps (WARs) that, as a >whole, will eventually replace a legacy application. We've started >writing WATIR tests to check some of the individual WARs, but what I'm >hoping to do is get some advise on: > > 1) How do people schedule automatic execution of a bunch of >different WATIR tests, similar to Continuum might do. Is everyone out >there writing their own cron + scripts? > > 2) Is there are pre-built "watir-harness" that will email >someone when a test doesn't run as expected? > > 3) Do people typically source control their WATIR tests along >side the code that's under test? Or do they typically group all their >WATIR tests together in a separate project for >ease-of-reuse/ease-of-discovery purposes? > >Thanks in advance! >Tom Vaughan > >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _________________________________________________________________ Find sales, coupons, and free shipping, all in one place! ?MSN Shopping Sales & Deals http://shopping.msn.com/content/shp/?ctid=198,ptnrid=176,ptnrdata=200639 From bret at pettichord.com Wed Dec 20 19:55:07 2006 From: bret at pettichord.com (Bret Pettichord) Date: Wed, 20 Dec 2006 18:55:07 -0600 Subject: [Wtr-general] Executing javascript in 1.5 In-Reply-To: References: Message-ID: <4589DB6B.30601@pettichord.com> Is there any reason why the run_script method should not be added to the main Watir distribution? Let's add a jira ticket for this, so it's on our list. From forum-watir-users at openqa.org Thu Dec 21 00:40:23 2006 From: forum-watir-users at openqa.org (vikash) Date: Wed, 20 Dec 2006 23:40:23 CST Subject: [Wtr-general] clicking on popup after selecting an item in select list In-Reply-To: <37572682.1166600715944.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <32945304.1166679653179.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> ok, I get the answer in forum how to do this, here is the answer : def jsAlert(button, waitTime = 3) w = WinClicker.new longName = $ie.dir.gsub("/" , "\\" ) shortName = w.getShortFileName(longName) c = "start ruby #{shortName}\\watir\\clickJSDialog.rb #{button} #{waitTime} " puts "Starting #{c}" w.winsystem(c) w=nil end Then, before the button you want to click that generates the popup, add in: jsAlert("OK", 3) ie.button(:name, "woohoo").click # This is the button you want to click that generates the popup --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5857&messageID=16453#16453 From forum-watir-users at openqa.org Thu Dec 21 01:20:46 2006 From: forum-watir-users at openqa.org (liucongying) Date: Thu, 21 Dec 2006 00:20:46 CST Subject: [Wtr-general] give a solution fo js popup Message-ID: <34454525.1166682076791.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I use ruby185-21 and watir-1.5.1.1127.gem, I want a solution fo js pop the web html is the one in watir \unittests\html ---JavascriptClick.html the source code: Alert Test

There are two basic methods for bringing up dialogs using javascript.

  • alert(message) -- Display message and OK button.
  • confirm(message) -- Display message and OK and Cancel buttons.

Results of dialogs:

So i hope someone can give me codes of watir to solve js popup,do not use aotoit! thanks --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5882&messageID=16455#16455 From forum-watir-users at openqa.org Thu Dec 21 01:46:41 2006 From: forum-watir-users at openqa.org (liucongying) Date: Thu, 21 Dec 2006 00:46:41 CST Subject: [Wtr-general] Give a solution fo javascript popup Message-ID: <35086126.1166683631910.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I use ruby185-21 and watir-1.5.1.1127.gem, I want a solution fo js pop the web html is the one in watir \unittests\html ---JavascriptClick.html。 So i hope someone can give me codes of watir to solve js popup,do not use aotoit! thanks --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5883&messageID=16456#16456 From angrez at gmail.com Thu Dec 21 01:52:30 2006 From: angrez at gmail.com (Angrez Singh) Date: Thu, 21 Dec 2006 12:22:30 +0530 Subject: [Wtr-general] How to verify if SPAN is visible In-Reply-To: <36782797.1166657479535.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <36782797.1166657479535.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi Brad, You can use "attribute_value" method to get the value of style attribute. Then you can use regular expression for comparison. Regards, Angrez On 12/21/06, Brad wrote: > > I'm a newbie and have been searching on how to verify if a SPAN element is > visible. I tried different things without success. Here is the HTML code > for when visible. > >
> > Here it is when hidden. > > > > How do you check the 'visibility' parameter of 'style'? > > Thanks, > Brad > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5879&messageID=16440#16440 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061221/35b9fc6c/attachment.html From vikashkumar051 at yahoo.co.in Thu Dec 21 02:57:17 2006 From: vikashkumar051 at yahoo.co.in (VIKASH KUMAR) Date: Thu, 21 Dec 2006 13:27:17 +0530 (IST) Subject: [Wtr-general] how to minimize the command prompt Message-ID: <20061221075718.13465.qmail@web7808.mail.in.yahoo.com> I running test cases under Windows Environment, using ruby, watir 1.5.1.1100. I have the following code: require 'watir' # the watir controller require 'watir/winClicker.rb' require 'watir\contrib\enabled_popup' test = "C:\\aa.htm" ie=Watir::IE.start(test) def startClicker( button,ie,waitTime = 3) w = WinClicker.new longName = ie.dir.gsub("/" , "\\" ) shortName = w.getShortFileName(longName) c = "start ruby #{shortName}\\watir\\clickJSDialog.rb #{button} #{waitTime} " puts "Starting #{c}" w.winsystem(c) w=nil end startClicker("OK",ie,3) ie.button("Submit").click The above is working fine, but when the method startClicker is called, it displays a command shell/prompt of ruby.exe, showing some message. I want the command shell/prompt doesn't comes up or if it is necessary for the prompt to come up, it should open in minimized state. Please, help me out from this. Thanks in advance Vikash Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download Now! http://messenger.yahoo.com/download.php -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061221/8bb04489/attachment-0001.html From vikashkumar051 at yahoo.co.in Thu Dec 21 03:31:29 2006 From: vikashkumar051 at yahoo.co.in (VIKASH KUMAR) Date: Thu, 21 Dec 2006 14:01:29 +0530 (IST) Subject: [Wtr-general] storing values in variables Message-ID: <20061221083129.36107.qmail@web7809.mail.in.yahoo.com> I am using the following code: require 'net/http' # read the page data http = Net::HTTP.new('kvcrpf.org', 80) resp, page = http.get('/achievements.htm', nil ) # BEGIN processing HTML def parse_html(data,tag) return data.scan(%r{<#{tag}\s*.*?>(.*?)}im).flatten end output = [] table_data = parse_html(page,"table") table_data.each do |table| out_row = [] row_data = parse_html(table,"tr") row_data.each do |row| cell_data = parse_html(row,"td") cell_data.each do |cell| cell.gsub!(%r{<.*?>},"") end out_row << cell_data end output << out_row end # END processing HTML # examine the result def parse_nested_array(array,tab = 0) n = 0 array.each do |item| if(item.size > 0) puts "#{"\t" * tab}[#{n}] {" if(item.class == Array) parse_nested_array(item,tab+1) else puts "#{"\t" * (tab+1)}#{item}" end puts "#{"\t" * tab}}" end n += 1 end end parse_nested_array(output[2][4]) It displays the output like this: [0] { 2004 } [1] { 65 } [2] { 58 } [3] { 89.23 } I want to store the value 2004, 65, 58, 89.23 in variables like this: aa = 2004 ab = 65 ac = 58 ad = 89.23 Please help me, in doing this. Thanks in advance Vikash Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download Now! http://messenger.yahoo.com/download.php -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061221/791e63d5/attachment.html From zeljko.filipin at gmail.com Thu Dec 21 04:23:53 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 21 Dec 2006 10:23:53 +0100 Subject: [Wtr-general] Wait functionality in Watir ..need help In-Reply-To: <4589A0CC.5060705@pettichord.com> References: <33583373.1166611619315.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <4589A0CC.5060705@pettichord.com> Message-ID: On 12/20/06, Bret Pettichord wrote: > > ?eljko Filipin wrote: > > while true > > break unless ie.text.include?("loading") > > sleep 1 > > end > This is a more concise way of doing the same thing: > > while (ie.text.include? 'loading') {sleep 1} I knew that there had to be a way to do it in a more elegant way, but this is even more elegant that I expected! Almost as good as 5.times { print "Chunky bacon!" } :) -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061221/d310b94e/attachment.html From zeljko.filipin at gmail.com Thu Dec 21 04:45:25 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 21 Dec 2006 10:45:25 +0100 Subject: [Wtr-general] How to verify if SPAN is visible In-Reply-To: <36782797.1166657479535.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <36782797.1166657479535.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: For * you can use irb(main):015:0> ie.span(:id, "MainLogin_Password").html => "*" irb(main):016:0> ie.span(:id, "MainLogin_Password").html =~ /visible/ => 85 irb(main):017:0> ie.span(:id, "MainLogin_Password").html =~ /hidden/ => nil It is similar when span is hidden. Is this useful for you? Let me know if it is to cryptic, I will add more detail. -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061221/c172ced6/attachment.html From ngarg at crestech.in Thu Dec 21 04:44:13 2006 From: ngarg at crestech.in (Navneesh Garg) Date: Thu, 21 Dec 2006 15:14:13 +0530 Subject: [Wtr-general] Watir or WET for Automation framework In-Reply-To: Message-ID: <20061221100014.D615252409A3@rubyforge.org> Hi, I am pretty new to WET and Watir. I have extensive automation experience in QTP and WinRunner where I created frameworks to make automation experience more maintainable and less time consuming I have created couple of automation scripts using WET (which is of course quick along with other feature benefits). Creating in Watir of-course takes time .But looking at framework perspective where we have 1. External Object Repository 2. Use External datafiles 3. Reporting in Excel 4. Batch running of scripts 5. Function Library creation In the long-run what should have more benefit (taking into consideration WET might be unstable and there might be some subjective limitations) Watir or WET for framework creation. If anything of this already exists or have been created that would be really helpful. Regards Navneesh Garg Sr. Technical Consultant CresTech Software Systems Noida _____ From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of ?eljko Filipin Sent: Thursday, December 21, 2006 2:54 PM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Wait functionality in Watir ..need help On 12/20/06, Bret Pettichord wrote: ?eljko Filipin wrote: > while true > break unless ie.text.include?("loading") > sleep 1 > end This is a more concise way of doing the same thing: while (ie.text.include? 'loading') {sleep 1} I knew that there had to be a way to do it in a more elegant way, but this is even more elegant that I expected! Almost as good as 5.times { print "Chunky bacon!" } :) -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061221/11106cd8/attachment.html From forum-watir-users at openqa.org Thu Dec 21 05:22:25 2006 From: forum-watir-users at openqa.org (vijay) Date: Thu, 21 Dec 2006 04:22:25 CST Subject: [Wtr-general] how to access an element whose html tag is In-Reply-To: Message-ID: <36548442.1166696575729.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank you, Zeljko, for your crystal-clear answer, using which the issue got resolved. Using the similar answer you have given to a different thread, I was unable to resolve the issue using that (because I was continually trying with the '.enabled' option and ignored the '.exists' options completely. I am sorry for that). If had dwelled a bit more on that answer or explored all of its options, the issue could have been resolved then. Two more questions, 1. How you came to know that there is a word called "cell", which can be used to check the contents of a table cell. Is that documented somewhere? If so, can you point me to the link where all these different types of objects, which can be referred to in Watir, are given? 2. why does watir say "undefined class 'element' for frame' when executing the following statement: ie.frame("Detail").element(:text,"Step 2. Inventors").exists? Does'nt the word 'element' signify some general object? The following is for Bret, who had asked me to give the 'html' of disabled tabs. Bret, the html for one of the disabled tabs is as follows: Active Element: [TD], Frame: [Detail], Index: [41] Just for your information, the html of one of the enabled tabs is as follows: Active Element: [TD], Frame: [Detail], Index: [36] Thanks, Vijay. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5711&messageID=16466#16466 From forum-watir-users at openqa.org Thu Dec 21 05:24:51 2006 From: forum-watir-users at openqa.org (vijay) Date: Thu, 21 Dec 2006 04:24:51 CST Subject: [Wtr-general] how to access an element whose html tag is In-Reply-To: Message-ID: <33181915.1166696721240.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank you, Zeljko, for your crystal-clear answer, using which the issue got resolved. Using the similar answer you have given to a different thread, I was unable to resolve the issue using that (because I was continually trying with the '.enabled' option and ignored the '.exists' options completely. I am sorry for that). If had dwelled a bit more on that answer or explored all of its options, the issue could have been resolved then. Two more questions, 1. How you came to know that there is a word called "cell", which can be used to check the contents of a table cell. Is that documented somewhere? If so, can you point me to the link where all these different types of objects, which can be referred to in Watir, are given? 2. why does watir say "undefined class 'element' for frame' when executing the following statement: ie.frame("Detail").element(:text,"Step 2. Inventors").exists? Does'nt the word 'element' signify some general object? The following is for Bret, who had asked me to give the 'html' of disabled tabs (They are not recognized as links when they are in a 'disabled' state). Bret, the html for one of the disabled tabs is as follows: Active Element: [TD], Frame: [Detail], Index: [41] Just for your information, the html of one of the enabled tabs is as follows: Active Element: [A], Frame: [Detail], Index: [35] Step 1. Details References: <20061221100014.D615252409A3@rubyforge.org> Message-ID: <458A611A.8090804@chriss-baumann.de> Hello Navneesh, would You be nice if You could start a new topic for each new discussion! Please don?t just answer to an old mail an change the topic! If a mail-program shows the discussion as threads Your behaviour isn?t very nice. Your mail is then shown as answer to "Re: [Wtr-general] Wait functionality in Watir ..need help" Thank You! Kind Regards, Christian Navneesh Garg schrieb: > > Hi, > > > > I am pretty new to WET and Watir. I have extensive automation > experience in QTP and WinRunner where I created frameworks to make > automation experience more maintainable and less time consuming > > > > I have created couple of automation scripts using WET (which is of > course quick along with other feature benefits). Creating in Watir > of-course takes time .But looking at framework perspective where we have > > > > 1. External Object Repository > 2. Use External datafiles > 3. Reporting in Excel > 4. Batch running of scripts > 5. Function Library creation > > > > In the long-run what should have more benefit (taking into > consideration WET might be unstable and there might be some subjective > limitations) Watir or WET for framework creation. If anything of this > already exists or have been created that would be really helpful. > > > > Regards > > Navneesh Garg > > Sr. Technical Consultant > > CresTech Software Systems > > Noida > > ------------------------------------------------------------------------ > > *From:* wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] *On Behalf Of *?eljko Filipin > *Sent:* Thursday, December 21, 2006 2:54 PM > *To:* wtr-general at rubyforge.org > *Subject:* Re: [Wtr-general] Wait functionality in Watir ..need help > > > > On 12/20/06, *Bret Pettichord* > wrote: > > ?eljko Filipin wrote: > > while true > > break unless ie.text.include?("loading") > > sleep 1 > > end > This is a more concise way of doing the same thing: > > while (ie.text.include? 'loading') {sleep 1} > > > I knew that there had to be a way to do it in a more elegant way, but > this is even more elegant that I expected! Almost as good as > > 5.times { print "Chunky bacon!" } > > :) > -- > Zeljko Filipin > zeljkofilipin.com > > ------------------------------------------------------------------------ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061221/d67a6e2e/attachment.html From satti_mg at yahoo.com Thu Dec 21 05:32:30 2006 From: satti_mg at yahoo.com (sathya shankar) Date: Thu, 21 Dec 2006 02:32:30 -0800 (PST) Subject: [Wtr-general] Watir or WET for Automation framework In-Reply-To: <20061221100014.D615252409A3@rubyforge.org> Message-ID: <20061221103230.12119.qmail@web31701.mail.mud.yahoo.com> Hi Naveen, Watir is a Powerful lib you an almost do everything. WET sits on top of Watir and WET supports all most all the features you have asked for. 1. External Object Repository => Use XRM Repository manager to create object repo in xml / use WET-UI to create objects. 2. Use External datafiles => Excel, XML Datatable support with easy conversion mechanism. 3. Reporting in Excel => We have Reporting in HTML but you can add one more plugin using Scripting Excel for this. 4. Batch running of scripts => Use BatchRunner 5. Function Library creation (you mean support for adding additional library right? If yes, then go through how to add external lib in Wiki) The power of WET can be found in WET-core that is using WET scripting. Plz go through the documentations in http://wet.qantom.org/stepbystep.html for further information. Regards, Sathya Shankar M G Sr. Test Engineer Qantom Software Private Limited 72/1B, 2nd Floor, K.H. Plaza, Kanakapura Road, Bangalore-78 Phone : 26655216-Xtn-<123>, Telefax : 26799269 --- Navneesh Garg wrote: > Hi, > > > > I am pretty new to WET and Watir. I have extensive > automation experience in > QTP and WinRunner where I created frameworks to make > automation experience > more maintainable and less time consuming > > > > I have created couple of automation scripts using > WET (which is of course > quick along with other feature benefits). Creating > in Watir of-course takes > time .But looking at framework perspective where we > have > > > > 1. External Object Repository > 2. Use External datafiles > 3. Reporting in Excel > 4. Batch running of scripts > 5. Function Library creation > > > > In the long-run what should have more benefit > (taking into consideration WET > might be unstable and there might be some subjective > limitations) Watir or > WET for framework creation. If anything of this > already exists or have been > created that would be really helpful. > > > > Regards > > Navneesh Garg > > Sr. Technical Consultant > > CresTech Software Systems > > Noida > > _____ > > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf > Of ?eljko Filipin > Sent: Thursday, December 21, 2006 2:54 PM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] Wait functionality in > Watir ..need help > > > > On 12/20/06, Bret Pettichord > wrote: > > ?eljko Filipin wrote: > > while true > > break unless ie.text.include?("loading") > > sleep 1 > > end > This is a more concise way of doing the same thing: > > while (ie.text.include? 'loading') {sleep 1} > > > I knew that there had to be a way to do it in a more > elegant way, but this > is even more elegant that I expected! Almost as good > as > > 5.times { print "Chunky bacon!" } > > :) > -- > Zeljko Filipin > zeljkofilipin.com > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From ngarg at crestech.in Thu Dec 21 05:38:35 2006 From: ngarg at crestech.in (Navneesh Garg) Date: Thu, 21 Dec 2006 16:08:35 +0530 Subject: [Wtr-general] Watir or WET for Automation framework Message-ID: <20061221103858.4A7195240BD3@rubyforge.org> Hi, I am pretty new to WET and Watir. I have extensive automation experience in QTP and WinRunner where I created frameworks to make automation experience more maintainable and less time consuming I have created couple of automation scripts using WET (which is of course quick along with other feature benefits). Creating in Watir of-course takes more time .But looking at framework perspective where we have 1. External Object Repository 2. Use External Datafiles 3. Reporting in Excel 4. Batch running of scripts 5. Function Library creation In the long-run what should have more benefit (taking into consideration WET might be unstable and there might be some subjective limitations) Watir or WET for framework creation. If anything of this already exists or have been created that would be really helpful. Regards Navneesh Garg Sr. Technical Consultant CresTech Software Systems -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061221/e8b75f4d/attachment.html From zeljko.filipin at gmail.com Thu Dec 21 05:53:07 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 21 Dec 2006 11:53:07 +0100 Subject: [Wtr-general] how to access an element whose html tag is In-Reply-To: <33181915.1166696721240.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <33181915.1166696721240.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: On 12/21/06, vijay wrote: > > 1. How you came to know that there is a word called "cell", which can be > used to check the contents of a table cell. Is that documented > somewhere? If so, can you point me to the link where all these different > types of objects, which can be referred to in Watir, are given? http://wtr.rubyforge.org/rdoc/index.html But I think this is for watir 1.4.1. It will probably be updated after watir 1.5 is released. Another great resource is this list. 2. why does watir say "undefined class 'element' for frame' when executing > the following statement: > > ie.frame("Detail").element(:text,"Step 2. Inventors").exists? > > Does'nt the word 'element' signify some general object? Somebody else should answer this. -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061221/9a010f60/attachment-0001.html From forum-watir-users at openqa.org Thu Dec 21 07:18:55 2006 From: forum-watir-users at openqa.org (vijay) Date: Thu, 21 Dec 2006 06:18:55 CST Subject: [Wtr-general] How to capture exception details Message-ID: <51825164.1166703565591.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hello, Can someone tell me how to handle exceptions (Watir::Exception::UnknownObjectException: Unable to locate object) in Watir such that Watir would write the exception message somewhere and continue with the script? Thanks, in Advance, Vijay --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5886&messageID=16475#16475 From forum-watir-users at openqa.org Thu Dec 21 07:58:39 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Thu, 21 Dec 2006 06:58:39 CST Subject: [Wtr-general] How to capture exception details In-Reply-To: <51825164.1166703565591.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <37461903.1166705949557.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> see: http://www.rubycentral.com/book/tut_exceptions.html this might be enough brain food to get you started. Just need to throw in some control loop (an array of tests maybe?), specific error handling and maybe even retries. begin -#Do your thing rescue -#put the error data into something nice -error = $!.to_s -stack = $@ # spit it out -puts 'Error ' + error -stack.each {|x|puts 'Stack Trace: ' + x} end --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5886&messageID=16478#16478 From raghu at qantom.com Thu Dec 21 10:09:44 2006 From: raghu at qantom.com (Raghu Venkataramana) Date: Thu, 21 Dec 2006 20:39:44 +0530 Subject: [Wtr-general] Watir or WET for Automation framework In-Reply-To: <20061221103858.4A7195240BD3@rubyforge.org> References: <20061221103858.4A7195240BD3@rubyforge.org> Message-ID: <458AA3B8.10303@qantom.com> An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061221/1c7d0bfb/attachment.html -------------- next part -------------- A non-text attachment was scrubbed... Name: wet_email.jpg Type: image/jpeg Size: 1609 bytes Desc: not available Url : http://rubyforge.org/pipermail/wtr-general/attachments/20061221/1c7d0bfb/attachment.jpg -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 2942 bytes Desc: S/MIME Cryptographic Signature Url : http://rubyforge.org/pipermail/wtr-general/attachments/20061221/1c7d0bfb/attachment.bin From mrussell at inpses.co.uk Thu Dec 21 10:24:43 2006 From: mrussell at inpses.co.uk (Max Russell) Date: Thu, 21 Dec 2006 15:24:43 -0000 Subject: [Wtr-general] Iterator in harness Message-ID: I'm cross posting this one from Ruby Forum as I'm at a loss here... I have a harness I'm using for testing with Watir. It has become apparent that the iterator is loading the tests defined based on the order they appear in the directory as opposed to the order in the testlist. File.open('testlist.txt').each_line do |entry| self.send(:define_method, entry.strip){ load "#{entry.strip}.rb"} so if the testlist read something like test_aac test_aab test_aaa instead of executing them in the order above it would do test_aaa test_aab test_aac I'm probably being thick, but I'm not spotting where my iterator is going wrong? Ta Max Max Russell Test Analyst. INPS Tel: 01382 223900 Fax: 01382 204488 Visit our Web site at www.inps.co.uk The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of In Practice Systems Limited or any of its affiliates. If you are not the intended recipient please contact is.helpdesk at inps.co.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061221/6d2603d6/attachment.html From charley.baker at gmail.com Thu Dec 21 11:13:49 2006 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 21 Dec 2006 09:13:49 -0700 Subject: [Wtr-general] Executing javascript in 1.5 In-Reply-To: References: Message-ID: Agreed: http://jira.openqa.org/browse/WTR-121. On 12/20/06, Charley Baker wrote: > > Ah, you're adding it to the IE class, which in Watir 1.4.1 was a super of > Frame. In 1.5.1, Frame doesn't inherit from IE, but does include Container > and PageContainer as mixins. You'll want to change your run_script method to > the Container namespace: > > module Watir::Container > > def run_script > .... > end > > end > > -Charley > > On 12/20/06, Max Russell < mrussell at inpses.co.uk> wrote: > > > > I'm running the code on the same machine as I'm developing it? > > > > > > > > The error I'm seeing is like this: > > > > > > > > > > > > test_drag_and_drop(TestWatir): > > > > NoMethodError: undefined method `run_script' for > > # > > > > dragdrophacking.rbw:40:in `test_drag_and_drop' > > > > > > > > > > > > The code I'm trying to work is one I've posted before on this list, > > based on the zbarzone.blogspot.com/ example. > > > > I don't expect it to complete the drag, but previously it would actually > > select the div. > > > > > > > > class Watir::IE > > > > def run_script(js) > > > > ie.Document.parentWindow.execScript(js) > > > > end > > > > end > > > > > > > > class TestWatir < Test::Unit::TestCase > > > > def test_drag_and_drop > > > > ie = Watir::IE.start('http://everestcf/CV_Tay_Test/home/Index.cfm' > > ) > > > > #ie.maximize > > > > ie.frame("main").text_field(:name, > > "username").set("ltanner") > > > > ie.frame("main").text_field(:name, > > "password").set("password9") > > > > ie.frame("main").select_list(:name, > > "ldapDir").select("SARAGON") > > > > ie.frame("main").button(:name, "Login").click > > > > > > > > #expand the admin node > > > > ie.frame("left").link(:index, 35).click > > > > #click on the data management link > > > > ie.frame("left").link(:index, 54).click > > > > > > > > #Enter a search string into the search field. > > > > ie.frame("main").text_field(:id, > > "Search_box").set("Batchelor") > > > > #Click to search > > > > ie.frame("main").button(:id, "btn_search").click > > > > > > > > #insert a sleep > > > > #sleep(5) > > > > > > > > #Guessing at the path to the searched item... > > > > ie.frame("main").div(:id, "10439,10439").flash #accessing > > through the div id. Pretty Brittle for now, but can wrap this.... > > > > > > > > widget = ie.frame("main").div(:id, "10439,10439") > > > > #sleep(10) > > > > #ie.frame("main").run_script("alert(document.getElementById > > ('10439,10439').id)") > > > > #~ #THIS SECTION USES THE SCRIPTACULOUS DRAG/DROP > > > > ie.frame("main").run_script("document.blah = > > document.createEventObject(); document.blah.button = 1") > > > > ie.frame("main").run_script("document.getElementById('#{widget}').fireEvent('onmousedown', > > document.blah)") > > > > ie.frame("main").run_script("document.blah = > > document.createEventObject(); document.blah.clientX = > > document.getElementById('search_results'); document.blah.clientY = > > document.getElementById('drop_p1_toolbar')")#.offsetLeft .offsetTop > > search_results > > > > ie.frame("main").run_script("document.getElementById('#{widget}').fireEvent('onmousemove', > > document.blah)") > > > > ie.frame("main").run_script("document.getElementById('#{widget}').fireEvent('onmouseup', > > document.blah)") > > > > #~ sleep(20) > > > > end > > > > end > > > > > > > > > > > > I know the dragdrop hacking stuff is slightly outwith the scope of > > Watir, but for me it's about the one thing that could really improve testing > > with Watir. > > > > > > > > > > > > *Max Russell* > > > > *Test Analyst.* > > > > *INPS* > > > > * * > > > > *Tel: 01382 223900* > > > > *Fax: 01382 204488* > > > > * * > > > > *Visit our Web site at www.inps.co.uk* > > > > * * > > > > *The information in this internet email is confidential and is intended > > solely for the addressee. Access, copying or re-use of information in it by > > anyone else is not authorised. Any views or opinions presented are solely > > those of the author and do not necessarily represent those of In Practice > > Systems Limited or any of its affiliates. If you are not the intended > > recipient please contact is.helpdesk at inps.co.uk* > > > > > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061221/49750cef/attachment-0001.html From mrussell at inpses.co.uk Thu Dec 21 11:16:35 2006 From: mrussell at inpses.co.uk (Max Russell) Date: Thu, 21 Dec 2006 16:16:35 -0000 Subject: [Wtr-general] Executing javascript in 1.5 Message-ID: I've been bending my brain round that Javascript thing for a while and should a glimmer of intelligence shine into the murk of my brain, I'll certainly contribute any code I create towards a standard method for dealing with these things... Max Russell Test Analyst. INPS Tel: 01382 223900 Fax: 01382 204488 Visit our Web site at www.inps.co.uk The information in this internet email is confidential and is intended solely for the addressee. Access, copying or re-use of information in it by anyone else is not authorised. Any views or opinions presented are solely those of the author and do not necessarily represent those of In Practice Systems Limited or any of its affiliates. If you are not the intended recipient please contact is.helpdesk at inps.co.uk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061221/eeab5851/attachment.html From charley.baker at gmail.com Thu Dec 21 11:21:36 2006 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 21 Dec 2006 09:21:36 -0700 Subject: [Wtr-general] Give a solution fo javascript popup In-Reply-To: <35086126.1166683631910.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <35086126.1166683631910.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Google is your friend, searching for watir javascript dialog, this is the first link: http://www.hanselman.com/blog/ClickingAJavaScriptDialogUsingWatir.aspx -Charley On 12/20/06, liucongying wrote: > > I use ruby185-21 and watir-1.5.1.1127.gem, I want a solution fo js pop the > web html is the one in watir \unittests\html --- > JavascriptClick.html。 > So i hope someone can give me codes of watir to solve js popup,do not > use aotoit! thanks > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5883&messageID=16456#16456 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061221/4cc95dac/attachment.html From forum-watir-users at openqa.org Thu Dec 21 11:27:23 2006 From: forum-watir-users at openqa.org (John Lolis) Date: Thu, 21 Dec 2006 10:27:23 CST Subject: [Wtr-general] Syntax for relative attributes In-Reply-To: <4589B9D6.3020500@pettichord.com> Message-ID: <53714004.1166718473525.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> > link = ie.div(:text, 'Pragmatic Version > Control').after.link(:class, > addtocard') > > > I think this is less intuitive and it would be > somewhat harder to > implement. That's why i came up with the other > proposal, above. Thats actually the first way I thought of it too. A second, slightly related question. Regardless of how you do it, i'm wondering whats going on behind the scenes. If you do > headline = $ie.div(:text, 'Pragmatic Version Control') > link = $ie.link(:class => 'addtocart', :after? => headline) Is headline now 'frozen'? For example, lets say there is a 'addtocart' after headline. What happens if after you create your headline variable the page changes (headline is now at the bottom of the page)? Will the after method re evaluate headlines position in the page? Or is headline now static so after would would be true even if it isn't? I'm not sure if that even made sense. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5849&messageID=16487#16487 From zeljko.filipin at gmail.com Thu Dec 21 11:29:41 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Thu, 21 Dec 2006 17:29:41 +0100 Subject: [Wtr-general] ie.minimize broken in watir-1.5.1.1127 In-Reply-To: <45885CAB.4030509@pettichord.com> References: <45802802.4090102@pettichord.com> <45885CAB.4030509@pettichord.com> Message-ID: On 12/19/06, Bret Pettichord wrote: > > Can you manually install AutoIt and then successfully run minmax_test.rb > as a limited user? ruby 1.8.5 (2006-08-25) [i386-mswin32], ie7, watir-1.5.1.1127 minmax_test.rb works when runned as a limited user without AutoIt installed (and even when limited user installs watir-1.5.1.1127). I guess that you ment send_keys_test.rb. After installing AutoIt and watir: - administrator: minmax_test.rb and send_keys_test.rb work - limited: minmax_test.rb works, send_keys_test.rb not C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.1.1127\unittests>send_keys_test.rb Loaded suite C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127 /unittests/send_keys _test Started FF. Finished in 2.719 seconds. 1) Failure: test_autoregistration(TC_Fields) [C:/ruby/lib/ruby/gems/1.8/gems/watir- 1.5.1.112 7/unittests/send_keys_test.rb:30]: exception expected but none was thrown. 2) Failure: test_enter(TC_Fields) [C:/ruby/lib/ruby/gems/1.8/gems/watir- 1.5.1.1127 /unittests /send_keys_test.rb:25]: is not true. 3 tests, 3 assertions, 2 failures, 0 errors -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061221/882532c5/attachment.html From forum-watir-users at openqa.org Thu Dec 21 14:04:11 2006 From: forum-watir-users at openqa.org (Nathan Christie) Date: Thu, 21 Dec 2006 13:04:11 CST Subject: [Wtr-general] How to verify if SPAN is visible In-Reply-To: <36782797.1166657479535.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <49181955.1166727906557.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I've found that Watir doesn't have as much power or control as I desire. I frequently use the Watir method `.getOLEObject()`. Then you have unfettered access to object and the entire [D]HTML DOM methods. ‹title›test‹/title› ‹td›‹input type="password" id="MainLogin_Password" name="MainLogin$Password"/›‹span style="color: Red; visibility: hidden;" title="Password is required." id="MainLogin_PasswordRequired"›* Required‹/span›‹/td› The method to verify an object's visibility (CSS style-type) could be called like this: ‹code› ... ie = IE.attach( :title, "test" ) mySpan = ie.span( :id, "MainLogin_PasswordRequired" ) mySpan.getOLEObject().style().visibility() ... ‹/code› Sometimes it is useful to access the object directly, as Watir does not wrap everything the DOM offers that one might need. A good reference for what true power one actually has over the DHTML DOM can be found here: http://www.w3schools.com/htmldom/default.asp It seems like there are a fair amount of adverts on the site, but the content is exceptional. Generally, just ignore the bottom of the page :) Let me know if I can be of any more assistance. —›Nathan Christie --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5879&messageID=16493#16493 From forum-watir-users at openqa.org Thu Dec 21 14:15:55 2006 From: forum-watir-users at openqa.org (Nathan Christie) Date: Thu, 21 Dec 2006 13:15:55 CST Subject: [Wtr-general] How to capture exception details In-Reply-To: <51825164.1166703565591.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <34523027.1166728835919.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> You start with a begin block, placing the code you know may throw an exception. The rescue block lets you work with the exception gracefully. There are some Ruby system globals that are useful to know here for reporting purposes. The ensure block will execute code regardless of whether an exception occurred. $! - The exception information message set by 'raise'. $@ - Array of backtrace of the last exception thrown. $stderr - The current standard error output. begin    myObject = Object.new( param )    myObject.action1( param ) ??... rescue => e    puts "Exception occured:    puts $@ ensure    myObject.tearDown() end Hope this helps, —›Nathan Christie --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5886&messageID=16494#16494 From paul.rogers at shaw.ca Thu Dec 21 15:02:13 2006 From: paul.rogers at shaw.ca (Paul Rogers) Date: Thu, 21 Dec 2006 13:02:13 -0700 Subject: [Wtr-general] How to verify if SPAN is visible References: <36782797.1166657479535.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <01b801c7253a$e8a29b10$6400a8c0@laptop> didnt some one post a is_visible? ( or visible?) method to the list? I think it walked up the dom tree looking to see if parent elements were visible, as the approach here wont work if the element that encloses the span ( if there is one ) is also hidden. Paul ----- Original Message ----- From: ?eljko Filipin To: wtr-general at rubyforge.org Sent: Thursday, December 21, 2006 2:45 AM Subject: Re: [Wtr-general] How to verify if SPAN is visible For * you can use irb(main):015:0> ie.span(:id, "MainLogin_Password").html => "*" irb(main):016:0> ie.span(:id, "MainLogin_Password").html =~ /visible/ => 85 irb(main):017:0> ie.span(:id, "MainLogin_Password").html =~ /hidden/ => nil It is similar when span is hidden. Is this useful for you? Let me know if it is to cryptic, I will add more detail. -- Zeljko Filipin zeljkofilipin.com ------------------------------------------------------------------------------ _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061221/80b51be8/attachment-0001.html From forum-watir-users at openqa.org Thu Dec 21 15:06:30 2006 From: forum-watir-users at openqa.org (Vince) Date: Thu, 21 Dec 2006 14:06:30 CST Subject: [Wtr-general] hi and help with some javascript In-Reply-To: Message-ID: <34837407.1166731620382.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Paul, > I tried placing this line of code in my test, just to see what it would > show: > > puts "Button 1: #{@ie.buttons[0].name}" The buttons array starts at index 1, not zero. ie.buttons[0] doesn't exist, hence your error. You will also see similar behavior in the many other object arrays such at links, divs, ect. Try the code again with [1] and you should be fine. As much of a pain in the back side the AJAX modals are, at least they aren't IE javascript modals which aren't actually on the page itself and require you to fire an outside script to deal with them since your testscript itself can't touch them. Hope this helps, ~Vince --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5830&messageID=16496#16496 From charley.baker at gmail.com Thu Dec 21 15:34:01 2006 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 21 Dec 2006 13:34:01 -0700 Subject: [Wtr-general] How to verify if SPAN is visible In-Reply-To: <01b801c7253a$e8a29b10$6400a8c0@laptop> References: <36782797.1166657479535.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <01b801c7253a$e8a29b10$6400a8c0@laptop> Message-ID: There's a user contribution on the Wiki: http://wiki.openqa.org/pages/viewpage.action?pageId=1119 that extends element to walk the DOM tree and check for disabled or non-visible elements. -Charley On 12/21/06, Paul Rogers wrote: > > didnt some one post a is_visible? ( or visible?) method to the list? > I think it walked up the dom tree looking to see if parent elements were > visible, as the approach here wont work if the element that encloses the > span ( if there is one ) is also hidden. > > Paul > > ----- Original Message ----- > *From:* ?eljko Filipin > *To:* wtr-general at rubyforge.org > *Sent:* Thursday, December 21, 2006 2:45 AM > *Subject:* Re: [Wtr-general] How to verify if SPAN is visible > > For > > id="MainLogin_PasswordRequired">* > > you can use > > irb(main):015:0> ie.span(:id, "MainLogin_Password").html > => " style=\"VISIBILITY: visible; COLOR: red\">*" > irb(main):016:0> ie.span(:id, "MainLogin_Password").html =~ /visible/ > => 85 > irb(main):017:0> ie.span(:id, "MainLogin_Password").html =~ /hidden/ > => nil > > It is similar when span is hidden. > > Is this useful for you? Let me know if it is to cryptic, I will add more > detail. > -- > Zeljko Filipin > zeljkofilipin.com > > ------------------------------ > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061221/3e66fe35/attachment.html From bks505 at comcast.net Thu Dec 21 15:59:49 2006 From: bks505 at comcast.net (bks505 at comcast.net) Date: Thu, 21 Dec 2006 20:59:49 +0000 Subject: [Wtr-general] Watir and Javascript Issues Message-ID: <122120062059.21535.458AF5C500093DA30000541F2215567074CACFCA9C050D@comcast.net> I have read numerous posts about problems with Watir and accessing data that is computed elsewhere (i.e. in a separate .js file) but unfortunately none of the posts have pointed me in the right direction. I am testing a simple html page that has no frames but does call javascript functions in an external file. When the user has typed text into the text field then a window appears with text in it. I would like to access this text to verify it in my Watir test, but all of the following return '0' for me: @@ie.select_list(:id,"sel").getAllContents.length @@ie.ie.Document.getElementById("sel").options.length @@ie.selectBox(:index,1).getAllContents.length @@ie.div(:id,"sid").select_list(:id,"sel").getAllContents.length @@ie.select_list(:index,1).getAllContents.length even though @@ie.show_all_objects seems to indicate there is a select list (select-multiple)? Does anyone have any suggestions for obtaining this data? In advance, thanks very much for any feedback provided! After executing the following: @@ie.text_field(:id, "fid").fire_event("onkeyup") @@ie.text_field(:id, "fid").set("country") @@ie.button(:value, "Show Synonyms").fire_event("onclick") @@ie.button(:value, "Show Synonyms").click here is the output of @@ie.show_all_objects: -----------Objects in page ------------- text/javascript id= src= text/javascript id= src=js/KMSuggest.js id= text name=textField id=fid value=country alt= src= button name= id=b value=Show Synonyms alt= src= name= id= select-multiple name= id=sel value= button name= id= value=Add alt= src= button name= id= value=Clear alt= src= button name= id= value=Close alt= src= button name= id= value=Add alt= src= button name= id= value=Clear alt= src= button name= id= value=Close alt= src= button name= id= value=Close alt= src= _______________________________________ Here is a portion of the HTML source:

This is a test:

(Start typing and watch words appear)

 
Step 2. Inventors* name="MainLogin$Password"/> title="Password is required." id="MainLogin_PasswordRequired">* name="MainLogin$Password"/> title="Password is required." id="MainLogin_PasswordRequired">*Step 2. Inventors Step 2. Inventors
Add selected items to text
Clear selections in list
Close the KM-Suggest window
 
To select more than one item, hold down the <CNTRL> key while clicking on the items

-------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061221/5a70931d/attachment.html From bret at pettichord.com Thu Dec 21 16:25:37 2006 From: bret at pettichord.com (Bret Pettichord) Date: Thu, 21 Dec 2006 15:25:37 -0600 Subject: [Wtr-general] ie.minimize broken in watir-1.5.1.1127 In-Reply-To: References: <45802802.4090102@pettichord.com> <45885CAB.4030509@pettichord.com> Message-ID: <458AFBD1.1090902@pettichord.com> ?eljko Filipin wrote: > > Can you manually install AutoIt and then successfully run > minmax_test.rb > as a limited user? > > > ruby 1.8.5 (2006-08-25) [i386-mswin32], ie7, watir-1.5.1.1127 > > minmax_test.rb works when runned as a limited user without AutoIt > installed (and even when limited user installs watir-1.5.1.1127 ). I > guess that you ment send_keys_test.rb. no i meant minmax test. it uses autoit, so it is odd that works without autoit installed. From kingsley at mindflowsolutions.com Thu Dec 21 16:39:09 2006 From: kingsley at mindflowsolutions.com (kingsley at mindflowsolutions.com) Date: Thu, 21 Dec 2006 21:39:09 -0000 (GMT) Subject: [Wtr-general] Alerts and modal dialogue handler Message-ID: <51847.87.75.18.166.1166737149.squirrel@mail.mindflowsolutions.com> Hi All, Here is the popup manager I wrote. (im just about to head off on holiday but I'll be back in Jan) download here: http://www.mindflowsolutions.com/software/popup.zip I would be grateful if people could try this out and give me feedback on if it is working for them. Any improvements and suggestions are also welcome. The software consists of 2 parts. popup.exe <--- the main application config.txt <--- the config file The exe doesnt (or shouldnt) need any dependencies it should all be compiled in. The config file contains the windows/alerts you want to close in yaml format. See the example. You can name the windows in the config file anything you like but you must indent the title, text and button with 2 spaces and then 1 space after the colon. You will get an error if use tabs in this file. Such is the nature of yaml. Also I dont know if you can use the : in the text anywhere I think you have to escape it somehow. Execution: popup.exe <---- reads the config.txt and loops forever looking for the windows in the file - when it finds them it clicks whatever button you have specified. you can also provide an interval between loops - the default is 1 second, and you can turn the logging off - default is on. example: popup.exe 5 <---- interval of 5 secs popup.exe 0.1 <---- interval of 0.1 secs popup.exe 1 off <---- interval 1 secs and turn off the logs The config file is parsed on each loop so once the exe is started you can modify the config and save for immediate effect - no need to stop and restart the exe. Example: The included config.txt has 2 popup windows from this url: http://www.waller.co.uk/javatest.htm If you navigate there in IE and then start the exe it will locate and close the 2 windows. Problems: If there is a very long list of windows to close it might take a while even on 0.1 secs interval to loop thru and look for them all. If you set the interval to 0 - your cpu gets a hammering. I have only tested it on a few javascript alerts. Background: The popup.exe runs as a separate process due to the nature of ruby threading its very difficult to handle modal windows in the parent or children of the ruby process that instigates the modal dialogue. Maybe one day I will find a way - but at the moment this was a quick and easy solution to handling dialogue and modal windows. Thanks for trying out this experimental software. Please provide feedback through the mailing list. Thanks Kingsley From christopher.mcmahon at gmail.com Thu Dec 21 16:55:00 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Thu, 21 Dec 2006 13:55:00 -0800 Subject: [Wtr-general] OT: anyone know Ruby Facets? Message-ID: <72799cd70612211355r17789a6eq7f41339a2a97c4ce@mail.gmail.com> http://facets.rubyforge.org/ Looks like some interesting things, I just wondered if anyone here has experience with it/them? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061221/4a779c0d/attachment.html From paul_hammer at hotmail.com Thu Dec 21 19:02:53 2006 From: paul_hammer at hotmail.com (Paul Hammer) Date: Fri, 22 Dec 2006 00:02:53 +0000 Subject: [Wtr-general] hi and help with some javascript In-Reply-To: <34837407.1166731620382.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Vince, I tried this: puts "Button 1: #{ie.buttons[1].name} puts "Button 2: #{ie.buttons[2].name} puts "Button 3: #{ie.buttons[3].name} Got this output: Button 1: search Button 2: sfwq E The first button is a search function on the page. The 2nd is the submit button for the regular form on the page. I think the E means error, which means there are only two buttons on the page. This means to me that WATIR doesn't see the the element the brings up the modal dialog as a "button". Paul >From: Vince >Reply-To: wtr-general at rubyforge.org >To: wtr-general at rubyforge.org >Subject: Re: [Wtr-general] hi and help with some javascript >Date: Thu, 21 Dec 2006 14:06:30 CST > >Paul, > > > I tried placing this line of code in my test, just to see what it would > > show: > > > > puts "Button 1: #{@ie.buttons[0].name}" > >The buttons array starts at index 1, not zero. ie.buttons[0] doesn't exist, >hence your error. You will also see similar behavior in the many other >object arrays such at links, divs, ect. > >Try the code again with [1] and you should be fine. As much of a pain in >the back side the AJAX modals are, at least they aren't IE javascript >modals which aren't actually on the page itself and require you to fire an >outside script to deal with them since your testscript itself can't touch >them. > >Hope this helps, > >~Vince >--------------------------------------------------------------------- >Posted via Jive Forums >http://forums.openqa.org/thread.jspa?threadID=5830&messageID=16496#16496 >_______________________________________________ >Wtr-general mailing list >Wtr-general at rubyforge.org >http://rubyforge.org/mailman/listinfo/wtr-general _________________________________________________________________ View Athlete?s Collections with Live Search http://sportmaps.live.com/index.html?source=hmemailtaglinenov06&FORM=MGAC01 From angrez at gmail.com Fri Dec 22 00:13:33 2006 From: angrez at gmail.com (Angrez Singh) Date: Fri, 22 Dec 2006 10:43:33 +0530 Subject: [Wtr-general] www.croczilla.com/jssh is down what does it mean ? In-Reply-To: <11c8704e0612190552j5ea7bd34u1a49af2656d3aac7@mail.gmail.com> References: <45876C8E.3030707@comcast.net> <7661e6730612182202l6a8aded9hb8c49641db24f990@mail.gmail.com> <11c8704e0612190552j5ea7bd34u1a49af2656d3aac7@mail.gmail.com> Message-ID: Hi, Croczilla site is up again. Following is Alex Fritze reply to the mail: > The server zope instance shut itself down and I didn't notice until today, > since I'm away on holiday in Mexico at the moment :-) > It's fixed now. Regards, Angrez On 12/19/06, Dave Hoover wrote: > > > > What does it mean for SafariWatir ? > > > > My understanding is that SafariWatir is Dave Hoover's project at > > http://safariwatir.rubyforge.org/ which is completely separate from > > Angrez's work, so there should be no implication for SafariWatir > > either. > > That is correct. SafariWatir is alive and well. SafariWatir has no > dependency on JSSh or FireWatir, it uses the rb-appscript Apple event > bridge to inject JavaScript into Safari to work its magic. > > I just spoke with Angrez a few days ago, helping him test a FireWatir > gem on my Mac. As far as I know, he's still working on it. > > Dave Hoover > http://obtiva.com/ > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061222/a8171356/attachment.html From vikashkumar051 at yahoo.co.in Fri Dec 22 00:16:15 2006 From: vikashkumar051 at yahoo.co.in (VIKASH KUMAR) Date: Fri, 22 Dec 2006 10:46:15 +0530 (IST) Subject: [Wtr-general] how to minimize command prompt of ruby.exe Message-ID: <20061222051615.20004.qmail@web7804.mail.in.yahoo.com> I running test cases under Windows Environment, using ruby, watir 1.5.1.1100. I have the following code: require 'watir' # the watir controller require 'watir/winClicker.rb' require 'watir\contrib\enabled_popup' test = "C:\\aa.htm" ie=Watir::IE.start(test) def startClicker( button,ie,waitTime = 3) w = WinClicker.new longName = ie.dir.gsub("/" , "\\" ) shortName = w.getShortFileName(longName) c = "start ruby #{shortName}\\watir\\clickJSDialog.rb #{button} #{waitTime} " puts "Starting #{c}" w.winsystem(c) w=nil end startClicker("OK",ie,3) ie.button("Submit").click The above is working fine, but when the method startClicker is called, it displays a command shell/prompt of ruby.exe, showing some message. I want the command shell/prompt doesn't comes up or if it is necessary for the prompt to come up, it should open in minimized state. Please, help me out from this. Thanks in advance Vikash Send free SMS to your Friends on Mobile from your Yahoo! Messenger. Download Now! http://messenger.yahoo.com/download.php -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061222/8bec9edd/attachment.html From dave at burt.id.au Fri Dec 22 00:51:54 2006 From: dave at burt.id.au (Dave Burt) Date: Fri, 22 Dec 2006 16:51:54 +1100 Subject: [Wtr-general] OT: anyone know Ruby Facets? In-Reply-To: <72799cd70612211355r17789a6eq7f41339a2a97c4ce@mail.gmail.com> References: <72799cd70612211355r17789a6eq7f41339a2a97c4ce@mail.gmail.com> Message-ID: <458B727A.4070908@burt.id.au> Chris McMahon wrote: > http://facets.rubyforge.org/ > > Looks like some interesting things, I just wondered if anyone here has > experience with it/them? Yes, they're rather cool. A lot of useful stuff, interesting stuff, and well-organised and -written. A lot of stuff that subsumes standard Ruby idioms (e.g. array.at_rand instead of the idiomatic array[rand(array.size)]). It includes a lot of eminently reinventable wheels (e.g. combinations and permutations of arrays). Its Symbol#to_proc is moving into core ruby in version 1.9. Cheers, Dave From forum-watir-users at openqa.org Fri Dec 22 03:15:45 2006 From: forum-watir-users at openqa.org (liucongying) Date: Fri, 22 Dec 2006 02:15:45 CST Subject: [Wtr-general] how to know the content of a table 's colomn and row Message-ID: <56053031.1166775390508.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I just wanna know to output the content of a table 's colomn and row. When I test the web, It has many tables without id, I do not make sure which table is which I want. my purpose is to click the link of a table .To output the contents of a table 's colomn and row ,So I can know the link I want to click is in which colomn and row Please help me if you know ,thanks --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5898&messageID=16511#16511 From forum-watir-users at openqa.org Fri Dec 22 03:43:16 2006 From: forum-watir-users at openqa.org (liucongying) Date: Fri, 22 Dec 2006 02:43:16 CST Subject: [Wtr-general] Give a solution fo javascript popup In-Reply-To: Message-ID: <46369396.1166777026867.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks very much!!! --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5883&messageID=16514#16514 From forum-watir-users at openqa.org Fri Dec 22 04:17:07 2006 From: forum-watir-users at openqa.org (liucongying) Date: Fri, 22 Dec 2006 03:17:07 CST Subject: [Wtr-general] how to know the content of a table 's colomn and row In-Reply-To: <56053031.1166775390508.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <58252143.1166779179187.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> My problem is that the table has sub-table. HTML:
...........Payroll Stucture
Pay Entity
Pay Group
Element Group
Payroll Calendar
Entity Calendar
So how can I handle the problem,to click the link that I want ! --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5898&messageID=16515#16515 From mail at chriss-baumann.de Fri Dec 22 05:47:51 2006 From: mail at chriss-baumann.de (Christian Baumann) Date: Fri, 22 Dec 2006 11:47:51 +0100 Subject: [Wtr-general] how to know the content of a table 's colomn and row In-Reply-To: <56053031.1166775390508.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <56053031.1166775390508.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <458BB7D7.60701@chriss-baumann.de> Hi liucongying, via "index" You can access different tables on the webpage, for example ie.table(:index, 2), to access a specific cell within this table You can use for example ie.table(:index, 2)[2][3]. Regards, Christian liucongying schrieb: > I just wanna know to output the content of a table 's colomn and row. > When I test the web, It has many tables without id, I do not make sure which table is which I want. > my purpose is to click the link of a table .To output the contents of a table 's colomn and row ,So I can know the link I want to click is in which colomn and row > Please help me if you know ,thanks > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5898&messageID=16511#16511 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > From forum-watir-users at openqa.org Fri Dec 22 06:21:46 2006 From: forum-watir-users at openqa.org (vijay) Date: Fri, 22 Dec 2006 05:21:46 CST Subject: [Wtr-general] How to capture exception details In-Reply-To: <34523027.1166728835919.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <48967042.1166786536444.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thank you, Jlolis and Nathan. Your answers were really very helpful. Now, we are able to trap exception messages using your suggestion but is there any way to capture the line number of the code that made Watir throw an exception as it would be really helpful to see an exception note like the following: "A 'so and so' exception has occured in 'so and so' line" Also can the name of the function in which the exception was thrown, be captured? Ex. if we have written a small function called 'add_an_inventor'. If, within that function, an exception occurs, can we capture the name of the user-defined function so that our exception note would be still more elaborate as it would say, "A 'so and so' exception has occured within the 'add_an_inventor' function in the 'so and so" line " Finally, can we make the script go to a particular line once it encounters an exception. Is there a "goto" statement in Ruby? Thanks, in Advance, Vijay --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5886&messageID=16516#16516 From forum-watir-users at openqa.org Fri Dec 22 06:44:16 2006 From: forum-watir-users at openqa.org (Kingsley Hendrickse) Date: Fri, 22 Dec 2006 05:44:16 CST Subject: [Wtr-general] Handling Javascript Alerts, Popups and Modal Dialogs Message-ID: <38840591.1166787892365.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi All, Here is the popup manager I wrote. (im just about to head off on holiday but I'll be back in Jan) download here: http://www.mindflowsolutions.com/software/popup.zip I would be grateful if people could try this out and give me feedback on if it is working for them. Any improvements and suggestions are also welcome. The software consists of 2 parts. popup.exe <--- the main application config.txt <--- the config file The exe doesnt (or shouldnt) need any dependencies it should all be compiled in. The config file contains the windows/alerts you want to close in yaml format. See the example. You can name the windows in the config file anything you like but you must indent the title, text and button with 2 spaces and then 1 space after the colon. You will get an error if use tabs in this file. Such is the nature of yaml. Also I dont know if you can use the : in the text anywhere I think you have to escape it somehow. Execution: popup.exe <---- reads the config.txt and loops forever looking for the windows in the file - when it finds them it clicks whatever button you have specified. you can also provide an interval between loops - the default is 1 second, and you can turn the logging off - default is on. example: popup.exe 5 <---- interval of 5 secs popup.exe 0.1 <---- interval of 0.1 secs popup.exe 1 off <---- interval 1 secs and turn off the logs The config file is parsed on each loop so once the exe is started you can modify the config and save for immediate effect - no need to stop and restart the exe. Example: The included config.txt has 2 popup windows from this url: http://www.waller.co.uk/javatest.htm If you navigate there in IE and then start the exe it will locate and close the 2 windows. Problems: If there is a very long list of windows to close it might take a while even on 0.1 secs interval to loop thru and look for them all. If you set the interval to 0 - your cpu gets a hammering. I have only tested it on a few javascript alerts. Background: The popup.exe runs as a separate process due to the nature of ruby threading its very difficult to handle modal windows in the parent or children of the ruby process that instigates the modal dialogue. Maybe one day I will find a way - but at the moment this was a quick and easy solution to handling dialogue and modal windows. Thanks for trying out this experimental software. Please provide feedback through the mailing list. Thanks Kingsley --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5900&messageID=16517#16517 From charley.baker at gmail.com Fri Dec 22 11:57:08 2006 From: charley.baker at gmail.com (Charley Baker) Date: Fri, 22 Dec 2006 09:57:08 -0700 Subject: [Wtr-general] how to minimize command prompt of ruby.exe In-Reply-To: <20061222051615.20004.qmail@web7804.mail.in.yahoo.com> References: <20061222051615.20004.qmail@web7804.mail.in.yahoo.com> Message-ID: Change your system call to call rubyw which won't open a command window: c = "start rubyw #{shortName}\\watir\\clickJSDialog.rb #{button} #{waitTime} " Here's more information in the Pickaxe book: http://www.rubycentral.com/book/win32.html -Charley On 12/21/06, VIKASH KUMAR wrote: > > I running test cases under Windows Environment, using ruby, watir > 1.5.1.1100. > > > > I have the following code: > > require 'watir' # the watir controller > > require 'watir/winClicker.rb' > require 'watir\contrib\enabled_popup' > > test = "C:\\aa.htm" > > ie=Watir::IE.start(test) > > > > > > def startClicker( button,ie,waitTime = 3) > w = WinClicker.new > longName = ie.dir.gsub("/" , "\\" ) > shortName = w.getShortFileName(longName) > c = "start ruby #{shortName}\\watir\\clickJSDialog.rb #{button} #{waitTime} > " > puts "Starting #{c}" > w.winsystem(c) > w=nil > end > > > > > > > > startClicker("OK",ie,3) > ie.button("Submit").click > > > > > > The above is working fine, but when the method startClicker is called, it > displays a command shell/prompt of ruby.exe, showing some message. I want > the command shell/prompt doesn't comes up or if it is necessary for the > prompt to come up, it should open in minimized state. > > > > Please, help me out from this. > > Thanks in advance > > Vikash > > Send free SMS to your Friends on Mobile from your Yahoo! Messenger. > Download Now! http://messenger.yahoo.com/download.php > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061222/5debaf26/attachment.html From bret at pettichord.com Fri Dec 22 11:59:15 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 22 Dec 2006 10:59:15 -0600 Subject: [Wtr-general] Syntax for relative attributes In-Reply-To: <53714004.1166718473525.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <53714004.1166718473525.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <458C0EE3.1030108@pettichord.com> John Lolis wrote: > A second, slightly related question. Regardless of how you do it, i'm > wondering whats going on behind the scenes. > If you do > >> headline = $ie.div(:text, 'Pragmatic Version Control') >> link = $ie.link(:class => 'addtocart', :after? => headline) >> > > Is headline now 'frozen'? For example, lets say there is a 'addtocart' after headline. What happens if after you create your headline variable the page changes (headline is now at the bottom of the page)? Will the after method re evaluate headlines position in the page? Or is headline now static so after would would be true even if it isn't? > > I'm not sure if that even made sense. > Actually this is a good question. Let's call each of these "Watir expressions". They can refer to different objects on different pages, or sometimes they refer to nothing. > $ie.div(:text, 'Pragmatic Version Control') > $ie.link(:class => 'addtocart', :after? => headline) > When they are used, they end up referring to specific control on a specific page at a specific point in time. Let's call this an "element reference" (internally it is called @o and getOLEobject and ole_object, variously depending on version). This reference is actually a COM object that will become stale as soon as a new page is loaded. However it will remain valid if javascript-based changes are made to the DOM. So your question becomes: What is the relationship between Watir expressions and element references? And the answer depends on whether you are using Watir 1.4 or 1.5. Both versions of Watir use "locate" methods to tie the Watir objects returned by Watir expressions to the element references, and we might call this process "binding". In Watir 1.4, this binding was made at call time. When the expression was executed, the Watir object would be bound. However, if there was a failure to bind (ObjectNotFound), an error would not be raised until you actually made a call to the object -- for example, calling its "click" method. The reason for this was to allow us to have an "exists?" method. This method would only return false if we had failed to bind -- not raise an error. In Watir 1.5, i moved the timing of the locate method (in most cases) so that binding itself would not happen until this time -- when we previously were just checking to see if the binding had been made or not. In other words, we had "late binding" in 1.4 and "really-late binding" in 1.5. In theory, really-late binding would allow you to create objects that would rebind themselves after a page load. However, i've never encouraged this, nor have i seen any evidence that people have actually been doing this. A big issue is that this automatic rebinding would happen in simple cases but not in complex cases and understanding the difference was really too much to expect from our users. I'm reluctant to even try and explain it, and frankly there are edge cases that i'm unsure of myself, and i also suspect there are bugs. So we have consistently urged people to wrap their watir expressions in methods rather than assign them to global variables. This makes it easy to reuse them, and ensure that a correct rebinding occurs on each reuse. Also, as i have been using Watir more on large projects, i am finding that there are other reasons why this is a sound way to structure Watir libraries. This made the automatic-rebinding we have in place simply a performance hog with no real benefit. I posted a patch the other day that removes it and will probably commit this to trunk soon. It has the potential to break tests, so first i want to post a release that rolls up the new features and bug fixes that will assuredly be popular. So the short answer to your question, is "it depends". Is headline now 'frozen'? For example, lets say there is a 'addtocart' after headline. What happens if after you create your headline variable the page changes (headline is now at the bottom of the page)? Will the after method re evaluate headlines position in the page? Or is headline now static so after would would be true even if it isn't? So when you say the page changes, we need to know whether a new page is loaded (or even reloading the same page) or whether the change is made dynamically. Right now, it will rebind if we get a page load (but, like i said, i'm considering removing this behavior). If it is an AJAX/Javascript change, then we would need more details. In particular, a lot of times when we see AJAX/Javascript page elements moving, they are actually being made visible or invisible, which is a whole other thing, since Watir can "see" invisible elements. The important message is that you really should re-execute the headline Watir expression after a page change. That will ensure that your tests work correctly, not matter how your page works or what version of Watir you are using. Bret From bret at pettichord.com Fri Dec 22 12:06:37 2006 From: bret at pettichord.com (Bret Pettichord) Date: Fri, 22 Dec 2006 11:06:37 -0600 Subject: [Wtr-general] how to minimize command prompt of ruby.exe In-Reply-To: <20061222051615.20004.qmail@web7804.mail.in.yahoo.com> References: <20061222051615.20004.qmail@web7804.mail.in.yahoo.com> Message-ID: <458C109D.9070905@pettichord.com> VIKASH KUMAR wrote: > c = "start ruby #{shortName}\\watir\\clickJSDialog.rb #{button} > #{waitTime} " > > The above is working fine, but when the method startClicker is called, > it displays a command shell/prompt of ruby.exe, showing some message. > I want the command shell/prompt doesn't comes up or if it is necessary > for the prompt to come up, it should open in minimized state. > What happens if you use "start rubyw ..." instead? Bret From mail at chriss-baumann.de Fri Dec 22 14:49:13 2006 From: mail at chriss-baumann.de (Christian Baumann) Date: Fri, 22 Dec 2006 20:49:13 +0100 Subject: [Wtr-general] How to capture exception details In-Reply-To: <48967042.1166786536444.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <48967042.1166786536444.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <458C36B9.3040207@chriss-baumann.de> Hello vijav, > Now, we are able to trap exception messages using your suggestion but is there any way to capture the line number of the code that made Watir throw an exception as it would be really helpful to see an exception note like the following: > > "A 'so and so' exception has occured in 'so and so' line" > __LINE__ is what You?re looking for. > Also can the name of the function in which the exception was thrown, be captured? Ex. if we have written a small function called 'add_an_inventor'. If, within that function, an exception occurs, can we capture the name of the user-defined function so that our exception note would be still more elaborate as it would say, > > "A 'so and so' exception has occured within the 'add_an_inventor' function in the 'so and so" line " > There are two libraries that both can log methode execution, maybe they can help you: http://copland.rubyforge.org/ http://needle.rubyforge.org/ > Finally, can we make the script go to a particular line once it encounters an exception. Is there a "goto" statement in Ruby? > Google should help You here, it?s easy to find an answer for that on You own. ;) Regards, Christian From gmaralina at beingpresent.org Fri Dec 22 14:59:15 2006 From: gmaralina at beingpresent.org (Galina Maralina) Date: Fri, 22 Dec 2006 11:59:15 -0800 Subject: [Wtr-general] Problem with Autoit? In-Reply-To: <458C109D.9070905@pettichord.com> Message-ID: <20061222195921.BDE96D1BB339@gollum.o1.com> Hello, I installed water 1.5.1.1135 and can not close alert windows any more... something is not working with Autoit, it worked before with version 1.4., code is the same: Thread.new { system("rubyw myClicker.rb") } $ie.image(:name, "Delete").click This is the error: c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1135/./watir/WindowHelper.rb:5:in `initialize': failed to create WIN32OLE object from `AutoItX3.Control' (WIN32OLERuntimeError) HRESULT error code:0x8007007e The specified module could not be found. from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1135/./watir/WindowHelper.rb:5:in `new' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1135/./watir/WindowHelper.rb:5:in `initialize' from myClicker.rb:6:in `new' from myClicker.rb:6 How can I make it work again? Galina. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061222/ac221be1/attachment-0001.html From forum-watir-users at openqa.org Mon Dec 25 00:45:49 2006 From: forum-watir-users at openqa.org (liucongying) Date: Sun, 24 Dec 2006 23:45:49 CST Subject: [Wtr-general] A strange problem of ie.maximize Message-ID: <55433248.1167025579303.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I have finished my script,but I met a problem : if I put the "$ie.maximize" in the login page, I login successfully, but cannt click the link; if I put the "$ie.maximize" after the login page , the script run normally. I want to why, I think it is a bug for ie.maximize!!! --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5914&messageID=16544#16544 From forum-watir-users at openqa.org Mon Dec 25 03:05:33 2006 From: forum-watir-users at openqa.org (liucongying) Date: Mon, 25 Dec 2006 02:05:33 CST Subject: [Wtr-general] The method of "show_links" is wrong !!! Message-ID: <45634148.1167033963824.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> verison : watir-1.5.1.1127.gem c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/./watir.rb:1813: [BUG] Segmentat ion fault ruby 1.8.5 (2006-08-25) [i386-mswin32] show_links is wrong ,someone can fix ? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5915&messageID=16545#16545 From forum-watir-users at openqa.org Mon Dec 25 22:44:08 2006 From: forum-watir-users at openqa.org (kim) Date: Mon, 25 Dec 2006 21:44:08 CST Subject: [Wtr-general] How to save the test result ? Message-ID: <57844881.1167104678978.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Recently I just learn the Watir. Watir is very good toos for web auto testing. I use the test/unit. The test result is always shown in command line. I want to know if I can save the test result into a text file? I think the perfect automatic test framework should be an export(Test Result) that will help the testers analyse the program. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5918&messageID=16552#16552 From forum-watir-users at openqa.org Tue Dec 26 01:26:30 2006 From: forum-watir-users at openqa.org (Sadeesh Vinoth) Date: Tue, 26 Dec 2006 00:26:30 CST Subject: [Wtr-general] Time of execution of each test method in a class Message-ID: <54136509.1167114448766.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi, How to get the time of execution of each method in watir. Please help me with this. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5919&messageID=16555#16555 From forum-watir-users at openqa.org Tue Dec 26 02:06:08 2006 From: forum-watir-users at openqa.org (san) Date: Tue, 26 Dec 2006 01:06:08 CST Subject: [Wtr-general] Is There Any Other Way To Fill A Text Box....? Message-ID: <34404627.1167116798932.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I Want To Fill A Text Box In IE By Watir... But As Watir Writes A Letter At A Time, Its Taking A Long Time To Fill The Box If I Have A Long String In Hand... So My Question Is, Is There Any Other Way To Fill The Box At A Time With The Long String,Insteed Of Writing The String Per Letter At A Time...? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5920&messageID=16556#16556 From forum-watir-users at openqa.org Tue Dec 26 02:12:53 2006 From: forum-watir-users at openqa.org (kim) Date: Tue, 26 Dec 2006 01:12:53 CST Subject: [Wtr-general] How to save the test result ? In-Reply-To: <57844881.1167104678978.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <63384300.1167117203384.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> I found the solution in "watir_bonus" directory. There is a sample to record the test result into a text file and a xml file. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5918&messageID=16557#16557 From angrez at gmail.com Tue Dec 26 03:21:53 2006 From: angrez at gmail.com (Angrez Singh) Date: Tue, 26 Dec 2006 13:51:53 +0530 Subject: [Wtr-general] Is There Any Other Way To Fill A Text Box....? In-Reply-To: <34404627.1167116798932.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <34404627.1167116798932.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi San, If you don't have any onkeyup and onkeydown events in your text box you can use 'value' property of text box to set the value. For e.g.: ie.text_field(:id, "some_id").value = "long string" Regards, Angrez On 12/26/06, san wrote: > > I Want To Fill A Text Box In IE By Watir... But As Watir Writes A Letter > At A Time, Its Taking A Long Time To Fill The Box If I Have A Long String In > Hand... > > So My Question Is, Is There Any Other Way To Fill The Box At A Time With > The Long String,Insteed Of Writing The String Per Letter At A Time...? > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5920&messageID=16556#16556 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061226/6ac265f1/attachment.html From forum-watir-users at openqa.org Tue Dec 26 03:30:29 2006 From: forum-watir-users at openqa.org (kim) Date: Tue, 26 Dec 2006 02:30:29 CST Subject: [Wtr-general] How to save the test result ? In-Reply-To: <63384300.1167117203384.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <58997936.1167121859269.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> We can use the logger.rb to finish this work. Thanks. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5918&messageID=16559#16559 From forum-watir-users at openqa.org Tue Dec 26 05:48:16 2006 From: forum-watir-users at openqa.org (vijay) Date: Tue, 26 Dec 2006 04:48:16 CST Subject: [Wtr-general] How to save the test result ? In-Reply-To: <57844881.1167104678978.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <48092698.1167130126796.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi interstellar, Good that you have solved your problem yourself. But still, I would like give you a small piece of information, which I got from this forum. The below-given link will take you to a page that contains crystal-clear information about how to read from and write to excel files: http://wiki.rubygarden.org/Ruby/page/show/ScriptingExcel The below piece of code creates a simple html file and writes data to it: # variable definitions number_of_cols = 2 column_names = ["Step number","Result"] def create_html(file_path,number_of_cols,column_names) end_of_loop = column_names.length - 1 output_html_file = File.new(file_path, File::CREAT|File::TRUNC|File::WRONLY) output_html_file.write("") output_html_file.write("") for i in 0..end_of_loop output_html_file.write("") end output_html_file.write("") output_html_file.close end def write_result(file_path,step_number,result_or_results) output_html_file = File.open(file_path, File::APPEND|File::WRONLY) output_html_file.write("") output_html_file.close end You may also find file handling information from the 'Basic Input/Output' section of the 'Ruby Guide': Start -> Programs -> Ruby -> Ruby Documentation -> Ruby Book Help -> Basic Input Ouput Thanks and hope I have not wasted your time, Vijay. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5918&messageID=16562#16562 From forum-watir-users at openqa.org Tue Dec 26 06:01:50 2006 From: forum-watir-users at openqa.org (san) Date: Tue, 26 Dec 2006 05:01:50 CST Subject: [Wtr-general] Is There Any Other Way To Fill A Text Box....? In-Reply-To: Message-ID: <45900638.1167130940040.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks For The Help... angrez ... Its Working Now... Thanks. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5920&messageID=16563#16563 From christopher.mcmahon at gmail.com Tue Dec 26 11:19:16 2006 From: christopher.mcmahon at gmail.com (Chris McMahon) Date: Tue, 26 Dec 2006 08:19:16 -0800 Subject: [Wtr-general] Time of execution of each test method in a class In-Reply-To: <54136509.1167114448766.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <54136509.1167114448766.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <72799cd70612260819l569db49dm997a7472fc597004@mail.gmail.com> > > How to get the time of execution of each method in watir. > Please help me with this. def my_cool_method sleep 2 puts "howdy" end starting_time = Time.now my_cool_method ending_time = Time.now time_to_execute_my_cool_method = ending_time - starting_time puts "my cool method took #{time_to_execute_my_cool_method} seconds" -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061226/45f1c2b5/attachment.html From forum-watir-users at openqa.org Tue Dec 26 13:14:04 2006 From: forum-watir-users at openqa.org (Dave Munns) Date: Tue, 26 Dec 2006 12:14:04 CST Subject: [Wtr-general] Simulate CNTRL-LEFT CLICK In-Reply-To: <42913869.1164750868797.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <54520527.1167156874705.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Here is the html for the object I want to control-leftclick: I do not see that action described in the html, but I can manually make it happen. ie.frame('fraNavigation').span(:id,'spnNodeText_120').html => "Settings" --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5490&messageID=16565#16565 From charley.baker at gmail.com Tue Dec 26 13:26:17 2006 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 26 Dec 2006 11:26:17 -0700 Subject: [Wtr-general] Problem with Autoit? In-Reply-To: <20061222195921.BDE96D1BB339@gollum.o1.com> References: <458C109D.9070905@pettichord.com> <20061222195921.BDE96D1BB339@gollum.o1.com> Message-ID: You might need to register the dll. Open a command prompt where AutoItX3.dllis installed. From the gem install you'll need to go to {ruby_install}\lib\ruby\gems\1.8\gems\watir-1.5.1.1135\watir where you'll find the dll and then run regsvr32 AutoIt3X.dll -Charley On 12/22/06, Galina Maralina wrote: > > Hello, > > > > I installed water 1.5.1.1135 and can not close alert windows any more... > something is not working with Autoit, it worked before with version 1.4., > code is the same: > > > > * Thread.new { system("rubyw myClicker.rb") }* > > * $ie.image(:name, "Delete").click* > > * * > > This is the error: > > > > *c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1135/./watir/WindowHelper.rb:5:in > `initialize': failed to create WIN32OLE object from `AutoItX3.Control' > (WIN32OLERuntimeError)* > > * HRESULT error code:0x8007007e* > > * The specified module could not be found. from > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1135/./watir/WindowHelper.rb:5:in > `new'* > > * from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1135/./watir/WindowHelper.rb:5:in > `initialize'* > > * from myClicker.rb:6:in `new'* > > * from myClicker.rb:6* > > * * > > How can I make it work again? > > > > Galina. > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061226/0db954e6/attachment-0001.html From bret at pettichord.com Tue Dec 26 13:39:52 2006 From: bret at pettichord.com (Bret Pettichord) Date: Tue, 26 Dec 2006 12:39:52 -0600 Subject: [Wtr-general] Problem with Autoit? In-Reply-To: References: <458C109D.9070905@pettichord.com> <20061222195921.BDE96D1BB339@gollum.o1.com> Message-ID: <45916C78.7080107@pettichord.com> Charley Baker wrote: > You might need to register the dll. Open a command prompt where > AutoItX3.dll is installed. From the gem install you'll need to go to > {ruby_install}\lib\ruby\gems\1.8\gems\watir-1.5.1.1135\watir where > you'll find the dll and then run regsvr32 AutoIt3X.dll Watir will do this automatically IF run with administrator rights. The OP's problem is probably due to the fact that they are running Watir under a user that does not have administrator privileges. Bret From charley.baker at gmail.com Tue Dec 26 13:58:56 2006 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 26 Dec 2006 11:58:56 -0700 Subject: [Wtr-general] A strange problem of ie.maximize In-Reply-To: <55433248.1167025579303.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <55433248.1167025579303.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Sending some of your script and html snippets might help. I'm using maximize pretty extensively and haven't run across any problems. -Charley On 12/24/06, liucongying wrote: > > I have finished my script,but I met a problem : if I put the > "$ie.maximize" in the login page, I login successfully, but cannt click the > link; if I put the "$ie.maximize" after the login page , the script run > normally. > I want to why, I think it is a bug for ie.maximize!!! > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5914&messageID=16544#16544 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061226/269e1dbd/attachment.html From charley.baker at gmail.com Tue Dec 26 14:02:25 2006 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 26 Dec 2006 12:02:25 -0700 Subject: [Wtr-general] The method of "show_links" is wrong !!! In-Reply-To: <45634148.1167033963824.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <45634148.1167033963824.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Not sure why you're having problems with show_links. Are you trying to show_links in a modal dialog? More specifics would be helpful. My only guess without more information could be the version of Ruby you're using. You might try rolling back from Ruby 1.8.5 to 1.8.2. -Charley On 12/25/06, liucongying wrote: > > verison : watir-1.5.1.1127.gem > c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/./watir.rb:1813: [BUG] > Segmentat > ion fault > ruby 1.8.5 (2006-08-25) [i386-mswin32] > show_links is wrong ,someone can fix ? > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5915&messageID=16545#16545 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061226/9b40ef87/attachment.html From gmaralina at beingpresent.org Tue Dec 26 14:19:45 2006 From: gmaralina at beingpresent.org (Galina Maralina) Date: Tue, 26 Dec 2006 11:19:45 -0800 Subject: [Wtr-general] Problem with Autoit? In-Reply-To: <45916C78.7080107@pettichord.com> Message-ID: <01dd01c72922$cd55d610$3700a8c0@dbrblackcompaq> No, I am running Watir under administrator and I still can not solve this problem... Any more ideas? Thank you, Galina. -----Original Message----- From: wtr-general-bounces at rubyforge.org [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord Sent: Tuesday, December 26, 2006 10:40 AM To: wtr-general at rubyforge.org Subject: Re: [Wtr-general] Problem with Autoit? Charley Baker wrote: > You might need to register the dll. Open a command prompt where > AutoItX3.dll is installed. From the gem install you'll need to go to > {ruby_install}\lib\ruby\gems\1.8\gems\watir-1.5.1.1135\watir where > you'll find the dll and then run regsvr32 AutoIt3X.dll Watir will do this automatically IF run with administrator rights. The OP's problem is probably due to the fact that they are running Watir under a user that does not have administrator privileges. Bret _______________________________________________ Wtr-general mailing list Wtr-general at rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general From charley.baker at gmail.com Tue Dec 26 16:29:17 2006 From: charley.baker at gmail.com (Charley Baker) Date: Tue, 26 Dec 2006 14:29:17 -0700 Subject: [Wtr-general] Problem with Autoit? In-Reply-To: <01dd01c72922$cd55d610$3700a8c0@dbrblackcompaq> References: <45916C78.7080107@pettichord.com> <01dd01c72922$cd55d610$3700a8c0@dbrblackcompaq> Message-ID: Does it still fail if you manually install AutoIt as I mentioned in my last email? -c On 12/26/06, Galina Maralina wrote: > > No, I am running Watir under administrator and I still can not solve > this problem... Any more ideas? > > Thank you, > Galina. > > -----Original Message----- > From: wtr-general-bounces at rubyforge.org > [mailto:wtr-general-bounces at rubyforge.org] On Behalf Of Bret Pettichord > Sent: Tuesday, December 26, 2006 10:40 AM > To: wtr-general at rubyforge.org > Subject: Re: [Wtr-general] Problem with Autoit? > > Charley Baker wrote: > > You might need to register the dll. Open a command prompt where > > AutoItX3.dll is installed. From the gem install you'll need to go to > > {ruby_install}\lib\ruby\gems\1.8\gems\watir-1.5.1.1135\watir where > > you'll find the dll and then run regsvr32 AutoIt3X.dll > Watir will do this automatically IF run with administrator rights. The > OP's problem is probably due to the fact that they are running Watir > under a user that does not have administrator privileges. > > Bret > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061226/5fbb7627/attachment.html From zeljko.filipin at gmail.com Wed Dec 27 05:50:39 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Wed, 27 Dec 2006 11:50:39 +0100 Subject: [Wtr-general] Iterator in harness In-Reply-To: References: Message-ID: Maybe this would help. http://wiki.openqa.org/display/WTR/Test-Unit+Patch -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061227/27d3af2f/attachment.html From forum-watir-users at openqa.org Thu Dec 28 19:42:06 2006 From: forum-watir-users at openqa.org (kim) Date: Thu, 28 Dec 2006 18:42:06 CST Subject: [Wtr-general] How to save the test result ? In-Reply-To: <48092698.1167130126796.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <34579553.1167352956830.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> hi,vijayvaidya Thanks for your infomation. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5918&messageID=16632#16632 From forum-watir-users at openqa.org Thu Dec 28 20:44:44 2006 From: forum-watir-users at openqa.org (kim) Date: Thu, 28 Dec 2006 19:44:44 CST Subject: [Wtr-general] the problem about test cases organization. Message-ID: <57044617.1167356714132.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Suppose In a project I wrote many rb files. I want to know how to organize them. I hope after the test scripts is executed there is only a test result file. In other word, I want all the rb files execution result to be saved in the same file. I expect the best solution. Thanks a lot. --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5943&messageID=16634#16634 From charley.baker at gmail.com Thu Dec 28 21:25:16 2006 From: charley.baker at gmail.com (Charley Baker) Date: Thu, 28 Dec 2006 19:25:16 -0700 Subject: [Wtr-general] the problem about test cases organization. In-Reply-To: <57044617.1167356714132.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <57044617.1167356714132.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Include them in a test suite and use test unit report: http://test-report.rubyforge.org/. You can report out like junit tests in html or xml. I'm glad you are expecting the best solution. -Charley On 12/28/06, kim wrote: > > Suppose In a project I wrote many rb files. > I want to know how to organize them. > I hope after the test scripts is executed there is only a test result > file. In other word, I want all the rb files execution result to be saved in > the same file. > I expect the best solution. > Thanks a lot. > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5943&messageID=16634#16634 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061228/50f43adc/attachment-0001.html From forum-watir-users at openqa.org Fri Dec 29 02:19:30 2006 From: forum-watir-users at openqa.org (san) Date: Fri, 29 Dec 2006 01:19:30 CST Subject: [Wtr-general] Image Uploading Problem.... Message-ID: <36462935.1167376800902.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Hi Everybody, I Want To Upload An Image On A Site... The Html Code Of The Palce Of Giving Name & The Browse Button Is Here: [i][/i] As Its A Field Of Type "File", Not A "Text Field", I Can't Put The Path, e.g c:\abc.gif In This Field By [i]ie.text_field(:id, "onetidIOFile").value = "c:\abc.gif" or ie.text_field(:name, "urn:schemas-microsoft-com:office:office#FileLeafRef").set("c:\abc.gif")[/i] So How Do I Put This Path Directly In The Blank Place Of Giving The File Name, Insteed Of Clicking On Browse & Then Selecting It Manually... & Then Of Course I'll Click On A Button, Here Named "Save And Close"... --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5946&messageID=16641#16641 From forum-watir-users at openqa.org Fri Dec 29 02:35:58 2006 From: forum-watir-users at openqa.org (san) Date: Fri, 29 Dec 2006 01:35:58 CST Subject: [Wtr-general] Image Uploading Problem.... In-Reply-To: <36462935.1167376800902.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: <40976455.1167377788765.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> [i]ie.file_field(:name, "urn:schemas-microsoft-com:office:office#FileLeafRef").set("c:\abc.gif")[\i] is not working... :( --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5946&messageID=16642#16642 From zeljko.filipin at gmail.com Fri Dec 29 04:08:09 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 29 Dec 2006 10:08:09 +0100 Subject: [Wtr-general] Image Uploading Problem.... In-Reply-To: <40976455.1167377788765.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <36462935.1167376800902.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> <40976455.1167377788765.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: This works for me ie.file_field(:id, "onetidIOFile").set('c:\abc.gif') ie.file_field(:name, "urn:schemas-microsoft-com:office:office#FileLeafRef").set('c:\abc.gif') I guess that your problem is that c:\abc.gif is in double qoutes ("c:\abc.gif"). Use single quotes and it should work just fine ('c:\abc.gif'). I would know more if you posted your error message instead of just "is not working". :) For more information see http://en.wikibooks.org/wiki/Ruby_Programming/Strings -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061229/11fb8d94/attachment.html From dhrubojyotib at gmail.com Fri Dec 29 06:09:27 2006 From: dhrubojyotib at gmail.com (Dhrubojyoti Biswas) Date: Fri, 29 Dec 2006 16:39:27 +0530 Subject: [Wtr-general] Cannot click on HTML button Message-ID: Hi, Problem 1: Watir doesn't seem to recognize buttons that are encapsulated inside label tags. As an example consider the following tag WATIR is not able to recognize and click on this button. ie.buttons.length returns nothing for a page which contains such controls. ie.button(:name, 'Go').click throws an 'assert_exists' (Watir::Exception::UnknownObjectException) Some help on how to click such controls would be really nice. Problem 2: If there are controls containing the same name on a page WATIR cannot distinguish between them. I had thought of caching up such controls in an Array (Collection) and then iterate over them. But most of the Watir classes including Watir::SelectList, Watir::Button do not expose methods through which the names of these controls can be retrieved. Can such methods be supported? -- Dhruv -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061229/a42f0e8c/attachment.html From zeljko.filipin at gmail.com Fri Dec 29 06:47:02 2006 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Fri, 29 Dec 2006 12:47:02 +0100 Subject: [Wtr-general] Cannot click on HTML button In-Reply-To: References: Message-ID: 1) This will work. ie.button(:alt, "Go").click ie.button(:value, "Go").click Watir works as expected, you told him to click a button with name Go, but your button does not have name atribute. 2) Quote from Bret Pettichord from this list: "In 1.5, this syntax works: ie.div(:name => 'foo', :index => 2).click This will find the second div with the name 'foo'. Not all elements yet have multiple attribute support." -- Zeljko Filipin zeljkofilipin.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061229/d5f5a238/attachment.html From forum-watir-users at openqa.org Fri Dec 29 06:56:38 2006 From: forum-watir-users at openqa.org (san) Date: Fri, 29 Dec 2006 05:56:38 CST Subject: [Wtr-general] Image Uploading Problem.... In-Reply-To: Message-ID: <36627195.1167393428638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Ok, It Was Not The Double Quotes That Was Causing Problem :) Its The Space In The Name Of The Folder... It taking Path Like "c"\abc.gif" But Its Not Taking The Path like 'c:\new folder\abc.jpg', as it says can't find 'c:\new'. I Think The Space Between New & Folder Is Causing Problem... I Also Tried... 'c:\\new\ folder\\abc.jpg' and "c:\\new\ folder\\abc.jpg", but nothing worked... So Whats The Solution Pls? Also as you said ie.file_field(:id, "onetidIOFile").set('c:\abc.gif') is working fine, but another black dos box is coming up and many lines are passing through it very fast, i think it the way of searching the file path, but its taking a long time, at least 10 secs for a file... Is there any other way to do it... Thanks For The Reply... --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5946&messageID=16647#16647 From angrez at gmail.com Fri Dec 29 07:33:57 2006 From: angrez at gmail.com (Angrez Singh) Date: Fri, 29 Dec 2006 18:03:57 +0530 Subject: [Wtr-general] Image Uploading Problem.... In-Reply-To: <36627195.1167393428638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <36627195.1167393428638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi, I too face the same problem with Watir 1.4.1 while running the unit tests; if the installation directory contains a space in the folder name the upload simply doesn't work. I don't know if it is solved or not. The only way is to remove the space from your folder name. Or try a path with no space. Regards, Angrez On 12/29/06, san wrote: > > Ok, It Was Not The Double Quotes That Was Causing Problem :) Its The Space > In The Name Of The Folder... It taking Path Like "c"\abc.gif" But Its Not > Taking The Path like 'c:\new folder\abc.jpg', as it says can't find > 'c:\new'. > I Think The Space Between New & Folder Is Causing Problem... I Also > Tried... 'c:\\new\ folder\\abc.jpg' and "c:\\new\ folder\\abc.jpg", but > nothing worked... So Whats The Solution Pls? > > Also as you said ie.file_field(:id, "onetidIOFile").set('c:\abc.gif') is > working fine, but another black dos box is coming up and many lines are > passing through it very fast, i think it the way of searching the file path, > but its taking a long time, at least 10 secs for a file... Is there any > other way to do it... Thanks For The Reply... > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5946&messageID=16647#16647 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061229/c7b3de47/attachment.html From angrez at gmail.com Fri Dec 29 07:55:03 2006 From: angrez at gmail.com (Angrez Singh) Date: Fri, 29 Dec 2006 18:25:03 +0530 Subject: [Wtr-general] Image Uploading Problem.... In-Reply-To: <36627195.1167393428638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> References: <36627195.1167393428638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi san, Can you try adding double quotes to the file path like this: ie.file_field(:id, "onetidIOFile").set("\"c:\new folder\abc.jpg\"") This should work. Regards, Angrez On 12/29/06, san wrote: > > Ok, It Was Not The Double Quotes That Was Causing Problem :) Its The Space > In The Name Of The Folder... It taking Path Like "c"\abc.gif" But Its Not > Taking The Path like 'c:\new folder\abc.jpg', as it says can't find > 'c:\new'. > I Think The Space Between New & Folder Is Causing Problem... I Also > Tried... 'c:\\new\ folder\\abc.jpg' and "c:\\new\ folder\\abc.jpg", but > nothing worked... So Whats The Solution Pls? > > Also as you said ie.file_field(:id, "onetidIOFile").set('c:\abc.gif') is > working fine, but another black dos box is coming up and many lines are > passing through it very fast, i think it the way of searching the file path, > but its taking a long time, at least 10 secs for a file... Is there any > other way to do it... Thanks For The Reply... > --------------------------------------------------------------------- > Posted via Jive Forums > http://forums.openqa.org/thread.jspa?threadID=5946&messageID=16647#16647 > _______________________________________________ > Wtr-general mailing list > Wtr-general at rubyforge.org > http://rubyforge.org/mailman/listinfo/wtr-general > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061229/35692791/attachment.html From angrez at gmail.com Fri Dec 29 08:03:40 2006 From: angrez at gmail.com (Angrez Singh) Date: Fri, 29 Dec 2006 18:33:40 +0530 Subject: [Wtr-general] Image Uploading Problem.... In-Reply-To: References: <36627195.1167393428638.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Message-ID: Hi san, Which watir version are using? It works for me on "watir-1.5.1.1100". I tried the following: ie.file_field(:name, "file1").click_no_wait ie.file_field(:name, "file1").set("c:\\Program Files\\input.txt") Regards, Angrez On 12/29/06, Angrez Singh wrote: > > Hi san, > > Can you try adding double quotes to the file path like this: > > ie.file_field(:id, "onetidIOFile").set("\"c:\new folder\abc.jpg\"") > > This should work. > > Regards, > Angrez > > On 12/29/06, san wrote: > > > > Ok, It Was Not The Double Quotes That Was Causing Problem :) Its The > > Space In The Name Of The Folder... It taking Path Like "c"\abc.gif" But Its > > Not Taking The Path like 'c:\new folder\abc.jpg', as it says can't find > > 'c:\new'. > > I Think The Space Between New & Folder Is Causing Problem... I Also > > Tried... 'c:\\new\ folder\\abc.jpg' and "c:\\new\ folder\\abc.jpg", but > > nothing worked... So Whats The Solution Pls? > > > > Also as you said ie.file_field(:id, "onetidIOFile").set('c:\abc.gif') is > > working fine, but another black dos box is coming up and many lines are > > passing through it very fast, i think it the way of searching the file path, > > but its taking a long time, at least 10 secs for a file... Is there any > > other way to do it... Thanks For The Reply... > > --------------------------------------------------------------------- > > Posted via Jive Forums > > http://forums.openqa.org/thread.jspa?threadID=5946&messageID=16647#16647 > > > > _______________________________________________ > > Wtr-general mailing list > > Wtr-general at rubyforge.org > > http://rubyforge.org/mailman/listinfo/wtr-general > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/wtr-general/attachments/20061229/f675e373/attachment-0001.html From waynev at gmail.com Fri Dec 29 19:12:48 2006 From: waynev at gmail.com (Wayne Vucenic) Date: Fri, 29 Dec 2006 16:12:48 -0800 Subject: [Wtr-general] OT: manipulate headers on HTTP GET? In-Reply-To: <72799cd70612081836l1db59a52qad4c86498a3c9857@mail.gmail.com> References: <72799cd70612081743q4c88ddefyac8555c06638293e@mail.gmail.com> <72799cd70612081836l1db59a52qad4c86498a3c9857@mail.gmail.com> Message-ID: Hi Chris, With open-uri, you can do this: open(s_URL, "Accept-Language" => "en-us,en;q=0.5", "Accept-Charset" => "ISO-8859-1,utf-8;q=0.7 ,*;q=0.7") Take care, Wayne --- Wayne Vucenic No Bugs Software Ruby, C#, and Erlang Agile Contract Programming in Silicon Valley From forum-watir-users at openqa.org Fri Dec 29 20:55:09 2006 From: forum-watir-users at openqa.org (kim) Date: Fri, 29 Dec 2006 19:55:09 CST Subject: [Wtr-general] the problem about test cases organization. In-Reply-To: Message-ID: <49253908.1167443739504.JavaMail.oqa-j2ee@openqa01.managed.contegix.com> Thanks for your answer. But I don't konw how to set up the test-report in Windows. Copy them into ruby's "lib" directory directly? --------------------------------------------------------------------- Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=5943&messageID=16669#16669
") output_html_file.write(column_names[i]) output_html_file.write("
") output_html_file.write(step_number) output_html_file.write("") output_html_file.write(result_or_results[i]) output_html_file.write("
") output_html_file.puts("