[wtr-general] Re: set watir_browser=ie is not working

2008-12-13 Thread Margam

HI marekj,
Thanks for the pointers. I think in a way I was using two command
prompts.
One to set the browser, and then I ran the script fromt SciTE (by
pressing F5). So I guess that's why it was not working.

When I used just one command prompt (to set browser and run the
script, everything is OK), the script works fine with both IE and FF.
Thank you everyone for the all the replies.

Margam

On Dec 12, 11:08 pm, marekj marekj@gmail.com wrote:
 On Thu, Dec 11, 2008 at 6:14 PM, Margam nk.mar...@gmail.com wrote:

  Hi John,
  So I tried using require 'watir/browser'  in my script and set
  watir_browser=ie from command prompt and everything is OK. IE is
  opened and the scripts runs fine.
  But when I type set watir_browser=firefox from command prompt and
  run the script, IE is still used. Firefox is not launched.
  Am I doing something wrong.

 one of two things may be happening:

 1) I wonder if you are using two cmd terminals.
 The problem with set command on windows is that the whatever you set lasts
 only for the duration of the process you are running in that one terminal
 window.
 So if you set watir_browser=firefox in terminal window 1 and run ruby script
 in terminal window 2 it will not know to run it on firefox.

 2) or when you type set watir_browser=firefox you can' t have any spaces
 so the following is incorrect 'set watir_browser = firefox'

 marekj

 Also for the time being I am doing to just change the default browser

  from the script itself (which works fine).

  Thank you
  Margam

  On Dec 11, 9:46 am, John Fitisoff jfitis...@yahoo.com wrote:
   I think the problem is that you are requiring watir rather than
  watir/browser. Something like this should work:

   require 'rubygems'
   require 'watir/browser'
   set watir_browser=ie
   browser = Watir::Browser.new
   browser.goto(http://www.hotmail.com;)

   --- On Wed, 12/10/08, Margam nk.mar...@gmail.com wrote:

From: Margam nk.mar...@gmail.com
Subject: [wtr-general] set watir_browser=ie is not working
To: Watir General watir-general@googlegroups.com
Date: Wednesday, December 10, 2008, 4:45 PM
HI All,
I am trying to write one script that will work on both IE
and FF. As
per the link:
   http://wiki.openqa.org/display/WTR/Browser.new

I am trying to use the set watir_browser=ie
command and
Watir::Browser.new

The code is :
--
require 'rubygems'
require 'watir'

set watir_browser=ie
browser = Watir::Browser.new
browser.goto(http://www.hotmail.com;)
--

But keep getting the following error:
-
 undefined method `set' for main:Object (NoMethodError)
-
What am I doing wrong? Should I require any other library?

Thank you.
Margam
--~--~-~--~~~---~--~~
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: set watir_browser=ie is not working

2008-12-12 Thread marekj
On Thu, Dec 11, 2008 at 6:14 PM, Margam nk.mar...@gmail.com wrote:


 Hi John,
 So I tried using require 'watir/browser'  in my script and set
 watir_browser=ie from command prompt and everything is OK. IE is
 opened and the scripts runs fine.
 But when I type set watir_browser=firefox from command prompt and
 run the script, IE is still used. Firefox is not launched.
 Am I doing something wrong.


one of two things may be happening:

1) I wonder if you are using two cmd terminals.
The problem with set command on windows is that the whatever you set lasts
only for the duration of the process you are running in that one terminal
window.
So if you set watir_browser=firefox in terminal window 1 and run ruby script
in terminal window 2 it will not know to run it on firefox.

2) or when you type set watir_browser=firefox you can' t have any spaces
so the following is incorrect 'set watir_browser = firefox'

marekj

Also for the time being I am doing to just change the default browser
 from the script itself (which works fine).

 Thank you
 Margam


 On Dec 11, 9:46 am, John Fitisoff jfitis...@yahoo.com wrote:
  I think the problem is that you are requiring watir rather than
 watir/browser. Something like this should work:
 
  require 'rubygems'
  require 'watir/browser'
  set watir_browser=ie
  browser = Watir::Browser.new
  browser.goto(http://www.hotmail.com;)
 
  --- On Wed, 12/10/08, Margam nk.mar...@gmail.com wrote:
 
   From: Margam nk.mar...@gmail.com
   Subject: [wtr-general] set watir_browser=ie is not working
   To: Watir General watir-general@googlegroups.com
   Date: Wednesday, December 10, 2008, 4:45 PM
   HI All,
   I am trying to write one script that will work on both IE
   and FF. As
   per the link:
  http://wiki.openqa.org/display/WTR/Browser.new
 
   I am trying to use the set watir_browser=ie
   command and
   Watir::Browser.new
 
   The code is :
   --
   require 'rubygems'
   require 'watir'
 
   set watir_browser=ie
   browser = Watir::Browser.new
   browser.goto(http://www.hotmail.com;)
   --
 
   But keep getting the following error:
   -
undefined method `set' for main:Object (NoMethodError)
   -
   What am I doing wrong? Should I require any other library?
 
   Thank you.
   Margam


--~--~-~--~~~---~--~~
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: set watir_browser=ie is not working

2008-12-11 Thread Chuck vdL

The set option is a nice way to be able to run the very same script
against both browsers without having to edit the script itself.   e.g.
run in one system set for IE, and it uses IE, run it on another system
set for firefox, and it uses firefox..

but speaking of that, if both are used, which takes precidence?   If
you try to use (or accidentially end up using) both the environment
variable and the inscript .default= at the same time, which one wins?
(or do we file that under 'bad ideas' along with crossing the streams
or sneaking up on a piersons puppeteer from behind and suprising
them)?

On Dec 10, 9:55 pm, Margam [EMAIL PROTECTED] wrote:
 Thanks for the reply and explanation.

 The
 Watir::Browser.default = 'ie'
 and
 Watir::Browser.default = 'firefox'
 lines in my Ruby script worked fine.
 Will try the set lines also.

 On Dec 10, 7:40 pm, marekj [EMAIL PROTECTED] wrote:



  set watir_browser=ie lines are 'environment variables' you would set at the
  command line and not in your ruby script.
  On the spage page on the wiki it shows you how to set the browser in Ruby
  code.
  Watir::Browser.default = 'ie'
  or
  Watir::Browser.default = 'firefox'
  keep expermimenting.

  marekj | Semantic Page Objects Automation

  Watirloo: Browser Page Helper 
  Frameworkhttp://www.bitbucket.org/marekj/watirloo/
  for IE, Firefox and others?

  On Wed, Dec 10, 2008 at 6:45 PM, Margam [EMAIL PROTECTED] wrote:

   HI All,
   I am trying to write one script that will work on both IE and FF. As
   per the link:
  http://wiki.openqa.org/display/WTR/Browser.new

   I am trying to use the set watir_browser=ie command and
   Watir::Browser.new

   The code is :
   --
   require 'rubygems'
   require 'watir'

   set watir_browser=ie
   browser = Watir::Browser.new
   browser.goto(http://www.hotmail.com;)
   --

   But keep getting the following error:
   -
    undefined method `set' for main:Object (NoMethodError)
   -
   What am I doing wrong? Should I require any other library?

   Thank you.
   Margam- 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: set watir_browser=ie is not working

2008-12-11 Thread Bret Pettichord

I claim that it works the way you'd expect. To test this claim, tell me 
how you'd expect it to work.

Bret


Chuck vdL wrote:
 The set option is a nice way to be able to run the very same script
 against both browsers without having to edit the script itself.   e.g.
 run in one system set for IE, and it uses IE, run it on another system
 set for firefox, and it uses firefox..

 but speaking of that, if both are used, which takes precidence?   If
 you try to use (or accidentially end up using) both the environment
 variable and the inscript .default= at the same time, which one wins?
 (or do we file that under 'bad ideas' along with crossing the streams
 or sneaking up on a piersons puppeteer from behind and suprising
 them)?

 On Dec 10, 9:55 pm, Margam [EMAIL PROTECTED] wrote:
   
 Thanks for the reply and explanation.

 The
 Watir::Browser.default = 'ie'
 and
 Watir::Browser.default = 'firefox'
 lines in my Ruby script worked fine.
 Will try the set lines also.

 On Dec 10, 7:40 pm, marekj [EMAIL PROTECTED] wrote:



 
 set watir_browser=ie lines are 'environment variables' you would set at the
 command line and not in your ruby script.
 On the spage page on the wiki it shows you how to set the browser in Ruby
 code.
 Watir::Browser.default = 'ie'
 or
 Watir::Browser.default = 'firefox'
 keep expermimenting.
   
 marekj | Semantic Page Objects Automation
   
 Watirloo: Browser Page Helper 
 Frameworkhttp://www.bitbucket.org/marekj/watirloo/
 for IE, Firefox and others?
   
 On Wed, Dec 10, 2008 at 6:45 PM, Margam [EMAIL PROTECTED] wrote:
   
 HI All,
 I am trying to write one script that will work on both IE and FF. As
 per the link:
 http://wiki.openqa.org/display/WTR/Browser.new
 
 I am trying to use the set watir_browser=ie command and
 Watir::Browser.new
 
 The code is :
 --
 require 'rubygems'
 require 'watir'
 
 set watir_browser=ie
 browser = Watir::Browser.new
 browser.goto(http://www.hotmail.com;)
 --
 
 But keep getting the following error:
 -
  undefined method `set' for main:Object (NoMethodError)
 -
 What am I doing wrong? Should I require any other library?
 
 Thank you.
 Margam- 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: set watir_browser=ie is not working

2008-12-11 Thread anna barbara ostrowska
HI there!
Default browser fof Windows is IE therefore you do not have define this
browser if you are on windows.
If you want to run your script on FF simply in commant prompt set
watir_browser=firefox

2008/12/11 Margam nk.mar...@gmail.com


 HI All,
 I am trying to write one script that will work on both IE and FF. As
 per the link:
 http://wiki.openqa.org/display/WTR/Browser.new

 I am trying to use the set watir_browser=ie command and
 Watir::Browser.new

 The code is :
 --
 require 'rubygems'
 require 'watir'

 set watir_browser=ie
 browser = Watir::Browser.new
 browser.goto(http://www.hotmail.com;)
 --

 But keep getting the following error:
 -
  undefined method `set' for main:Object (NoMethodError)
 -
 What am I doing wrong? Should I require any other library?

 Thank you.
 Margam

 


--~--~-~--~~~---~--~~
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: set watir_browser=ie is not working

2008-12-11 Thread John Fitisoff

I think the problem is that you are requiring watir rather than watir/browser. 
Something like this should work:

require 'rubygems'
require 'watir/browser'
set watir_browser=ie
browser = Watir::Browser.new
browser.goto(http://www.hotmail.com;)


--- On Wed, 12/10/08, Margam nk.mar...@gmail.com wrote:

 From: Margam nk.mar...@gmail.com
 Subject: [wtr-general] set watir_browser=ie is not working
 To: Watir General watir-general@googlegroups.com
 Date: Wednesday, December 10, 2008, 4:45 PM
 HI All,
 I am trying to write one script that will work on both IE
 and FF. As
 per the link:
 http://wiki.openqa.org/display/WTR/Browser.new
 
 I am trying to use the set watir_browser=ie
 command and
 Watir::Browser.new
 
 The code is :
 --
 require 'rubygems'
 require 'watir'
 
 set watir_browser=ie
 browser = Watir::Browser.new
 browser.goto(http://www.hotmail.com;)
 --
 
 But keep getting the following error:
 -
  undefined method `set' for main:Object (NoMethodError)
 -
 What am I doing wrong? Should I require any other library?
 
 Thank you.
 Margam
 
 

  

--~--~-~--~~~---~--~~
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: set watir_browser=ie is not working

2008-12-11 Thread Margam

Hi John,
So I tried using require 'watir/browser'  in my script and set
watir_browser=ie from command prompt and everything is OK. IE is
opened and the scripts runs fine.
But when I type set watir_browser=firefox from command prompt and
run the script, IE is still used. Firefox is not launched.
Am I doing something wrong.

Also for the time being I am doing to just change the default browser
from the script itself (which works fine).

Thank you
Margam


On Dec 11, 9:46 am, John Fitisoff jfitis...@yahoo.com wrote:
 I think the problem is that you are requiring watir rather than 
 watir/browser. Something like this should work:

 require 'rubygems'
 require 'watir/browser'
 set watir_browser=ie
 browser = Watir::Browser.new
 browser.goto(http://www.hotmail.com;)

 --- On Wed, 12/10/08, Margam nk.mar...@gmail.com wrote:

  From: Margam nk.mar...@gmail.com
  Subject: [wtr-general] set watir_browser=ie is not working
  To: Watir General watir-general@googlegroups.com
  Date: Wednesday, December 10, 2008, 4:45 PM
  HI All,
  I am trying to write one script that will work on both IE
  and FF. As
  per the link:
 http://wiki.openqa.org/display/WTR/Browser.new

  I am trying to use the set watir_browser=ie
  command and
  Watir::Browser.new

  The code is :
  --
  require 'rubygems'
  require 'watir'

  set watir_browser=ie
  browser = Watir::Browser.new
  browser.goto(http://www.hotmail.com;)
  --

  But keep getting the following error:
  -
   undefined method `set' for main:Object (NoMethodError)
  -
  What am I doing wrong? Should I require any other library?

  Thank you.
  Margam
--~--~-~--~~~---~--~~
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: set watir_browser=ie is not working

2008-12-11 Thread John Fitisoff

Sorry, missed that part. I haven't tried it the way that the example describes. 
The following works for me:

require 'watir/browser'  
Watir::Browser.default = 'firefox'
b = Watir::Browser.new 

I basically have a test runner that takes a command line option for the browser 
type. When it starts it sets the browser type as described above and doesn't 
touch it after that. If you do something like this in the script:

require 'watir/browser'  
Watir::Browser.default = ARGV[0]
b = Watir::Browser.new

and then call the script this way from DOS you won't have to keep changing back 
and forth:

script.rb firefox

I've stayed away from calling Watir::Browser.default more than once (i.e., 
changing the value in irb or in a script once it has been initially set).



--- On Thu, 12/11/08, Margam nk.mar...@gmail.com wrote:

 From: Margam nk.mar...@gmail.com
 Subject: [wtr-general] Re: set watir_browser=ie is not working
 To: Watir General watir-general@googlegroups.com
 Date: Thursday, December 11, 2008, 4:14 PM
 Hi John,
 So I tried using require 'watir/browser'
  in my script and set
 watir_browser=ie from command prompt and everything
 is OK. IE is
 opened and the scripts runs fine.
 But when I type set watir_browser=firefox from
 command prompt and
 run the script, IE is still used. Firefox is not launched.
 Am I doing something wrong.
 
 Also for the time being I am doing to just change the
 default browser
 from the script itself (which works fine).
 
 Thank you
 Margam
 
 
 On Dec 11, 9:46 am, John Fitisoff
 jfitis...@yahoo.com wrote:
  I think the problem is that you are requiring watir
 rather than watir/browser. Something like this should work:
 
  require 'rubygems'
  require 'watir/browser'
  set watir_browser=ie
  browser = Watir::Browser.new
  browser.goto(http://www.hotmail.com;)
 
  --- On Wed, 12/10/08, Margam
 nk.mar...@gmail.com wrote:
 
   From: Margam nk.mar...@gmail.com
   Subject: [wtr-general] set watir_browser=ie is
 not working
   To: Watir General
 watir-general@googlegroups.com
   Date: Wednesday, December 10, 2008, 4:45 PM
   HI All,
   I am trying to write one script that will work on
 both IE
   and FF. As
   per the link:
  http://wiki.openqa.org/display/WTR/Browser.new
 
   I am trying to use the set
 watir_browser=ie
   command and
   Watir::Browser.new
 
   The code is :
   --
   require 'rubygems'
   require 'watir'
 
   set watir_browser=ie
   browser = Watir::Browser.new
   browser.goto(http://www.hotmail.com;)
   --
 
   But keep getting the following error:
   -
undefined method `set' for main:Object
 (NoMethodError)
   -
   What am I doing wrong? Should I require any other
 library?
 
   Thank you.
   Margam
 

  

--~--~-~--~~~---~--~~
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: set watir_browser=ie is not working

2008-12-11 Thread Bret Pettichord

Margam,

I cannot reproduce your problem as described.

C:\set watir_browser=firefox

C:\irb
irb(main):001:0 require 'watir'
= true
irb(main):002:0 b = Watir::Browser.new
= #FireWatir::Firefox:0x3d32c48 @window_url=about:blank,
@t=#Thread:0x3d0c7
8c sleep, @window_title=, @error_checkers=[]
irb(main):003:0

Bret


Margam wrote:
 Hi John,
 So I tried using require 'watir/browser'  in my script and set
 watir_browser=ie from command prompt and everything is OK. IE is
 opened and the scripts runs fine.
 But when I type set watir_browser=firefox from command prompt and
 run the script, IE is still used. Firefox is not launched.
 Am I doing something wrong.

 Also for the time being I am doing to just change the default browser
 from the script itself (which works fine).

 Thank you
 Margam


 On Dec 11, 9:46 am, John Fitisoff jfitis...@yahoo.com wrote:
   
 I think the problem is that you are requiring watir rather than 
 watir/browser. Something like this should work:

 require 'rubygems'
 require 'watir/browser'
 set watir_browser=ie
 browser = Watir::Browser.new
 browser.goto(http://www.hotmail.com;)

 --- On Wed, 12/10/08, Margam nk.mar...@gmail.com wrote:

 
 From: Margam nk.mar...@gmail.com
 Subject: [wtr-general] set watir_browser=ie is not working
 To: Watir General watir-general@googlegroups.com
 Date: Wednesday, December 10, 2008, 4:45 PM
 HI All,
 I am trying to write one script that will work on both IE
 and FF. As
 per the link:
 http://wiki.openqa.org/display/WTR/Browser.new
   
 I am trying to use the set watir_browser=ie
 command and
 Watir::Browser.new
   
 The code is :
 --
 require 'rubygems'
 require 'watir'
   
 set watir_browser=ie
 browser = Watir::Browser.new
 browser.goto(http://www.hotmail.com;)
 --
   
 But keep getting the following error:
 -
  undefined method `set' for main:Object (NoMethodError)
 -
 What am I doing wrong? Should I require any other library?
   
 Thank you.
 Margam
   
 
   


--~--~-~--~~~---~--~~
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: set watir_browser=ie is not working

2008-12-10 Thread Margam

Thanks for the reply and explanation.

The
Watir::Browser.default = 'ie'
and
Watir::Browser.default = 'firefox'
lines in my Ruby script worked fine.
Will try the set lines also.



On Dec 10, 7:40 pm, marekj [EMAIL PROTECTED] wrote:
 set watir_browser=ie lines are 'environment variables' you would set at the
 command line and not in your ruby script.
 On the spage page on the wiki it shows you how to set the browser in Ruby
 code.
 Watir::Browser.default = 'ie'
 or
 Watir::Browser.default = 'firefox'
 keep expermimenting.

 marekj | Semantic Page Objects Automation

 Watirloo: Browser Page Helper 
 Frameworkhttp://www.bitbucket.org/marekj/watirloo/
 for IE, Firefox and others?

 On Wed, Dec 10, 2008 at 6:45 PM, Margam [EMAIL PROTECTED] wrote:

  HI All,
  I am trying to write one script that will work on both IE and FF. As
  per the link:
 http://wiki.openqa.org/display/WTR/Browser.new

  I am trying to use the set watir_browser=ie command and
  Watir::Browser.new

  The code is :
  --
  require 'rubygems'
  require 'watir'

  set watir_browser=ie
  browser = Watir::Browser.new
  browser.goto(http://www.hotmail.com;)
  --

  But keep getting the following error:
  -
   undefined method `set' for main:Object (NoMethodError)
  -
  What am I doing wrong? Should I require any other library?

  Thank you.
  Margam
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---