korimo / firewatir

Automatically exported from code.google.com/p/firewatir
0 stars 0 forks source link

attach method does not work properly in FireWatir #50

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. ff=FireWatir::Firefox.new
2. ff.goto("www.aol.com")
3. ff.attach(:title, 'Google')

What is the expected output? What do you see instead?
It should be able to refer to the an existing browser with the 
title 'Google'. It still refers to the newly created window

What version of the product are you using? On what operating system?
FireWatir 1.1 and WindowsXPSP2

Please provide any additional information below.

Original issue reported on code.google.com by chanti.b...@gmail.com on 30 Oct 2007 at 2:02

GoogleCodeExporter commented 9 years ago
Currently as per design of Firewatir you can't attach to already opened window. 
You
can only attach to windows pop ups that are opened by script. See unit tests 
for more
detail.

Original comment by ang...@gmail.com on 31 Oct 2007 at 6:26

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Is it intended to be possible at some point to be able to do this(I have tested 
and
verified this as working in Watir with IE):

Launch a FireWatir instance and navigate to some site that has a link that 
opens in a
new window
Click the link, so that a new window is opened
Perform some action, or verify something in that popup window
Close the popup window
Reattach to the original browser window and continue the testing path

Original comment by ashgromn...@gmail.com on 27 Nov 2007 at 9:22

GoogleCodeExporter commented 9 years ago
I think attach_to_new_window_test.rb in unittests directory should be able to 
help you.

Original comment by ang...@gmail.com on 28 Nov 2007 at 5:56

GoogleCodeExporter commented 9 years ago
I ran the attach_new_window_test.rb script.

I am trying to run this code snippet:
===============================
ff.link(:id,"proceed").click

ff2 = FireWatir::FireFox.attach(:url,'http://www.google.com/')

ff2.button(:value,"Google Search").click
===============================

FireWatir doesn't seem to recognize the new window.

Original comment by codetest...@gmail.com on 17 Dec 2007 at 10:54

GoogleCodeExporter commented 9 years ago

Original comment by ang...@gmail.com on 8 Apr 2008 at 7:48

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Fixed. Get latest watir/firewatir 1.6.2 from openqa.org

Original comment by ang...@gmail.com on 23 Mar 2009 at 10:53

GoogleCodeExporter commented 9 years ago
I still can't get this to work on version 1.6.2.  Neither the static method nor 
the
instance method seem to work.

Static method:
ff = Firefox.attach(:title, "Google")

Gives:
undefined method `attach' for FireWatir::Firefox:Class (NoMethodError)

Instance method:
ff.attach(:url, "http://www.google.com")
 Unable to locate window, using url and http://www.google.com
(Watir::Exception::NoMatchingWindowFoundException)

Original comment by thomas.a...@gmail.com on 25 Mar 2009 at 3:23

GoogleCodeExporter commented 9 years ago
Did you started Firefox with "-jssh" extension before you ran the script? We can
follow this up on watir-general mailing list.

Original comment by ang...@gmail.com on 25 Mar 2009 at 6:23

GoogleCodeExporter commented 9 years ago
ff.attach() pry didn't work for me because I am using Firefox 3.1b.  However, as
joybetsy pointed out, the static version (FireWatir::Firefox.attach) still 
doesn't
work.  Should that be a separate Issue Report?

Original comment by thomas.a...@gmail.com on 26 Mar 2009 at 12:29

GoogleCodeExporter commented 9 years ago
Thanks everyone...
attach() works perfectly now...

Original comment by joybe...@gmail.com on 26 Mar 2009 at 4:04

GoogleCodeExporter commented 9 years ago
Can anyone put up documentation for how to use attach in FireWatir? I have this 
code:

browser = FireWatir::Firefox.attach(:url, "http://www.google.com/")

which returns "undefined method `attach' for FireWatir::Firefox:Class"

This will really help a lot, because currently we have to close down Firefox in 
order to use Firewatir's Browser.new

