Re: [wtr-general] Re: Driving Watir scripts in IE and Firefox at the same time

2010-01-20 Thread Željko Filipin
On Wed, Jan 20, 2010 at 3:54 PM, tester86  wrote:
> Is there any way I that I can a browser
> i.e. IE run my code then when it finishes run it again (same code) but
> in FF.

And this is no good for you (from my first reply in this thread):


[Watir::IE.new, FireWatir::Firefox.new].each do |browser|
  browser.goto "google.com"
  browser.goto "yahoo.com"
end

Željko
-- 
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: Driving Watir scripts in IE and Firefox at the same time

2010-01-20 Thread tester86
Well, my point that I am trying to get at is that I want to execute my
code against IE and FF. All of the disucssion is making me stick to
either run it again IE and FF. Is there any way I that I can a browser
i.e. IE run my code then when it finishes run it again (same code) but
in FF. I have used the example from: 
http://wiki.openqa.org/display/WTR/Browser.new
but I cannot get it to execute.

Thanks


On Jan 20, 8:24 am, Željko Filipin 
wrote:
> On Wed, Jan 20, 2010 at 3:20 PM, tester86  wrote:
> > Sorry my typo in options.yml I have it as
>
> You have to be careful when copy/pasting code. Everything matters.
>
> > When I do $b = Watir::firefox.start("your url") I get an error
> > message:
> > NoMethodError: undefined method `firefox' for Watir:Module
>
> Well, your syntax is wrong. It should be:
>
> browser = FireWatir::Firefox.new
>
> More information:
>
> http://wiki.openqa.org/display/WTR/FireWatir+Example+Script
>
> Željko
-- 
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

Re: [wtr-general] Re: Driving Watir scripts in IE and Firefox at the same time

2010-01-20 Thread Željko Filipin
On Wed, Jan 20, 2010 at 3:20 PM, tester86  wrote:
> Sorry my typo in options.yml I have it as

You have to be careful when copy/pasting code. Everything matters.

> When I do $b = Watir::firefox.start("your url") I get an error
> message:
> NoMethodError: undefined method `firefox' for Watir:Module

Well, your syntax is wrong. It should be:

browser = FireWatir::Firefox.new

More information:

http://wiki.openqa.org/display/WTR/FireWatir+Example+Script

Željko
-- 
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: Driving Watir scripts in IE and Firefox at the same time

2010-01-20 Thread tester86
Sorry my typo in options.yml I have it as

browser: ie
browser: firefox

When I do $b = Watir::firefox.start("your url") I get an error
message:

