Re: [Wtr-general] How to run test cases in sequence rather than atthe same time?

2007-01-22 Thread Jason He
Yes, it is not required to use test unit.
 
However, it seems that test unit encapsulate some methods could handle error, 
as well as include some statistics for the test result.
 
What is the suggestion if I want to write about 200~300 standalone test cases, 
which will run in a sequence, should I use test unit or without it?
 
Could you please give some advice. Thanks.
 
Regards,
Jason



From: [EMAIL PROTECTED] 代表 ?eljko Filipin
Sent: 2007-1-19 (星期五) 8:37
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] How to run test cases in sequence rather than atthe 
same time?


You do not have to use test unit. Take a look at this.
http://www.openqa.org/watir/example_testcase.html 
https://neo/watir/example_testcase.html,DanaInfo=www.openqa.org+ 
-- 
Zeljko Filipin
zeljkofilipin.com https://neo/,DanaInfo=zeljkofilipin.com+ 
Testing is not only what I do for a living. It is also what I do for fun. 
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] How to click on image associated with link

2007-01-22 Thread Željko Filipin

On 1/19/07, minal [EMAIL PROTECTED] wrote:


For some strange resons ie.cell(:id, 10TD37).click doesn't work on my
application.



I think you need to have watir 1.5 for that.
--
Zeljko Filipin
zeljkofilipin.com
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] key codes are always zero

2007-01-22 Thread Željko Filipin

On 1/21/07, David Appledore [EMAIL PROTECTED] wrote:


the text entered into text boxes does not fire key events properly in the
IE DOM



Take a look at FAQ, section Triggering JavaScript events
http://wiki.openqa.org/display/WTR/FAQ#FAQ-TriggeringJavaScriptevents
--
Zeljko Filipin
zeljkofilipin.com
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] How to run test cases in sequence rather than atthe same time?

2007-01-22 Thread Željko Filipin

On 1/22/07, Jason He [EMAIL PROTECTED] wrote:


However, it seems that test unit encapsulate some methods could handle
error



You can also handle errors in ruby without test unit. Take a look at
Exceptions,
Catch, and Throw section of Programming Ruby (
http://www.rubycentral.com/book/tut_exceptions.html).

as well as include some statistics for the test result.




You can also make your own statistics.

What is the suggestion if I want to write about 200~300 standalone test

cases, which will run in a sequence, should I use test unit or without it?



Without test unit. But, it is only what I think.

If you really like test unit, Bret made a patch for it so methods are run in
order you define them, but I did not try it. Take a look.
http://wiki.openqa.org/display/WTR/Test-Unit+Patch
--
Zeljko Filipin
zeljkofilipin.com
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] key codes are always zero

2007-01-22 Thread Paul Rogers
I think Ive tried to do this and never made it work...

Hi,

I enjoyed using Watir, I have one problem.

When automating tests, the text entered into text boxes does not fire key
events properly in the IE DOM, the key codes are always zero. I am testing a
browser plugin, that captures keystrokes when im doing debugging so I can
set the plugin into certain modes from text entered. Ive tried modifying the
source to generate the right codes but doesn't work. Is there a way to make
it set the correct key codes?



Regards

David
___
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 test cases in sequence rather than atthe same time?

2007-01-22 Thread Bret Pettichord
Jason He wrote:
 Yes, it is not required to use test unit.
 However, it seems that test unit encapsulate some methods could handle
 error, as well as include some statistics for the test result.
 What is the suggestion if I want to write about 200~300 standalone
 test cases, which will run in a sequence, should I use test unit or
 without it?
 Could you please give some advice. Thanks.


My advice is that you continue to use Test::Unit. By default, Test::Unit
will create a Test::Suite made up of all your tests, but in a somewhat
random order. If you create the Suite yourself instead, you can control
the order. I suggest you look at the Rdoc for Test::Unit and create the
suite yourself.

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


Re: [Wtr-general] same text fordifferent urls..

2007-01-22 Thread Nathan Christie
When you say, ...it's working for the general urls, but not for the ajax 
links..., what exactly to you mean by not working. Does it seem the click() 
method is not being called and the page is not changing, or is there a runtime 
object [link] identification error?
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6183messageID=17494#17494
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] How to retrieve TH in table

2007-01-22 Thread Nathan Christie
This COM code will work if you're having trouble getting exactly what you want 
from Watir:

my_header = $browser.table( :id, 
'ctl00_MasterContentPlaceHolder_DomainGridView' ).getOLEObject().rows( 0 
).innerText().to_a()

Unfortunately, this returns escaped characters as well.

You can also access individual cells this way, and sometimes I find it easier 
to just do it directly through the COM.

my_cell = $browser.table( :id, 'theID' ).rows( x ).cells( y ).innerText()

Hope this helps^^

#8212;Nathan Christie
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6193messageID=17502#17502
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


[Wtr-general] Cannot select in dropdown box, written in javascript

2007-01-22 Thread Andrew
Hello,

I am new to Watir and need to select an item in a dropdown box.
This dropdown is a table and located in a body, written in javascript.
I tried regular $ie.select_list( :name , search_clientid).select(qaone), 
but it doesn't work. 
Please help!

body
script type=text/javascript src=/js/include.js /script
script type=text/javascript src=/js/admin.js/script

table class=table_box cellpadding=0 cellspacing=0 width=200
tr class=bar
td nowrapCLIENTS a href=/it/crm/clients.cfm-all/a/td
td align=righta 
href=/it/crm/modules/add_mod_modules.cfm?action=removemodule=sm_quick_add_projectimg
 src=/images/delete.gif border=0/a/td
