[Wtr-general] Watir on Rails

2006-09-07 Thread Dave Hoover
I have just released a Ruby on Rails Plugin that allows for easy Watir
testing in Rails.  To install the plugin in your Rails project,
execute

  ./script/plugin install svn://rubyforge.org/var/svn/watir-on-rails

You can then use the generator to get you started on writing your
first Watir on Rails test...

  ./script/generate watir SuccessfulLogin

Your Watir tests will live in test/watir and can be executed from Rake
like this...

  rake test:watir

In your Watir tests you will have access to all the standard Rails
testing conveniences, such as fixtures and ActiveRecord APIs.

More information can be found at http://watir-on-rails.rubyforge.org/

Watir on Rails supports both Watir::IE and Watir::Safari.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Watir on Rails

2006-09-07 Thread David Schmidt
Dave,

Very nice!

I notice that your example at http://watir-on-rails.rubyforge.org/ tests 
the URL for the local development Rails app on the default port 
(http://localhost:3000/).  Does your plugin start the web server when 
you do the rake test:watir or do you have to ensure that the web 
server is already running?

David Schmidt

Dave Hoover wrote:
 I have just released a Ruby on Rails Plugin that allows for easy Watir
 testing in Rails.  To install the plugin in your Rails project,
 execute

   ./script/plugin install svn://rubyforge.org/var/svn/watir-on-rails

 You can then use the generator to get you started on writing your
 first Watir on Rails test...

   ./script/generate watir SuccessfulLogin

 Your Watir tests will live in test/watir and can be executed from Rake
 like this...

   rake test:watir

 In your Watir tests you will have access to all the standard Rails
 testing conveniences, such as fixtures and ActiveRecord APIs.

 More information can be found at http://watir-on-rails.rubyforge.org/

 Watir on Rails supports both Watir::IE and Watir::Safari.
   
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Watir on Rails

2006-09-07 Thread Dave Hoover
You need to ensure that the web server is running in test mode.

On 9/7/06, David Schmidt [EMAIL PROTECTED] wrote:
 Dave,

 Very nice!

 I notice that your example at http://watir-on-rails.rubyforge.org/ tests
 the URL for the local development Rails app on the default port
 (http://localhost:3000/).  Does your plugin start the web server when
 you do the rake test:watir or do you have to ensure that the web
 server is already running?

 David Schmidt

 Dave Hoover wrote:
  I have just released a Ruby on Rails Plugin that allows for easy Watir
  testing in Rails.  To install the plugin in your Rails project,
  execute
 
./script/plugin install svn://rubyforge.org/var/svn/watir-on-rails
 
  You can then use the generator to get you started on writing your
  first Watir on Rails test...
 
./script/generate watir SuccessfulLogin
 
  Your Watir tests will live in test/watir and can be executed from Rake
  like this...
 
rake test:watir
 
  In your Watir tests you will have access to all the standard Rails
  testing conveniences, such as fixtures and ActiveRecord APIs.
 
  More information can be found at http://watir-on-rails.rubyforge.org/
 
  Watir on Rails supports both Watir::IE and Watir::Safari.
 
 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general

___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Hi watir problem

2006-09-07 Thread ykrish

Hi 
I am a newbie to watir and really love working with watir now. i had installed the waitr 1.4 which was running really well. now as i wanted to check out 'firewatir' which does not run on 1.4 i had to download the version 1.5
so here are the steps that i have followed.
I have done an svn check out of the latest watir files through https://svn.openqa.org/svn/watir/trunk into a file watir
i uninstalled the previous version of watir.
I went in to cmd promt. cd ed into the watir directory(where i had checked out the latest files). 
i built the gem file by using gem build watir.gemspec
Successfully built RubyGem
Name: watir
Version: 1.5.1.1081
File: watir-1.5.1.1081.gem
i then installed watir - gem install watir
Successfully installed watir, version 1.5.1.1081
Installing ri documentation for watir-1.5.1.1081...
Installing RDoc documentation for watir-1.5.1.1081...

now when i go to irb and type - require 'watir' -- i get an error
RuntimeError: LoadLibrary: c:\ruby\lib\ruby\site_ruby\1.8\watir\IEDialog\Release
\IEDialog.dll

 from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:483:in `initialize'
 from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:483
 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re
quire'
 from (irb):1

have i done some thing wrong?? i uninstalled and downloaded watir 1.5.1075-- here also i am getting the same problem


thanks
krish





Check out AOL.com today. Breaking news, video search, pictures, email and IM. All on demand. Always Free.



___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Hi watir problem

2006-09-07 Thread Zeljko Filipin
Uninstall ruby, install it again, then install watir gem.Željko
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

[Wtr-general] right click???

2006-09-07 Thread David
Here I go with another newb question, how can you do a right click? instead of 
.click would it be .rightclick? I do look for the answers before I post these 
things, but im lost again.
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=4007messageID=10999#10999
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Div Access

2006-09-07 Thread Michael Ehrich








Hi my name is Michael, 

i have a problem with div access. i got a sample page with an external js file.
the js file creates a dynamtic popup menu with several subfolders. all data is
located in an array. at the end of the js it is written on the file by
document.writeln

so when i try ie.div(:id,'menuItem0').click it seems to work i can see the
yellow clicking mark. but the problem is the div has several onlick onmouseover
events which are used to open the subfolders. and when i try
ie.div(:id,'menuItem0').fireEvent(onMouseOver) i get the same
result as .click but it ignores the js command in the onmouseover or onclick
parts.

i thought it might be a general problem so that watir is not able to access
divs in that way so i built a simple version of the script.

div id=test1 
href="" target="_new">http://www.yahoo.de','','');;

href="" target="_new">http://www.google.com','','');;
TEST/div

i tried to access and it worked.. so im confused. the only difference to the js
is that the js is a bit more complicated and that there are more elements but
its based on the same structure. i thought it might be cuz it is written by js
but why do the first elements of the menu blink when i access them with ruby. i
get all the divs with show_divs() too so watir has no identifing problems. 

i have no solution maybe if someone has any idea whats wrong plz tell me thx so
far



Greetings Michael






___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Cannot access input element

2006-09-07 Thread Karim Noorani
Thanks, Bill. This looks like what is going on here.

Is there any more details or examples of how I may use the execscript of the
windows object?

Also if this in fact the problem is there a show that would display if
this is in fact what is my problem?

Thanks,
Karim



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Attebery, Bill
Sent: Wednesday, September 06, 2006 6:45 AM
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] Cannot access input element


I also found that with Ajax that the javascript event handling may get
handled by the window object and not the dom.  One of our developers was
playing with the google ajax tree, I could find the objects in the tree
(they were table elements inside a div) that I wanted to click, but
there was no onClick event and clicking them through watir didn't work
-- I had to use the execScript method of the window object.  Seems that
this was somehow building the event handler on the fly and clicking
through watir API wasn't the same as actually clicking the tree entry
manually -- a bit over my head how/why but just fyi.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of David Schmidt
 Sent: Wednesday, September 06, 2006 12:13 AM
 To: wtr-general@rubyforge.org
 Subject: Re: [Wtr-general] Cannot access input element

 The lack of any input tags in a view source is easy to
 explain.  I've found that a view source will only show the
 *initial* HTML that was sent to the browser.  Any changes due
 to AJAX or Dynamic HTML will not show up in a view source, 
 but will show up using development tools which show you the
 active DOM.

 As to why the button isn't being clicked, it isn't clear from
 the HTML below, but perhaps there is something in the
 onClick() handler that aborts the effects of the click.  One
 thing I've done in our web scraping applications is to
 re-write the HTML before clicking to prevent some
 un-necessary events from firing.

 David

 [EMAIL PROTECTED] wrote:
  No it is a div with absolute position.
   
  Sounds like frames to me. True?
 
  [EMAIL PROTECTED] wrote:
 
  Hey all,
 
  I have a form which I click on to perform an action.
 
  I get a result back from the action and a screen displays
 with an OK
  option.
 
  Inspecting the code through view source does not show me
 any input
  tags, yet when I download Dev tools for firefox and view the
  generated source I see the elements like
 
 
  div class=alphababe_buttons
  input value=OK onclick=Dialog.cancelTalker()
 class=cancel_button
  type=button/div
 
  but if I add
  ie.button(:value,OK).click
  nothing happens
 
  Any help would be much appreciated
   

 ___
 Wtr-general mailing list
 Wtr-general@rubyforge.org
 http://rubyforge.org/mailman/listinfo/wtr-general


The content contained in this electronic message is not intended to
constitute formation of a contract binding TWTC.  TWTC will be
contractually bound only upon execution, by an authorized officer, of
a contract including agreed terms and conditions or by express
application of its tariffs.

This message is intended only for the use of the individual or entity
to which it is addressed. If the reader of this message is not the
intended recipient, or the employee or agent responsible for
delivering the message to the intended recipient, you are hereby
notified that any dissemination, distribution or copying of this
message is strictly prohibited. If you have received this
communication in error, please notify us immediately by replying to
the sender of this E-Mail or by telephone.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Hi watir problem

2006-09-07 Thread Charley Baker
It looks like you're still running some files from the 1.4.1 version from site_ruby directory if you look at the path you have below for iedialog.dll. If you've already uninstalled 1.4.1 then make sure to reme the watir.rb
 and watir directory from site_ruby and try it again.-CharleyOn 9/7/06, [EMAIL PROTECTED] 
[EMAIL PROTECTED] wrote:
Hi 
I am a newbie to watir and really love working with watir now. i had installed the waitr 1.4 which was running really well. now as i wanted to check out 'firewatir' which does not run on 1.4 i had to download the version 
1.5
so here are the steps that i have followed.
I have done an svn check out of the latest watir files through https://svn.openqa.org/svn/watir/trunk
 into a file watir
i uninstalled the previous version of watir.
I went in to cmd promt. cd ed into the watir directory(where i had checked out the latest files). 
i built the gem file by using gem build watir.gemspec
Successfully built RubyGem
Name: watir
Version: 1.5.1.1081
File: watir-1.5.1.1081.gem
i then installed watir - gem install watir
Successfully installed watir, version 1.5.1.1081
Installing ri documentation for watir-1.5.1.1081...
Installing RDoc documentation for watir-1.5.1.1081...

now when i go to irb and type - require 'watir' -- i get an error
RuntimeError: LoadLibrary: c:\ruby\lib\ruby\site_ruby\1.8\watir\IEDialog\Release
\IEDialog.dll

 from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:483:in `initialize'
 from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:483
 from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re
quire'
 from (irb):1

have i done some thing wrong?? i uninstalled and downloaded watir 1.5.1075-- here also i am getting the same problem


thanks
krish





Check out AOL.com today. Breaking news, video search, pictures, email and IM. All on demand. Always Free.





___Wtr-general mailing listWtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

[Wtr-general] Handling (Browser Security Driven?) Modal Dialog

2006-09-07 Thread Sun
I have a popup titled simply Internet Explorer containing the text: When you 
send information to the Internet, it might be possible for others to see that 
information. Do you want to continue? There are two buttons, labeled Yes and 
No.

I am unable to attach to this like so: ie2 = Watir::IE.attach(:title, ‘Internet 
Explorer’), or by doing: ie2 = Watir::IE.attach(:title, /Internet/). This made 
me suspect this was a modal dialog (besides the fact that it acts like one 
functionally.)

This pops up, by the way, when I execute the script googleSearch.rb (you know, 
the pickaxe script referenced in the Watir user guide.) It happens after the 
script sends the click to the Google Search button.

So...I uninstalled Watir 1.4.1, downloaded the current 1.5 gem (currently 
watir-1.5.1.1065.gem) and installed the gem. So far so good. This was to gain 
modal dialog processing functionality.

I then inserted this statement: ie.modal_dialog.button(:text, Yes).click
immediately after these 3 lines in the script:
=puts Step 3: click the 'Google Search' button
=ie.button(:name, btnG).click   # btnG is the name of the Search button
=puts   Action: clicked the Google Search button.

No good. After step 2 completes (pickaxe loaded into google search field) I see:
Step 3: click the 'Google Search' button
  Action: clicked the Google Search button.
Modal Dialog not found. Timeout = 2.0
c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1065/./watir.rb:2606:in `locate'
Press ENTER to close the window...

Now, my BELIEF is that the reason this occurs is that this dialog popup is not 
launched by Javascript from the current IE session -- but rather is triggered 
by IE security. Which since I am testing a corporate browser I cannot alter. So 
-- has anyone dealt with this before? I haven't seen any postings in this forum 
or elsewhere on the web about dealing with Browser security generated 
dialogs

Has anyone dealt with this standard security modal dialog before? If so, what 
should I add to that simple googleSearch.rb to get past it automatically?
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=4012messageID=11008#11008
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Inputing text into a textarea that is contained within a div

2006-09-07 Thread Ryan Howard \(Intern\)








Hi, 

 Im
having a lot of trouble trying to get Watir to input text into a textarea
that is within a div, I have tried a lot of things, such as 



ie.divs(:class,
CommonFormField ).set('watir')



and a ton of variations to
that. I am totally out of ideas.





From what I know, the box
is know as a WYSIWYG editor, and the box has buttons on top that look like
these.







Any help would be greatly appreciated.





-Ryan Howard

Intern: Systems Testing  Automation

telligentsystems 
Exceptional Service. Predictable
Results.
www.telligent.com

email: [EMAIL PROTECTED]








___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] Navigating in IE frames

2006-09-07 Thread haggard
Yes, the frame itself must be dereferenced.

Example: Multiple nested frames and a hyper link to be clicked.

ie.frame(:name, frame3).frame(:name, frame3).link(:index, 1).click
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=3459messageID=11025#11025
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Inputing text into a textarea that is containedwithin a div

2006-09-07 Thread Alan Ark








Hey there.



Your editor looks similar to FreeTextBox
which I was looking to test against.



I had no luck in my investigations, but I
have also been pretty busy with other things lately.



One thing that I was going to try is ask
around to see if one of the developers could interact with the editor using
_vbscript_. Usually, if it can be modified successfully in _vbscript_, finding the
Ruby way isnt that far of a reach.



Just a though.

-Alan











From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ryan Howard (Intern)
Sent: Thursday, September 07, 2006
11:31 AM
To: wtr-general@rubyforge.org
Subject: [Wtr-general] Inputing
text into a textarea that is containedwithin a div





Hi, 


Im having a lot of trouble trying to get Watir to input text into a
textarea that is within a div, I have tried a lot of things,
such as 



ie.divs(:class,
CommonFormField ).set('watir')



and a ton of variations to
that. I am totally out of ideas.





From what I know, the box
is know as a WYSIWYG editor, and the box has buttons on top that look like
these.







Any help would be greatly appreciated.





-Ryan Howard

Intern: Systems Testing  Automation

telligentsystems 
Exceptional Service. Predictable
Results.
www.telligent.com

email: [EMAIL PROTECTED]










--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.1/440 - Release Date: 9/6/2006
 



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.1/440 - Release Date: 9/6/2006
 

  
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

[Wtr-general] Calling JavaScript code in the browser

2006-09-07 Thread Egil Sorensen
Thanks to Bill Attebery for pointing to a blog with a good solution to this
problem. I have experimented with making it easier to get any return value
back to Watir. This is what I came up with:

===
require 'watir'

module Watir
  class IE
def execute_script(scriptCode)
  ie.Document.parentWindow.execScript(window.WatirJSResult =
+scriptCode)
  return ie.Document.parentWindow.WatirJSResult
end
  end
end

===

This allows for dropping an extra step in the test from the blog to relay
the result. The test now simply becomes:

===
def test_selection
  @ie.execute_script(RadComboBox1.FindItemByText(\Golf\).Select())
  assert_equal(Golf, @ie.execute_script(RadComboBox1.GetText()))
end
===

I am no JavaScript expert, and I have only used this in a few small tests,
so I don't know if this will get me in trouble anywhere, though.

~~ Egil


 -Original Message-
 From: Attebery, Bill [EMAIL PROTECTED]
 Subject: Re: [Wtr-general] Cannot access input element

 I thought I posted this a month or so back but I can't find it.

 Check out
 http://blogs.telerik.com/blogs/twisted_asp_net/archive/2006/04/26/201.aspx
 this is where I found out how to get to the window object and call the
 execScript method.
 (...)


___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general