NoMethodError: undefined method `firefox' for Watir:Module

I have require 'firewatir'

Is there are reason why I cannot run it aginst FF because I want to
execute my scripts against both IE and FF.

Thanks

On Jan 20, 8:07 am, Željko Filipin 
wrote:
> On Wed, Jan 20, 2010 at 3:00 PM, tester86  wrote:
> > Browser ie
>
> I think this should be:
>
> browser: ie
>
> Željko
-- 
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

Re: [wtr-general] Re: Driving Watir scripts in IE and Firefox at the same time

2010-01-20 Thread Željko Filipin
On Wed, Jan 20, 2010 at 3:00 PM, tester86  wrote:
> Browser ie

I think this should be:

browser: ie

Željko
-- 
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: Driving Watir scripts in IE and Firefox at the same time

2010-01-20 Thread tester86
Hi

Yes I did specify my browser in option.yml using the following example
from:

http://wiki.openqa.org/display/WTR/Browser.new

In that file it contains

Browser ie
Browser firefox

I also tried:

$b ie
$b firefox

(but I was getting the same error message)

You comment out the browser that you want to use. I know that if I
specify $b = Watir::IE.start("your url") or $b = Watir::Firefox.start
("your url") it will work but I was hoping to get it working with the
options.yml file

On Jan 19, 8:50 pm, Wesley Chen  wrote:
> You get that error message: NoMethodError: undefined method `text_field' for
> nil:NilClass
> Because the script can't find the browser, have you defined your browser?*
> require 'watir'
> require 'watir/testcase'
> class TestXXX < Watir::TestCase
>      def test_setup
>            $b = Watir::IE.start("your url")
>      end
>      def test_set_value
>            $b.text_field(:name, "username").set("user1")
>            $b.text_field(:name, "password").set("X")
>            $b.link(:id, "button1").fire_event("onMouseDown")
> *
> *           $b.link(:id, "button1").fire_event("**onMouseUp")*
> *     end
>      def test_tear_down
>            $b.close
>      end
> end*
>
> Thanks.
> Wesley Chen.
> For life, the easier, the better.
>
>
>
> On Tue, Jan 19, 2010 at 10:23 PM, tester86  wrote:
> > Welsey,
>
> > I changed my script according to what you mentioned above. When I run
> > it in IE I get the following error message:
>
> > NoMethodError: undefined method `text_field' for nil:NilClass
>
> > All I am trying to do is to login to an application:
>
> > $b.text_field(:name, "username").set("user1")
> > $b.text_field(:name, "password").set("X")
> > $b.link(:id, "button1").fire_event("onMouseDown")
> > $b.link(:id, "button1").fire_event("onMouseUp")
>
> > Any Idea's since when I run my scripts in IE I seem to get error
> > message like that for different things i.e. text field and links
>
> > Thanks
> > On Jan 15, 8:41 pm, Wesley Chen  wrote:
> > > You may change
> > > *Class TestGoogle < Test::Unit::TestCase*
> > > to
> > > *class TestGoogle < Watir::TestCase*
> > > And
> > > *require 'watir'
> > > require 'watir/testcase'*
>
> > > Thanks.
> > > Wesley Chen.
> > > For life, the easier, the better.
>
> > > On Sat, Jan 16, 2010 at 5:35 AM, Bill Agee  wrote:
> > > > Can you post the complete backtrace?  I bet the method "test_entertext"
> > is
> > > > being run before "test_start".
>
> > > > If I remember correctly, Test::Unit runs the methods inside a test
> > class in
> > > > asciibetical order.
>
> > > > You might want to collapse all three of those methods into one.
> >  There's
> > > > probably no real gain in having them be separated.
>
> > > > On Fri, Jan 15, 2010 at 11:31 AM, tester86 
> > wrote:
>
> > > >> Hi
>
> > > >> Please note that this is an example of what tests.
>
> > > >> Class TestGoogle < Test::Unit::TestCase
>
> > > >> def test_start()
>
> > > >> $b=Watir::Browser.start("https://www.google.com";)
>
> > > >> end
>
> > > >> def test_entertext()
> > > >> $b.text_field(:name, "SearchField").set("Search")
> > > >> $b.button(:name, "btnG").click
> > > >> end
>
> > > >> def test_verify()
>
> > > >> if $b.contains_text("Search")
> > > >> puts "passed"
> > > >> else
> > > >> puts "failed"
> > > >> end
>
> > > >> end
>
> > > >> end
>
> > > >> In my options.yml if I tell it to run with IE then in command prompt I
> > > >> get the error $b is not defined.
>
> > > >> --
>
> > > >> 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
>
> > > > --
> > > > 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-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/g

Re: [wtr-general] Re: Driving Watir scripts in IE and Firefox at the same time

2010-01-19 Thread Wesley Chen
You get that error message: NoMethodError: undefined method `text_field' for
nil:NilClass
Because the script can't find the browser, have you defined your browser?*
require 'watir'
require 'watir/testcase'
class TestXXX < Watir::TestCase
 def test_setup
   $b = Watir::IE.start("your url")
 end
 def test_set_value
   $b.text_field(:name, "username").set("user1")
   $b.text_field(:name, "password").set("X")
   $b.link(:id, "button1").fire_event("onMouseDown")
*
*   $b.link(:id, "button1").fire_event("**onMouseUp")*
* end
 def test_tear_down
   $b.close
 end
end*

Thanks.
Wesley Chen.
For life, the easier, the better.


On Tue, Jan 19, 2010 at 10:23 PM, tester86  wrote:

