[wtr-general] Re: How to run 2 different scripts at the same time?

2009-08-11 Thread Dylan

Did you look at the link I posted? It shows you how to do this.

Here's an example for running two google searches at the same time:

require 'watir'
require 'watir/ie'

  def test_google1
ie = Watir::IE.start('http://www.google.com')
ie.text_field(:name, q).set(Test)
ie.button(:value, Google Search).click
ie.close
  end

  def test_google2
ie = Watir::IE.start('http://www.google.com')
ie.text_field(:name, q).set(Other Test)
ie.button(:value, Google Search).click
ie.close
  end

  threads = []
  threads  Thread.new{test_google1}
  threads  Thread.new{test_google2}
  threads[0].join
  threads[1].join


-Dylan

On Aug 10, 10:30 pm, Marlon marlonmoja...@gmail.com wrote:
 for example:

 require 'thread'
 require 'watir'

 class search
   def test_google
     ie = Watir::IE.start('http://www.google.com')
     ie.text_field(:name, q).set(pickaxe)
     ie.button(:value, Google Search).click
     ie.close
   end

   def test_yahoo
     ie = Watir::IE.start('http://www.google.com')
     ie.text_field(:id, p).set(pickaxe)
     ie.button(:id, searchsubmit).click
     ie.close
   end
 end

 threads = []

 how can I run this 2 def at the same time?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How to run 2 different scripts at the same time?

2009-08-11 Thread zakir hussain
This is just gr8. It works

Thanks Dylan

- zakir

On Tue, Aug 11, 2009 at 11:31 AM, Dylan mej...@gmail.com wrote:


 Did you look at the link I posted? It shows you how to do this.

 Here's an example for running two google searches at the same time:

 require 'watir'
 require 'watir/ie'

  def test_google1
ie = Watir::IE.start('http://www.google.com')
ie.text_field(:name, q).set(Test)
ie.button(:value, Google Search).click
ie.close
  end

  def test_google2
ie = Watir::IE.start('http://www.google.com')
ie.text_field(:name, q).set(Other Test)
ie.button(:value, Google Search).click
ie.close
  end

  threads = []
  threads  Thread.new{test_google1}
  threads  Thread.new{test_google2}
  threads[0].join
  threads[1].join


 -Dylan

 On Aug 10, 10:30 pm, Marlon marlonmoja...@gmail.com wrote:
  for example:
 
  require 'thread'
  require 'watir'
 
  class search
def test_google
  ie = Watir::IE.start('http://www.google.com')
  ie.text_field(:name, q).set(pickaxe)
  ie.button(:value, Google Search).click
  ie.close
end
 
def test_yahoo
  ie = Watir::IE.start('http://www.google.com')
  ie.text_field(:id, p).set(pickaxe)
  ie.button(:id, searchsubmit).click
  ie.close
end
  end
 
  threads = []
 
  how can I run this 2 def at the same time?
 



-- 
Best Regards

zakir

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: RDoc files on rubyforge need to be updated

2009-08-11 Thread Brandon Faloona

hmm... I made that assumption after comparing my gem server version to
this:
http://wtr.rubyforge.org/rdoc/classes/Watir/RadioCheckCommon.html

... which shows different methods available.

Brandon

On Aug 10, 7:46 am, Bret Pettichord bpettich...@gmail.com wrote:
 They are updated to 1.6.2. Why do you say they aren't updated?

 Bret

 On Aug 9, 9:13 pm, Brandon bfalo...@gmail.com wrote:

  These docs are still at 1.5.6 and need to be 
  updated...http://wtr.rubyforge.org/rdoc/

  Please let me know if I can assist...

  Brandon
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Need a sample code to import test data from Excel sheet

2009-08-11 Thread Naveen devadass

Hi all,
Can you please help on this

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Need a sample code to import test data from Excel sheet

2009-08-11 Thread zakir hussain
Hi,

I wud like to post in this group. Kindly add me in this chain


Thanks

zakir

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] How can I add a new method to Watir::Radio?

2009-08-11 Thread John Kolokotronis

Hi All,

