Código:
require 'rubygems'
require 'watir-webdriver'
b = Watir::Browser.new
b.goto(www.google.com)
b.window(:title => "Untitled Page").use do
b.goto(www.gmail.com)
b.text_field(:id => "Email").set "daniel.r.23"
b.text_field(:id => "Passwd").set "leoleo161989"
b.button(:id => "signIn").click
end
Al compilar y ejecutar me salta este error:
Código:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.2/lib/watir-webdriver/window.rb:225:in `locate': {:title=>"Untitled Page"} (Watir::Exception::NoMatchingWindowFoundException)
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.2/lib/watir-webdriver/window.rb:209:in `handle'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.2/lib/watir-webdriver/window.rb:202:in `use'
from C:/Users/Daniel/Desktop/echo.rb:25:in `<main>'
[Finished in 5.5s with exit code 1]
Y el html que estoy usando de prueba es este:
Código:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
</head>
<body>
</body>
</html>