> Welsey,
>
> I changed my script according to what you mentioned above. When I run
> it in IE I get the following error message:
>
> NoMethodError: undefined method `text_field' for nil:NilClass
>
> All I am trying to do is to login to an application:
>
> $b.text_field(:name, "username").set("user1")
> $b.text_field(:name, "password").set("X")
> $b.link(:id, "button1").fire_event("onMouseDown")
> $b.link(:id, "button1").fire_event("onMouseUp")
>
>
> Any Idea's since when I run my scripts in IE I seem to get error
> message like that for different things i.e. text field and links
>
> Thanks
> On Jan 15, 8:41 pm, Wesley Chen  wrote:
> > You may change
> > *Class TestGoogle < Test::Unit::TestCase*
> > to
> > *class TestGoogle < Watir::TestCase*
> > And
> > *require 'watir'
> > require 'watir/testcase'*
> >
> > Thanks.
> > Wesley Chen.
> > For life, the easier, the better.
> >
> >
> >
> > On Sat, Jan 16, 2010 at 5:35 AM, Bill Agee  wrote:
> > > Can you post the complete backtrace?  I bet the method "test_entertext"
> is
> > > being run before "test_start".
> >
> > > If I remember correctly, Test::Unit runs the methods inside a test
> class in
> > > asciibetical order.
> >
> > > You might want to collapse all three of those methods into one.
>  There's
> > > probably no real gain in having them be separated.
> >
> > > On Fri, Jan 15, 2010 at 11:31 AM, tester86 
> wrote:
> >
> > >> Hi
> >
> > >> Please note that this is an example of what tests.
> >
> > >> Class TestGoogle < Test::Unit::TestCase
> >
> > >> def test_start()
> >
> > >> $b=Watir::Browser.start("https://www.google.com";)
> >
> > >> end
> >
> > >> def test_entertext()
> > >> $b.text_field(:name, "SearchField").set("Search")
> > >> $b.button(:name, "btnG").click
> > >> end
> >
> > >> def test_verify()
> >
> > >> if $b.contains_text("Search")
> > >> puts "passed"
> > >> else
> > >> puts "failed"
> > >> end
> >
> > >> end
> >
> > >> end
> >
> > >> In my options.yml if I tell it to run with IE then in command prompt I
> > >> get the error $b is not defined.
> >
> > >> --
> >
> > >> 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
> >
> > > --
> > > 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- 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
>
-- 
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: Driving Watir scripts in IE and Firefox at the same time

2010-01-19 Thread tester86
Welsey,

I changed my script according to what you mentioned above. When I run
it in IE I get the following error message:

NoMethodError: undefined method `text_field' for nil:NilClass

All I am trying to do is to login to an application:

$b.text_field(:name, "username").set("user1")
$b.text_field(:name, "password").set("X")
$b.link(:id, "button1").fire_event("onMouseDown")
$b.link(:id, "button1").fire_event("onMouseUp")


Any Idea's since when I run my scripts in IE I seem to get error
message like that for different things i.e. text field and links

Thanks
On Jan 15, 8:41 pm, Wesley Chen  wrote:
> You may change
> *Class TestGoogle < Test::Unit::TestCase*
> to
> *class TestGoogle < Watir::TestCase*
> And
> *require 'watir'
> require 'watir/testcase'*
>
> Thanks.
> Wesley Chen.
> For life, the easier, the better.
>
>
>
> On Sat, Jan 16, 2010 at 5:35 AM, Bill Agee  wrote:
> > Can you post the complete backtrace?  I bet the method "test_entertext" is
> > being run before "test_start".
>
> > If I remember correctly, Test::Unit runs the methods inside a test class in
> > asciibetical order.
>
> > You might want to collapse all three of those methods into one.  There's
> > probably no real gain in having them be separated.
>
> > On Fri, Jan 15, 2010 at 11:31 AM, tester86  wrote:
>
> >> Hi
>
> >> Please note that this is an example of what tests.
>
> >> Class TestGoogle < Test::Unit::TestCase
>
> >> def test_start()
>
> >> $b=Watir::Browser.start("https://www.google.com";)
>
> >> end
>
> >> def test_entertext()
> >> $b.text_field(:name, "SearchField").set("Search")
> >> $b.button(:name, "btnG").click
> >> end
>
> >> def test_verify()
>
> >> if $b.contains_text("Search")
> >> puts "passed"
> >> else
> >> puts "failed"
> >> end
>
> >> end
>
> >> end
>
> >> In my options.yml if I tell it to run with IE then in command prompt I
> >> get the error $b is not defined.
>
> >> --
>
> >> 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
>
> > --
> > 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- 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