I thought my understanding of Ruby classes was getting a bit better
but I can't seem to add a new method to Watir::Radio, without breaking
all functionality for radio buttons... E.g. I tried adding a dummy
method like this:

class Watir::Radio
  def myMethod
puts this is my method
  end
end

When I then call the method or any other existing method, like
isSet?, I get error messages about the number of arguments given:

wrong number of arguments (4 for 0)

whenever I try to call any method from the Watir::Radio class. What
I'm doing wrong? How can I extend Watir::Radio, without messing with
the main watir.rb files? Thanks in advance.

Regards,

John


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How can I add a new method to Watir::Radio?

2009-08-11 Thread Dylan

Try looking at where the radio methods are defined in watir, that
should give you a clue.

In input_elements.rb, the declaration of Radio functions look like
this:

Module Watir
   class Radio  RadioCheckCommon
  def myMethod
  puts this is my method
  end
end
end

-Dylan

On Aug 11, 12:56 am, John Kolokotronis johnj...@gmail.com wrote:
 Hi All,

 I thought my understanding of Ruby classes was getting a bit better
 but I can't seem to add a new method to Watir::Radio, without breaking
 all functionality for radio buttons... E.g. I tried adding a dummy
 method like this:

 class Watir::Radio
   def myMethod
     puts this is my method
   end
 end

 When I then call the method or any other existing method, like
 isSet?, I get error messages about the number of arguments given:

 wrong number of arguments (4 for 0)

 whenever I try to call any method from the Watir::Radio class. What
 I'm doing wrong? How can I extend Watir::Radio, without messing with
 the main watir.rb files? Thanks in advance.

 Regards,

 John
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How can I add a new method to Watir::Radio?

2009-08-11 Thread John Kolokotronis

Thanks - I noticed the Radio class is in input_elements.rb and tried
the structure you suggested before my original post:

module Watir
   class Radio  RadioCheckCommon
  def myMethod
 puts this is my method
  end
end
end

But this just generates another error:
uninitialized constant Watir::RadioCheckCommon (NameError)

And the script can't be executed at all then...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Need a sample code to import test data from Excel sheet

2009-08-11 Thread Smruti Ranjan Kar
require 'win32ole'

$application = WIN32OLE.new('Excel.Application')
generalworksheet=$application.Workbooks.Open(Dir.getwd+\\Testdata\\testdata.xls).Worksheets(General)
generalworksheet.Activate
$test_site=generalworksheet.Cells(6,2).value

On Tue, Aug 11, 2009 at 1:14 PM, zakir hussain zaki...@gmail.com wrote:

 Hi,

 I wud like to post in this group. Kindly add me in this chain


 Thanks

 zakir


 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Need a sample code to import test data from Excel sheet

2009-08-11 Thread Wesley Chen
You can search in the google group, you can also turn to Watir community,
you can get all the great documents about what you want.

Please search...

Thanks.
Wesley Chen.


On Tue, Aug 11, 2009 at 5:04 PM, Smruti Ranjan Kar 
smrutiranjan@gmail.com wrote:

 require 'win32ole'

 $application = WIN32OLE.new('Excel.Application')

 generalworksheet=$application.Workbooks.Open(Dir.getwd+\\Testdata\\testdata.xls).Worksheets(General)
 generalworksheet.Activate
 $test_site=generalworksheet.Cells(6,2).value


 On Tue, Aug 11, 2009 at 1:14 PM, zakir hussain zaki...@gmail.com wrote:

 Hi,

 I wud like to post in this group. Kindly add me in this chain


 Thanks

 zakir





 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] undefined method `length' for nil:NilClass

2009-08-11 Thread Maumita

Hi all

 I have written a script, in which from an excel file a value will get
enter in the text field ie.text_field(:name, productName).set
$worksheet.Range(a#{i}).value

My script:

require 'watir'
include Watir

$excel_path = D:/Data/dportalTestScripts/Product.xlsx
$sheet_id   = 1
$excel = WIN32OLE.new(excel.application)
$excel['Visible'] = true;
$workbook = $excel.Workbooks.Open $excel_path
$worksheet = $workbook.WorkSheets($sheet_id)
$worksheet.Select

 ie = Watir::IE.new
 ie.goto(http://test.com;)
 ie.text_field(:name, userName).set(a)
 ie.text_field(:name, password).set('d')
 ie.button(:value, Login).click
 ie.image(:name, 'toplogo_nav_08_off').click
 ie.link(:text, Manage Products).click
 ie.link(:text, Create Product).click

ie.text_field(:name, productName).set $worksheet.Range(a#
{i}).value

I get the error when my script gets to this point (ie.text_field
(:name, productName).set $worksheet.Range(a#{i}).value)

D:\Data\dportalTestScriptsCreate Multiple Product.rb
d:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1230/./watir.rb:4005:in
`doKeyPress': undefined method `length' for nil:NilClass
(NoMethodError)
from d:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1230/./
watir.rb:3986:in `set'
from D:/Data/dportalTestScripts/Create Multiple Product.rb:50

Does anyone know if my problem is the length of the field name or ?
Is there any way around the problem? The length of the field name is
100

Thanks in advance for any help you can provide!

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: undefined method `length' for nil:NilClass

