[Wtr-general] How to deal with jsp event

2007-04-11 Thread lin
How to click this link.follwoig is code






Date 
& Time

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


Re: [Wtr-general] Accessing elements between DIV tags

2007-04-11 Thread Bret Pettichord
Daniel Kurtz wrote:
> Thanks, I'll give it a try. Although I haven't had luck so far with things 
> like div().links. We'll see how it goes.
>  
Use Watir 1.5.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Running Watir in cygwin environment

2007-04-11 Thread Bret Pettichord
Koteswara Annavarapu wrote:
> So , if I need to use WATIR module from the cygwin environment , 
> please let me know wat I need to do of the below
>  
> 1) change the environement variables in cygwin , for using the same 
> ruby installed in windows
> 2)  let me know , if we can install the watir gem in the cygwin ruby 
> environment.
In the early days of watir development, we regularly tested it with both 
Native Windows and Cygwin. If you look at the setup.rb in the unit 
tests, you will see one small function that ensured that the file:// 
paths we used in the unit testing framework would be correct in either 
environment. You can use either the Windows Ruby or the cygwin ruby from 
within the cygwin environment. It's really just a matter of the path you 
use to access ruby.exe.

Over time, we may have added a few dependencies on Native Windows in a 
few of the Watir methods, but if you run the unit tests, they should 
help you track down any possible problems. Let us know how it works for you.

I consider Cygwin a supported environment and am happy to accept bug 
reports and patches for it if you turn up any issues.

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


Re: [Wtr-general] screen_capture filename

2007-04-11 Thread Charley Baker

This is probably some code that needs to be yanked out and put in contrib. I
haven't used it and have yet to hear anyone else using it although I'm sure
there are some. You might take a look at Aslak Hellesoy's screenshot
library.
http://blog.aslakhellesoy.com/2006/12/2/getting-screenshots-from-watir
which might make sense to include in Watir vs the screen_capture library
since his implementation has unit tests. You can enter a ticket for that in
Jira if you'd like. As far as the current function, taking a brief look at
it, you've not included curly brackets for evaluation on the
time.jpgvariable, you might try the following:

screen_capture("
C:[EMAIL PROTECTED]"
, true, false)

or this:

screen_capture("
C:/InstantRails/rails_apps/watir_tests/public/images/[EMAIL PROTECTED]"
, true, false)

which should get converted into the same thing.


-Charley

On 4/11/07, Matt Makins <[EMAIL PROTECTED]> wrote:


 i am using the screen_capture function which i have working correctly.



How do i specify the path where i want to save the image file?



screen_capture("
C:[EMAIL PROTECTED]"
, true, false)



this doesn't work, anybody tried this??



Cheers,

Matt

___
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] unknown property or method `readyState' (WIN32OLERuntimeError)

2007-04-11 Thread Charley Baker

It's likely your frames are throwing errors with cross site scripting
issues. You might try updating to the latest version of watir 1.5.1.1165 in
svn. Installation instructions are included on the FAQ site. I may end up
making a gem from the current source today. It's been a while and there have
been a couple of changes, notably this workaround that might make it
worthwhile.

-c

On 4/11/07, Parv <[EMAIL PROTECTED]> wrote:


Some more info.  The application i'm testing uses a lot of frames.
___
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] How to run all the steps defined in a method even if any of step fails?

2007-04-11 Thread Charley Baker

 There's no flag in watir to swallow all exceptions, that's rather
dangerous behavior and not recommended. You could wrap methods with
begin/rescue blocks and print out the exceptions as they occur - follow
Zeljko's example above and the more specific the exceptions you catch the
better.

 I'd agree, it's not slick or pretty but it's the nature of the way test
unit is designed and my understanding of how these specific tests are coded
and the requirements. I reserve the right to be wrong on both accounts. :)
The way test unit and assertions work is more on a unit => single assertion
aspect vs grouping multiple assertion points(test cases) into one larger
grouping.

 For better or worse, I've ignored the issue to some extent as the
assertion points fold up into a larger test case, which I'm assuming passes
if all individual test points pass, and dump out of the test case with a
message on any individual assertion instead of bending it all around to a
functional pass through with multiple assertions that are all independent. I
added the ability track assertions in the test unit reports we're running
just to identify the running assertions. Otherwise, I'm basically using test
unit as is with it's limitations for true functional test scenarios.

-c

On 4/11/07, Vamsee Krishna M <[EMAIL PROTECTED]> wrote:


I think what he meant was he wants to execute each and every statement
without considering whether the previous statement was failed.

So the solution would be like putting try rescue catch block around around
each line and code won't look professional.

Is there any flag in watir that can be used to suppress all the exceptions
?
___
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] unknown property or method `readyState' (WIN32OLERuntimeError)

2007-04-11 Thread Parv
Some more info.  The application i'm testing uses a lot of frames.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] OT: Ruby idioms

2007-04-11 Thread Chris McMahon
I ran across this, and it's worth sharing...
Dan Manges blogged about what he calls "Ruby anti-patterns".  I might
argue with some of them, but he's got some great examples of efficient
ways to do some things that we all do every day:
http://www.dcmanges.com/blog/28
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] How to run all the steps defined in a method even if any of step fails?

2007-04-11 Thread Vamsee Krishna M
I think what he meant was he wants to execute each and every statement without 
considering whether the previous statement was failed. 