Re: [wtr-general] Re: Driving Watir scripts in IE and Firefox at the same time

2010-01-15 Thread Wesley Chen
You may change
*Class TestGoogle < Test::Unit::TestCase*
to
*class TestGoogle < Watir::TestCase*
And
*require 'watir'
require 'watir/testcase'*

Thanks.
Wesley Chen.
For life, the easier, the better.


On Sat, Jan 16, 2010 at 5:35 AM, Bill Agee  wrote:

> Can you post the complete backtrace?  I bet the method "test_entertext" is
> being run before "test_start".
>
> If I remember correctly, Test::Unit runs the methods inside a test class in
> asciibetical order.
>
> You might want to collapse all three of those methods into one.  There's
> probably no real gain in having them be separated.
>
>
> On Fri, Jan 15, 2010 at 11:31 AM, tester86  wrote:
>
>> Hi
>>
>> Please note that this is an example of what tests.
>>
>> Class TestGoogle < Test::Unit::TestCase
>>
>> def test_start()
>>
>> $b=Watir::Browser.start("https://www.google.com";)
>>
>> end
>>
>> def test_entertext()
>> $b.text_field(:name, "SearchField").set("Search")
>> $b.button(:name, "btnG").click
>> end
>>
>> def test_verify()
>>
>> if $b.contains_text("Search")
>> puts "passed"
>> else
>> puts "failed"
>> end
>>
>> end
>>
>> end
>>
>> In my options.yml if I tell it to run with IE then in command prompt I
>> get the error $b is not defined.
>>
>> --
>>
>> 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
>>
>
>
> --
> 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
>
-- 
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

Re: [wtr-general] Re: Driving Watir scripts in IE and Firefox at the same time

2010-01-15 Thread Bill Agee
Can you post the complete backtrace?  I bet the method "test_entertext" is
being run before "test_start".

If I remember correctly, Test::Unit runs the methods inside a test class in
asciibetical order.

You might want to collapse all three of those methods into one.  There's
probably no real gain in having them be separated.


On Fri, Jan 15, 2010 at 11:31 AM, tester86  wrote:

> Hi
>
> Please note that this is an example of what tests.
>
> Class TestGoogle < Test::Unit::TestCase
>
> def test_start()
>
> $b=Watir::Browser.start("https://www.google.com";)
>
> end
>
> def test_entertext()
> $b.text_field(:name, "SearchField").set("Search")
> $b.button(:name, "btnG").click
> end
>
> def test_verify()
>
> if $b.contains_text("Search")
> puts "passed"
> else
> puts "failed"
> end
>
> end
>
> end
>
> In my options.yml if I tell it to run with IE then in command prompt I
> get the error $b is not defined.
>
> --
> 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
>
-- 
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: Driving Watir scripts in IE and Firefox at the same time

2010-01-15 Thread tester86
Hi

Please note that this is an example of what tests.

Class TestGoogle < Test::Unit::TestCase

def test_start()

$b=Watir::Browser.start("https://www.google.com";)

end

def test_entertext()
$b.text_field(:name, "SearchField").set("Search")
$b.button(:name, "btnG").click
end

def test_verify()

if $b.contains_text("Search")
puts "passed"
else
puts "failed"
end

end

end

In my options.yml if I tell it to run with IE then in command prompt I
get the error $b is not defined.
-- 
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: Driving Watir scripts in IE and Firefox at the same time

2010-01-15 Thread al3kc
could you share your code?
-- 
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

Re: [wtr-general] Re: Driving Watir scripts in IE and Firefox at the same time

2010-01-15 Thread Željko Filipin
On Thu, Jan 14, 2010 at 10:02 PM, tester86  wrote:
> But when I execute in IE I get the error $b is undefined.

It is hard to guess how your code looks and where is the problem. If you
post it, we would have more chance in helping you.

Željko
-- 
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: Driving Watir scripts in IE and Firefox at the same time

2010-01-14 Thread tester86
Hi

Question:

