Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to handle Basic Authentication windows
    text
    copied!<p>Iam working on Popup windows i.e. handling Basic Authentication windows.Please find the below code which I am trying to run the test with</p> <pre><code>{ require 'watir/ie' require 'win32ole' require 'watir/WindowHelper' ie=Watir::IE.new ie.goto "http://www.google.com" helper = WindowHelper.new helper.logon('Connect to proxy1','Mohammed','WE8SR') # where title=Connect to Proxy1 is the auth window,User name= Mohammed and Password=WE8SR. puts x.inspect ie.close } </code></pre> <p>What happens is the User Name and Password is never typed in the Authentication Window and <code>Timedout Error</code> is displayed.</p> <pre><code>ruby google_search.rb C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.7.1/lib/watir/ie-class.rb:494:in sleep': execution expired (Timeout::Error) from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.7.1/lib/watir/ie-class.rb:494:in block in wait' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.7.1/lib/watir/ie-class.rb:491:in wait' from C:/Ruby192/lib/ruby/gems/1.9.1/gems/watir-1.7.1/lib/watir/ie-class.rb:357:in goto' from google_search.rb:96:in `&lt;main&gt;' &gt;Exit code: 1 </code></pre> <p>Is this the problem with the version of <strong>Ruby 1.9.2</strong> which I am using?</p> <p>I modified the code for a method <code>logon</code> in the <code>WindowHelper.rb</code> and tried doing it.</p> <pre><code>// Actual method in the "WindowHelper.rb" file { def logon(title,name = 'john doe',password = 'john doe') @autoit.WinWait title, "" @autoit.Send name @autoit.Send "{TAB}" @autoit.Send password @autoit.Send "{ENTER}" end } </code></pre> <p>Code which I modified to and found working sometimes </p> <pre><code>{ def logon(title,name,password) @autoit.WinWait title, "" @autoit.Send name @autoit.Send "{TAB}" @autoit.Send password @autoit.Send "{ENTER}" end } </code></pre> <p>I have tried for the solution in various blogs. Suggest me if I am missing something.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload