I think this is in contrib:
http://jira.openqa.org/browse/WTR-53
On 7/10/07, mihai [EMAIL PROTECTED] wrote:
exist method does not work, because the control exist but its hidden, and
there is not a hidden? methodthat the reason for what ive asked if how i
can find out that a control is
Any thoughts???
I think this is the same issue I reported here:
http://jira.openqa.org/browse/WTR-152
There is a pure-javascript workaround, see if that does the job for you.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
I'm interested in how many registered users the project has.
Other information like page traffic, downloads, would be fun to know also.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
So here's the question: Why aren't the csv results in the order of the hash?
And what order /are/ they in? There seems to be some method to the madness
here, because they come out consistently in the /same/ order...but it isn't
the order they are listed in the hash, or alphabetical by key or
I'm not a huge expert at this stuff, but I've tripped over it before.
...and here comes Chris McMahon, champion of the off topic question! Thanks
dude. I half-wondered if my tagging my post as OT would call you out. ;)
heehee!
I am so not-Ruby not-Watir these days. I am heads-down-elbows
Because of the increased traffic on this list and the ongoing troubles
we have had keeping the forums and mailing list synchronized, I have
been considering migrating watir-general to google groups. I would like
to hear comments on this idea, as well as other suggestions.
+1
Now that I'm
On 6/7/07, Norris [EMAIL PROTECTED] wrote:
Hi,
I'm currently having trouble selecting a list box item, any solutions?
For example, I'm trying to select the Quantity from the attached Gap site,
but I can't.
http://www.gap.com/browse/product.do?cid=7389pid=453549
I hope Charley answers
I have got a script that creates an 'excel_file' while running. After
running, I want to rename it so that next time, when the script is run, it
will create the excel file anew. Can I do that? I tried a few DOS commands
but I could find only two DOS commands working in Watir. They are
On 6/6/07, Lana [EMAIL PROTECTED] wrote:
Thank You,
here is my final basic piece working with your help:
You're welcome, I'm glad you got it to go!
___
Wtr-general mailing list
Wtr-general@rubyforge.org
On 6/5/07, Lana [EMAIL PROTECTED] wrote:
How would you approach verification of data in *xml* format with Watir
through the browser?
data example: _http://www.live365.com/stations/easytempo?site=xml_
is there some XMLParser available?
My understanding is that REXML is pretty much the
It's been a while since I've mucked around with REXML, but this works:
#
require rexml/document
include REXML
xml = REXML::Document.new(LIVE365_STATION_INFO
STATION_BROADCASTERusername/STATION_BROADCASTER
/LIVE365_STATION_INFO)
xml.elements.each(*/STATION_BROADCASTER)
2. Is Firewatir completely operational like Watir? (though, I could see that
firewatir is being used currently, I just wants a confirmation from the
appropriate persons)
In a sense.
Think of it like this:
Watir is a set of instructions in Ruby for manipulating Windows OLE
and COM
So, this shows that we've outgrown the current script and need something
more robust (probably proper parsing through REXML), and that when you least
expect it, consultants will throw a few landmines under your scooter.
I'd like to underscore this point:
IF YOU HAVE XML, USE AN XML PARSER TO
The tool is called Raakt (Ruby Accessibility Analysis Kit) and the
project wiki can be found here:
http://www.peterkrantz.com/raakt/wiki/
This is very cool and I'm going to try it out.
But your site looks awful in Firefox on OS X. :)
___
Wtr-general
Hmm, error on both Windows and Mac from the demo script:
raakt.rb:14: uninitialized constant Raakt (NameError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
from raakt2.rb:4
The error below is from the command-line script.
On 5/25/07, Chris McMahon [EMAIL PROTECTED] wrote:
Hmm
It must be Friday.
Some free advice: don't name your test file raakt.rb.:)
On 5/25/07, Chris McMahon [EMAIL PROTECTED] wrote:
Error from the standalone script also Windows and Mac:
mechanize.rb:334:in `to_absolute_uri': no history. please specify an
absolute URL (RuntimeError
Aslak Hellesoy's been working with Watir:
http://blog.aslakhellesoy.com/2006/12/2/getting-screenshots-from-watir
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
Maybe you're running out of memory? Take a look at taskmanager, or
see if you can run more browsers on a beefier machine. I know I've
personally run about 80-90 browsers simultaneously on a single desktop
some time ago, but they weren't holding any large amounts of test
data.
Just BTW, you'll
We don't have a more elegant way of dealing with Basic Authentication
yet. Someday Watir might borrow some of the code from Net::HTTP to do
this, but it won't be happening any time soon.
If you search the archives, you'll find some discussion of me trying
to hack Basic Auth into Watir's goto()
Might be worth trying Mechanize to bypass the nasty UI:
http://rubyforge.org/projects/mechanize/
-C
On 5/21/07, Erik Oliver [EMAIL PROTECTED] wrote:
A web page I'm trying to automate with Watir works as follows: Visible
to user is a link to a javascript (JS1), JS1 in turn sets a bunch of
You might be interested in my venerable Perl controller below. It
launches a ruby script using system(1,), which returns control to the
calling process. A short explanation of how system() does this is
here: http://perlmonks.org/?node_id=547218
use warnings;
use strict;
use Win32::GuiTest
My experience is that the include Watir line is never understood and
in fact people end up thinking that it is some kind of magic. That, to
me, is a reason to avoid it.
Eh. I had the opposite experience. It made me go read about what a Module is.
I meant to the new user, all of this looks like magic, so we might as
well break down the Watir setup commands in as granular a fashion as
possible
On 5/18/07, Bret Pettichord [EMAIL PROTECTED] wrote:
Chris McMahon wrote:
Eh. I had the opposite experience. It made me go read about what
I just think
ie = IE.new
is nicer than
ie = Watir::IE.new
On 5/18/07, Željko Filipin [EMAIL PROTECTED] wrote:
On 5/18/07, Chris McMahon [EMAIL PROTECTED] wrote:
I meant to the new user, all of this looks like magic, so we might as
well break down the Watir setup commands in as granular
From my perspective, I always start out by requiring and including watir,
because I'd rather paste it into the top of a script once than have to type
Watir:: several times below.
I was planning to say that I'd love to have watir automatically included
whenever I require it...but that might
...or was my question so simple nobody felt like addressing it?? I would
really appreciate some guidance. I have a script with 66 test cases that I
was wanting to test this way...but it's apparently not giving me the correct
test results??
Again, if you have any ideas...please reply.
I
On 5/17/07, Željko Filipin [EMAIL PROTECTED] wrote:
Can you tell that it is past 1 am here? I forgot the link. Here it is.
http://wiki.openqa.org/display/WTR/New+Watir+User+Guide+%28beta%29
Clearly this is going to be iterative :)
If it were me, I would have done
require 'watir'
include
BODY\r\n
DIV class=wikiReplace this text with your own. BR/DIV
/BODY
I have a DIV whose class is wiki. (It's in an iframe, but that
doesn't matter.)
I would like to manipulate the contents of this tag. I know it can be
done with raw javascript, but I haven't been able to figure out how to
do
On 5/16/07, Bret Pettichord [EMAIL PROTECTED] wrote:
Paul Rogers wrote:
ie.div(:class , 'wiki').ole_object.invoke('innerText' , hi Chris)
My guess would be
ie.div(:class , 'wiki').ole_object.innerText = hi Chris
Interesting, I've never hit this part of Watir before. Any chance of
doing
ie.div(:class , 'wiki').ole_object.innerText = hi Chris
Interesting, I've never hit this part of Watir before. Any chance of
doing this in FireWatir?
Answering my own question, I'll bet that s/innerText/textContent/
would work. (Thanks Selenium reference page!) But I haven't tried
it
Could you say more words about what you are suggesting.
Quoting from the Selenium reference:
storeText ( locator, variableName )
Gets the text of an element. This works for any element that
contains text. This command uses either the textContent (Mozilla-like
browsers) or the innerText
Neither Watir nor Selenium nor FireWatir currently provides commands for
munging text directly. To me this sounds like something that is outside
the scope of a testing tool. Can you elaborate on the scenario that
makes you want to do this? Is it testing related?
Yes, it's testing. My
Paul, Bret, I tried both syntax examples and got errors on both. Do
you see anything wrong with
ie.frame(:index,1).div(:class, 'wiki').ole_object.innerText = McChris
was here or
ie.frame(:index,1).div(:class,
'wiki').ole_object.invoke(innerText,McChris was here)
I'm using the latest Watir
And here's the watcher script:
def initialize(title)
@autoit = Watir.autoit
@title = title
end
I don't know how interested you'd be, but if you'd like to try to
build a watcher with a Ruby GuiTest instead of autoIt, I'd be
interested in what happens:
I have been looking at the win32utils set of gems on rubyforge lately.
The win32-process gem includes a windows implementation of fork that may
be promising.
I looked at this some time ago, but it turned out be really stupid.
Sorry, I don't remember the details, but it quickly becomes clear
Has anyone got any ideas? Has anyone else gotten WATIR running on Windows
Vista in 64-bit mode?
I'm interested in an academic sort of way.
Does Ruby itself run? Does IRB run? What are your error messages?
___
Wtr-general mailing list
On 5/10/07, Walter Kruse [EMAIL PROTECTED] wrote:
I am very keen to have this done, but leeching isn't nice and I can't
write C. If there is forward movement on win32guitest, I volunteer to do
a document for it, either a user guide, or something in the style of
this:
I had occasion today to measure page load times in anger using
FireWatir. I don't have a regular Watir installation handy, but I
know Watir tracks the latest page load times in a variable called
down_load_time or download_time or something similar.
FireWatir doesn't have this feature. I used
Neat. I guess I should have just written the code and tried it out.
On 5/8/07, Bret Pettichord [EMAIL PROTECTED] wrote:
Chris McMahon wrote:
I can think of a couple of ways to do this, but they're all painful in
one way or another. Ruby being Ruby, I wonder if there's some nifty
shortcut
, I was able to click the link and get the new page with
ff.link(:text, Help).click
So that's FireWater 1, Selenium 0. :)
On 5/8/07, Chris McMahon [EMAIL PROTECTED] wrote:
I was able to click on the help link which opened in new window. Currently
you can connect to only new window not new tab
This is odd:
require 'rubygems'
require 'firewatir'
require 'test/unit'
require 'firewatir/testUnitAddons'
include FireWatir
ff = FireWatir::Firefox.new()
ff.goto(http://www.socialtext.net/stoss/index.cgi?mcmahon_test;)
ff.link(:text, Help).click
sleep 5
ff.attach(:title, /Documentation/)
include Test::Unit::Assertions # you need to mix in the assertion
methods if you want to use them outside of a testcase.
Thanks, got it, I should have seen that.
-C
___
Wtr-general mailing list
Wtr-general@rubyforge.org
Untested, but this will try to attach every two seconds forever:
def get_popup
begin
ie.attach(:title, My Window)
rescue
sleep 2
get_popup
end
end
##
You could put your counter in there with an exit clause.
On 5/9/07, Dhrubojyoti
On 5/9/07, Brown, David [EMAIL PROTECTED] wrote:
In case anyone can re-use them, I've posted a basic Watir training
presentation and some associated exercises that I've developed and used
a few times to train individuals groups in my company on the basics of
Watir. Feel free to re-use,
On 5/9/07, Bret Pettichord [EMAIL PROTECTED] wrote:
Paul Rogers wrote:
Id like the winclicker code to disappear and be replaced by a full windows
testing library ( How you getting along with that Chris ? ). Enough people
seem to want it.
I think a lot of people would like to see that.
Since integration of the various watirs is also part of the roadmap, I
expect that some of the better modal dialog support will also be
migrated to the other watir flavors. Perhaps I have the wrong impression?
I think it's a terminology problem: modal dialog is an artifact of
IE only.
Run the script below. The script runs without error.
But when you click the Help button manually, a new window or tab
(depending on FF settings) will open; but when clicking with
FireWatir, the new window does not open.
I would like to be able to click the link and then to attach to the
new
I can think of a couple of ways to do this, but they're all painful in
one way or another. Ruby being Ruby, I wonder if there's some nifty
shortcut. Given
floats = []
floats 3.456
floats 1.53
floats 5.123
show that the least element of the array is 1.53 and the greatest
element of the array
I was able to click on the help link which opened in new window. Currently
you can connect to only new window not new tab. Make sure you have allowed
popups for that site. I got error that Firefox prevented from opening a pop
up from the site. When I allowed pop ups I was able to click on the
Thanks! How should we contribute to the User Guide? It doesn't appear
to be user editable:
I'd suggest either adding to this thread, or contacting Zeljko directly.
Feel free to add my tutorial for installing FireWatir on Mac OS X
(Intel) (or let me know where I should add it):
Zeljko, how can we all help you?
The usual.
Suggestions. What to add, what to remove, what to change.
Comments on my changes. They will be bold.
Bacon. Those foxes demanded lots of bacon.
Chunky bacon!
One thing I would like to see featured prominently is a discussion not
only of how to
Im going to guess that this is a bug in 1.5
Seems like this would be an opportunity to sync up FireWatir with
Watir. I think Charley has been looking into some of that recently.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
On 5/4/07, Alien Ruby [EMAIL PROTECTED] wrote:
How are you guys so helpful ?
That's actually a really good question. The people who started Watir
had all participated in other Open Source projects, some successful,
some unsuccessful. The early Watir community insisted that everyone,
Good information. You and Charley and maybe some others should put
this in blogs so the wider world can find it.
On 5/4/07, Bret Pettichord [EMAIL PROTECTED] wrote:
I've been doing a lot of thinking and planning for what we need to do
with Watir. I've also been fairly quiet. I now have a new
On 5/3/07, Angrez Singh [EMAIL PROTECTED] wrote:
Hi Chris,
You might want to have a look at this for installing FireWatir or MAC OS X.
http://crasch.livejournal.com/550521.html
According to the troubleshooting section of this article, the error you are
getting is because of incorrect xpi.
On 5/3/07, Angrez Singh [EMAIL PROTECTED] wrote:
Hi Chris,
Did you tried the XPI at
http://alephzarro.com/blog/2007/03/12/jssh-for-firefox-on-linux-because-firewatir-loves-it
Its an XPI for linux but seems to work on Mac OS also (according the link i
sent you in last mail)
Yay! That one
The Developer Toolbar is great
http://www.microsoft.com/downloads/details.aspx?familyid=E59C3964-672D-4511-BB3E-2D5E1DB91038displaylang=en
Also, Watir has nice show_all_* methods we like to use from IRB.
Using the flash method from IRB is also recommended.
And eventually, you even get pretty
Hi...
Seems like this script should work, but I'm getting
FireWatir::Exception::UnknownObjectException: Unable to locate object,
using id and id value
for both the buttons. I put the sleeps in in case it was a
page-rendering issue, but I don't think that it is.
(BTW, feel free to add
On 5/1/07, Bret Pettichord [EMAIL PROTECTED] wrote:
Paul Rogers wrote:
This may be a good thing to try and coordinate with Chris Macmahons
Win32guitest port.
Where can i find out more about this?
http://rubyforge.org/projects/guitest/
I've mostly been a cheerleader, but there is working
The purpose of pausing the testing is to let people have time to check the
status of GUI and device under test, after running some test cases or some
steps of a test case.
There is a really simple way, if this helps:
puts type anything and hit return to resume the script
Look up ruby system or exec commands.
Also consider connecting to the DB directly with ODBC or DBI.
-Chris
On 4/30/07, alan [EMAIL PROTECTED] wrote:
In my watir script i would like to have it go to open a dos command window
and start sqlplus, then run a simple query to see if a member exists,
t'd be nice to work on his basic conceptual view and present
a basic programming using Ruby class, wearing bunny suits of course.
With ukuleles. Propose it for Agile2008. I am *so* there.
-Chris
___
Wtr-general mailing list
Wtr-general@rubyforge.org
On 4/23/07, Jason [EMAIL PROTECTED] wrote:
I ran this by Bret and he suggested posting it on the Wtr-General to get some
feedback from others. So please let me know what you think.
I'd wear it to next year's http://mtnwestruby.org, so no hurry. :)
But I like the idea.
I'm not comfortable with truncating the original file either. What I
would like to do is get the latest data, see what's not in the main
file, and append it.
I'm reading this sentence as a set of requirements. Assuming that the
arrays are small enough to not blow out the RAM on the machine,
error: first line\r\n\r\nsecond line expected but acutal was /fist
line\s+secondling/
Your application has badly misspelled the message to the user.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
\s+ means match any white space characters, so the regex will
match any number of tabs, spaces, crs, and/or lfs.
On 4/16/07, vamsi [EMAIL PROTECTED] wrote:
thanks for your help and it is working for single return... however i have 2
carriage returns after first line.
ex: data=first line
How does one get the value of a variable into a regular expression?
require 'test/unit'
class TC_Spike Test::Unit::TestCase
def test_1950
var = 1950
data = xxx1950xxx
assert_match(/#{var}/,data)
end
end
___
Wtr-general mailing list
[EMAIL
Watir Result is like this: Do you want to continue. \n Click on continue
Button. expected but was
Do you want to continue. \r\n Click on continue Button?
So that \r\n means carriage return -- line feed, and it has a long
history. http://en.wikipedia.org/wiki/Carriage_return
What's bad in
This makes my head hurt:
http://seejay.wordpress.com/2007/04/11/firefox-inside-firefox/
___
Wtr-general mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/wtr-general
-
Unable to locate object, using index and 5--- This is the exception
thrown.
Do you get anything if you try smaller values of index, like 1 or 2?
It might choose the wrong one, but you would know if it's working at
all.
I ran across this, and it's worth sharing...
Dan Manges blogged about what he calls Ruby anti-patterns. I might
argue with some of them, but he's got some great examples of efficient
ways to do some things that we all do every day:
http://www.dcmanges.com/blog/28
On 4/10/07, Charley Baker [EMAIL PROTECTED] wrote:
This is an offtopic post on Selenium and a recent release from TIBCO with an
ajax testing framework:
http://ddj.com/198702228;jsessionid=OP1CXLIHSLECCQSNDLPCKH0CJUNN2JVN
?
Thoughts?
It's weird that it's from TIBCO, who sell EAI products and
On 4/3/07, Fletch [EMAIL PROTECTED] wrote:
Thanks for your replies,
The date guide was really good, but as it is only a String comparison, I did
not want to over complicate the code.
I have also tried the other two suggestions, and have still not been able to
get the match to work.
I think
I'm trying to put a loop in a script where it checks for a link on a page, if
the link isn't there, it clicks on the next page button, looks for the link
again, and the process repeats until it finds the link, and then clicks on it.
It'd be easier to help if you would post a) the HTML
Aha, so you want to click Google's Next button? Take a look at
this, it might give you some ideas:
http://testingjeff.wordpress.com/2007/01/27/creating-methods-on-the-flyand-bugs-in-google-phonebook/
Also, if you are unsure how to address a particular page element, take
a look at the unittests
TW is about to release this thing called Mingle to manage agile
projects. Today they announced an upcoming tool for testers:
http://studios.thoughtworks.com/2007/4/2/how-our-testers-use-mingle
(see the last paragraph).
___
Wtr-general mailing list
If I use a constant '01/01/07 - 01/01/08' there is no problem, but I need
some way to deal with the dates in the parameters.
escape the slashes: /01\/01\/07/ - 01\/01\/08/
That said, anytime I deal with dates, I usually try to make them
actual date objects, then I can assert interesting
The number of variables is not going to be a problem. But watch out
if you have for instance several arrays with 50,000 elements in each.
Those can eat up some memory.
Ruby has what's called a garbage collector that handles removing
things that the script is done with.
-Chris
On 3/28/07, vijay
On 3/28/07, Maloy kanti debnath [EMAIL PROTECTED] wrote:
hi,
IS there any function which is simlar like VB 6.0 GOTO so
that we can say
if condition
goto line 8
else
goto line 20
end
GOTO is not a very good way to do such things. Try using methods:
I run Brad's code with no problem (thanks for the example!).
Googling, I find that IEnum interface is an error coming from Ruby's
WIN32OLE library. The root cause seems to be some kind of error in
the interface between Ruby and Windows on the particular machine.
One very suggestive issue is
Sorry I can't help more.
I'm using ruby 1.8.5 (2006-08-25) and Watir 1.5.1.1158, WinXP.
You might try playing with OLE directly. For instance, try to move
object from Paint to Word, or something. See if you can get the same
error from pure MS applications.
-C
On 3/26/07, Brad [EMAIL
In all it only took 5 rails controllers (less than 100 lines total) and 5 or
6 separate views. (And I'm sure it could be compacted even more.) I came
out of the experience pretty impressed with rails. If there's interest I can
try to clean up the code and post it.
I'm interested as
On 3/22/07, Oscar [EMAIL PROTECTED] wrote:
Thanks, I'm looking into it now.
Another thing I thought of with the help of someone at my work was to send
the http headers along with my request for the url. I fired up Ethereal to
capture the packets and found out some information about the http
On 3/22/07, Charley Baker [EMAIL PROTECTED] wrote:
Well, if you want to go down that roadyou could investigate using
Navigate2 on the internal ie ole_object.
ie = IE.new
ie.ie.Navigate2('http://www.google.com',0,'','' )
Aha. I might get around to trying this today, if I can find a site
I have a long-running script that occasionally encounters a server
error. I've been considering putting in some retry logic (there are
only 5 clicks in the script) that would just hit refresh if
something went haywire.
I didn't think Watir had a refresh method, but I went and looked,
and there
question: @ie.refresh2(3)?
To: wtr-general@rubyforge.org
http://msdn.microsoft.com/workshop/browser/webbrowser/reference/methods/refresh2.asp?frame=true
- Original Message -
From: Chris McMahon [EMAIL PROTECTED]
To: wtr-general@rubyforge.org
Sent: Sunday, March 18, 2007 11:48 AM
Subject
On 3/15/07, Kevin Rutherford [EMAIL PROTECTED] wrote:
Hi,
Does anyone have any idea what's broken in my environment please?
Many thanks,
Kevin
Different versions of Ruby maybe?
BTW, there is detailed information about which tests didn't pass. I
think it goes to STDERR, though, not
Nop,e checked that. Besides, the irb session I pasted is verbatim.
Run the unit tests from the command line and check the output. At the
*very end* of the entire run (that is, don't kill the process in the
middle), you should have some ... characters, some F characters,
followed by the
There is a good discussion of this on p. 159-160 of Programming
Ruby. (Second edition). If you spend any significant time with Ruby,
having this book is really important.
-Chris
On 3/14/07, Jet Aquino [EMAIL PROTECTED] wrote:
Hi,
I was wondering if you guys can help me out. I'm kinda lost in
Bravo!
-C
On 3/2/07, Brown, David [EMAIL PROTECTED] wrote:
I've posted an Excel Interface class which I've developed over the past
few months on the Watir openqa.org site under contributions:
http://wiki.openqa.org/display/WTR/Excel+interface+class
This class provides simple methods for
On 3/1/07, Jason He [EMAIL PROTECTED] wrote:
Hi all,
Is there any available method to fetch the localhost's IP address?
irb(main):001:0 require 'socket'
= true
irb(main):002:0 ip_address = IPSocket.getaddress(Socket.gethostname)
= 192.168.2.106
irb(main):003:0
I could probably make the third option work in Ruby. I have not worked with
databases yet, but I hope it would not be too hard. I just wonder if there is
a more simple way
That sounds like a reasonable approach. I wrote an article for this
month's Better Software with very simple exercises
That's a frame. You need to do something like
frame(:name, 'Quickwatch').show_all_objects
On 2/22/07, Simba [EMAIL PROTECTED] wrote:
Thanks Bret , Toady i have seen that limitation in Watir site , i did not
knew this limitation in Watir and also i am new to Watir , I have another
question
They work if these tests are run individually. However, when I run the
class, they fail, since the TC#1 already created the user jdandy.
So, how can I call this batch file in between each TC, with the batch file
completing before starting TC#2?
You might consider making a direct database
On 2/22/07, Walter Kruse [EMAIL PROTECTED] wrote:
Bret,
I had a look long ago at Piotr Kaluski's very detailed docs for Perl's
Win32GuiTest
(http://www.piotrkaluski.com/files/winguitest/docs/winguitest.html).
He even lists some C code examples. I'm afraid C is a little beyond
me...
Wayne
Thanks for taking the time to look at this. If you are referring to
Ruby/OCI8 for Oracle, yes I already have that installed. Any other ideas as
to how to get this fixed?
Clearly you *don't* have it installed, or else it's installed
improperly. The message custom_require.rb:27:in
On 2/16/07, Bret Pettichord [EMAIL PROTECTED] wrote:
Here is a clever and elegant solution:
http://dannorth.net/2007/02/monkey-business-value
I read this yesterday, I was kind of surprised to find it coming from
a TW developer. This is *so* not unit-testing!
-Chris
def calc(weights)
r = weights.inject(0){|s,x|s+x} * rand
weights.inject(0) {|s,x| s+=x; return x if s=r;s}
weights[-1]
end
stat={}
stat.default=0
1_000_000.times { stat[ calc([0.2, 0.5, 0.1, 0.3]) ] += 1 }
stat.each {|k,v| printf %4.2f %4.2f\n, k, v/1_000_000.0}
One major
One major drawback for this is that it won't work out of the box for
values like calc([0.1,0.1,0.8]) That is, call def a 10% of the time,
def b 10% of the time, def c 80% of the time. It seems input values
have to be unique.
Here's something that does the job, but I can't help thinking
1 - 100 of 360 matches
Mail list logo