Re: [Wtr-general] Inserting date from a Date picker handled thru javascript
On 1/24/07, sarita [EMAIL PROTECTED] wrote: An image link is there. when it's clicked, the Date picker appears where date, month, year are there. When u click on a date, that date is inserted in the text box immediately the Date picker disappears. And, where is the problem? What can you do, and what you can not do? Bill said it really nice: Please show us an HTML snippet around it and maybe we can help. -- Zeljko Filipin zeljkofilipin.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Inserting date from a Date picker handled thru javascript
TABLE cellSpacing=0 cellPadding=0 width=71% border=0 TBODY TR TD width=38% style=height: 24pxinput name=ctl00$ContentPlaceHolder1$txtCreateDate type=text id=ctl00_ContentPlaceHolder1_txtCreateDate class=Input style=WIDTH: 84px size=8 readonly=readOnly value=1/24/2007 / nbsp; nbsp; nbsp;nbsp; /TD TD width=62% style=height: 24px img id=ctl00_ContentPlaceHolder1_imgCalCrDate onclick=javascript:return popUpCalendar(this,ctl00_ContentPlaceHolder1_txtCreateDate, 'mm/dd/', '__doPostBack(\'ctl00_ContentPlaceHolder1_txtCreateDate\')') src=../../../Javascript/cal/show_calendar.gif align=absmiddle style=color:IndianRed;height:21px;width:29px;border-width:0px; / /TD /TR /TBODY /TABLE - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6231messageID=17580#17580 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] error with running a testsuite
I got this error while running a test thru testsuite: Loaded suite C:/TESTSU~1.RB Started FE Finished in 15.124 seconds. 1) Failure: default_test(TC_newprojectso) [c:/ruby/lib/ruby/1.8/Test/Unit.rb:278 C:/TESTSU~1.RB:44]: No tests were specified. 2) Error: default_test(TC_newprojectso): NameError: undefined local variable or method `ie' for #TC_newprojectso:0x34be648 C:/TESTSU~1.RB:40:in `teardown' 1 tests, 1 assertions, 1 failures, 1 errors My code was like this: require 'Test/Unit' require 'watir/WindowHelper' require 'watir' class MyTests include Watir def self.suite suite = Test::Unit::TestSuite.new suite TC_newprojectso.suite return suite end end class TC_newprojectso Test::Unit::TestCase def setup --- end def teardown --- end def newprojectso end end How to avoid this error - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6256messageID=17585#17585 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] undefined method `[]' for
Another way to say this is: t.each {|x| puts x[0]} I'm enjoying this thread, heres another way. Sans 0! for element in (t.index(t.first)..t.index(t.last)) puts t[element].first end - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6230messageID=17595#17595 ___ 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???
On 23/01/07, Bret Pettichord wrote: This is largely because Watir is stupid in this area. We made a bad design choice with Watir 1.0. We'd now like to make Watir consistent and start with 0 everywhere (like everything else in Ruby) but this would raise compatibility issues. We welcome your thoughts in this area. I think being consistent everywhere would be a good thing. If that means being consistent with Ruby and starting at 0, then so be it. Personally, I think the person who first coded programming/scripting languages to start counting at 0 should have had his/her head examined and then been committed to an insane asylum. I've learnt many programming languages over the years and even once sat and painfully read through a series of programming language manuals as long as a desk shelf back almost 20 years ago. I still recall how that language was hailed as a Fourth-Generation Language that was supposed to make programming easier because the syntax and vocabulary (commands, methods, etc) were closer to more natural language. It seemed ironic that the easier the language was supposed to be, the more manuals were required to teach you how to program in it. The point here is that it is natural for human beings to start counting at 1. I have never in my entire life ever heard anyone start counting at 0. *That* is stupid. So, Paul, how many children do you have? Well, my first boy would be 0, and my second son would be 1, so I guess I have 1 child. Even the Cat in the Hat's best friends are Thing 1 and Thing 2. I would have like to have heard Dr. Seuss' thoughts on the topic of counting. If machines can't be made to speak *our* language, then they're not very useful. Forcing people to think and code in that way is an impediment to clear, human thought IMHO. In the absence of something good, I'll take something consistent. The enemy you know and all that, right? If you want to attract non-programmers to the use of the tool, then you will have to appeal to them in a friendly, non-programming way. (That would include not forcing them to rethink how to count because that's not a friendly thing to do.) I recall Gracie Hopper once saying that if you hear the phrase that's the way it's always been done then you know it's time to change it. Well, you asked for my thoughts. ;-) Thanks for asking. Let me just put this soapbox away for now.. ;-) Cheers. Paul C. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] error with running a testsuite
Can you post the complete code for your unit tests? I notice the `ie` not found variable; I'm assuming you have either: a) tried to create a Watir IE object like: myIE = ie.start( www.url.com ) - in this case the Watir IE object must be capitalized b) created your Watir IE object correctly like myIE = IE.start( www.url.com ) but make this variable only local to the setup(() method. If you define your ie variable in the setup method you must make it global, like $ie = IE.start( www.url.com ). These are just some suggestions based on what I see here. Hope this help, Nathan Christie - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6256messageID=17598#17598 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How to retrieve TH in table
Try this: t = ie.table( :id, ctl00_MasterContentPlaceHolder_DomainGridView ) t.row_values(1) Let me know if this is what you're looking for. Hope this helps, Nathan Christie - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6193messageID=17599#17599 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How to retrieve TH in table
Hi Nathan, I also came to that conclusion after writing my first question (see my first br response after first question). I don't understand why the 'header' is not shown whenbr I do a '.to_a'. Do you understand why it's not shown when doing '.to_a' br (see result in first question). Thanks for your response. br br Brad - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6193messageID=17601#17601 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] error with running a testsuite
Try changing the name of the test method from 'newprojectso' to 'test_01_newprojectso'. Test::Unit looks for methods that start with 'test_'. John --- sarita [EMAIL PROTECTED] wrote: I got this error while running a test thru testsuite: Loaded suite C:/TESTSU~1.RB Started FE Finished in 15.124 seconds. 1) Failure: default_test(TC_newprojectso) [c:/ruby/lib/ruby/1.8/Test/Unit.rb:278 C:/TESTSU~1.RB:44]: No tests were specified. 2) Error: default_test(TC_newprojectso): NameError: undefined local variable or method `ie' for #TC_newprojectso:0x34be648 C:/TESTSU~1.RB:40:in `teardown' 1 tests, 1 assertions, 1 failures, 1 errors My code was like this: require 'Test/Unit' require 'watir/WindowHelper' require 'watir' class MyTests include Watir def self.suite suite = Test::Unit::TestSuite.new suite TC_newprojectso.suite return suite end end class TC_newprojectso Test::Unit::TestCase def setup --- end def teardown --- end def newprojectso end end How to avoid this error - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6256messageID=17585#17585 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/features_spam.html ___ 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???
Whoever you are, you are FREAKING FUNNY and made an excellent point here:-) So, Paul, how many children do you have? Well, my first boy would be 0, and my second son would be 1, so I guess I have 1 child. Even the Cat in the Hat's best friends are Thing 1 and Thing 2. I would have like to have heard Dr. Seuss' thoughts on the topic of counting. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] problem to get handle of popup window
Hi All, I have a problem with getting handle of a popup window. I use Ruby 185-21 Watir 1.5.1.1145 Watir is installed with gem install watir on Ruby and directory looks like:C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.1.1145 Popup window is written in JavaScript: SCRIPT LANGUAGE=JavaScript TYPE=text/javascript I run a script to get handle of a popup window and puts handle number to cmd. require 'watir/contrib/enabled_popup' puts 'look for handle' hwnd = $ie.enabled_popup(10) puts 'got handle' + hwnd Watir fails to get handle and exits from the script before puts 'got handle' + hwnd. In cmd I receive the following info: c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir/waiter.rb:55:in `wait_un til': Timed out after 10.5 seconds. (Watir::Exception::TimeOutException) from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir.rb:208:in ` until_with_timeout' from c:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1145/./watir/contrib/ena bled_popup.rb:10:in `enabled_popup' from C:/Watir/new2.rb:47 Please advise. - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6262messageID=17613#17613 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Inserting date from a Date picker handledthru javascript
I think you should be able to trigger the date picker with one of these: ie.image(:id, /imgCalCrDate/).click or ie.image(:id, /imgCalCrDate/).fire_event('onClick') I've seen where the calendar can show up in a new ie popup window, as well as just another layer in the same window, I can't tell that from the HTML but if the date picker shows in a new ie window you'll need to attach to it using something like this ie2=IE.attach(:title, 'name of window') Once the date picker shows up (and you've attached to it if necessary) I'm guessing you can probably select a date with something like this (I've been able to it this way in the calendars I've run across): ie.link(:text, '25').click #where 25 is the date to pick #note -- ie would be ie2 if it's another window obviously I've also been able to change the month and year (and use whatever other controls may exist) in similar fashion using the appropriate regular watir objects - select_list, link, text_field, button or whatever. Hope this helps. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of sarita Sent: Wednesday, January 24, 2007 1:55 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Inserting date from a Date picker handledthru javascript TABLE cellSpacing=0 cellPadding=0 width=71% border=0 TBODY TR TD width=38% style=height: 24pxinput name=ctl00$ContentPlaceHolder1$txtCreateDate type=text id=ctl00_ContentPlaceHolder1_txtCreateDate class=Input style=WIDTH: 84px size=8 readonly=readOnly value=1/24/2007 / nbsp; nbsp; nbsp;nbsp; /TD TD width=62% style=height: 24px img id=ctl00_ContentPlaceHolder1_imgCalCrDate onclick=javascript:return popUpCalendar(this,ctl00_ContentPlaceHolder1_txtCreateDate, 'mm/dd/', '__doPostBack(\'ctl00_ContentPlaceHolder1_txtCreateDate\')') src=../../../Javascript/cal/show_calendar.gif align=absmiddle style=color:IndianRed;height:21px;width:29px;border-width:0px; / /TD /TR /TBODY /TABLE - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6231messageID=17580#17580 ___ 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] Logon popup window
Hi All, Does Watir work on HTTP Authentication logon popup windows? Thank you - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6264messageID=17616#17616 ___ 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???
Željko Filipin wrote: We'd now like to make Watir consistent and start with 0 everywhere (like everything else in Ruby) but this would raise compatibility issues. We welcome your thoughts in this area. I vote for start with 0 everywhere. Here is where you and everyone with an opinion should vote: http://jira.openqa.org/browse/WTR-61 It would not be hard to change Watir, if we don't care about backwards compatibility. But if we do care, then this becomes a more difficult change. Bret ___ 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???
do we have the ability to vote 'Yes - with no backwards compatability' 'Yes - with backwards compatability' or 'No' or just yes or no Ive just grepped my code and found 196 occurrances of :index :-( Paul - Original Message - From: Bret Pettichord [EMAIL PROTECTED] Date: Wednesday, January 24, 2007 2:40 pm Subject: Re: [Wtr-general] undefined method `[]' for nil:NilClass (NoMethodError) error at the end of array??? Željko Filipin wrote: We'd now like to make Watir consistent and start with 0 everywhere (like everything else in Ruby) but this would raise compatibility issues. We welcome your thoughts in this area. I vote for start with 0 everywhere. Here is where you and everyone with an opinion should vote: http://jira.openqa.org/browse/WTR-61 It would not be hard to change Watir, if we don't care about backwards compatibility. But if we do care, then this becomes a more difficult change. 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] undefined method `[]' for nil:NilClass (NoMethodError) error at the end of array???
Paul Rogers wrote: do we have the ability to vote 'Yes - with no backwards compatability' 'Yes - with backwards compatability' or 'No' or just yes or no I created two sub tickets. Vote for the one you want. Without backwards compatibility http://jira.openqa.org/browse/WTR-135 With backwards compatibility http://jira.openqa.org/browse/WTR-134 But realize that if you vote for this ticket, that means that you don't want 0-based indexing in Watir ever unless it has backwards compatability. In other words, it is probably a no. Bret ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] error with running a testsuite
sarita wrote: def self.suite suite = Test::Unit::TestSuite.new suite TC_newprojectso.suite return suite end end Why are you doing this? ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] How to handle the popup security alert
Hi, I'm using https to do the test, and I want to push the security alert automatically when it popups, which of the following function is available? clearSecurityAlertBox (WinClicker) file:///C:/watir1145/rdoc/classes/WinClicker.html#M23 push_security_alert_yes (WindowHelper) file:///C:/watir1145/rdoc/classes/WindowHelper.html#M63 Besides, is it necessary to judge whether that security alert popup? Regards, Jason ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] error with running a testsuite
I replaced ie with $ie throughout the code. The second error didn't come, but the first one still coming. This time in testsuite, I used two tests the following error came: C:\testsuite.rb Loaded suite C:/TESTSU~1.RB Started FF Finished in 34.139 seconds. 1) Failure: default_test(TC_newprojectsoisec) [c:/ruby/lib/ruby/1.8/test/Unit.rb:278 C:/TESTSU~1.RB:101]: No tests were specified. 2) Failure: default_test(TC_newprojectsounity) [c:/ruby/lib/ruby/1.8/test/Unit.rb:278 C:/TESTSU~1.RB:101]: No tests were specified. 2 tests, 2 assertions, 2 failures, 0 errors - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=6256messageID=17636#17636 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general