[wtr-general] Adding Date

2008-11-17 Thread Sunil Philip

Hi All..

Need help regarding adding date. In my application, there is a text
field which shows the system date. And i need to copy the next date to
another text field. What i curently do is, i add a number to the date
and then put that in the requried text field. Problem occurs when the
date is the last day of that month. Eg: if the system date is 30-
NOV-2008, i need to add 1-DEC-2008. How will it be possible? Is there
any method to add days to the system date? please help..

Sunil
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Should Tutorial and Quickstart be updated to use Watir::Browser?

2008-11-17 Thread Chuck vdL

I'm just getting started learning Watir, I've not even finished the
tutorial  (distractions at work keep pulling me away) and I only now
many of the items I mentioned because either other folks have told me
they exist (firebug) or because I saw references to them in other
messages here in the last few days.

I'm at that lovely stage where because I'm learning the stuff and have
fresh eyes I can see what's missing, or in some cases needs to change,
but unfortunately don't know the subject well enough to make the
changes myself.

On Nov 17, 1:07 am, Željko Filipin [EMAIL PROTECTED] wrote:
 On Fri, Nov 14, 2008 at 17:23, Chuck vdL [EMAIL PROTECTED] wrote:
  Shouldn't they be changed to reflect the new integration with
  Firewatir

 +1

 You sound like you know what you are talking about (a lot of you's in this
 short sentence). Would you do it?

 Željko
 --http://watirpodcast.com/alister-scott/
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Adding Date

2008-11-17 Thread Alan Baird
Sunil -
You want the Time class which is one of Ruby's core classes (see
http://www.ruby-doc.org/core/  http://www.ruby-doc.org/core/look for the
Time class).  Here are some examples that may help:

irb(main):014:0 require 'time'
= true
irb(main):016:0 t = Time.parse(30-11-2008)
= Sun Nov 30 00:00:00 -0600 2008
irb(main):017:0 t = t + (60 * 60 * 24)
= Mon Dec 01 00:00:00 -0600 2008
irb(main):020:0 t.strftime(%m/%d/%Y)
= 12/01/2008

Alan

On Mon, Nov 17, 2008 at 3:11 AM, Sunil Philip [EMAIL PROTECTED]wrote:


 Hi All..

 Need help regarding adding date. In my application, there is a text
 field which shows the system date. And i need to copy the next date to
 another text field. What i curently do is, i add a number to the date
 and then put that in the requried text field. Problem occurs when the
 date is the last day of that month. Eg: if the system date is 30-
 NOV-2008, i need to add 1-DEC-2008. How will it be possible? Is there
 any method to add days to the system date? please help..

 Sunil
 


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Browser locale setting

2008-11-17 Thread codek

Hi,

Is it possible to change IE's locale using watir?  We need to do this
as we have an app that displays localised content based on the
browsers locale setting - and we need to regression test this code.

If not has anyone come across any other tools to do this? I guess I
could use a generic application scripting tool...  Wouldnt be very
reliable though i suspect.

Thanks,
Dan

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] What Watir uses to control the browser?

2008-11-17 Thread Xuan Ngo

What Watir uses to control the browser?
Is it like Selenium, it uses JavaScript to control the browser?

Xuan.


  __
Instant Messaging, free SMS, sharing photos and more... Try the new Yahoo! 
Canada Messenger at http://ca.beta.messenger.yahoo.com/


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: What Watir uses to control the browser?

2008-11-17 Thread marekj
On Mon, Nov 17, 2008 at 9:52 AM, Xuan Ngo [EMAIL PROTECTED] wrote:


 What Watir uses to control the browser?
 Is it like Selenium, it uses JavaScript to control the browser?

 Xuan.

 magic, and some more magic
But for IE we connect to COM object
and for Firefox we connect with JSSH (javascriptt shell telnet session)
but all flows through Watir and its elegant human comprehensible API
but if you feel a need for raw sushi like experience you can always telnet
localhost 9997 to talk to ChromeWindow or XULElmenent

cheers.
marekj | Semantic Page Objects Automation

Watir Framework
http://www.bitbucket.org/marekj/watirloo/

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] how to attach to Firefox browser

2008-11-17 Thread marekj
Need help understanding something.

My main way of attaching to an already existing window for IE is:
browser = Watir::IE.attach how, what
it returns a ref to IE and I can continue with my tests without starting any
new windows.
It allows me to stop tests. setup some conditions manually and continue
tests from that known context.

1) how do I do the same behavior with Firefox?
It seems I have to start Firefox every time with new or start but when the
script ends I can't attach back to the same window.
it looks like the attach method does not attach to the browser but binds
popup as belonging to the main browser.

ideas?





marekj | Semantic Page Objects Automation

Watir Framework
http://www.bitbucket.org/marekj/watirloo/

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Adding Date

2008-11-17 Thread Sunil Philip

Thanks for the solution Alan.

I also got 2 other methods which are given below:

Method 1:

require 'date'

temp = Date::today+1
puts(temp.strftime(%d-%b-%Y).upcase)

Method 2: (I got it from this group itself)

require 'date'

#Date Add Function
def date_add(mth,day,yr)
  #Set Date Variable
  @new_date = Date.today
  #Month calculations
  if mth != 0
@new_date = @new_date  mth
  end
  #Day calculation
  if day != 0
@new_date = @new_date.+(day)
  end
  #Year calculation
  if yr != 0
@new_date = @new_date  yr * 12
  end
  #Returns new date
  return @new_date
end
@new_date = date_add(0,0,0)
puts @new_date
puts @new_date.strftime(%d-%b-%Y)




On Nov 17, 5:50 pm, Alan Baird [EMAIL PROTECTED] wrote:
 Sunil -
 You want the Time class which is one of Ruby's core classes 
 (seehttp://www.ruby-doc.org/core/ http://www.ruby-doc.org/core/look for the
 Time class).  Here are some examples that may help:

 irb(main):014:0 require 'time'
 = true
 irb(main):016:0 t = Time.parse(30-11-2008)
 = Sun Nov 30 00:00:00 -0600 2008
 irb(main):017:0 t = t + (60 * 60 * 24)
 = Mon Dec 01 00:00:00 -0600 2008
 irb(main):020:0 t.strftime(%m/%d/%Y)
 = 12/01/2008

 Alan

 On Mon, Nov 17, 2008 at 3:11 AM, Sunil Philip [EMAIL PROTECTED]wrote:





  Hi All..

  Need help regarding adding date. In my application, there is a text
  field which shows the system date. And i need to copy the next date to
  another text field. What i curently do is, i add a number to the date
  and then put that in the requried text field. Problem occurs when the
  date is the last day of that month. Eg: if the system date is 30-
  NOV-2008, i need to add 1-DEC-2008. How will it be possible? Is there
  any method to add days to the system date? please help..

  Sunil- 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---



[wtr-general] Re: Adding Date

2008-11-17 Thread Paul Rogers
I think watir now includes active support ( and if it doesnt its easy to add
it anyway) then you can do things like this:

irb(main):001:0 require 'date'
= true
irb(main):002:0 require 'activesupport'
= true
irb(main):003:0 Date.today + 2.days
= Wed, 19 Nov 2008


Paul



On Mon, Nov 17, 2008 at 8:46 PM, Sunil Philip [EMAIL PROTECTED]wrote:


 Thanks for the solution Alan.

 I also got 2 other methods which are given below:

 Method 1:

 require 'date'

 temp = Date::today+1
 puts(temp.strftime(%d-%b-%Y).upcase)

 Method 2: (I got it from this group itself)

 require 'date'

 #Date Add Function
 def date_add(mth,day,yr)
  #Set Date Variable
  @new_date = Date.today
  #Month calculations
  if mth != 0
@new_date = @new_date  mth
  end
  #Day calculation
  if day != 0
@new_date = @new_date.+(day)
  end
  #Year calculation
  if yr != 0
@new_date = @new_date  yr * 12
  end
  #Returns new date
  return @new_date
 end
 @new_date = date_add(0,0,0)
 puts @new_date
 puts @new_date.strftime(%d-%b-%Y)




 On Nov 17, 5:50 pm, Alan Baird [EMAIL PROTECTED] wrote:
  Sunil -
  You want the Time class which is one of Ruby's core classes (seehttp://
 www.ruby-doc.org/core/ http://www.ruby-doc.org/core/look for the
  Time class).  Here are some examples that may help:
 
  irb(main):014:0 require 'time'
  = true
  irb(main):016:0 t = Time.parse(30-11-2008)
  = Sun Nov 30 00:00:00 -0600 2008
  irb(main):017:0 t = t + (60 * 60 * 24)
  = Mon Dec 01 00:00:00 -0600 2008
  irb(main):020:0 t.strftime(%m/%d/%Y)
  = 12/01/2008
 
  Alan
 
  On Mon, Nov 17, 2008 at 3:11 AM, Sunil Philip [EMAIL PROTECTED]
 wrote:
 
 
 
 
 
   Hi All..
 
   Need help regarding adding date. In my application, there is a text
   field which shows the system date. And i need to copy the next date to
   another text field. What i curently do is, i add a number to the date
   and then put that in the requried text field. Problem occurs when the
   date is the last day of that month. Eg: if the system date is 30-
   NOV-2008, i need to add 1-DEC-2008. How will it be possible? Is there
   any method to add days to the system date? please help..
 
   Sunil- 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~--~~~~--~~--~--~---