Re: [Wtr-general] Any function for getting random values

2007-01-11 Thread Angrez Singh
Hi Sarita, chars = ("a".."z").to_a + ("A".."Z").to_a random_string = "" 1.upto(5) { |i| random_string << chars[rand(chars.length - 1)] } puts random_string This will generate random string of 5 chars in length. To generate large string change 5 to whatever length you want. The generated string w

Re: [Wtr-general] Any function for getting random values

2007-01-11 Thread sarita
What about char values. If i want to enter a random string, how i will generate it. As you know in most applications duplicate values'r not allowed. So data has to be different each time we run the test. But changing data, each time the test is run, is burdensome. ---

Re: [Wtr-general] working with bitmap

2007-01-11 Thread Maloy kanti debnath
hi, I tried this code but it was not working require 'RMagick' include Magick im = Image.new('C:\Documents and Settings\Administrator\My Documents\My Pictures\SAI1.jpg') im.display exit can you please help me out . thank you maloy

Re: [Wtr-general] Speed of Firewatir vs. Watir

2007-01-11 Thread Angrez Singh
Hi Bach, Could you please let me know the scripts or the statements that failed? Regards, Angrez On 1/11/07, Bach Le <[EMAIL PROTECTED]> wrote: Hi Angrez, I did not have any problems installing FireWatir. I followed the installation guide at http://code.google.com/p/firewatir/ and it wor

Re: [Wtr-general] Any function for getting random values

2007-01-11 Thread Angrez Singh
Hi Sarita, You can use rand(int) where integer specifies the range. For eg: rand(100) will generate random numbers between 0 to 100. For more info: http://www.rubycentral.com/ref/ref_m_kernel.html#rand Regards, Angerz On 1/12/07, sarita <[EMAIL PROTECTED]> wrote: Is there any function avai

