I'm noticing this question or very similar questions get posted a lot here
(which means its a good question). I would search through the old posts and
read what others said, there has been some very good posts on the subject.
Below I'm posting a chunk of code that should help you answer your
I had some time to kill this morning so I decided to toss together another
'sample'. I know when I start learning something new there is nothing better
then working examples that I can modify and see how they break, so here you go.
This is a 'wrapper' for the Google website. I wrote it with the
You had me laughing in my cube Bret :)
I am not a fanilow
___
Wtr-general mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/wtr-general
Take a look at this thread
http://forums.openqa.org/thread.jspa?threadID=7082tstart=30
I give some ideas on how to approach a very similar problem.
The easy option to catch the specific exception and handle it from there.
___
Wtr-general mailing list
I'm not sure how new 'wait_until' is, but if you have it do
wait_until(time_to_wait_in_seconds){ $ie.element(:type,'value').exists? }
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
Thanks for the demo Chris, I haven't messed with dates beyond the basics, this
was a nice way to get brought up to speed.
While my first thoughts were along the lines of Chris, I think I would go with
the string compare. It seems, in his case, that the level of complexity isn't
needed. I can
Looks good.
In your setup I would wrap $ie with a global function (internet_explorer or
some such). I would then use that global function through out your class files.
This could save you a headache down the road :)
___
Wtr-general mailing list
also it looks like its in a table so you could do
table(:type,'value')[row][column].click
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
Another example i thought i would share. Again I tried to keep the code very
readable. This example should be enough to get anyone going. I'm currently
using this with a DB and storing the yaml in a file, it works great!
I'll let the code and comments speak for itself, it should be readable.
This is something I've started using and I figured others might find it useful.
The main form of testing I have been doing is a 'smoke test'. This is a complex
test that takes about 20 minutes to setup data to get the expected results at
the end. The issue i ran into with this is that the
wait_until(time_in_seconds){ ie.element(:type,value).exists? }
that?
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
Jason,
I started off using Mondrian ( http://www.mondrian-ide.com/ ) and at first
really liked the structure if gave me. I came from Visual Studio .Net so I was
very used to the 'Heavy IDE' format.
The problem is I started to have growing pains with with it. I noticed that it
was slowing down
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
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.
Ruby 182-15, Watir 1.5.1.1136
works fine
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
waitr 1136
Lets say I have the following action i want to perform
$ie.frame('Frame').table(:id,'ID).table(:index,1)[1][2].click
But, the this is frame heavy page, and wait sometimes doesn't play nice, so I
decide to do
element = $ie.frame('Frame').table(:id,'ID).table(:index,1)
wait_until(30)
I have no idea if this will help you, i wrote it awhile ago and it still works
for me. I ripped out as much app specific junk as i could :)
look at 'multi_find' and work your way down. Its not exactly what you want but
might give you ideas. find_value would be values in rows, find_type would
Thank you both for the information.
I can enter the data fine (just need to use an editor that can handle special
characters). The issue remains that in the html the value is servi # 2 3 1 ;
o (note i included spaces so you could see all the characters), watir stores
the value as Nome do
well heres some more code i found, which does the conversion. Now i just need
to go the other way
string = Nome do servi\347o
puts string.gsub(/.$/u, '')
regex = Regexp.new(//u)
-
Posted via Jive Forums
if i'm reading this right, you click $ie.button(:value, Log on).click and
it makes a pop up window?
$ie.button(:value, Log on).click_no_wait
$ie.modal_dialog.button(:value, close).click
that might do it. If you have an old version of watir this might not work.
You are looking for some kind of interactive script. I can't imagine its too
hard to do, but I don't have much time to mess around with it. Heres a fun
little script i put together to test out an idea. Maybe it will spark some
ideas.
(note: do not use this for anything, its just for fun. Also,
I like using
http://rubyforge.org/projects/ruby-breakpoint/
all you do is call breakpoint() and the application stops. The best part is
that you are now at the IRB prompt so you can do all sorts of fun things :)
I setup my smoke test to call break point on any exception, i can then hop in
bret,
I don't have time to look into this right now (too much going on at work), but
something is up with 1158. I have areas in my app where it just waits forever
(never used to happen) and its spitting out access denied errors constantly
(single server). I reverted back to ruby 1.8.2 and
As a side note, I just found out another possible
case where the cross site
cripting/frame access problems will happen when the
frames are being served
by the same domain *and* you have proxy enabled in ie
which would explain
some issues I've encountered.
I have frames being served from
I think the problem for the OP is that we don't have
good
examples/documentation describing this approach.
I don't feel that its a problem Watir needs to solve. If the community really
did want some framework I think it would be a project separate from Watir. I'm
not even sure a project
http://rubyforge.org/frs/?group_id=2857release_id=9716
I think that will get you want you want
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6596messageID=18947#18947
find the element that has it and try something like
ie.link(:what,ever).fire_event('even_name')
i think
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6583messageID=18794#18794
check the FAQ ( http://wiki.openqa.org/display/WTR/FAQ ) see Access denied
when trying to access a frame
that may be the issue, not sure.
-
Posted via Jive Forums
I'm not exactly sure why someone would do 'ie.close if ie'. Below is my best
guess at it.
---
require 'watir'
include Watir
ie = nil
if ie
puts 'ie object created'
else
puts 'no ie object'
endie
ie = IE.new()
if ie
puts 'ie object created'
else
puts 'no
What does the actual HTML look like for link you are clicking?
Maybe there is some kind of event that needs to be fired? My gut feeling is
that you are just 'clicking the wrong thing'.
Again, this is just a wild guess i really have no clue whats going on in here :)
However those others were not helpful. If you check
the console output i pasted, you will realize that
puts cmdButton actually works fine and prints the
properties of the button. Furthermore the error is in
a match function, not in the puts function. More
careful reading next time people!!!
when you make a new thread you have the option of making it a 'question'. If
you do that then there will be an icon next to each post to mark them as
correct or mostly correct.
Think its too late now though :)
-
Posted via Jive
you missed typed it, type it exactly
ie.link(:html, /ajax_add_term\/133/).click
I think the \ / is allowing the forward slash to be used as a string and not as
a special regex character.
-
Posted via Jive Forums
to add to that, you could do something like writing out to a text file thats
just a bunch of insert statements... FUN!
hrm, so many ideas now.
-
Posted via Jive Forums
heres my question to you.
You want SQL to store your results, but you are having some issues with using
MSSQL. This tells me in the future you will continue to have issues. Why not
think around the problem? Export into a format that can be imported into MSSQL
(there are a ton of formats and it
Post your code, I'm willing to bet that you are doing something out of order.
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6466messageID=18316#18316
___
Another option is to locate it within the table.
ie.table(:what, ever).button(:index,number)
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6471messageID=18335#18335
Heres a link i found useful when i was going using Excel
http://wiki.rubygarden.org/Ruby/page/show/ScriptingExcel
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6472messageID=18341#18341
ie.link(:text, 'Consultation des AS').exists?
is that what you are looking for?
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6436messageID=18223#18223
___
Google spit this out
http://wiki.rubyonrails.com/rails/pages/HowtoConnectToMicrosoftSQLServer
never tried it, but it might help :)
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6445messageID=18254#18254
My best guess is that your modal dialog is using frames. The HTML that its
returning is not the right frame.
Thats my best guess and how i would approach the problem.
-
Posted via Jive Forums
Yes, i think this should work. I have never tried this and I can assure you
that it will break way more things then it could ever fix :)
module Watir
class IE
def wait
puts 'hello'
end
end
end
Another option is to use this script:
puts $ie.modal_dialog.html
... something about a forest and trees comes to mind ...
Thanks for such a simple solution :)
-
Posted via Jive Forums
I have never seen this happen. Are you using -b (background) Run Internet
Explorer invisible when you run the program? Is IE just minimized by chance?
What version of IE are running? Is this a multi desktop setup (is it off the
screen?)
Just some ideas :)
result = ie.frame('builderFrame') ,
form(:name,'dummy').table(:index,1)[1][1].text
well if that comma is in the actual code i don't think its going to work :)
-
Posted via Jive Forums
thanks for the link Zeljko, always wondered how patches worked.
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6275messageID=17660#17660
___
Wtr-general mailing
Another way to say this is:
t.each {|x| puts x[0]}
I'm enjoying this thread, heres another way. Sans 0!
for element in (t.index(t.first)..t.index(t.last))
puts t[element].first
end
-
Posted via Jive Forums
not sure on your exact question but would
ie.link(:text,'Images').click
work?
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6165messageID=17314#17314
___
Adding to what Zeljko said,
Is there a way for Watir when its first load to check your version or ruby, if
AutoIt is loaded and if things aren't as they should be spit out a warning?
-
Posted via Jive Forums
thanks zeljko,
I am logged in as an admin. I tried to register win32ole.so (which i have no
idea what kind of file it is). Is there a win32ole.dll somewhere I should try?
-
Posted via Jive Forums
Thanks!
I guess I should just read the error message more carefully next time :)
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6110messageID=17153#17153
___
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=6074messageID=17052#17052
___
Having some problems using file_field in a modal window. Like the subject says
i do have 1.8.2 installed (just installed it) and Watir 1.5.1.1127 (from the
gem) and I'm getting the following error.
The AutoIt dll must be correctly registered for this feature to work properly
c:/program
Thanks for the information!
I registered AutoItX3.dll using regsvr32 and it got rid of the error message,
the problem now is it doesn't fill in the field with any text. I can flash it,
so i know I have the right field - I just can't put anything in there.
any more ideas?
## Main script snippet:
...
# open the IE browser
$ie = IE.new
# A) Walk the Public Pages. = Need to Trap this so
the
something_went_wrong variable works correctly
page_set_to_check( walk_Public_Pages )
---
# Here's the page_set_to_check() method:
module
I think what bret said is
$my_button = $ie.button(:id, 'foo')
is a bad idea. It may be better to do something like...
def my_button()
return( $ie.button(:id, 'foo') )
end
while
my_string = $ie.text
could be fine, though you could still do
def my_string()
return( $ie.text )
end
... i think
for editors I use Mondrian. Its very simple, but works great.
Try out a bunch of them, find one that works for you.
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6048messageID=16961#16961
I just ran into same problem myself i think. I am running 1.8.4. Going to
switch to 1.8.2 tomorrow and see if that fixes it.
The AutoIt dll must be correctly registered for this feature to work properly
C:/Program
Files/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1127/./watir/windowhelper.rb:42:in
Are either of the Edit News links contained within another element (table?).
You may be able to do something like
ie.frame('whatever').table(:id,'table1').link(:title,'Edit News')
and
ie.frame('whatever').table(:id,'table2').link(:title,'Edit News')
like the other poster said though, a hard
Otherwise a group I'm associated with is beginning to
write an open source enterprise Ruby Rails interface
for launching Watir scripts remotely but we've only
begun and it may take up to a year before we have
anything solid.
I think as Watir becomes more mature and accepted tools like this
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
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
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
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
shot in the dark here, did you by chance require 'Watir' twice?
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5662messageID=15816#15816
___
Wtr-general mailing
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=5662messageID=15830#15830
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.
I assume this is the standard 'access is denied' error.
http://wiki.openqa.org/display/WTR/FAQ
Look for the 'access is denied' section, it should help.
-
Posted via Jive Forums
maybe a silly question, how do we apply the above patch?
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5487messageID=15295#15295
___
Wtr-general mailing list
Lets say we have the following
Table
.TR
..TD
..TD
...SPAN text=findme
..TD
...Text Input Field
The only element in this entire section that I can identify uniquely is the
span. The span happens to be located within a table. That table also contains
the text input field (my real goal). So is
That is actually a really nice simple solution, I have no idea why I didn't
think of it. I decided to go with a simple parser. It looks for a certain
table, finds a sub stable by index, finds the length then attempts to locate
input fields within it.
Thank you though, you got my brain thinking
So if I'm reading this right you are saying you have collected 2670 links, but
are exploring link 129 and the browser closes? The exploring is just a goto
'address' I assume. If my assumptions are correct, heres a couple questions.
Questions,
If you attempt to go straight to that link (hard
I do this to a degree, but I consider it to be logging not documentation.
I have 3 levels of logging (there are more, but thats besides the point)
Section, Test and Details
A section would be like Administration a test would Create a New User and
details are Clicked 'new user', 'Set user name
Thanks for the great input. I have a more specific question though. How is the
support of (well written) QTP steps down the road?
Watir/Ruby scripts (if well designed) seem to be very easy to support. Is that
also the case with QTP?
Post the code you are using that causes this, that might help :)
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5137messageID=14254#14254
___
Wtr-general mailing
Thanks for the input. I was seeing the crash as a problem to get around, as
opposed to a problem to investigate :)
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5069messageID=14195#14195
Looking for some experience from people that have used both. We are currently
looking into both of these applications, and I'm wondering if anyone has any
experience (that they care to share on the subject).
Cost alone isn't that big of an issue. So its a point that doesn't need to be
I seem to have found a way of crashing IE during my testing (something I do
makes it happen, though I have never done it in a manual way).
Is there a way to recover from this? (IE, can I close the dialog that asks me
to debug it?)
Message was edited by:
jlolis
Just thought I would share this. I found this interesting program called
breakpoint
http://ruby-breakpoint.rubyforge.org/
this allows you to add breakpoint() anywhere in your program and the IRB pops
up. You can then poke around and debug issues. This has been a HUGE help to me.
It allows me
Looking for some feed back on this topic.
To start, I'm attempting to automate a very large and very complex web
application. Watir is great at handling all the strange controls (it has some
timing issues with frames and modal dialogs, but those are known issues). The
problem I now face is how
unable to located object in general means that the page has not yet load (as
far as I understand it. Instead of sleep (which just slows down everything) try
wrapping your code as follows. (The below is just an example, and only my
opinion. I'm sure there are 1000 better ways of doing this) :)
Timing issues are by far my biggest headache too.
I did see a patch (never tried it) that would handle recursive frame waits (or
something like that). Not sure if that would handle modal issues.
-
Posted via Jive Forums
82 matches
Mail list logo