I am using a testing framework using Watir and I have given a global
variable $b. I am running my scripts against FF. But I also want to
execute them against IE. I am using the example from:

http://wiki.openqa.org/display/WTR/Browser.new

But when I execute in IE I get the error $b is undefined. Is there any
solution to this problem as I would like to run my scripts in FF and
after in IE.

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] Re: Driving Watir scripts in IE and Firefox at the same time

2010-01-06 Thread Jared
The code below was an interesting experiment, but not so
straightforward.  Don't try this at home :) (although it would be kind
of cool to get it working, as side-by-side execution is something I
would use).

Jared

On Jan 6, 10:55 pm, Jared Quinert  wrote:
> If it's just about running the same test code, I've documented an
> approach here:
>
> http://www.software-testing.com.au/blog/2009/07/02/running-watir-cros...
>
> I found there were minor differences between browsers that I needed to fix.
>
> Or did you mean you wanted to run tests simultaneously against different
> browsers to do a side-by-side comparison?
> I can't test this as my PC at home isn't set up, but can someone confirm
> if something like this should work?
>
> class Browsers
>   def initialize(browsers)
>     @browsers=[]
>     browsers.each do |browser |
>       @browsers.push Watir::IE.new if browser=='ie'
>       @browsers.push FireWatir::Firefox.new if browser=='firefox'
>     end
>   end
>
>   def method_missing(method, *args)
>     @browsers.each do | browser |
>       browser.send(method, *args)
>     end
>   end
>
> end
>
> browsers=Browsers.new([ie, firefox])
> browsers.goto('http://www.google.com/')
>
> Jaredhttp://www.software-testing.com.au/blog/
>
>
>
> tester86 wrote:
> > Question, with the not tested code:
>
> > If I was to test against one application or browser i.e. google and
> > then search in both IE and FF would I need to specify the code twice.
>
> > Could I state:
>
> > Open IE
> > Open FF
>
> > Check Page Title
> > Text Box Place "Test"
> > Click Search
>
> > End
>
> > All of the above would be one set of code not duplicating the code
> > twice..
>
> > On Jan 5, 9:30 am, tester86  wrote:
>
> >> Hi
>
> >> Or would you like to do something like this (not tested)?
>
> >>> [Watir::IE.new, FireWatir::Firefox.new].each do |browser|
> >>>   browser.goto "google.com"
> >>>   browser.goto "yahoo.com"
> >>> end
>
> >>> The above code will go to google and yahoo first in IE, and then in FF
>
> >> --Yes I would like something like that. Has this been tested or is
> >> there any good documentation?
>
> >> Thanks
>
> >> On Jan 5, 8:29 am, Željko Filipin 
> >> wrote:
>
> >>> On Tue, Jan 5, 2010 at 3:21 PM, tester86  wrote:
>
>  My question is would I have to write two sets of code
>  one for ie and one for ff in order to run my script against both
>  browsers.
>
> >>> I am not sure what you mean by this. Would this work for you?
>
> >>> ie = Watir::IE.new
> >>> ie.goto "google.com"
>
> >>> ff = FireWatir::Firefox.new
> >>> ff.goto "google.com"
>
> >>> ie.goto "yahoo.com"
> >>> ff.goto "yahoo.com
>
> >>> Or would you like to do something like this (not tested)?
>
> >>> [Watir::IE.new, FireWatir::Firefox.new].each do |browser|
> >>>   browser.goto "google.com"
> >>>   browser.goto "yahoo.com"
> >>> end
>
> >>> The above code will go to google and yahoo first in IE, and then in FF.
>
> >>> Željko
> >>> --
> >>> watir.com - community manager
> >>> watirpodcast.com - host- Hide quoted text -
>
> >> - Show quoted text -- 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: Driving Watir scripts in IE and Firefox at the same time

2010-01-06 Thread tester86
Thanks the following linked worked:

http://wiki.openqa.org/display/WTR/Browser.new

But I have one question. In my code I specify $b.link(:id,
"t61").click then when I go to run my code in IE and FF I get
undefined global variable. Is there any way to over come this issue
without having:

$b.link(:id, "t61").click for FF

ie.link(:id, "t61").click for IE



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

Re: [wtr-general] Re: Driving Watir scripts in IE and Firefox at the same time