So the solution would be like putting try rescue catch block around around each 
line and code won't look professional.  

Is there any flag in watir that can be used to suppress all the exceptions ?
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Selecting value from a List displayed through Autoextender

2007-04-11 Thread Chris McMahon
> -
> Unable to locate object, using index and 5---> This is the exception 
> thrown.

Do you get anything if you try smaller values of index, like 1 or 2?
It might choose the wrong one, but you would know if it's working at
all.
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] How to run all the steps defined in a method even if any of step fails?

2007-04-11 Thread Ċ½eljko Filipin

On 4/11/07, watir-user watir-user <[EMAIL PROTECTED]> wrote:


Is there any other way which executes all the steps defined in the method
even any of the step fails and also should show the message why it has
failed?




Of course. Read "Exceptions, Catch, and Throw" chapter from "Programming
Ruby" (http://phrogz.net/ProgrammingRuby/tut_exceptions.html).

This is sample code.

begin
 raise
rescue
 puts $!
end

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

[Wtr-general] screen_capture filename

2007-04-11 Thread Matt Makins
i am using the screen_capture function which i have working correctly.

 

How do i specify the path where i want to save the image file?

 

 
screen_capture("C:[EMAIL PROTECTED]
jpg" , true, false)

 

this doesn't work, anybody tried this??

 

Cheers,

Matt

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

Re: [Wtr-general] code structure problem

2007-04-11 Thread Attebery, Bill
instantiate $ie in setup or don't close browser in teardown - when you
close browser, $ie is closed (because browser is just a reference to the
same object) and thus unavailable going forward.

  #the setup method is executed before each test method
  def setup
browser.goto('http://missiontesting.updatelog.com')
browser.bring_to_front
browser.maximize
  end

  #the teardown method is executed after each test method
  def teardown
   browser.close
  end

  However, after the first test method, the browser is closed,
  so Ruby cannot find the goto method (above in setup)

  How best can I structure this?

  aidy
___
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] How to run all the steps defined in a method even if any of step fails?

2007-04-11 Thread watir-user watir-user
Hi Charley and Paul,

If I use rescue true in the method, i wont be getting any error all the methods 
will execute. But, the method which has error does not shows what actual error 
it has.

Here is the code which i executed 

def test_yahooSite
test_site = 'http://www.mail.yahoo.com'
$ie = IE.new
$ie.goto(test_site)
assertTextfield
assertCheckbox #If this method fails it wont execute the next method
assertButton
end

def assertTextfield
assert($ie.text_field(:id,"username").exists?, "Username text field does not 
exist")
assert($ie.text_field(:id,"passwd").exists?, "Password text field does not 
exist")
end

def assertButton
  assert($ie.button(:value,"Sign In").exists?, "Sign In button does not 
exist")
end

def assertCheckbox
 assert_equal($ie.checkbox(:id, "persistent",2).isSet?, "Keep me signed in, 
 check box is not checked")
 rescue
 true
end

Is there any other way which executes all the steps defined in the method even 
any of the step fails and also should show the message why it has failed? 


That's what I get for answering emails before finishing my first cup of coffee. 
 :)

-c

 On 4/10/07, Paul  Carvalho < [EMAIL PROTECTED]> wrote: You're  repeating 
yourself, Charley. ;-)  This new assertions.rb covers one aspect of  what Watir 
User asked but not the other: "Its not only related to assertions ..  ".  
That's why I described a general Ruby construct for recovering from methods  
regardless of what Watir version you're using. 

Cheers.  Paul C. 


 On 10/04/07, Charley  Baker <  [EMAIL PROTECTED]> wrote: You  can also pull 
the assertions file and use it with Watir 1.4.1. 
https://svn.openqa.org/svn/watir/trunk/watir/watir/assertions.rbDownload 
this file, put it in your watir/watir directory and use it the  same way I 
mentioned in my previous mail.  

-Charley





   
-
 Check out what you're missing if you're not on Yahoo! Messenger 

yahoopage.rb
Description: 2132032765-yahoopage.rb


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

[Wtr-general] Need suggestion to download files from net....

2007-04-11 Thread san
Hi Everybody

I Need To Download Huge No Of html Files From net As Intact... & Also pdf 
Files... As Far As I Know Watir Can't Download Both ie.html just gives the 
html codes & watir Can't Save pdf...

So Will You Pls Suggest A gem Or Some Other Way To Do It By Ruby

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


[Wtr-general] code structure problem

2007-04-11 Thread aidy lewis
Hi,

I have a bit of a code structure problem, I wonder if any-one can help?

I instantiate the IE class and assign it to a global object

$ie = Watir::IE.new
def browser;$ie;end

I go through an Object Map using Module constants

module Login
  USERNAME = browser.text_field(:name, 'user_name')
  PASSWORD = browser.text_field(:name, 'password')

 # etc

end

I use Test::Unit setup and teardown methods

  include Login

  #the setup method is executed before each test method
  def setup
browser.goto('http://missiontesting.updatelog.com')
browser.bring_to_front
browser.maximize
  end

  #the teardown method is executed after each test method
  def teardown
   browser.close
  end

  However, after the first test method, the browser is closed,
  so Ruby cannot find the goto method (above in setup)

  How best can I structure this?

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