I am looking at your unittests
example jscript_test.rb and can't figure out what check_dialog refers to?:
check_dialog('jscriptExtraAlert',
/Alert OK/){ $ie.button(:id, 'btnAlert').click }
In my application, I am trying to figure out how to
click on the image "/image/icon_open.gif"
Thanks, Shao. Your suggestion:
irb(main):007:0> ie.frame("main").frame(:name,"context_bar").image(:src, /icon_open.gif/).fire_event("onmouseover")
works great!
Now I know what to do with images.
___
Wtr-general mailing list
Wtr
Instead of doing this:
ie.frame(:name,
"portfolioTreeContent").frame(:name, "treeframe1120166572909").getHTML
How can I do this:
ie.frame(:name,
"portfolioTreeContent").frame(:name, "treeframe*").getHTML
I want to put a wildcard in the last
part of the "treeframe" name where
Thanks for your suggestion,
Bret. I did try it and got this:
irb(main):050:0> ie.frame(:name,
"portfolioTreeContent").frame(:name, /^treeframe/).html
Watir::Exception::UnknownFrameException:
Unable to locate a frame with name (?-m
ix:^treeframe)
from c:/ruby/lib/ruby/site_ru
Thanks, Shao. It didn't work
either.
However, I was just informed by
Jonathan that:
"That is a bug that Bret identified in Watir. Frames are not
found
using regexps like other objects. I hope that will be fixed
in the next release."
I am wondering if there is a way I can do th
Hi Bret, Per your response: "Yes, i see.This is a bug in watir. We don't support regexps with frames, but we should."
Would you mind telling me if this feature will be in the next release?And when would that be? J We have a lot of frames that will need regexps to get to the information.
How do I extract "treeframe1120266500902"
from this String class and stored it in a variable to be used later in a Watir
command?
irb(main):205:0> puts c
*
border=0 name=sidebar_header marginWidth=0 marginHe
ight=0
src="">
amp;showHelp=true&common.sessionId=sGCq3td6d5iQGx94y
Thanks, Atilla for your suggestion.
It turns out there is a simpler way
to get what I need and it works just great ( for me: regular _expression_ is
worth learning J)
c = c[/treeframe\d+/]
___
Wtr-general mailing list
Wtr-general@rubyforge
Thanks, Bret. I appreciate it!
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
I can't seem to be able to
find the right attribute to click on. I want to click on the Export icon
(image). This should work, but I got an error
Another pair of eyes to look at this
would really be appreciated:
irb(main):030:0>
ie.frame("main").frame("header").image(:src,
/icon_export_
Sorry, I made a typo, but it still didn’t
work even with the right syntax:
irb(main):035:0>
ie.frame("main").frame("header").image(:src,
/icon_export.gif/)
.click
Watir::Exception::UnknownObjectException:
Unable to locate object, using src and
(?-mix:icon_export.gif)
from C:/r
Thank you Shao. Alas, your good
suggestion didn't work either.
irb(main):037:0>
ie.frame("main").frame("header").image(:src,
/icon_export\.gif/).click
Watir::Exception::UnknownObjectException:
Unable to locate object, using src and
(?-mix:icon_export\.gif)
from C:/ruby/lib/rub
I finally talked to the Engineer that
wrote the code, and she suggested this command that did the job (whew!):
irb(main):048:0>
ie.frame("main").frame("body").frame("tabs").image(:src,
/icon_customize.gif/).click
What I don't understand is why this
didn't show up when I did the show
This statement executes just fine
when looking at the GUI, but the command prompt shows a warning.
I am not sure what to fix since it
does click the MMIM object just fine.
irb(main):005:0>
ie.frame(:name, "portfolioTreeContent").frame(:name, treeframe).link(:text,
/MMIM/).click
W, [11
I don't know why when I use the goto to launch my
application, it always
comes up not fully maximized.
However, when I do launch it from clicking on the IE icon on
my desktop
and typing in the url, the window is fully maximized. I
am Puzzled??
Is there a way to maximize IE within a .rb
in irb mode as well as within the
script, I got this error when trying to test for exists? for a frame:
error result from irb mode:
irb(main):009:0>
assert(ie.frame("main").exists?)
> NoMethodError: undefined method `exists?' for
#
> from (irb):9
> from
C:/ruby/li
I want to use the value rather than
the text since the text has spaces in it, but I don't know if doing
select by value is supported since I got an error:
irb(main):017:0>
ie.frame("customizeRemoteContent").select_list(:id, "availableColumnsSelectBox").select("|SYSTEM|AUSTRALIAN").fire_eve
In this select box, there are 2
items that have the word Sector in it:
1) GICS Sector
2) Sector
I am trying to select the item "Sector",
but I keep getting "GICS Sector" because it appears before "Sector".
I think \A should match the
beginning of a string but this doesn't seem to
Thanks for all your suggestions.
I was able to decipher the right
answer with the help of these 2 web sites:
http://www.regular-expressions.info/quickstart.html
http://samuelfullman.com/team/php/tools/regular_expression_tester_p2.php
(this is a great tool to test out
How can I clear a selection that was
previously selected?
1) Selecting this item works fine
irb(main):012:0>
ie.frame("customizeRemoteContent").select_list(:id, "availableC
olumnsSelectBox").select("-Descriptive
Data")
=> nil
2) But clearing it seems to not work
irb(main):013:0>
ie
I start my script without any IE
window open.
It always launches a brand new one
and there is no other IE instance open.
I don't know why it always
comes up minimized.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyfo
I tried /^Sector/ and it doesn't work either.
I thought my solution of using /[^GICS Sector]Sector/
will work since it works when I tested it with this tool
http://samuelfullman.com/team/php/tools/regular_expression_tester_p2.php
This is a web based regular _expression_ tester.
but in W
OH, please do add that as soon as
possible! It would save me so much time.
I have a WATIR demo next Wednesday
and trying hard to make it look good.
Having to wait for 20 seconds to
clear my select box is not a good "feature".
Thanks!
___
I vote for the suggestion below for
intuitive and consistency in implementing Select using Value:
The :value , :index and:text ( I guess ) is probably also more intuitive and more like the restof the api.
___
Wtr-general mailing list
I wish we have a "search"
engine for all the great postings so I can look up whether someone has posted a
question on how to handle the series of pop-ups that happen when you want to do
a Windows File Download (Export a File). Here are the series of windows
that appear when I Export a file
I have tried closing down ALL the
windows, and the only one opened is the DOS Command prompt window which I use
to launch the ruby script.
I even maximized that window.
Nothing else is opened. Yet, still, IE is launched minimized! What a puzzle!
For my demo, I have to manually
maximize
The select box I am using has
several nodes. The node I expanded to select from has about 100 items
underneath it.
I am using a single-select. I
believe as Bret mentioned that the reason it took over 20 seconds to
ClearSelection is because it iterates through all the items.
The scary
No dice. I was incorrect in saying
that IE came up "minimized", what I meant is that it came up NOT
fully maximized.
It is sort of three-quarters
maximized in width, but not quite, so I always have to manually maximize it.
I also tried closing down any instance
of IE and in irb and di
How do I find out if an item exists
in a Select Box?
I looked at the unittests selectbox_test.rb
and see that you can test for the existence of the Select Box,
but couldn’t find an example
for testing for the existence of an “item” in the Select Box.
I tried this, but got an error:
OK, I volunteer. I can give it a
shot since I need this feature.
I don't know what the process
it for submitting the code after I test it out though.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/
OK, I got it working. Easier than I
thought.
Attached is the WinMaximize.rb
To use it you need to:
1) copy the WinMaximize.rb to this
path:
C:\ruby\lib\ruby\site_ruby\1.8\watir
2) include at the top of the script:
require 'watir/WinMaximize'
3) add in the body of your
I have to pepper some sleep
statements in my script because the application I am automating takes a
variable amount of time to load a page.
I tried inserting some wait
statements for a frame but can't seem to do it for an object like an
image. I have to resort to sleep statements but some
I still get this error and cannot figure out why.
Any suggestion to debug this would be appreciated:
This statement executes just fine when looking at the GUI, but the command
prompt shows a warning. I am not sure what to fix since it does click the
MMIM object just fine.
irb(main):005:0> ie.fr
I tried many ways to validate whether a text exists on my page
("Import.csv"), but can't seem to make it work.
Also, the assert command doesn't return anything. Should it return true or
false or give some kind of message to let you know whether it worked or not?
irb(main):014:0> ie.frame("main").
Hmm!
This is what I coded in my script and I got nothing back, no "Passed", no
"Failed":
if ie.contains_text("Import.csv")
puts "PASSED"
else
puts "FAILED"
end if
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/l
I have this routine that calculates starting time and finished time, but I
can't figure out how to get the Elapsed time (finished time - starting
time).
I messed around with all sorts of permutations, but kept getting "0.00".
Any suggestion is appreciated, thanks:
require 'test/unit'
require 'tes
Thanks for the info.
Are you referring to the "Programming in Ruby" book by Dave Thomas 2nd
edition?
I couldn't find the code on the page you specified.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-gener
I am wondering if anyone out there is in the process or has
already switched from Segue’s SilkTest to WATIR.
Any feedback on how the process went or is going for you
would be appreciated?
We have adopted Segue’s SilkTest to automate our Web
application a few years ago, but we are not happ
I am back with this issue.
We have to resolve this “Access is Denied” issue;
otherwise, we can’t use WATIR (sigh!)
I am only able to use WATIR on our staging server which not
in the same domain as my computer.
But for some reason, our development servers cannot be
accessed by WATIR as sh
You are right. The development servers can serve the
page from different servers because there is a “traffic” cop server
that manages the load. I don’t think that’s the case for our
staging server.
I hope I included the info you need below, but if not,
please let me know the exact irb co
Thanks, Bret for your suggestions. Still some issues though….
Any suggestion is appreciated!
I used this command:
irb(main):002:0> ie = Watir::IE.new
irb(main):004:0* ie.goto("https://qa-b1.test.com/araneae/login")
ð 8.547
ð
Which worked fine, but then I did this comma
I checked with the engineer that knows the hardware/software
configuration of this application and forwarded him your take on why the error
is generated, and here is his answer:
“I don't
think this is the case. All the requests are being processed from one domain. I
think the microsoft
below will work if the object is at the main level as this example is, but won’t work if the object is found within frames like the example above: At 05:06 PM 7/25/2005, Tuyet Cong-Ton-Nu wrote:>irb(main):005:0> ie.frame("main").text_field(:name, >"UserId").fire_even
After a test has finished running, is there a way to send
out an email notification to several people to notify them whether the test has
passed or failed?
We use blat.exe for our SilkTest application to send out
emails. What options do we have for WATIR/Ruby?
__
Thanks, Mark. I did find CDOEX.DLL on my
machine, so I copied your code and ran it, but got this error:
C:\watir\watir>email2.rb
C:/watir/watir/email2.rb:20:in `method_missing': Send
(WIN32OLERuntimeError)
OLE error code:80040220 in CDO.Message.1
The "SendUsing" configurat
Thanks for the good link, Zeljko.
I also tried using the example from the link but didn’t
get anything through.
Probably didn’t enter the right SMTP.
Would you mind posting an example that worked for you?
Thanks!
___
Wtr-general mailing
Sure, here is the attachment to be added to the Wiki page.
Comparisons between Watir and SilkTest.doc
Description: MS-Word document
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
Thanks, Mark. I did as you suggest and executed each line
in irb, and here it what I got, still an error even with capital S and small s:
irb(main):014:0> cdoMail =
WIN32OLE.new("CDO.Message")
=> #
irb(main):015:0> cdoMail.From =
"[EMAIL PROTECTED]"
=> "[EMAIL PROTECTED]"
irb(main):0
Thanks Zeljko. I copied your code and
made the appropriate changes and got this error.
Is this a security issue from the SMTP server that I sent the email to?
C:\watir\watir>email.rb
c:/ruby/lib/ruby/1.8/net/protocol.rb:83:in `initialize': No
connection could be
made because the tar
I have the same problem and was going to post this, so
thanks Jan for doing it first.
I use sleep statements but have to tweak the time because it
varies how long it takes to load the page.
I hope the fix will be in the next release. I use a lot of
attach statements and the scripts fail
OK, I figured out why it didn’t work, the SMTP name
was wrong. But it’s working now.
Here is the code that worked:
require 'net/smtp'
msgstr = "This is a test email message"
# using block form of SMTP.start
Net::SMTP.start('isis.msci.com', 25) do
|smtp|
smtp.send_mess
I am able to see that this 3rd table has 10
columns and 24 rows.
irb(main):122:0> puts frame1.table(:index,
3).column_count
10
=> nil
irb(main):123:0> puts frame1.table(:index, 3).row_count
24
=> nil
How do I get the value of each cell for every row and every
column?
Here are so
Are the latest/greatest fixes available for download or is
it only for the developer at this point?
I know 1.4 is in the works but have been seeing some
patches/fixes that look like they are available.
Sorry, if I don’t understand how this works yet. Just
want to make sure I am in the lo
Thanks Paul and Jonathan for the explanation.
I did find the section that talked about tarball in the
Watir User Guide.
I have another important demo coming up next week,
So I think I will wait until after that to download the
latest code.
Appreciate the info.
I don’t know how to get back to irb when it gives me
this message:
Terminate batch job Y/N?
It doesn’t matter if I say Y or N, it terminates irb
and sends me back to the command prompt which is not what I want when
I select N. I want to be able to get back to the irb
command line and co
Thanks, Tim, for the suggestion. It very helpful!
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
1) In my script A, I have these commands that call a
do_click method:
w = RptFunctions.new
icon = "/icon_customize.gif/"
w.do_click(icon)
2) In the do_click method, I have this statement which
clicks on an icon (there are 5 possible icons it can click on)
ie.frame("main").frame("bod
Thanks, Shao. It didn’t work either.
I decided to do a CASE statement inside the called routine
and set the icon to the specific one depending on the icon number that I send
in from the calling module.
That seems to work.
___
Wtr-genera
I’d like to create a Test Plan that contains 2 or more
test cases.
How do I do that? I read the WATIR User Guide p.18/19, and
tried to copy what’s there, but nothing got executed.
I have two test cases:
1) login.rb
2) analysis.rb
1) This is the outline of Login.rb:
class TC_Login
One of the developers asked me whether WATIR can read and
process arguments from the DOS-prompt command line?
Is there an easy way for WATIR to interface with the command
line?
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://r
I still can’t get “Asserts” commands to
work in the irb.
I got all the “require” statements correctly
(they return true), but here are some asserts statements that don’t give
me back anything.
Maybe I don’t know how to use them or decipher whether
it’s true or false:
irb(main):046:1
You need these 2 attached files that will make it work;
You need to put both in the C:\ruby\lib\ruby\site_ruby\1.8\watir
directory
I don’t think they are in the 1.3 version
(probably in tarball).
Also add the code below, it works great for me.
require 'watir'include Watirrequire 'w
Back again with this issue.
One of our engineers did some testing and
here are his comments:
“The error occurs in the watir.rb
file in the wait() method, around line 1470. The wait() method is called after
the goto method has been issued and is waiting for all the frames in IE to sh
The problem is actually a security issue on the machine that
is executing the script!
We fixed the “access is denied” issue by adding
the URL that is causing the problem as a “trusted site”.
This is done in Tools/Internet Options/Security/Trusted
Sites (then add the URL).
No more “access
Some questions came up during a demo of WATIR.
Our automation team would like to know whether WATIR can do
the following functions:
1.
Launch
external applications from a test script such as Excel, Word, etc.
2.
Include
variables, functions, web/window declarations and/or
Some questions came up during a demo of WATIR.
Our automation team would like to know whether WATIR can do
the following functions:
1.
Launch
external applications from a test script such as Excel, Word, etc.
2.
Include
variables, functions, web/window declarations and/or
Thank everyone for all your input. It was of great help. I
will relay the answers back to the Automation Tool team.
I
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
The code below, for example, is a typical thing that I have
to do in our application.
1) Click on an
icon to launch the “Select Portfolio” window
2) The problem
is that it may take the “Select Portfolio” window a little while to
load,
so I have to add a Sleep par
Is there a way to insert a command inside the ruby script to
stop it’s execution so you can debug or set a breakpoint on a certain
line of code.
Kind of like the way Segue’s SilkTest allows you to
run in debug mode with all the variables and context available?
It would be great if the scr
Oh, GREAT. I will try it out and let you know! Thanks.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
I used SpySmith (great tool, thanks Bret for letting us
know) to find a value (USAL6l1) in a table and it gave me this info:
Innermost Element: [TD], Frame: [main/body/tabContent],
Index: [137]
USAL6I1
I want to extract “USAL6l1” from this table, and
I can do it in irb with this com
I used both the WAIT command and a loop with a
“sleep” statement but they both didn’t “wait” or
“sleep long enough”?
Here is the code:
ie.frame("main").frame("sidebar").wait("analysisSidebarTabContent")
sleep 3
while !ie.frame("main").frame("sidebar")
OK, thanks, Bret for the suggestion. Per your request, here
are some additional lines of code that preceded the “while”
statement.
There is the “attach” statement which may be
causing the problem since you had opened up a bug on that a couple of days ago?
ie.frame(:name,
"portfolioT
Just so you know, this doesn't do what you think: ie.frame("main").frame("sidebar").wait("analysisSidebarTabContent")It's actually the same as ie.frame("main").frame("sidebar").wait(true)
Hmm! So the statement I used is actually is checking to see
if the “sidebar” is there and NOT t
74 matches
Mail list logo