2009-08-11 Thread John Kolokotronis

The local variable i in your last line isn't defined anywhere in your
script...

So: ie.text_field(:name, productName).set $worksheet.Range(a#
{i}).value)

i isn't defined so no value is retrieved. If you are trying to
retrieve a number of cells, you can do it with a for loop:

for i in 1..5 # to get the first five cells...
  ie.text_field(:name, productName).set($worksheet.Range(a#
{i}).value) # Note the missing bracked in your original...
end

This is assuming the rest of your code is correct, which I haven't
tested. You could try outputting the Excel values to the command line
first to make sure you are getting the expected results - length is
not your problem, the error simply is there because you are passing a
nil value...

Regards,

John
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: undefined method `length' for nil:NilClass

2009-08-11 Thread Maumita

Please find the updated script -

require 'watir'
include Watir

$excel_path = D:/Data/dportalTestScripts/Product.xlsx
$sheet_id   = 1
$excel = WIN32OLE.new(excel.application)
$excel['Visible'] = true;
$workbook = $excel.Workbooks.Open $excel_path
$worksheet = $workbook.WorkSheets($sheet_id)
$worksheet.Select

 ie = Watir::IE.new
 ie.goto(http://test.com;)
 ie.text_field(:name, userName).set(a)
 ie.text_field(:name, password).set('d')
 ie.button(:value, Login).click
 ie.image(:name, 'toplogo_nav_08_off').click
 ie.link(:text, Manage Products).click
 ie.link(:text, Create Product).click

i = 1
until i  3
ie.text_field(:name, productName).set $worksheet.Range(a#
{i}).value
ie.button(:name, submit_btn).click

if i == 3
break
  end
  i+=1
end


Thanks
Maumita


On Aug 11, 3:41 pm, John Kolokotronis johnj...@gmail.com wrote:
 The local variable i in your last line isn't defined anywhere in your
 script...

 So: ie.text_field(:name, productName).set $worksheet.Range(a#
 {i}).value)

 i isn't defined so no value is retrieved. If you are trying to
 retrieve a number of cells, you can do it with a for loop:

 for i in 1..5 # to get the first five cells...
   ie.text_field(:name, productName).set($worksheet.Range(a#
 {i}).value) # Note the missing bracked in your original...
 end

 This is assuming the rest of your code is correct, which I haven't
 tested. You could try outputting the Excel values to the command line
 first to make sure you are getting the expected results - length is
 not your problem, the error simply is there because you are passing a
 nil value...

 Regards,

 John
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] user experience response time script.

2009-08-11 Thread Maumita

Hi,

we are developing a shopping website.
I want to write a user experience response time script.
The script should contain the following steps -
Users - 3

1. 3 users will hit a URL at the same time
2. 3 users will click on a product tab and the product page will
appear. The product page will have images of total 9 items along with
their product name and price  on one page
3. 3 users will click on any of the product name
4. The corresponding product detail page will appears. The product
detail page will have description about the product and more info.

In all the above cases, we want to capture the response time of the
page to load.
Is this possible in watir. Its urgent

Thanks
Maumita
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Watir and Active X

2009-08-11 Thread Pallavi Sharma
Hi

Has anyone ever countered a scenario below:

td align=right Date of Birth/td
td colspan=1

OBJECT id=txtUDF origvalue=##fld##_unmask=18011962
HiddenName=udf1
classid=CLSID:98A52828-A5D6-11D3-82B8-00104B39A31D
   codebase=../OnyxMaskEdit2Dual.cab#version=4,00,0,108
height=19 width=124 VIEWASTEXT
class=clsUDF
tabindex=42
PARAM NAME=MaxLength VALUE=20
PARAM NAME=Mask VALUE=99//99//

PARAM NAME=Text VALUE=18011962

PARAM NAME=Enabled VALUE=1

PARAM NAME=PromptInclude VALUE=0
/OBJECT

Does anyone has an idea if we have to do it with Watir how will go about it.

Any help appreciated..Please

Thanks

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] A Solution for PopUps Work around for Click no Wait

2009-08-11 Thread Pallavi Sharma
Hi

After being stuck with ClickNoWait, we found a jugad solution for the
click no wait..

SetFocus on your button
PressEnter
PressEnter again

Use obj.focus

and auto it autoit.Send({enter})

it works like wonders. Helped us.. may be of some help to someone out
there...

Thanks

Pallavi.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: undefined method `length' for nil:NilClass

