while working with watir, when i execute any watir file (.rb) a window will
open, executing all the statements written in the code. But when any exception
occurs the exception is displayed for a second and the window close. How to
capture that exception.
awating for a reply
The HTML code like this:
...
td name=outlooktitle0 id=outlooktitle0 style=background-color:
rgb(108, 142, 229); color: rgb(255, 255, 255); height: 5px;
onclick=switchoutlookBar(0) align=center nowrap=nowrap
span class=smallFontUser Group/span/td/trtr
td name=outlookdiv0 id=outlookdiv0
Hello people,
Rarely, Watir starts the execution of a statement before the brwoser gets
loaded fully from the previous step's execution. What to do in those
situation? Is there any statement in Watir that will tell its script to wait
for a particular frame or a table before resuming the
Hello people,
Can variables be used as regular expressions in Watir?
For example, if we want to check whether there is a link with 'href' containing
a particular text say 'submitpage', we can say,
puts (ie.link(:href,/submitpage/).exists?)
Simiarly can we do the following.
Thanks for your reply.
This is one case that opening a url, how about other operations such as click a
button/link/image/, fill in text field, etc. If all these operations in scripts
use this method, then the code will become not concise.
Is there a global method/variable that could simplify
Try Sleep
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of vijay
Sent: Wednesday, March 28, 2007 1:58 PM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] Rarely,watir does not wait till the browser gets
loaded fully
Hello people,
Rarely, Watir
yes, you can!
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
begin
.
.
your code here
.
.
rescue Timeout_Error = e # you can mention the error you want to rescue if
you know them, or just leave it as rescue
puts e
.
.
some more code
.
rescue
puts $!
end
___
Wtr-general mailing list
Wtr-general@rubyforge.org
Thank for the response satees
I use sciTe to write the watir code in .rb file. when i execute the .rb file
the executable window opens and shows us what it is doing. sometimes when a
exception occurs it just shows the exception for a second and closes the
window. The code which you have
Please post html snippet or link to your application.
--
ZeljkoFilipin.com
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
Do not execute rb files by double clicking. Instead, open command prompt, go
to folder where your rb files are located and then call them. In that case
command prompt window will stay open even if exception occur.
--
ZeljkoFilipin.com
___
Wtr-general
Which one? And what do you want to do with it?
For example this span
span class=smallFontUser Group/span
you can flash with any of this
ie.span(:text, User Group).flash
ie.span(:index, 1).flash
ie.span(:class, smallFont).flash
I tried it with watir 1.5.1.1158
--
ZeljkoFilipin.com
thanks zelijko.
My doubt is cleared. :)
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
Put variable inside #{}, like this:
ie.link(:href,/#{variable_for_holding_text}/).exists?
--
ZeljkoFilipin.com
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
When i execute Modal_dialog_test.rb [which will be under unittests folder], i
get 12 errors ,in that Last error says NoMethoderror:IE#modal-dialog is not
supported withcurrent vresion of Ruby (1.8.6)
So what is the Ruby Version i have to use ,to resolve this problem.
I am using Watir 1.5.1.1158
Thanks vermillion ,actually i made silly mistake there, i was not downloaded
Gem.zip file i was having only Bonus.zip.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
Thank you so much ZeljkoFilipin. Your answer had clarified my doubt.
Thanks,
Vijay.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
when i called the test case ie yahoo mail mark the first file, i am getting the
exception or error as
undefied method 'element' for nil:NilClass NoMethodError
can someone through some light on it. appreciatable
___
Wtr-general mailing list
One part fo the doubt is cleared..other is still not clear
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
Hello people,
Can we use as many variable names as we want in a script without worrying about
the memory wastage? Each variable is going to occupy some bytes in memory and
those bytes would remain occupied as long as the script is running. If so,
then in order to avoid memory wastage, to the
Ruby takes care of that, as far as I know. You do not have to worry about
memory, unless you have extremely low memory situation.
--
ZeljkoFilipin.com
___
Wtr-general mailing list
Wtr-general@rubyforge.org
Hello people,
In our application, there are is a dialog box, which takes a lot of time to
load. We give the statement, 'ie.modal_dialog', at the point, where the dialog
box would come. But this statement times out within a few seconds before the
modal dialog gets loaded. While executing the
class Watir::IE
@@attach_timeout = 10
end
I think that should work
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
You can use sleep command like sleep(5)
so that it will wait until it loads..
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
No.
Read this important article : http://en.wikipedia.org/wiki/Spaghetti_code
Please rethink how you structure your code. I *highly* recommend taking a
course on Programming Concepts and Design if you haven't done any formal
structured programming/scripting in a *long* time.
GOTO's bad.
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
I used this code
def x
puts press return
gets
end
class Foo; end
n = 100
x
f= Foo.new
n.times do |i|
f.instance_eval(@a_variable_#{i} = #{i})
end
x
with n=100 ruby used 6.35M ( according to task manager), before and after
creating the variables
when n=1, it used 300M
Hi Paul,
Could you just please explain how you are mapping something like this:
text_field :user_name , :id='username'
in the parent class?
cheers
aidy
___
Wtr-general mailing list
Wtr-general@rubyforge.org
There might be a way to redirect both to console and file, search google for
redirect dos output. I know how to do it in unix, but not sure how to do it
in dos. You might also want to look at ci_reporter (available on rubyforge),
log4r or some other mechanism to log your test runs.
-Charley
On
there was some code posted to comp.lang.ruby in the last few days to do this.
There might be a way to redirect both to console and file, search google for
redirect dos output. I know how to do it in unix, but not sure how to do it
in dos. You might also want to look at ci_reporter (available on
Simba wrote:
So what is the Ruby Version i have to use ,to resolve this problem.
1.8.2
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
This may be more of a test/unit question than a watir question...
I have a test case, based on the Test::Unit::TestCase. How does one pass data
to the test in such a way that the test can be run multiple times with
different data.
For example:
class TC_CreateOrder Test::Unit::TestCase
def
Bill,
I thought I'd pick your brain a little on an issue I'm having
with this app. I've had no trouble dropping scripts into the suites
directory and running them from the railsapp unless the script includes
or requires another script. For instance, I have library.rb, which is
included
areed,
I have noticed that paths in ruby are relative to file that is being executed (
i think ). This has caused a couple of head scratching moments on my part while
i wonder they files will no longer load using relative paths.
I'm not sure this is related to your problem, hope it helps.
No I agree, I think it may be related. With this specific application
it seems like it should be calling the same path (the app tells me that
the path is where I thought it should be), and I've attempted to set the
load path in the script as well -- that's why I'm still confused!
-Original
I had the same issue where the script would execute but couldn't find
any of the other 'required' files in the directory. To solve this
problem, I had to add some code to the
runner\app\controllers\runner_controller.rb specifying the test suite
directory that the test should execute in. Now it
Thanks David, those changes worked for me as well! Thanks also to Bill
Agee - this is going to be a lot of fun to play with. It's nice to have
a centralized location like this to run scripts from so that colleagues
aren't required to install ruby, install (many) gems, etc.
- Adam
-Original
The way I solved this back when I was using the rails app was:
- I put all my library files into a common dir
- I added a line of code to each test script that allows it to find and add the
lib dir to $LOAD_PATH
For this I use the same idiom from some of the Watir unit test files (in this
I wasnt really following the thread, but have you prevented people from running
the tests simultaeously?
- Original Message -
From: Adam Reed [EMAIL PROTECTED]
Date: Wednesday, March 28, 2007 3:06 pm
Subject: Re: [Wtr-general] watir execution from webserver
Thanks David, those
Hello,
Thanks for viewing this.
I am new to Watir and I am having this problem clicking on this particular
element on my company's website.
Our graphics guy described it to me as not an image but rather submit form with
and image placed on it.
I have tried different methods of clicking
here was one of the ideas I tried.
In essence, what it does is create a method called the_search_box that
returns the ie.text_field object.
Im sure there are some better ways of doing it.
Paul
require 'watir'
class WatirNaming
def self.parse_ops( obj_name , opts )
if opts.has_key?
It is easier anyone to help you, if you would post the HTML code!
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
Currently I am trying with Process. The main point here is to separate the Save
Image from the main process and control the Save Image process from the main
process.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
The version of the runner app I posted doesn't check to see if a script is
already running before it executes a new one. But that would definitely be
necessary if more than one person is likely to try to run a Watir script at the
same time.
Some solutions I considered were to use a lock
Hi Bret,
I also facing same probelm as bart but i am using ruby 1.8.2 watir 1.5.1.1158
and my IE version is 7.0,what may be the probelm in this case.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
hi,
Can you just let me know the script that you are using and the watir
version?
- Angrez
On 3/28/07, rkkanneganti [EMAIL PROTECTED] wrote:
when i called the test case ie yahoo mail mark the first file, i am
getting the exception or error as
undefied method 'element' for nil:NilClass
hi angrez the following is the script and the version i am using is watir
1.5.1.1158.gem
require 'watir'
include Watir
require 'test/unit'
class TC_mail_yahoo_check Test::Unit::TestCase
puts ## Opening the Mail.Yahoo.com site
sleep 1
ie = IE.new
ie.goto(http://mail.yahoo.com;)
ie.maximize()
Thank Q Naga..
The script is perfectly working for me :)
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
Hi,
What are the differences/limitations of each of these other than Watir works
on IE and Selenium IDE works on Firefox?
Regards,
Angrez
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
Hi,
I think the code usage is not correct.
element = ie.element_by_xpath(//lihttp://contains(.,'Mark as Read'))
its ie.element_by_xpath(//li[contains(.'Mark as Read')])
# Print properties of the element just to make sure you selected correct
element.
Is this comment on single line?
50 matches
Mail list logo