Original comment by ashwoodd...@gmail.com on 27 Mar 2009 at 8:07

GoogleCodeExporter commented 9 years ago
This should be a high defect.

It's impossible for me to automate our application with out the ability to 
attach to
a open firefox browser.

Original comment by DDuph...@cltsloyalty.com on 9 Apr 2009 at 7:16

GoogleCodeExporter commented 9 years ago
It works with Firewatir 1.6.2 on windows. One thing you need to take care is 
that
JSSh should be running. So if you are opening a new "firefox" window then make 
sure
you open with -jssh option. If there is already firefox running with 'jssh' 
option
then you don't have to specify it again.

Below is the code that I used and it worked as expected

require 'firewatir'

ff = FireWatir::Firefox.attach(:title,"Google")
puts ff.html
ff.close

Thanks,
Angrez

Original comment by ang...@gmail.com on 10 Apr 2009 at 9:04

GoogleCodeExporter commented 9 years ago
Forgot to mention that I'm developing on the Mac.

Original comment by ashwoodd...@gmail.com on 10 Apr 2009 at 6:39

GoogleCodeExporter commented 9 years ago
Hi all,

I am using Windows XP Pro SP3, Firefox 3.0.10, firewatir 1.6.2 and JSSh 0.9.

When I do

  require 'watir'
  require 'firewatir'
  require 'rubygems'

  ff = FireWatir::Firefox.attach(:url,"www.google.com")

I get "undefined method `attach' for FireWatir::Firefox:Class (NoMethodError)"

I have a Firefox window opened with -jssh.
If I do 

  ff = FireWatir::Firefox.start("www.yahoo.com")
  ff.attach(:url, "www.google.com")

everything is fine and I am able to perform the actions I want.

Please let me know if there's something I am doing wrong ...

Thanks,
Alex

Original comment by alexrot...@gmail.com on 29 Apr 2009 at 3:35

GoogleCodeExporter commented 9 years ago
I am sorry for my comments. I use the latest Firewatir always on my machine. 
"attach"
method has not been released as a part of Firewatir 1.6.2. If you want to use 
you can
get the latest code & then use it.

Original comment by ang...@gmail.com on 30 Apr 2009 at 7:11

GoogleCodeExporter commented 9 years ago
Hi Angrez,

Thanks for your fast reply.
What I find strange is that I have the attach method in firefox.rb ...
I got the firewatir code

svn checkout http://firewatir.googlecode.com/svn/trunk/ firewatir-read-only

but the attach method is the same as the one I have within 1.6.2.
Should I get the latest code from somewhere else? 

Sorry to bother you with this issue, but I think this feature would make things 
much
easier for me ... :)

Thanks,
Alex

Original comment by alexrot...@gmail.com on 30 Apr 2009 at 7:22

GoogleCodeExporter commented 9 years ago
Hi Angrez,

Please ignore my previous comment.
I've just realized that firefox.rb is totally changed, and now the attach 
method is
inside FireWatir module, and no in the firefox file.

I will try to update my gem and give it a try.

Thanks,
Alex

Original comment by alexrot...@gmail.com on 30 Apr 2009 at 7:51

GoogleCodeExporter commented 9 years ago
Get latest from http://github.com/bret/watir/tree/master

Thanks,
Angrez

Original comment by ang...@gmail.com on 30 Apr 2009 at 9:06

GoogleCodeExporter commented 9 years ago
Hi Angrez,

I was finally able to download the latest watir sources, build and install them.
Now I can use the attach method as you described in your previous posts.

Thanks a lot for your help,
Alex

Original comment by alexrot...@gmail.com on 30 Apr 2009 at 8:57

GoogleCodeExporter commented 9 years ago
Hello Alexrotaru, 

I'm quite confused about what sources I should use to have to attach method 
working
for FF. Like for you the attach method works in this case :

ff = FireWatir::Firefox.start("www.yahoo.com")
ff.attach(:url, "www.google.com")

