Re: [Wtr-general] Porting Watir to JRuby

2007-06-17 Thread aidy lewis
Hi,

On 13/06/07, Nick Sieger [EMAIL PROTECTED] wrote:
 On 6/13/07, Nivetha Padmanaban [EMAIL PROTECTED] wrote:
 
  Any plans of porting WATIR to JRuby??

 None that I know of at the moment.  The stumbling block is to get a
 compatible version of 'win32ole' on JRuby which we don't have.

Watij uses Groovy as it's scripting language. Groovy is a dynamic
lanagage that exists within a JVM. Groovy can access COM.

http://groovy.codehaus.org/COM+Scripting

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


Re: [Wtr-general] Breaking code into several classes and methods

2007-06-17 Thread Paul Rogers
a very quick look suggesrs you need
  if $ie.link(:text, $page.link_to_text ).exists?
in place of 
  if $ie.link(:text, page.link_to_text ).exists?


  - Original Message - 
  From: Jeff Fry 
  To: wtr-general@rubyforge.org 
  Sent: Friday, June 15, 2007 6:43 PM
  Subject: [Wtr-general] Breaking code into several classes and methods


  Hi all,

  I'm using my trusty pickaxe plus various code samples to try to take a script 
of mine and break it up a bit into several classes and methods within 
classes...and getting stuck.

  When I run the code below, I get: 
  test_benchmark_page(TC_PerformanceBenchmark):
  NoMethodError: undefined method `link_to_text' for #Page:0x2e28b94
  performance_benchmark2.rb:56:in `benchmark'
  performance_benchmark2.rb:54:in `times' 
  performance_benchmark2.rb:54:in `benchmark'
  performance_benchmark2.rb:69:in `test_benchmark_page'

  It complains about this line in particular:
if $ie.link(:text, page.link_to_text).exists? 

  But when I try it in irb it seems that page.link_to_text shouldn't be a 
problem:
  irb(main):040:0 $page = Page.new(c_eastwood, 
/view?id=%239202a8c04000641f8056de6, Mystic River) 
  = #Page:0x2dafe24 @link_to_test=Mystic River, 
@url=/view?id=%239202a8c0400641f80056de6, @key=c_eastwood
  irb(main):041:0 $page.link_to_test
  = Mystic River 

  Here's my relevant code:
  class TC_PerformanceBenchmark  Test::Unit::TestCase
...
def benchmark(page)
  1.times do
$ie.goto($url_root + page.url)
if $ie.link(:text, page.link_to_text ).exists?
  $results_array  $ie.down_load_time.to_s
  p '$ie.down_load_time: '+$ie.down_load_time.to_s
else
  $results_array  'e'
  p 'e' 
end #if
  end #do
end

def test_benchmark_page
  login($url_root, $user, $pw)
  $page = Page.new(c_eastwood, 
/view?id=%239202a8c04000641f80056de6, Mystic River) 
  benchmark($page)
end  

  end #class

  class Page 
def initialize (key, url, link_to_test)
  @key = key
  @url = url
  @link_to_test = link_to_test
end
attr_reader :key
attr_reader :url 
attr_reader :link_to_test
  end

  Any ideas?

  Thanks,
  Jeff

  -- 
  http://testingjeff.wordpress.com 


--


  ___
  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] Our contribution to Watir

2007-06-17 Thread Paul Rogers
looking at the methods provided, it would seem that some are definite 
candidates for inclusion  the dialog code for example )

some of the others, like the regex methods, dont seem to be particularly 
suited watir.

But saying that, thanks for the contributions, they are always welcome, and 
give people ideas of what can be done

Paul

- Original Message - 
From: Bret Pettichord [EMAIL PROTECTED]
To: wtr-general@rubyforge.org
Sent: Saturday, June 16, 2007 4:45 PM
Subject: Re: [Wtr-general] Our contribution to Watir


 Charley Baker wrote:
 It's great to have user contributions, I haven't had a chance to look
 at it yet,  but will soon. Instead of adding it to a jira ticket, you
 should add it to the user contribution area of the wiki on openqa.
 http://wiki.openqa.org/display/WTR/Contributions
 I've been talking the people at Webmetrics off-list. They would like
 their enhancements to be bundled in the watir gem. I explained that we
 would need unit tests and need to review the enhancements for
 consistency with the Watir design principles. Submissions via Jira are
 appropriate for this kind of thing. For changes, we prefer a patch file,
 but since this submission amounts to a monkey patch, it's current form
 is acceptable.

 Just for the record, we don't have these constraints (tests,
 consistency) for code that submitted to the contributions page of the 
 wiki.

 Bret
 ___
 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] Breaking code into several classes and methods

2007-06-17 Thread Bret Pettichord
Jeff Fry wrote:
 It complains about this line in particular:
   if $ie.link(:text, page.link_to_text).exists?

 But when I try it in irb it seems that page.link_to_text shouldn't be 
 a problem:
 irb(main):040:0 $page = Page.new(c_eastwood, 
 /view?id=%239202a8c04000641f8056de6, Mystic River)
 = #Page:0x2dafe24 @link_to_test=Mystic River, 
 @url=/view?id=%239202a8c0400641f80056de6, @key=c_eastwood
 irb(main):041:0 $page.link_to_test
 = Mystic River
you've confused link_to_text for link_to_test
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Understanding down_load_time on AJAXy pages

2007-06-17 Thread Bret Pettichord
Jeff Fry wrote:
 100.times do
   url = $url_root + /view?id=%239202a8c04000641f80056de6
   start = Time.now
   $ie.goto(url)
   if $ie.link(:text,'Million Dollar Baby').exists?
 $results_array  $ie.down_load_time.to_s
 p '$ie.down_load_time: '+$ie.down_load_time.to_s
   else # there's a problem with the page
 $results_array  'e'
 p 'e'
   end #if
   took = Time.now - start

 I'm curious why I get up to .5 seconds more for 'took' than I do for 
 down_load_time. Does down_load_time have a way of knowing when 
 everything on the page has finished loading on a page where various 
 elements render in phases?
You should take a look at the code in the wait method that compiles the 
download_time (which really is the page load time).

ie.goto calls navigate before starting the counter, you could measure it 
to see how much time it is taking.

You are also calling ie.link().exists? before stopping your counter and 
it is also probably taking some time.

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


Re: [Wtr-general] how to properly use the snippet function?

2007-06-17 Thread Bret Pettichord
reinier wrote:
 I am trying to get rid of all cookies via a function.
 On this forum I found the Snippet thingy.
 http://rubyforge.org/snippet/detail.php?type=snippetid=26
 So I included that code in my script and trying to use it, but I can't figure 
 out how.

 this is the code:
 [code]
 DeleteUrlCacheEntry = Win32API.new(wininet, DeleteUrlCacheEntry, ['P'], 
 'V')
 [/code]

 So what function should be called to delete all the cookies
main

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


Re: [Wtr-general] Microsoft Tab Strip Issues - urgent

2007-06-17 Thread imran
Hi, Bret

Thanks.

I will try the regular expression. If you means to say any hidden parameter as 
session key then no.

I need to work on regular expressions. thanks for the link. I will let you know 
about the progress i made.
I think microsft tab strip support must be added to the watir.
Also if one wants to add one's own function then what one will have to do. 
Please refer any site How to contribute to watir and what are the required 
skills.

Thanks again.

Kind Regards,
M.Imran
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general