2010-01-06 Thread Jared Quinert
If it's just about running the same test code, I've documented an 
approach here:


http://www.software-testing.com.au/blog/2009/07/02/running-watir-cross-browser-using-internet-explorer-firefox-and-celerity/

I found there were minor differences between browsers that I needed to fix.

Or did you mean you wanted to run tests simultaneously against different 
browsers to do a side-by-side comparison?
I can't test this as my PC at home isn't set up, but can someone confirm 
if something like this should work?


class Browsers
 def initialize(browsers)
   @browsers=[]
   browsers.each do |browser |
 @browsers.push Watir::IE.new if browser=='ie'
 @browsers.push FireWatir::Firefox.new if browser=='firefox'
   end
 end

 def method_missing(method, *args)
   @browsers.each do | browser |
 browser.send(method, *args)
   end
 end

end

browsers=Browsers.new([ie, firefox])
browsers.goto('http://www.google.com/')

Jared
http://www.software-testing.com.au/blog/

tester86 wrote:

Question, with the not tested code:

If I was to test against one application or browser i.e. google and
then search in both IE and FF would I need to specify the code twice.

Could I state:

Open IE
Open FF

Check Page Title
Text Box Place "Test"
Click Search

End

All of the above would be one set of code not duplicating the code
twice..

On Jan 5, 9:30 am, tester86  wrote:
  

Hi

Or would you like to do something like this (not tested)?





[Watir::IE.new, FireWatir::Firefox.new].each do |browser|
  browser.goto "google.com"
  browser.goto "yahoo.com"
end
  
The above code will go to google and yahoo first in IE, and then in FF
  

--Yes I would like something like that. Has this been tested or is
there any good documentation?

Thanks

On Jan 5, 8:29 am, Željko Filipin 
wrote:





On Tue, Jan 5, 2010 at 3:21 PM, tester86  wrote:
  

My question is would I have to write two sets of code
one for ie and one for ff in order to run my script against both
browsers.


I am not sure what you mean by this. Would this work for you?
  
ie = Watir::IE.new

ie.goto "google.com"
  
ff = FireWatir::Firefox.new

ff.goto "google.com"
  
ie.goto "yahoo.com"

ff.goto "yahoo.com
  
Or would you like to do something like this (not tested)?
  
[Watir::IE.new, FireWatir::Firefox.new].each do |browser|

  browser.goto "google.com"
  browser.goto "yahoo.com"
end
  
The above code will go to google and yahoo first in IE, and then in FF.
  
Željko

--
watir.com - community manager
watirpodcast.com - host- 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: Driving Watir scripts in IE and Firefox at the same time

2010-01-06 Thread ajil
Please got to the following link. You can specify ie or firefox in a
config file before u start running
http://wiki.openqa.org/display/WTR/Browser.new

On Jan 5, 8:41 pm, tester86  wrote:
> Question, with the not tested code:
>
> If I was to test against one application or browser i.e. google and
> then search in both IE and FF would I need to specify the code twice.
>
> Could I state:
>
> Open IE
> Open FF
>
> Check Page Title
> Text Box Place "Test"
> Click Search
>
> End
>
> All of the above would be one set of code not duplicating the code
> twice..
>
> On Jan 5, 9:30 am, tester86  wrote:
>
> > Hi
>
> > Or would you like to do something like this (not tested)?
>
> > > [Watir::IE.new, FireWatir::Firefox.new].each do |browser|
> > >   browser.goto "google.com"
> > >   browser.goto "yahoo.com"
> > > end
>
> > > The above code will go to google and yahoo first in IE, and then in FF
>
> > --Yes I would like something like that. Has this been tested or is
> > there any good documentation?
>
> > Thanks
>
> > On Jan 5, 8:29 am, Željko Filipin 
> > wrote:
>
> > > On Tue, Jan 5, 2010 at 3:21 PM, tester86  wrote:
> > > > My question is would I have to write two sets of code
> > > > one for ie and one for ff in order to run my script against both
> > > > browsers.
>
> > > I am not sure what you mean by this. Would this work for you?
>
> > > ie = Watir::IE.new
> > > ie.goto "google.com"
>
> > > ff = FireWatir::Firefox.new
> > > ff.goto "google.com"
>
> > > ie.goto "yahoo.com"
> > > ff.goto "yahoo.com
>
> > > Or would you like to do something like this (not tested)?
>
> > > [Watir::IE.new, FireWatir::Firefox.new].each do |browser|
> > >   browser.goto "google.com"
> > >   browser.goto "yahoo.com"
> > > end
>
> > > The above code will go to google and yahoo first in IE, and then in FF.
>
> > > Željko
> > > --
> > > watir.com - community manager
> > > watirpodcast.com - host- 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: Driving Watir scripts in IE and Firefox at the same time

