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
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 own
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
Give this a shot
require 'watir'
include Watir
# Lets setup our data so the code is easier to read
url = "http://www.google.co.uk";
search_string = "barry manilow"
target_url = "http://www.classicbands.com/manilow.html";
# Get IE ready to go
ie = IE.new
# Goto
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
Take a look at this thread
http://forums.openqa.org/thread.jspa?threadID=7082&tstart=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
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
Wtr-gen
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 se
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.
--
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
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
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
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 system
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.
_
Thanks for the feedback everyone,
Heres another way of approaching the problem. This takes the current wait_until
it makes it tolerant to exceptions. This seems to have the desired effect. I
don't think this should be used for any real code, just food for thought.
require 'watir'
include Wat
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
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
Ok, you guys helped me out more then i thought.
The *real* problem was that i was using single quotes and that my editor was
corrupting the accented characters.
I now pull the values straight from the db, wrap some basic ruby around them
and make a translation file. Works like a champ!
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
http://forums.open
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 s
Looking for a bit of help here.
I have a select list that has the following value 'Nome do serviço'.
When I do select_list(whatever).text i get back 'Nome do servi\347o'
if i look in the source of the html i get 'Nome do serviço'
I also found code to convert 'Nome do serviço' to 'Nome do servi
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,
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.
-
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
a
I'm no expert on assert, but heres what I would try
Do a puts ie.text (i think there is a text, if not html) and confirm you can
see it
maybe the text you want is in a different frame?
-
Posted via Jive Forums
http://forums.openq
> 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
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 1145
I may be way off base here.
Something has to call those functions to display the puts. As long as "test_1"
gets called, puts should work. Maybe its just not getting called?
puts "Begin test"
class DNX_1
def test_1
puts "Howdy"
end
end
new_class = DNX_1.new()
new
http://rubyforge.org/frs/?group_id=2857&release_id=9716
I think that will get you want you want
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6596&messageID=18947#18947
> 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 l
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=6583&messageID=18794#18794
___
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 :)
--
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 ie
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
http://forums.openqa.org/thread.jspa?threadID=6558&messageID=187
> 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 p
> mainFrame.link(:text,"Recibir Documentos").click
> cmdButtonGo = mainFrame.button(:name,"cmdGo")
> puts cmdButtonGo
> cmdButtonGo.click <-- error here!!!
what are you expecting "puts cmdButtonGo" to do? :)
Message was edited by:
jlolis
--
use the IE dev toolbar and just count it out :)
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6498&messageID=18514#18514
___
Wtr-general mailing list
Wtr-general@
I looks like this is in a table, figure out which row and cell it is in then do
table(:what,ever)[row][cell].click
that might work.
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6498&messageID=18494#18494
div(:id, "ContractDoc").click
i think that should work
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6325&messageID=18488#18488
___
Wtr-general mailing list
Wtr-
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
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
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
http://forums.openqa.org/thread.jspa?threadID=6445&messageID=
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
http://forums.op
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=6472&messageID=18341#18341
__
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=6471&messageID=18335#18335
___
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=6466&messageID=18316#18316
___
Wtr-gen
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=6445&messageID=18254#18254
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=6436&messageID=18223#18223
___
Wtr-
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
http://forums.openqa.org/thread.jspa?
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
http://forums.openqa.org/thread.jspa?t
Good question, heres my trick.
Download a product called spysmith (its linked in the wiki, but i'm sure google
can find it).
After you install this spysmith allows you to see HTML values of any web page
(including modal). The real trick though is that it allows you to see ALL the
HTML. So what
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 :)
--
thanks for the link Zeljko, always wondered how patches worked.
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6275&messageID=17660#17660
___
Wtr-general mailing l
> 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
http://forums.openqa.org/thread.js
> 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
http
It may help if you include a snip of your code and html. I haven't had any
problems using any 'ajax' items.
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6170&messageID=17315#17315
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=6165&messageID=17314#17314
___
Wtr-g
great to hear!
I'm going to give this a shot today.
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6147&messageID=17246#17246
___
Wtr-general mailing list
Wtr-gen
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
http://forums.openqa.
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=6110&messageID=17153#17153
___
Wtr
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
http://forums.openqa.org/thread.j
I seem to be having some issues attaching to modal_dialogs. I tried to register
my win32ole but it didn't seem to help. (the dialog popped up and said it
didn't appear to be a valid dll)
Heres my session in the IRB. Not after I hit 'new' I manually navigated and
opened a modal dialog. Do I need
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
> ## 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 site_w
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?
---
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
files/ru
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
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=6048&messageID=16961#16961
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
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 th
> 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, sli
see: http://www.rubycentral.com/book/tut_exceptions.html
this might be enough brain food to get you started. Just need to throw in some
control loop (an array of tests maybe?), specific error handling and maybe even
retries.
begin
-#Do your thing
rescue
-#put the error data into something nice
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 o
have you tried .fire_event('onClick')?
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5868&messageID=16411#16411
___
Wtr-general mailing list
Wtr-general@rubyforge
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 fail
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=5662&messageID=15830#15830
shot in the dark here, did you by chance "require 'Watir'" twice?
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5662&messageID=15816#15816
___
Wtr-general mailing
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
.im
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.
---
maybe a silly question, how do we apply the above patch?
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5487&messageID=15295#15295
___
Wtr-general mailing list
Wtr
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
http://forums.openqa.org/thread.jspa?threadID=5476&m
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
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 th
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 cod
As with everything i type, I'm sure its not the best of way of doing it. Heres
a quick way of getting it working until someone comes along and helps.
select_list = $ie.select_list( :name , 'yourSelectListHere').
select_list.text.include? 'What you want to find'
Message was edited by:
j
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 n
Post the code you are using that causes this, that might help :)
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5137&messageID=14254#14254
___
Wtr-general mailing
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?
---
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
stressed.
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=5069&messageID=14195#14195
_
very cool!
I have been wondering how to do something like this, and it makes so much sense
now.
thanks!
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5072&messageID=14118#14118
__
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
Great advice so far, and thank you for the link to the article.
The idea of testing the testing framework is very interesting! I guess it would
be really straight forward to write a basic test that jumps into the framework,
and just does a very basic probe making sure no exception gets thrown.
Thanks for the input davemunns, its nice to hear from someone who is so far
along in a project.
My only real fear is that of maintaining such a giant library. If you were to
leave your company tomorrow, would someone be able to pick it up in time before
it got too out of date?
I typed a lot mo
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
1 - 100 of 103 matches
Mail list logo