Hello.

I've created something like this. Commented it also to make it more
obvious. You should create method for saving screenshots also. Hope it
helps.

def save_javascript_error
  if $browser.is_a?(Watir::IE) && $browser.getIE.StatusText =~ /Error
on page/
    $autoit.AutoItSetOption("MouseCoordMode", 0) # set mouse
coordinates to be treated relative to active window
    $autoit.ControlClick("[TITLE:#{$browser.title}]", "",
"[CLASS:msctls_statusbar32]", "left", 2) # perform double click on
statusbar
    $autoit.WinWait("Internet Explorer", "", 10) # wait for javascript
error details window to open
    puts "save screenshot" # with win32screenshot
    $autoit.WinClose("Internet Explorer") #close popup window
  end
end

$browser = Watir::IE.attach :url, //
$browser.button(:id => 'button').click
save_javascript_error

On Oct 14, 4:23 pm, Pallavi Sharma <write2pall...@gmail.com> wrote:
> Hi Jarmo
> Can you share the code for the AutoIt if its not an issue. I would be
> interested in something similar for our work.
>
> On Fri, Oct 9, 2009 at 3:46 PM, Jarmo Pertman <jarm...@gmail.com> wrote:
>
> > Hello.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to