/tr
tr
td colspan=2
select style=width:200px name=search_clientid 
onChange=document.location=this.options[this.selectedIndex].value;
option value=0choose client

option 
value=client_setup_view.cfm?clientid=117aavacations/option

option 
value=client_setup_view.cfm?clientid=1advertiser/option
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6222messageID=17504#17504
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general


Re: [Wtr-general] Cannot select in dropdown box, written in javascript

2007-01-22 Thread carl . l . shaulis




Howdy,

Does your select box appear as a Popup?

If my assumption is correct you can use something like this:

@ie.link(:text, link to JS Pop Up).click

ie2 = IE.attach(:title, Title of the Pop Up)

assert(ie2.selectBox(:name, search_clientid).exists?)
assert(ie2.selectBox(:name, search_clientid).enabled?)

ie2.selectBox( :name , search_clientid).select(advertiser)

ie2.image(:src , /save_button.gif/).click  {In your application
this may not be an image so your treat it as a link}

I hope this helps.  If I am way off base could you provide a bit more
detail about the behavior?

Welcome to WATIR!

Carl





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


Re: [Wtr-general] How to run test cases in sequence rather than at the same time?

2007-01-22 Thread Jason He
Do these test cases are compatible both running in IE and firefox? How about it 
to the test cases with/without using test unit?
 
Should each test cases need to be changed, or just change the browser name at 
the control list.
 
 
Regards,
Jason



From: [EMAIL PROTECTED] 代表 ?eljko Filipin
Sent: 2007-1-22 (星期一) 7:43
To: wtr-general@rubyforge.org
Subject: Re: [Wtr-general] How to run test cases in sequence rather thanatthe 
same time?


On 1/22/07, Jason He [EMAIL PROTECTED] wrote: 

However, it seems that test unit encapsulate some methods could handle 
error


You can also handle errors in ruby without test unit. Take a look at 
Exceptions, Catch, and Throw section of Programming Ruby 
(http://www.rubycentral.com/book/tut_exceptions.html 
https://neo/book/tut_exceptions.html,DanaInfo=www.rubycentral.com+ ).




as well as include some statistics for the test result.


You can also make your own statistics.



What is the suggestion if I want to write about 200~300 standalone test 
cases, which will run in a sequence, should I use test unit or without it?


Without test unit. But, it is only what I think.

If you really like test unit, Bret made a patch for it so methods are run in 
order you define them, but I did not try it. Take a look.
http://wiki.openqa.org/display/WTR/Test-Unit+Patch 
https://neo/display/WTR/Test-Unit+Patch,DanaInfo=wiki.openqa.org+ 
-- 
Zeljko Filipin
zeljkofilipin.com https://neo/,DanaInfo=zeljkofilipin.com+  
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] How to run test cases in sequence rather than at the same time?

2007-01-22 Thread Bret Pettichord

 If you really like test unit, Bret made a patch for it so methods are
 run in order you define them, but I did not try it. Take a look.
 http://wiki.openqa.org/display/WTR/Test-Unit+Patch
 https://neo/display/WTR/Test-Unit+Patch,DanaInfo=wiki.openqa.org+
This is in the latest Development gems.

This is how to use it:

require 'watir/testcase'

class MyTest  Watir::TestCase
def test_in_order
...
end
end

This only ensures that your test methods are executed in the order they
are defined. TestCase classes are still executed in random order. As i
said in the other post, work around this problem, by creating your own
test suite.

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


[Wtr-general] error happened when calling verify_match() ...

2007-01-22 Thread Jason He
Hi,
 
 
I tried to use Verification methods 
verify file:///C:/watir1145/rdoc/classes/Watir/Assertions.html#M000186
verify_equal file:///C:/watir1145/rdoc/classes/Watir/Assertions.html#M000187  
  verify_match 
file:///C:/watir1145/rdoc/classes/Watir/Assertions.html#M000188

Included Modules (Test::Unit::Assertions )

The script as follow,
 
---
require 'watir' 
require 'test/unit/assertions'

   $ie = Watir::IE.new
..
 
   verify_match($ie.text_field(:name, user).set(admin).to_s, admin)
 
..
 
---
when run the above script, it will return the following error,
undefined method `verify_match' for #Object:0x294fa3c (NoMethodError) 
 
I also tried above other methods, will return error too.
 
I found that these methods are defined in watir/assertions.rb.
 
 
Did I miss anything when use those methods?
 
 
Regards,
Jason
 
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Re: [Wtr-general] undefined method `[]' for nil:NilClass (NoMethodError) error at the end of array???

2007-01-22 Thread mi
sorry, i keep forgetting that the array starts at 0:-(

mi wrote:
 t = [[a, b], [aa, bb]]

 0.upto (t.length) { |x|
puts t[x][0]
 }

 For some reason i'm getting the following error at the end of the 
 loop, any idea WHY??? a
 aa
 undefined method `[]' for nil:NilClass (NoMethodError)

 Thanks in advance!

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


[Wtr-general] undefined method `[]' for nil:NilClass (NoMethodError) error at the end of array???

2007-01-22 Thread mi
t = [[a, b], [aa, bb]]

0.upto (t.length) { |x|
puts t[x][0]
}

For some reason i'm getting the following error at the end of the loop, 
any idea WHY??? 
a
aa
undefined method `[]' for nil:NilClass (NoMethodError)

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


[Wtr-general] Inserting date from a Date picker handled thru javascript

2007-01-22 Thread sarita
There is a read-only text box where date is inserted from a Date picker thru 
java script. How to automate this?
-
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=6231messageID=17524#17524
___
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general