2010-01-05 Thread marekj
Couple of examples.
you can use git to clone the Watir project from http://github.com/bret/watir
or just downloa the source in a zip file.
Then look at Rakefile and see how the same unittests are being run by
Firefox and IE.
There is a wealth of information there. Do run the unittests.
also notice the use of tagging in test files.

you can also download watirloo gem, it has an example of running the
some of the same set of spec files for both FF and IE.

You can run watir code by setting options before the code is executed
then
browser  = Watir::Browser.new
will return either FF or IE

study unittests

On Jan 5, 8:21 am, tester86  wrote:
> Hi
>
> Yes you are correct but when I executed it that way it did open a
> firefox session. My question is would I have to write two sets of code
> one for ie and one for ff in order to run my script against both
> browsers.
>
> Thanks.
>
> On Jan 4, 9:11 pm, Wesley Chen  wrote:
>
> > First, I think there is something wrong in your script.
> > 1. You use ie for both ie browser and FF browser;
> > 2. Your Firefox invoke way is not right.
> > I think it works if you use:
> > *require 'watir'
> > ie = Watir::IE.new
> > ie.goto("www.google.com")
> > ff = FireWatir::Firefox.new
> > ff.goto("www.google.com")*
>
> > Thanks.
> > Wesley Chen.
> > For life, the easier, the better.
>
> > On Mon, Jan 4, 2010 at 11:03 PM, tester86  wrote:
> > > Hi
>
> > > From my research as far as I understand you can not drive watir
> > > scripts at the same time in the browser unless you create seperate
> > > scripts for them. I have a Test::Unit script that runs in Firefox but
> > > when I specify IE it just opens a new browser and nothing happens. I
> > > am guess that I would have to write a different set of code for that.
>
> > > example:
>
> > > ie=Watir::IE.new
> > > ie.goto("www.google.com")
>
> > > ie=FireWatir.FireFox.new
> > > ie.goto("www.google.com")
>
> > > # then a code to perform search
>
> > > When I run a script like this it only performs the search in Firefox
> > > and not in IE. Is ther any solution to execute against both browsers.
>
> > > 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-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: Driving Watir scripts in IE and Firefox at the same time

2010-01-05 Thread tester86
Question, with the not tested code:

If I was to test against one application or browser i.e. google and
then search in both IE and FF would I need to specify the code twice.

Could I state:

Open IE
Open FF

Check Page Title
Text Box Place "Test"
Click Search

End

All of the above would be one set of code not duplicating the code
twice..

On Jan 5, 9:30 am, tester86  wrote:
> Hi
>
> Or would you like to do something like this (not tested)?
>
>
>
> > [Watir::IE.new, FireWatir::Firefox.new].each do |browser|
> >   browser.goto "google.com"
> >   browser.goto "yahoo.com"
> > end
>
> > The above code will go to google and yahoo first in IE, and then in FF
>
> --Yes I would like something like that. Has this been tested or is
> there any good documentation?
>
> Thanks
>
> On Jan 5, 8:29 am, Željko Filipin 
> wrote:
>
>
>
> > On Tue, Jan 5, 2010 at 3:21 PM, tester86  wrote:
> > > My question is would I have to write two sets of code
> > > one for ie and one for ff in order to run my script against both
> > > browsers.
>
> > I am not sure what you mean by this. Would this work for you?
>
> > ie = Watir::IE.new
> > ie.goto "google.com"
>
> > ff = FireWatir::Firefox.new
> > ff.goto "google.com"
>
> > ie.goto "yahoo.com"
> > ff.goto "yahoo.com
>
> > Or would you like to do something like this (not tested)?
>
> > [Watir::IE.new, FireWatir::Firefox.new].each do |browser|
> >   browser.goto "google.com"
> >   browser.goto "yahoo.com"
> > end
>
> > The above code will go to google and yahoo first in IE, and then in FF.
>
> > Željko
> > --
> > watir.com - community manager
> > watirpodcast.com - host- 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: Driving Watir scripts in IE and Firefox at the same time