Re: [Wtr-general] Error with file_field in a modal window (using

2007-01-11 Thread Angrez Singh
Hi Bret, I'll go ahead with using "rubyw" and will make the changes to code. Regards, Angrez On 1/11/07, Bret Pettichord <[EMAIL PROTECTED]> wrote: Angrez Singh wrote: > I would like to add something here. > > 1. In the file 'winClicker.rb' and method 'clickJSDialog_NewProcess()' > myapp

[Wtr-general] Any function for getting random values

2007-01-11 Thread sarita
Is there any function available to get random values (char or int) so that values can be assigned from the system itself. - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6096&messageID=17082#17082 __

Re: [Wtr-general] working with bitmap

2007-01-11 Thread Maloy kanti debnath
hi, i mean to check the expected image to the actual image in a web application. Same as bitmap checkpoint in Winrunner or QTP ... i need to check the image pixel-by-pixel .. thank you, maloy - Posted via Jive Forums http://

Re: [Wtr-general] working with bitmap

2007-01-11 Thread Bach Le
I think he means checking if one image is the same as another image pixel-by-pixel and if that is the case, rmagick should be able to do the trick although I have not tested it out myself. Message was edited by: beefandbachle -

Re: [Wtr-general] What does IE.down_load_time really measure?

2007-01-11 Thread Paul Carvalho
Okay, I didn't want to reply right away without trying a few things first. My results seem to be consistent in that my second counter is always larger than the default down_load_time value. On 10/01/07, Bret Pettichord wrote: The "down_load_time" is the amount of time that watir waits in the wa

Re: [Wtr-general] Alert box - hangs

2007-01-11 Thread usha
Aha! it worked. with this. wc = WinClicker.new wc.clickWindowsButton("Microsoft Internet Explorer", "OK") Just changed OK to Cancel - which worked and then back to OK and then it worked. Well whatever works!. Thanks to all - Po

Re: [Wtr-general] Alert box - hangs

2007-01-11 Thread usha
my previous post has the html and the script I have. I am not seeing any errors. Script just hangs till I manually close the Alert. Appreciate any help. Thx - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=

Re: [Wtr-general] OT: Need help Trapping Errors in Ruby

2007-01-11 Thread Paul Carvalho
Hi Nathan, thanks for the follow-up. I do have it working, as per my last message in this thread, but I'll offer some additional info here since you asked. The $something_went_wrong variable is a legacy variable from when I first wrote these scripts using Watir and I was trying to tell the scrip

Re: [Wtr-general] problem in accessing element of a web page

2007-01-11 Thread Bret Pettichord
VIKASH KUMAR wrote: > > If I use sleep 5, or sleep 10 then it works for me, but I want to > avoid using sleep in my code, what should be the better approach of > doing this. > Have you tried "ie.wait"? ___ Wtr-general mailing list Wtr-general@rubyforge.

Re: [Wtr-general] OT: Need help Trapping Errors in Ruby

2007-01-11 Thread Nathan Christie
When you say, "...the "rescue => e" part of page_set_to_check() doesn't run like I would expect it to..", what exactly do you mean. Am I correct in assuming that the `$something_went_wrong` variable is used inside of the `write_status` method? If so, is the incorrect behavior coming from what t

Re: [Wtr-general] Need Regular Expression help with a URL string

2007-01-11 Thread Paul Carvalho
Thanks Alan! That works better than what I was trying to do. Now I can create the new URL with a line like: new_url = ie.url[/(.*)\//] + "new_page.html" Sweet! I was trying expressions like =~ /\&\// but wasn't having any luck. Cheers! Paul C. On 11/01/07, Alan Ark <[EMAIL PROTECTED]> wro

Re: [Wtr-general] Need Regular Expression help with a URL string

2007-01-11 Thread Nathan Christie
Might be a little sloppy, and I'm sure there is a more effecient Regex operation to do this, but this works. myURL = 'http://foo/bar.html' destURL = 'leetPage.html' myURL.sub( /\bfoo\/.*/, 'foo/' + destURL ) Basically the Regex inside the string sub() function looks for the first instnace of `

Re: [Wtr-general] working with bitmap

2007-01-11 Thread Nathan Christie
Can you be more specific please? Do you need to validate filesize, filename, modified date between two images? - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6089&messageID=17063#17063 _

Re: [Wtr-general] Need Regular Expression help with a URL string

2007-01-11 Thread Alan Ark
Hi Paul. The following should work: irb(main):001:0> web_url = 'http://foo/bar.html' => "http://foo/bar.html"; irb(main):002:0> web_url=~/(.*)\// => 0 irb(main):003:0> p $1 "http://foo"; nil The regex (.*)\/ Mean to match everything you can to a slash. Since the * operator is

[Wtr-general] Need Regular Expression help with a URL string

2007-01-11 Thread Paul Carvalho
Okay, I give up. I've worked on this for over an hour and I need more experienced help. (Web searches and book references haven't helped either.) I have a URL in a string and I'd like to replace part of it but first I need to find the part that I care about. Here's an example of the string: w

Re: [Wtr-general] working with bitmap

2007-01-11 Thread Bach Le
I'm not sure if this well help you in any way but rmagick is a library for ruby that can be used to do image processing such as comparisons and such but you need both the source and target image. - Posted via Jive Forums http://f

Re: [Wtr-general] Speed of Firewatir vs. Watir

2007-01-11 Thread Bach Le
Hi Angrez, I did not have any problems installing FireWatir. I followed the installation guide at http://code.google.com/p/firewatir/ and it worked like a charm. I tried to run a few scripts that I had successfully run with Watir and they seemed to break when it got to clicking buttons in f

Re: [Wtr-general] a common error

2007-01-11 Thread Bret Pettichord
> Nobody is listening on port 9002 on localhost. > Why are you using drb? Sarita is working through the scripting101 exercises and timeclock uses drb. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-ge

Re: [Wtr-general] Error with file_field in a modal window (using

2007-01-11 Thread Bret Pettichord
Angrez Singh wrote: > I would like to add something here. > > 1. In the file 'winClicker.rb' and method 'clickJSDialog_NewProcess()' > myapp = "[EMAIL PROTECTED]/clickJSDialog.rb #{button} > " > winsystem(" start #{myapp}") >

Re: [Wtr-general] Alert box - hangs

2007-01-11 Thread Cain, Mark
Can you send your code and html so I can see what you're doing? --Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of usha Sent: Wednesday, January 10, 2007 4:13 PM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Alert box - hangs I'm using IE

[Wtr-general] installing watir from trunk

2007-01-11 Thread Ċ½eljko Filipin
I checked out Watir with TortoiseSVN and build a gem from revision 1142. But when I built the gem, it had name watir-1.5.1.1141.gem (revision number is not the same as the number in the gem name). Is that OK, or am I doing something wrong? I installed and executed tests while logged in as adminis

Re: [Wtr-general] Error with file_field in a modal window (using

2007-01-11 Thread John Lolis
Thanks Bret! Everything is working perfect now. (who do i send the beer to?) - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6074&messageID=17052#17052 ___ Wtr-gen

[Wtr-general] working with bitmap

2007-01-11 Thread Maloy kanti debnath
hi, Can we do some think for doing the bitmap check in WATIR . for some application where i want to check the image with the original one . maloy - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6089&messag

[Wtr-general] problem in accessing element of a web page

2007-01-11 Thread VIKASH KUMAR
I am running running a test case in windows platform. Some of the time page can't get downloaded fully, due to slow speed, then my code breaks, by giving message object not found - something like this. If I use sleep 5, or sleep 10 then it works for me, but I want to avoid using sleep in my cod