Watir command to attach browser window does not work in radrails ide

0

I use the radrails ide for running watir tests. I have the following command:

ie.link(:text, "Task").click
ie1=Watir::IE.attach(:title, 'Task')

Using the above command I get the error:

E:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/ie-class.rb:760:in `rescue in attach_browser_window': Unable to locate a window with title of Task (Watir::Exception::NoMatchingWindowFoundException)
    from E:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/ie-class.rb:755:in `attach_browser_window'
    from E:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/ie-class.rb:157:in `_attach_init'
    from E:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/ie-class.rb:151:in `attach'
    from file.rb:31:in `<main>'

The Ruby version is 1.9.3, ie 8, html code of the page I want to attach -

<a id="sdmenu141" class="nodeSel" onclick="javascript: dmenu.s(141);" target="_self" href="javascript:configuredWindowOpen('../ROU/Mterou004p0001Form.do?resetFilter_‌​‌​action=','_blank','regular');">Task</a>

after clicking on the link in the first line of code it opens new browser window.

Also today I got a new error:

E:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/ie-cla‌​ss.rb:374:in method_missing': (in OLE method navigate': ) 
(WIN32OLERuntimeError) OLE error code:800700AA in <Unknown> <No Description> HRESULT error code:0x80020009
Exception occurred. from E:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.0.0/lib/watir-classic/ie-cla‌​ss.rb:374:in goto' from file.rb:7:in <main>' 
watir
title
radrails
asked on Stack Overflow Jun 7, 2012 by khris • edited Mar 26, 2015 by the Tin Man

2 Answers

1

Well, the error message says it all: Unable to locate a window with title of Task.

answered on Stack Overflow Jun 8, 2012 by Željko Filipin
1

To resolve this issue use Watir Web Driver.

answered on Stack Overflow Jun 8, 2012 by Dima

User contributions licensed under CC BY-SA 3.0