I'm working with Firefox 3.0.10, jssh 0.9 is properly installed (Telnet says 
so) on
Windows XP sp2. I launch FF with -jssh option on the google page, and while 
executing
this code:
require 'rubygems'
require 'watir'
require 'firewatir'
include FireWatir
FireWatir::Firefox.attach(:url, "www.google.com")

I still have the error 
"undefined method `attach' for FireWatir::Firefox:Class (NoMethodError)"

I have Watir 1.6.2, Firewatir 1.6.2 that i got by using the gem install command.

Could you provide more details about the source code i have to get? 
Is it from  http://github.com/bret/watir/tree/master ? it looks as if the 
source code
is the same as Firewatir 1.6.2...Is there a new package I could get? 

Thanks a lot for your help, regards
Simon

Original comment by simonpic...@gmail.com on 2 Jun 2009 at 9:52

GoogleCodeExporter commented 9 years ago
Hi Simon,

You can get the latest code from the link you mentioned. We are in process of
releasing the updated version. In Firewatir 1.6.2 which you install using "gem
install watir" the attach method is not defined as class method its an instance
method thats why you are getting the error. Either you can get the latest code 
or let
me know your email Id I can send you the latest gem.

Thanks,
Angrez

Original comment by ang...@gmail.com on 3 Jun 2009 at 7:03

GoogleCodeExporter commented 9 years ago
Hi Angrez,

thanks for your answer, yes checked this link and I used the "download" link 
and got
the watir 1.6.3 zip file.
but if I'm right the sources for FireWatir look exactly the same as the ones i 
have
installed, which sources exactly do I have to download?
Yes, you can send me the gem at this address: simonpicciotto@yahoo.fr
Thanks a lot!

Simon

Original comment by simonpic...@gmail.com on 3 Jun 2009 at 8:23

GoogleCodeExporter commented 9 years ago
Hi Angrez,

I also have the same problem.I'm not able to attach the new firefox 
window.Getting
the same "attach method undefined error". Can you please send me the latest 
firewatir
gem which supports attach function.
My email id : er.yogeshkhandelwal@gmail.com

Thanks,
Yogesh

Original comment by er.yoges...@gmail.com on 9 Jul 2009 at 4:58

GoogleCodeExporter commented 9 years ago
Hi Angrez,

I'm facing same problem. Tried to build gem from Git, but no success. Can you 
please
send me the latest FireWatir gem which has support for the attach method? My 
mail id
is upgundecha@gmail.com

Many thanks,
Unmesh

Original comment by upgunde...@gmail.com on 27 Sep 2009 at 6:54

GoogleCodeExporter commented 9 years ago
Hi, Angrez, 

Can you please send me the latest watir gem which fixes the attach issue?  
Thanks
My mail id: freezingsmile@gmail.com

Thanks

Original comment by freezing...@gmail.com on 22 Oct 2009 at 9:30

GoogleCodeExporter commented 9 years ago
I will be happy to get the update as well.

shlomitpatrick@gmail.com

Original comment by ShlomitP...@gmail.com on 22 Oct 2009 at 10:22

GoogleCodeExporter commented 9 years ago
Can you all try the latest watir gem 1.6.5rc2 the release is here with 
instructions:
http://wiki.openqa.org/display/WTR/Development+Builds 

Original comment by ang...@gmail.com on 23 Oct 2009 at 7:06

GoogleCodeExporter commented 9 years ago
Hi Angrez,
        I tried latest watir/firewatir/commonwatir gems and it worked fine!
But if I use above gems for funfx -0.2.2 then it gives me error saying 
'uninitialized
constant Element'

Original comment by k.kaustu...@gmail.com on 29 Oct 2009 at 7:47

GoogleCodeExporter commented 9 years ago
Did anyone ever get to the bottom of this 'uninitialized constant Element' 
issue?

I've had that problem forever, keep giving up (waiting for Chrome support) and 
coming back because it would be so beneficial if I could get it to work.

Any info would be appreciate.

Original comment by dbisho...@gmail.com on 30 Oct 2010 at 8:25