2010-01-05 Thread tester86
Hi

Or would you like to do something like this (not tested)?
>
> [Watir::IE.new, FireWatir::Firefox.new].each do |browser|
>   browser.goto "google.com"
>   browser.goto "yahoo.com"
> end
>
> The above code will go to google and yahoo first in IE, and then in FF

--Yes I would like something like that. Has this been tested or is
there any good documentation?

Thanks

On Jan 5, 8:29 am, Željko Filipin 
wrote:
> On Tue, Jan 5, 2010 at 3:21 PM, tester86  wrote:
> > My question is would I have to write two sets of code
> > one for ie and one for ff in order to run my script against both
> > browsers.
>
> I am not sure what you mean by this. Would this work for you?
>
> ie = Watir::IE.new
> ie.goto "google.com"
>
> ff = FireWatir::Firefox.new
> ff.goto "google.com"
>
> ie.goto "yahoo.com"
> ff.goto "yahoo.com
>
> Or would you like to do something like this (not tested)?
>
> [Watir::IE.new, FireWatir::Firefox.new].each do |browser|
>   browser.goto "google.com"
>   browser.goto "yahoo.com"
> end
>
> The above code will go to google and yahoo first in IE, and then in FF.
>
> Željko
> --
> watir.com - community manager
> watirpodcast.com - host

-- 
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


Re: [wtr-general] Re: Driving Watir scripts in IE and Firefox at the same time

2010-01-05 Thread Željko Filipin
On Tue, Jan 5, 2010 at 3:21 PM, tester86  wrote:
> My question is would I have to write two sets of code
> one for ie and one for ff in order to run my script against both
> browsers.

I am not sure what you mean by this. Would this work for you?

ie = Watir::IE.new
ie.goto "google.com"

ff = FireWatir::Firefox.new
ff.goto "google.com"

ie.goto "yahoo.com"
ff.goto "yahoo.com

Or would you like to do something like this (not tested)?

[Watir::IE.new, FireWatir::Firefox.new].each do |browser|
  browser.goto "google.com"
  browser.goto "yahoo.com"
end

The above code will go to google and yahoo first in IE, and then in FF.

Željko
--
watir.com - community manager
watirpodcast.com - host

-- 
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: Driving Watir scripts in IE and Firefox at the same time

2010-01-05 Thread tester86
Hi

Yes you are correct but when I executed it that way it did open a
firefox session. My question is would I have to write two sets of code
one for ie and one for ff in order to run my script against both
browsers.

Thanks.

On Jan 4, 9:11 pm, Wesley Chen  wrote:
> First, I think there is something wrong in your script.
> 1. You use ie for both ie browser and FF browser;
> 2. Your Firefox invoke way is not right.
> I think it works if you use:
> *require 'watir'
> ie = Watir::IE.new
> ie.goto("www.google.com")
> ff = FireWatir::Firefox.new
> ff.goto("www.google.com")*
>
> Thanks.
> Wesley Chen.
> For life, the easier, the better.
>
>
>
> On Mon, Jan 4, 2010 at 11:03 PM, tester86  wrote:
> > Hi
>
> > From my research as far as I understand you can not drive watir
> > scripts at the same time in the browser unless you create seperate
> > scripts for them. I have a Test::Unit script that runs in Firefox but
> > when I specify IE it just opens a new browser and nothing happens. I
> > am guess that I would have to write a different set of code for that.
>
> > example:
>
> > ie=Watir::IE.new
> > ie.goto("www.google.com")
>
> > ie=FireWatir.FireFox.new
> > ie.goto("www.google.com")
>
> > # then a code to perform search
>
> > When I run a script like this it only performs the search in Firefox
> > and not in IE. Is ther any solution to execute against both browsers.
>
> > 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- 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