Hi,
This is my code:

require 'rubygems'
require 'firewatir'
Watir::Browser.default = 'firefox'
Browser = Watir::Browser.new
Browser.goto("http://localhost:3000/users";)  ---- This goes to the
application
B = Browser.title.each { |d| puts d.to_s }     ---- here i am checking if
that page(above) contains any title.The ans is true and i am getting
"Users:"

a = Browser.link(:title, "Users:").exist?
puts a
sleep 5
Browser.attach(:title, '/Users:/')    ---- On this i get an error i.e.
`attach': Unable to locate window, using title and /Users:/
(Watir::Exception::NoMatchingWindowFoundException)

Now if i try
Browser.attach(:title, "Users:")  --- No error is displayed and link is not
clicked.

------------------
Now the title on clicking the link is "Users:" which is same which i have
mentioned

I hope now the confusion is clear :)
Please let me know if you require any more info.



2010/11/30 Željko Filipin <zeljko.fili...@wa-research.ch>

> On Tue, Nov 30, 2010 at 7:24 AM, Amit Kulkarni <amitkkulkarni...@gmail.com>
> wrote:
> > <title>Users: new</title>
>
> > <title>Users: index</title> ---- on the top
> > Browser.attach(:title, '/Users: new/')
>
> I am now completely confused what is the title of the page that you want to
> attach to. One of these could work:
>
> Browser.attach(:title => "Users: new/)
> Browser.attach(:title => "Users: index/)
> Browser.attach(:title => /Users: new/)
> Browser.attach(:title => /Users: index/)
> Browser.attach(:title => /Users/)
>
> More information:
>
> http://wiki.openqa.org/display/WTR/New+Browser+Windows
>
>
> Željko
>
> --
> Before posting, please read http://watir.com/support. In short: search
> before you ask, be nice.
>
> watir-general@googlegroups.com
> http://groups.google.com/group/watir-general
> watir-general+unsubscr...@googlegroups.com<watir-general%2bunsubscr...@googlegroups.com>
>

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

Reply via email to