2009-08-11 Thread John Kolokotronis

Why are you complicating the loop that much?

If you only want cells 1 and 2, use the for i in 1..2 loop or for i in
1...3 (three dots - that'll exclude 3 by definition).

But if you include the click in your loop, the 2nd time (and any other
iteration) around won't work because you won't be on the page that has
the text field - so you need to add functionality to return to the
correct page as well in the loop or add the click after all the text
fields are filled in (so it should be outside your loop).

What exactly are you trying to do? If you loop through the value in
the worksheet but keep filling in the same text field, you'll simply
end up overwriting its' contents with each iteration...

Regards,

John
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How to click the link in dynamically generated ajax content?

2009-08-11 Thread Durgesh Nadkarni
Hi Reveendran,

Thanks a lot for the given code. But the code which I am getting is as follows:
div class=prev_arrow_img
a count=0 class=PageLinkDisable 
href=/RSCpubs.ePlatform.Web/en/Search/JournalResultPrevious/a
/div

Currently the 'Previous' link is disabled. But when I use verify statement it 
does not recognized that link is disabled.

Thanks  Regards
Durgesh.

--- On Mon, 10/8/09, Raveendran P jazzezr...@gmail.com wrote:

From: Raveendran P jazzezr...@gmail.com
Subject: [wtr-general] Re: How to click the link in dynamically generated  ajax 
content?
To: watir-general@googlegroups.com
Date: Monday, 10 August, 2009, 9:51 AM

Hi Durgesh,

See the below example. 
1. Uploading some imsges
2. In Runtime -- I will get some code in BOLDED Div's. I collected the info 
from that div and checked it.

Still you are not clear then just copy and paste the Source code for that page. 
I will try more.


CODE:


def check_status
sleep(2)

@status=$ie.div(:class,display-states).html
@blo...@status.scan(%r{style=DISPLAY: block(.*?)/div}im).flatten.to_s  
  

@su...@block.include?(Success)
@que...@block.include?(Queued)
@uploadi...@block.include?(Uploading)
@canc...@block.include?(Cancelled)
@err...@block.include?(Error) 


if @succ == true
  return
end

if @queue == true
  sleep(20)
  check_status
end

if  @uploading== true
  sleep(10)
  check_status

end

  
if  @cancel== true
  $ie.link(:text,Retry)
  sleep(20)
  check_status
end

if  @error== true
  $ie.link(:text,Retry)

  sleep(20)
  check_status  
end   
  end  
  
end

Thanks


On Fri, Aug 7, 2009 at 6:13 PM, Durgesh Nadkarni fordurg...@yahoo.co.in wrote:


Hi Raveendran,

That HTML code is getting during runtime. Thats why we cannot paste the html 
code for that link.

Is there any other method through which we can recognized that link?

Thanks  Regards

Durgesh. 

--- On Fri, 7/8/09, Raveendran P raveend...@railsfactory.org wrote:


From: Raveendran P raveend...@railsfactory.org
Subject: [wtr-general] Re: How to click the link in dynamically generated ajax  
content?
To: watir-general@googlegroups.com

Date: Friday, 7 August, 2009, 2:58 PM

Hi Durgesh,

is it possible to paste the html code for that link here ?

Thanks,
Raveendran
http://raveendran.wordpress.com


On Fri, Aug 7, 2009 at 1:44 PM, Durgesh durgeshnadka...@gmail.com wrote:




Hi,



I want to click one link which is coming from dynamically generated

ajax contents.The source could not be found when I do view source.



Thanks  Regards

Durgesh






-- 
Regards,
P.Raveendran







   See the Web's breaking stories, chosen by people like you. Check out  
Yahoo! Buzz







-- 
Regards,
P.Raveendran
http://raveendran.wordpress.com










  Yahoo! recommends that you upgrade to the new and safer Internet Explorer 
8. http://downloads.yahoo.com/in/internetexplorer/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Cannot subclass Table

2009-08-11 Thread Jim Evans

That's fantastic. Thanks for that. Now that it's working, can someone
point me to some further reading as to why it works? What does the /
ie imply? If it's simply a namespace thing, I can understand that.
What documentation did I miss that I didn't figure this without having
to bother you good folks?

--Jim Evans
Numara Software, Inc.

On Aug 10, 7:50 pm, Bret Pettichord bpettich...@gmail.com wrote:
 Add this line to your script:

   require 'watir/ie'

 Bret

 On Aug 10, 1:03 pm, Jim Evans jim.ev...@numarasoftware.com wrote:



  As I mentioned in a previous message, I'm trying to model my
  application to enforce code reuse in my scripts. I think I've managed
  to find a way around the answer for my previous question, but I'm
  having a difficult time subclassing the Watir::Table class.

  If I try the following:

  require watir
  class TicketListGridControl  Watir::Table
    ...
  end

  then I get the following error stack when I attempt to run a script:

  C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/
  dependencies.rb:440:in `load_missing_constant': uninitialized constant
  Watir::Table (NameError)
          from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/
  active_support/dependencies.rb:80:in `const_missing'
          from ./object_model.rb:67
          from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
  `gem_original_require'
          from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
  `require'
          from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/
  active_support/dependencies.rb:156:in `require'
          from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/
  active_support/dependencies.rb:521:in `new_constants_in'
          from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/
  active_support/dependencies.rb:156:in `require'
          from program.rb:2

  It looks clear that my code can't resolve the name for the Table
  class. How do I correct the NameError?

  I'm sure this is probably another lack of Ruby experience issues on
  my part, but I'd really appreciate a nudge in the right direction.

  --Jim Evans
  Numara Software, Inc.- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: user experience response time script.

2009-08-11 Thread Felipe Knorr Kuhn
Hello Maumita,

As Tony said, you should probably stick to JMeter.

But, if you really want to do that quickly with Ruby, you could try the
following:

t1 = Time.now

 Navigate through the site 

t2 = Time.now

puts time taken:  + t2-t1.to_s +  seconds


FK

On Tue, Aug 11, 2009 at 9:25 AM, Tony ynot...@gmail.com wrote:


 Hi Maumita,

 The scenario you have described here is performance testing the
 shopping website.
 Would suggest you use jmeter or another performance test tool to do
 this.

 Watir is best used for functional testing.

 Thanks,
 Tony
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Trouble testing dynamically-created HTML

2009-08-11 Thread Burdette Lamar

I erred in asking two questions here.  I'll post the second
separately.

On Aug 5, 9:32 am, Burdette Lamar burdettela...@yahoo.com wrote:
 I’ve been having a lot of trouble with stuff that Javascript builds in
 the DOM after the complete HTML page is returned.  I’ve tried to
 counter that with extreme defensiveness.

 For example, this extension to Watir::SelectList is meant to bullet-
 proof SelectList#select against Javascript that’s building the options
 dynamically.  It waits until the desired option is included in the
 select list before trying to select it, thus:

 module Watir

   class SelectList

     # Wait for option, select it, return whether selected.

     alias old_select select

     def select(text)
       Watir::Waiter::wait_until { self.includes?(text) }
       Watir::Waiter::wait_until do
         old_select(text)
         self.selected?(text)
       end
     end

   end

 end

 When my test executes and it tries to select, for example,
 ‘2009.08.03.Mon.16.09.43:Name’, it _occasionally_ causes this failure
 (via RSpec):

 No option with text of 2009.08.03.Mon.16.09.43:Name in this select
 element
 C:/test/watir_extensions.rb:93:in `select'
 snipped traceback
 91      Watir::Waiter::wait_until { self.includes?(text) }
 92      Watir::Waiter::wait_until do
 93        old_select(text)
 94        self.selected?(text)
 95      end

 So one question is:  If self.includes?(text) is true, how can
 old_select fail?

 Another is:  How are other Watir users handling dynamically-created
 HTML?

 Thanks,Burdette
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Testing dynamically-created elements in the DOM

2009-08-11 Thread Burdette Lamar

(I erred in an earlier post by asking two questions in one post.  This
post puts the second question separately.)

Some of the HTML pages I test are modified in the DOM after the HTML
is delivered.

One of the first manifestations of this that I saw was getting an
exception when I tried to select an option in a select list.  When I
put in code to print the number of options in the list, I got 0 even
though I could see many options on my screen.  I found that the
options were built by Javascript after the page is delivered.

I don't know of a way to be sure when all dynamically-created elements
exist, so I don't know when it's safe to try to access them.

Does anyone have a strategy for dealing with this?

Thanks, Burdette

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Modeling web pages and table rows

2009-08-11 Thread Jim Evans

Sure, I'd be happy to. I think, though, that a little more background
might be in order. As I mentioned before, I have a table on the page
which represents a list of tickets. The first row of the table is a
row of header cells; subsequent rows represent individual tickets.
It's a little more complicated, in that the column order is user-
configurable. In other words, the first column is not always the same
data, so I can't rely on position for modeling the content of the row
elements. Initially I tried subclassing the Table object, adding a
couple of attributes that I need, like a Hash containing the current
column bindings. Here's something similar to my class for that table.

class TicketListGridControl  Watir::Table
  def SelectAllTicketsCheckBox
self.rows[1].checkbox(:name, MASTER_CHECKBOX)
  end

  def FieldNameMap
if not instance_variable_defined? :@field_map
  @field_map = Hash.new
  self.rows[1].cells.each_with_index {|value, index| @field_map
[value]=index }
end
@field_map
  end

  def VisibleTickets
# this method should return the list of tickets.
  end
end

I tried have VisibleTickets return TableRows.new(self), since that
doesn't filter out the header row, and I can't see any way to get that
to work. Additionally, using the built in TableRows collections will
not allow me to return objects that extend TableRow. This lead me down
the path of subclassing the TableRows collection, and suddenly it
seems like I'm doing a whole lot of subclassing, rather than just
extending what I need to.

Further, I tried to subclass a TableRow to give me the individual
ticket model, but I can't see how TableRow has any intrinsic knowledge
of the table it belongs to. I suppose I could pass in a reference to
the table's field map hash, but that seems a little clunky. If I
call .parent up the hierarchy on the subclassed TableRow, I can get
the table to which the row belongs, but it's a Watir::Table, not a
TicketListGridControl. I'm know I don't want to extend all tables to
contain these methods.

I'm sure there are other people who are trying to do the type of
semantic page modeling I'm attempting, where the pages to be modeled
are fairly sophisticated. I've had some success generating a model of
the application using WatiN; the latest builds provide a great deal of
plumbing to make this kind of thing dead simple. However, there are
some concerns in my organization about a need for cross-platform (not
just cross-browser) test execution. Thus, I find myself in unfamiliar
territory.

On Aug 10, 7:49 pm, Bret Pettichord bpettich...@gmail.com wrote:
 Can you show us what you tried?

 On Aug 10, 9:07 am, Jim Evans jim.ev...@numarasoftware.com wrote:



  I have a web application that I'm trying to create a model of in
  Watir, to encourage code reuse in the scripts, and I've hit a little
  snag. I have a table on the main page of the application, the first
  row of which has column header information. I need a method by which I
  can return all other rows in the table, ideally without iterating
  through the rows and adding them to an array. There must be a more
  efficient way. Certain ports of the Watir library have features that
  make this very easy, and maybe it's my lack of familiarity with Ruby
  that is causing my disconnect.- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How can I add a new method to Watir::Radio?

2009-08-11 Thread Dylan

Try adding require 'watir/ie' after your require 'watir' line

-Dylan

On Aug 11, 2:03 am, John Kolokotronis johnj...@gmail.com wrote:
 Thanks - I noticed the Radio class is in input_elements.rb and tried
 the structure you suggested before my original post:

 module Watir
    class Radio  RadioCheckCommon
       def myMethod
          puts this is my method
       end
     end
 end

 But this just generates another error:
 uninitialized constant Watir::RadioCheckCommon (NameError)

 And the script can't be executed at all then...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: How can I add a new method to Watir::Radio?

2009-08-11 Thread Bret Pettichord

You need to show us more code. E.g. what method is giving you this
error? Also send us the backtrace.

Bret

On Aug 11, 2:56 am, John Kolokotronis johnj...@gmail.com wrote:
 Hi All,

 I thought my understanding of Ruby classes was getting a bit better
 but I can't seem to add a new method to Watir::Radio, without breaking
 all functionality for radio buttons... E.g. I tried adding a dummy
 method like this:

 class Watir::Radio
   def myMethod
     puts this is my method
   end
 end

 When I then call the method or any other existing method, like
 isSet?, I get error messages about the number of arguments given:

 wrong number of arguments (4 for 0)

 whenever I try to call any method from the Watir::Radio class. What
 I'm doing wrong? How can I extend Watir::Radio, without messing with
 the main watir.rb files? Thanks in advance.

 Regards,

 John
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Trouble testing dynamically-created HTML

2009-08-11 Thread Bret Pettichord



On Aug 10, 8:28 pm, Jari Bakken jari.bak...@gmail.com wrote:
 On Tue, Aug 11, 2009 at 1:35 AM, Bret Pettichordbpettich...@gmail.com wrote:

  I just took a quick look at the Watir code (latest from trunk). I see
  an include? method but not an includes? method.

 They both exist. SelectList#includes? is aliased in camel_case.rb.

That explains it.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Trouble testing dynamically-created HTML

2009-08-11 Thread Bret Pettichord

My only explanation would be that the page changes (again) after the
call to includes? returns true but before you select the item.

Bret

On Aug 5, 9:32 am, Burdette Lamar burdettela...@yahoo.com wrote:
 I’ve been having a lot of trouble with stuff that Javascript builds in
 the DOM after the complete HTML page is returned.  I’ve tried to
 counter that with extreme defensiveness.

 For example, this extension to Watir::SelectList is meant to bullet-
 proof SelectList#select against Javascript that’s building the options
 dynamically.  It waits until the desired option is included in the
 select list before trying to select it, thus:

 module Watir

   class SelectList

     # Wait for option, select it, return whether selected.

     alias old_select select

     def select(text)
       Watir::Waiter::wait_until { self.includes?(text) }
       Watir::Waiter::wait_until do
         old_select(text)
         self.selected?(text)
       end
     end

   end

 end

 When my test executes and it tries to select, for example,
 ‘2009.08.03.Mon.16.09.43:Name’, it _occasionally_ causes this failure
 (via RSpec):

 No option with text of 2009.08.03.Mon.16.09.43:Name in this select
 element
 C:/test/watir_extensions.rb:93:in `select'
 snipped traceback
 91      Watir::Waiter::wait_until { self.includes?(text) }
 92      Watir::Waiter::wait_until do
 93        old_select(text)
 94        self.selected?(text)
 95      end

 So one question is:  If self.includes?(text) is true, how can
 old_select fail?

 Another is:  How are other Watir users handling dynamically-created
 HTML?

 Thanks, Burdette
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Watir General group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---