[wtr-general] Re: How can we take screen shot when error occurs?
Hi John, Thanks for your solution. But still it does not work the way I want. Its not capturing the second image with alert error after clicking search button. Below is my code. -- require 'test/unit' require 'watir' require 'watir/assertions' require 'watir/screen_capture' class Portal Test::Unit::TestCase include Watir::Assertions include Watir::ScreenCapture def test_Working #Open IE and navigate to site ie = Watir::IE.new ie.goto http://www.acs.org/; # Click the link 'Managing your finances' ie.link(:text, Journals).click screen_capture(keywords.jpg,true) sleep 3 t = Thread.new(){ ie.button(:name, searchSub).click } m = Thread.new(ie) { screen_capture(keywordserror.jpg,true) } m.join t.join ie.close() end end So its not capturing the image. Please update me if I am committing any mistake in the code Thanks Regards Durgesh --- On Tue, 12/5/09, John Kolokotronis johnj...@gmail.com wrote: From: John Kolokotronis johnj...@gmail.com Subject: [wtr-general] Re: How can we take screen shot when error occurs? To: Watir General watir-general@googlegroups.com Date: Tuesday, 12 May, 2009, 8:02 PM Sorry, that second $ie, should be ie to match your browser object, like this: t = Thread.new(){ ie.button(:name, searchSub).click } m = Thread.new(ie) { screen_capture(keywordserror.jpg,true) } m.join t.join Own a website.Get an unlimited package.Pay next to nothing.*Go to http://in.business.yahoo.com/ --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[wtr-general] Re: How can we take screen shot when error occurs?
Hi Kiran, Thanks for the reply. Please find the code below. require 'test/unit' require 'watir' require 'watir/assertions' require 'watir/screen_capture' class Portal Test::Unit::TestCase include Watir::Assertions include Watir::ScreenCapture def test_Working #Open IE and navigate to site ie = Watir::IE.new ie.goto http://www.acs.org/; # Click the link 'Managing your finances' ie.link(:text, Journals).click # Capturing first image screen_capture(keywords.jpg,true) sleep 5 # Clicking on search button ie.button(:name, searchSub).click # Capturing second image which is not working at the moment screen_capture(keywordserror.jpg,true) # Close the browser ie.close() end end Please let me what I need to amend so that the above code will work. Thanks again. Durgesh. --- On Mon, 11/5/09, kiran gki...@gmail.com wrote: From: kiran gki...@gmail.com Subject: [wtr-general] Re: How can we take screen shot when error occurs? To: Watir General watir-general@googlegroups.com Date: Monday, 11 May, 2009, 5:13 PM Give me the code that your using. On May 11, 4:13 pm, Durgesh Nadkarni durgeshnadka...@gmail.com wrote: Hi, I want to take screen shots of the web pages twice by using following method. screen_capture(somename.jpg,true) For first image it works fine. Then I clicked on Submit button for which there is one javascript validation kept. So as soon as I click on Submit button that alert error window appears. And I want to take the screenshot of this page with error window. But its not opening the paint application to save the image unless I manually click on OK button close the error window. So please help me as to how can we take the screen shot of the web page having javascript error on it. Thanks Regards Durgesh. Now surf faster and smarter ! Check out the new Firefox 3 - Yahoo! Edition http://downloads.yahoo.com/in/firefox/?fr=om_email_firefox --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[wtr-general] Re: How can we take screen shot when error occurs?
Change code to # Clicking on search button ie.button(:name, searchSub).click_no_wait # Capturing second image which is not working at the moment screen_capture(keywordserror.jpg,true) Thanks, kiran. On May 12, 12:02 pm, Durgesh Nadkarni fordurg...@yahoo.co.in wrote: Hi Kiran, Thanks for the reply. Please find the code below. require 'test/unit' require 'watir' require 'watir/assertions' require 'watir/screen_capture' class Portal Test::Unit::TestCase include Watir::Assertions include Watir::ScreenCapture def test_Working #Open IE and navigate to site ie = Watir::IE.new ie.goto http://www.acs.org/; # Click the link 'Managing your finances' ie.link(:text, Journals).click # Capturing first image screen_capture(keywords.jpg,true) sleep 5 # Clicking on search button ie.button(:name, searchSub).click # Capturing second image which is not working at the moment screen_capture(keywordserror.jpg,true) # Close the browser ie.close() end end Please let me what I need to amend so that the above code will work. Thanks again. Durgesh. --- On Mon, 11/5/09, kiran gki...@gmail.com wrote: From: kiran gki...@gmail.com Subject: [wtr-general] Re: How can we take screen shot when error occurs? To: Watir General watir-general@googlegroups.com Date: Monday, 11 May, 2009, 5:13 PM Give me the code that your using. On May 11, 4:13 pm, Durgesh Nadkarni durgeshnadka...@gmail.com wrote: Hi, I want to take screen shots of the web pages twice by using following method. screen_capture(somename.jpg,true) For first image it works fine. Then I clicked on Submit button for which there is one javascript validation kept. So as soon as I click on Submit button that alert error window appears. And I want to take the screenshot of this page with error window. But its not opening the paint application to save the image unless I manually click on OK button close the error window. So please help me as to how can we take the screen shot of the web page having javascript error on it. Thanks Regards Durgesh. Now surf faster and smarter ! Check out the new Firefox 3 - Yahoo! Editionhttp://downloads.yahoo.com/in/firefox/?fr=om_email_firefox --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[wtr-general] Re: How can we take screen shot when error occurs?
Hi Kiran, I have tried using click_no_wait method. But its still not working. This time it stores the file with extension .mht and that too before alert window appears. Do I need to make any more changes? Thanks Durgesh. --- On Tue, 12/5/09, kiran gki...@gmail.com wrote: From: kiran gki...@gmail.com Subject: [wtr-general] Re: How can we take screen shot when error occurs? To: Watir General watir-general@googlegroups.com Date: Tuesday, 12 May, 2009, 2:00 PM Change code to # Clicking on search button ie.button(:name, searchSub).click_no_wait # Capturing second image which is not working at the moment screen_capture(keywordserror.jpg,true) Thanks, kiran. On May 12, 12:02 pm, Durgesh Nadkarni fordurg...@yahoo.co.in wrote: Hi Kiran, Thanks for the reply. Please find the code below. require 'test/unit' require 'watir' require 'watir/assertions' require 'watir/screen_capture' class Portal Test::Unit::TestCase include Watir::Assertions include Watir::ScreenCapture def test_Working #Open IE and navigate to site ie = Watir::IE.new ie.goto http://www.acs.org/; # Click the link 'Managing your finances' ie.link(:text, Journals).click # Capturing first image screen_capture(keywords.jpg,true) sleep 5 # Clicking on search button ie.button(:name, searchSub).click # Capturing second image which is not working at the moment screen_capture(keywordserror.jpg,true) # Close the browser ie.close() end end Please let me what I need to amend so that the above code will work. Thanks again. Durgesh. --- On Mon, 11/5/09, kiran gki...@gmail.com wrote: From: kiran gki...@gmail.com Subject: [wtr-general] Re: How can we take screen shot when error occurs? To: Watir General watir-general@googlegroups.com Date: Monday, 11 May, 2009, 5:13 PM Give me the code that your using. On May 11, 4:13 pm, Durgesh Nadkarni durgeshnadka...@gmail.com wrote: Hi, I want to take screen shots of the web pages twice by using following method. screen_capture(somename.jpg,true) For first image it works fine. Then I clicked on Submit button for which there is one javascript validation kept. So as soon as I click on Submit button that alert error window appears. And I want to take the screenshot of this page with error window. But its not opening the paint application to save the image unless I manually click on OK button close the error window. So please help me as to how can we take the screen shot of the web page having javascript error on it. Thanks Regards Durgesh. Now surf faster and smarter ! Check out the new Firefox 3 - Yahoo! Editionhttp://downloads.yahoo.com/in/firefox/?fr=om_email_firefox Now surf faster and smarter ! Check out the new Firefox 3 - Yahoo! Edition http://downloads.yahoo.com/in/firefox/?fr=om_email_firefox --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[wtr-general] Re: How can we take screen shot when error occurs?
Hi Mark, Thanks for the reply. But .click_no_wait method is not working. It just creates one .mht file before the alert error window appears. Is there any other way to deal with this problem? Thanks Durgesh. --- On Mon, 11/5/09, Mark Anderson mander...@drillinginfo.com wrote: From: Mark Anderson mander...@drillinginfo.com Subject: [wtr-general] Re: How can we take screen shot when error occurs? To: watir-general@googlegroups.com Date: Monday, 11 May, 2009, 7:33 PM My first instinct is that you want to use .click_no_wait instead of .click on the submit button. .click waits for the next screen to load which doesn’t happen until after the error window has been dealt with. /\/\ark From: watir-general@googlegroups.com [mailto: watir-general@googlegroups.com ] On Behalf Of Durgesh Nadkarni Sent: Monday, May 11, 2009 6:13 AM To: watir-general@googlegroups.com Subject: [wtr-general] How can we take screen shot when error occurs? Hi, I want to take screen shots of the web pages twice by using following method. screen_capture(somename.jpg,true) For first image it works fine. Then I clicked on Submit button for which there is one javascript validation kept. So as soon as I click on Submit button that alert error window appears. And I want to take the screenshot of this page with error window. But its not opening the paint application to save the image unless I manually click on OK button close the error window. So please help me as to how can we take the screen shot of the web page having javascript error on it. Thanks Regards Durgesh. __ Information from ESET NOD32 Antivirus, version of virus signature database 4064 (20090511) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com __ Information from ESET NOD32 Antivirus, version of virus signature database 4064 (20090511) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com Now surf faster and smarter ! Check out the new Firefox 3 - Yahoo! Edition http://downloads.yahoo.com/in/firefox/?fr=om_email_firefox --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[wtr-general] Re: How can we take screen shot when error occurs?
Sorry, that second $ie, should be ie to match your browser object, like this: t = Thread.new(){ ie.button(:name, searchSub).click } m = Thread.new(ie) { screen_capture(keywordserror.jpg,true) } m.join t.join --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[wtr-general] Re: How can we take screen shot when error occurs?
Have a look at Spec::Ui (http://github.com/scudco/rspec-ui/tree/ master) Its Html report automaticaly includes screen-shots for failed tests. ~Prashant On May 11, 4:43 pm, kiran gki...@gmail.com wrote: Give me the code that your using. On May 11, 4:13 pm, Durgesh Nadkarni durgeshnadka...@gmail.com wrote: Hi, I want to take screen shots of the web pages twice by using following method. screen_capture(somename.jpg,true) For first image it works fine. Then I clicked on Submit button for which there is one javascript validation kept. So as soon as I click on Submit button that alert error window appears. And I want to take the screenshot of this page with error window. But its not opening the paint application to save the image unless I manually click on OK button close the error window. So please help me as to how can we take the screen shot of the web page having javascript error on it. Thanks Regards Durgesh. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[wtr-general] Re: How can we take screen shot when error occurs?
My first instinct is that you want to use .click_no_wait instead of .click on the submit button. .click waits for the next screen to load which doesn't happen until after the error window has been dealt with. /\/\ark _ From: watir-general@googlegroups.com [mailto:watir-gene...@googlegroups.com] On Behalf Of Durgesh Nadkarni Sent: Monday, May 11, 2009 6:13 AM To: watir-general@googlegroups.com Subject: [wtr-general] How can we take screen shot when error occurs? Hi, I want to take screen shots of the web pages twice by using following method. screen_capture(somename.jpg,true) For first image it works fine. Then I clicked on Submit button for which there is one javascript validation kept. So as soon as I click on Submit button that alert error window appears. And I want to take the screenshot of this page with error window. But its not opening the paint application to save the image unless I manually click on OK button close the error window. So please help me as to how can we take the screen shot of the web page having javascript error on it. Thanks Regards Durgesh. __ Information from ESET NOD32 Antivirus, version of virus signature database 4064 (20090511) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---