[wtr-general] Re: How to take full screen, screenshots after test fails

2018-09-24 Thread NaviHan
Hi Sam

Issue resolved. It was basically the issue with PATH variable for Jenkins 
job.

"convert.exe" is also the name of a windows executable which converts FAT 
filesystem to NTFS. When you do not specify the full path of an executable

the system first searches the current working directory and then searches 
the path environment variable, examining each directory from left to right, 
looking for an executable filename that matches the command name given.

"C:\Windows\System32" is generally present in the beginning of %PATH% 
variable, causing the Windows convert utility to launch, which fails with 
"Invalid Parameter" error as expected.

As a workaround, I just modified the order of PATH variable as


SET "PATH=C:\Program Files\ImageMagick-6.9.10-Q8;%PATH%;C:\Ruby24-x64\bin"


Good God!!!

On Thursday, 20 September 2018 21:14:17 UTC+10, NaviHan wrote:
>
> Hi 
>
> I have put this code in the hooks which takes scresnshot when a test 
> fails. The issue is that Im not getting the full browser screen. Its chops 
> off at the bottom
>
> After do |scenario|
>  take_screenshot(@browser, scenario)
> end
>
>
> def take_screenshot(browser, scenario)
>   time = Time.now.strftime("%Y-%m-%d_%H%M")
>   if scenario.failed?
> scenario_name = scenario.name.gsub(/[^\w\-]/, ' ')
> screenshot_path =  "#{scenario_name}" + "_failure_" + time
> @browser.screenshot.save("./screenshots/#{screenshot_path}.png")
>   end
> end
>
>
> By the way my before hooks looks like this.
>
> Before do|scenario|
> ENV['HTTP_PROXY'] = ENV['http_proxy'] = nil
> @browser.goto "https://www.sandbox.paypal.com;
> @browser.cookies.clear
> @browser.goto "https://portal-sandbox.afterpay.com;
> @browser.cookies.clear
> @browser.goto "https://i-pay.co.za;
> @browser.cookies.clear
> @browser.goto("ci.XXX.com/")
> @browser.window.maximize
> @browser.driver.manage.timeouts.implicit_wait = 0
> @browser.cookies.clear
> @browser.driver.manage.window.maximize
> PageObject.default_element_wait=(10)
> PageObject.javascript_framework = :jquery
> end #before scenario
>
>
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
In short: search before you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How to take full screen, screenshots after test fails

2018-09-24 Thread NaviHan
A more readable format of the error


`convert -size 1920x1957 xc:white ./screenshots/Button Function  Checkout with 
an email address without a website account  without PERKS membership hit   
Continue As Guest _failure_2018-09-24_1712.png` failed with error:
Invalid Parameter - 1920x1957
 (MiniMagick::Error)
./features/support/hooks.rb:86:in `take_screenshot'
./features/support/hooks.rb:71:in `After'


On Thursday, 20 September 2018 21:14:17 UTC+10, NaviHan wrote:
>
> Hi 
>
> I have put this code in the hooks which takes scresnshot when a test 
> fails. The issue is that Im not getting the full browser screen. Its chops 
> off at the bottom
>
> After do |scenario|
>  take_screenshot(@browser, scenario)
> end
>
>
> def take_screenshot(browser, scenario)
>   time = Time.now.strftime("%Y-%m-%d_%H%M")
>   if scenario.failed?
> scenario_name = scenario.name.gsub(/[^\w\-]/, ' ')
> screenshot_path =  "#{scenario_name}" + "_failure_" + time
> @browser.screenshot.save("./screenshots/#{screenshot_path}.png")
>   end
> end
>
>
> By the way my before hooks looks like this.
>
> Before do|scenario|
> ENV['HTTP_PROXY'] = ENV['http_proxy'] = nil
> @browser.goto "https://www.sandbox.paypal.com;
> @browser.cookies.clear
> @browser.goto "https://portal-sandbox.afterpay.com;
> @browser.cookies.clear
> @browser.goto "https://i-pay.co.za;
> @browser.cookies.clear
> @browser.goto("ci.XXX.com/")
> @browser.window.maximize
> @browser.driver.manage.timeouts.implicit_wait = 0
> @browser.cookies.clear
> @browser.driver.manage.window.maximize
> PageObject.default_element_wait=(10)
> PageObject.javascript_framework = :jquery
> end #before scenario
>
>
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
In short: search before you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How to take full screen, screenshots after test fails

2018-09-24 Thread NaviHan
Hi Sam

Im getting this weird error when running the script on Jenkins box. Its a 
machine of AWS. Any clue?

 [
31m features/Loyalty_Memberships-AU.feature:189:in `And the perks overlay popup 
closes' [0m 2018-09-24 16:11:50 WARN Watir Screenshot Stitch [DEPRECATION] 
Passing the browser is deprecated and will no longer work in version 0.7.0 
/lib/watir-screenshot-stitch.rb:31  [31m `convert -size 1920x1957 xc:white 
./screenshots/Button Function Checkout with an email address without a website 
account without PERKS membership hit Continue As Guest 
_failure_2018-09-24_1611.png` failed with error: [0m  [31m Invalid Parameter - 
1920x1957  [0m  [31m (MiniMagick::Error) [0m  [31m 
./features/support/hooks.rb:86:in `take_screenshot' [0m  [31m 
./features/support/hooks.rb:71:in `After' [0m  [36mScenario Failed ! [0m



On Thursday, 20 September 2018 21:14:17 UTC+10, NaviHan wrote:
>
> Hi 
>
> I have put this code in the hooks which takes scresnshot when a test 
> fails. The issue is that Im not getting the full browser screen. Its chops 
> off at the bottom
>
> After do |scenario|
>  take_screenshot(@browser, scenario)
> end
>
>
> def take_screenshot(browser, scenario)
>   time = Time.now.strftime("%Y-%m-%d_%H%M")
>   if scenario.failed?
> scenario_name = scenario.name.gsub(/[^\w\-]/, ' ')
> screenshot_path =  "#{scenario_name}" + "_failure_" + time
> @browser.screenshot.save("./screenshots/#{screenshot_path}.png")
>   end
> end
>
>
> By the way my before hooks looks like this.
>
> Before do|scenario|
> ENV['HTTP_PROXY'] = ENV['http_proxy'] = nil
> @browser.goto "https://www.sandbox.paypal.com;
> @browser.cookies.clear
> @browser.goto "https://portal-sandbox.afterpay.com;
> @browser.cookies.clear
> @browser.goto "https://i-pay.co.za;
> @browser.cookies.clear
> @browser.goto("ci.XXX.com/")
> @browser.window.maximize
> @browser.driver.manage.timeouts.implicit_wait = 0
> @browser.cookies.clear
> @browser.driver.manage.window.maximize
> PageObject.default_element_wait=(10)
> PageObject.javascript_framework = :jquery
> end #before scenario
>
>
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
In short: search before you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [wtr-general] Re: How to take full screen, screenshots after test fails

2018-09-21 Thread Sam Nissen
Hi Navi — the version there refers to Watir Screenshot Stitch. When we publish 
version 0.7.0, we will no longer allow you to pass the browser in. This was a 
hack that we needed, but thanks to the changes Titus has made to Watir, the 
Screenshot class now knows the browser it was created for.

Sorry that wasn’t clear!
-Sam

> On Sep 21, 2018, at 11:37 AM, NaviHan  wrote:
> 
> Hi Sam
> 
> Just found this warning
> 2018-09-21 20:32:17 WARN Watir Screenshot Stitch [DEPRECATION] Passing the 
> browser is deprecated and will no longer work in version 0.7.0 
> /lib/watir-screenshot-stitch.rb:31
> 
> 
> In fact I did try using version 0.7.0 of ImageMagick, but found this issue 
> mentioned in this thread (issue with convert command) --> 
> https://stackoverflow.com/questions/38163849/imagemagick-issue-with-windows-and-convert-function
> 
> So I reverted to 6.9
> 
> But aren't we supposed to pass browser as mentioned in the previous reply?
> 
> Cheers
> Navi
> 
> On Thursday, 20 September 2018 21:14:17 UTC+10, NaviHan wrote:
> Hi
> 
> I have put this code in the hooks which takes scresnshot when a test fails. 
> The issue is that Im not getting the full browser screen. Its chops off at 
> the bottom
> 
> After do |scenario|
>  take_screenshot(@browser, scenario)
> end
> 
> 
> def take_screenshot(browser, scenario)
>   time = Time.now.strftime("%Y-%m-%d_%H%M")
>   if scenario.failed?
> scenario_name = scenario.name.gsub(/[^\w\-]/, ' ')
> screenshot_path =  "#{scenario_name}" + "_failure_" + time
> @browser.screenshot.save("./screenshots/#{screenshot_path}.png")
>   end
> end
> 
> By the way my before hooks looks like this.
> 
> Before do|scenario|
> ENV['HTTP_PROXY'] = ENV['http_proxy'] = nil
> @browser.goto "https://www.sandbox.paypal.com 
> "
> @browser.cookies.clear
> @browser.goto "https://portal-sandbox.afterpay.com 
> "
> @browser.cookies.clear
> @browser.goto "https://i-pay.co.za "
> @browser.cookies.clear
> @browser.goto("ci.XXX.com/ ")
> @browser.window.maximize
> @browser.driver.manage.timeouts.implicit_wait = 0
> @browser.cookies.clear
> @browser.driver.manage.window.maximize
> PageObject.default_element_wait=(10)
> PageObject.javascript_framework = :jquery
> end #before scenario
> 
> 
> 
> --
> --
> Before posting, please read 
> https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group
>  
> .
> In short: search before you ask, be nice.
> 
> watir-general@googlegroups.com
> http://groups.google.com/group/watir-general 
> 
> watir-general+unsubscr...@googlegroups.com
> ---
> You received this message because you are subscribed to a topic in the Google 
> Groups "Watir General" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/watir-general/Cp8TbjnWpn8/unsubscribe 
> .
> To unsubscribe from this group and all its topics, send an email to 
> watir-general+unsubscr...@googlegroups.com 
> .
> For more options, visit https://groups.google.com/d/optout 
> .

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
In short: search before you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: Message signed with OpenPGP


[wtr-general] Re: How to take full screen, screenshots after test fails

2018-09-21 Thread NaviHan
Hi Sam

Just found this warning
2018-09-21 20:32:17 WARN Watir Screenshot Stitch [DEPRECATION] Passing the 
browser is deprecated and will no longer work in version 0.7.0 /lib/watir-
screenshot-stitch.rb:31


In fact I did try using version 0.7.0 of ImageMagick, but found this issue 
mentioned in this thread (issue with convert command) 
--> 
https://stackoverflow.com/questions/38163849/imagemagick-issue-with-windows-and-convert-function

So I reverted to 6.9

But aren't we supposed to pass browser as mentioned in the previous reply?

Cheers
Navi

On Thursday, 20 September 2018 21:14:17 UTC+10, NaviHan wrote:
>
> Hi 
>
> I have put this code in the hooks which takes scresnshot when a test 
> fails. The issue is that Im not getting the full browser screen. Its chops 
> off at the bottom
>
> After do |scenario|
>  take_screenshot(@browser, scenario)
> end
>
>
> def take_screenshot(browser, scenario)
>   time = Time.now.strftime("%Y-%m-%d_%H%M")
>   if scenario.failed?
> scenario_name = scenario.name.gsub(/[^\w\-]/, ' ')
> screenshot_path =  "#{scenario_name}" + "_failure_" + time
> @browser.screenshot.save("./screenshots/#{screenshot_path}.png")
>   end
> end
>
>
> By the way my before hooks looks like this.
>
> Before do|scenario|
> ENV['HTTP_PROXY'] = ENV['http_proxy'] = nil
> @browser.goto "https://www.sandbox.paypal.com;
> @browser.cookies.clear
> @browser.goto "https://portal-sandbox.afterpay.com;
> @browser.cookies.clear
> @browser.goto "https://i-pay.co.za;
> @browser.cookies.clear
> @browser.goto("ci.XXX.com/")
> @browser.window.maximize
> @browser.driver.manage.timeouts.implicit_wait = 0
> @browser.cookies.clear
> @browser.driver.manage.window.maximize
> PageObject.default_element_wait=(10)
> PageObject.javascript_framework = :jquery
> end #before scenario
>
>
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
In short: search before you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How to take full screen, screenshots after test fails

2018-09-21 Thread NaviHan
Hi Titus and Sam

This worked like a charm. Such a very usefull gem. Thanks a ton.
I just prepared a wiki for my project. Pasting here in case if this helps.

*For capturing full screen images*

Use gem https://github.com/samnissen/watir-screenshot-stitch
Include in Gemfile

gem 'watir-screenshot-stitch'
gem "mini_magick"
Run bundle installInstall "ImageMagick" exe on host machine

The host machine should have "ImageMagick" intsalled

The windows exe can be downloaded from 
https://www.imagemagick.org/download/binaries/

Recommeneded:- ImageMagick-6.9.10-11-Q8-x64-dll
Verify Installation

Select “Command Prompt” from the Windows Start menu. Within the window type

convert logo: logo.miff
imdisplay logo.miff

and the ImageMagick logo should be displayed in a window. 
Usage

browser = Watir::Browser.new :chrome, options: {args: args}

opts = {:page_height_limit => 5000}

screenshot_path =  "#{scenario_name}" + "_failure_" + time

@browser.screenshot.save_stitch(screenshot_path, browser, opts)


On Thursday, 20 September 2018 21:14:17 UTC+10, NaviHan wrote:
>
> Hi 
>
> I have put this code in the hooks which takes scresnshot when a test 
> fails. The issue is that Im not getting the full browser screen. Its chops 
> off at the bottom
>
> After do |scenario|
>  take_screenshot(@browser, scenario)
> end
>
>
> def take_screenshot(browser, scenario)
>   time = Time.now.strftime("%Y-%m-%d_%H%M")
>   if scenario.failed?
> scenario_name = scenario.name.gsub(/[^\w\-]/, ' ')
> screenshot_path =  "#{scenario_name}" + "_failure_" + time
> @browser.screenshot.save("./screenshots/#{screenshot_path}.png")
>   end
> end
>
>
> By the way my before hooks looks like this.
>
> Before do|scenario|
> ENV['HTTP_PROXY'] = ENV['http_proxy'] = nil
> @browser.goto "https://www.sandbox.paypal.com;
> @browser.cookies.clear
> @browser.goto "https://portal-sandbox.afterpay.com;
> @browser.cookies.clear
> @browser.goto "https://i-pay.co.za;
> @browser.cookies.clear
> @browser.goto("ci.XXX.com/")
> @browser.window.maximize
> @browser.driver.manage.timeouts.implicit_wait = 0
> @browser.cookies.clear
> @browser.driver.manage.window.maximize
> PageObject.default_element_wait=(10)
> PageObject.javascript_framework = :jquery
> end #before scenario
>
>
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
In short: search before you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How to take full screen, screenshots after test fails

2018-09-20 Thread Titus Fortner
Hey Sam. Is now a good time to release the update and publish a blog post 
about it? :)


On Thursday, September 20, 2018 at 8:20:16 AM UTC-7, Sam Nissen wrote:
>
> Hi Navi -- I created that gem, help maintain it, and would be happy to 
> help you if you run across any issues.
>
> On Thursday, September 20, 2018 at 2:33:00 PM UTC+1, NaviHan wrote:
>>
>> Thanks Justin, Let me give it a go..
>>
>> On Thursday, 20 September 2018 21:14:17 UTC+10, NaviHan wrote:
>>>
>>> Hi 
>>>
>>> I have put this code in the hooks which takes scresnshot when a test 
>>> fails. The issue is that Im not getting the full browser screen. Its chops 
>>> off at the bottom
>>>
>>> After do |scenario|
>>>  take_screenshot(@browser, scenario)
>>> end
>>>
>>>
>>> def take_screenshot(browser, scenario)
>>>   time = Time.now.strftime("%Y-%m-%d_%H%M")
>>>   if scenario.failed?
>>> scenario_name = scenario.name.gsub(/[^\w\-]/, ' ')
>>> screenshot_path =  "#{scenario_name}" + "_failure_" + time
>>> @browser.screenshot.save("./screenshots/#{screenshot_path}.png")
>>>   end
>>> end
>>>
>>>
>>> By the way my before hooks looks like this.
>>>
>>> Before do|scenario|
>>> ENV['HTTP_PROXY'] = ENV['http_proxy'] = nil
>>> @browser.goto "https://www.sandbox.paypal.com;
>>> @browser.cookies.clear
>>> @browser.goto "https://portal-sandbox.afterpay.com;
>>> @browser.cookies.clear
>>> @browser.goto "https://i-pay.co.za;
>>> @browser.cookies.clear
>>> @browser.goto("ci.XXX.com/")
>>> @browser.window.maximize
>>> @browser.driver.manage.timeouts.implicit_wait = 0
>>> @browser.cookies.clear
>>> @browser.driver.manage.window.maximize
>>> PageObject.default_element_wait=(10)
>>> PageObject.javascript_framework = :jquery
>>> end #before scenario
>>>
>>>
>>>
>>>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
In short: search before you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How to take full screen, screenshots after test fails

2018-09-20 Thread NaviHan
Hi Sam

Thanks for reaching out. I will try that out tomorrow from office. Will let 
you know the outcome :-)

On Thursday, 20 September 2018 21:14:17 UTC+10, NaviHan wrote:
>
> Hi 
>
> I have put this code in the hooks which takes scresnshot when a test 
> fails. The issue is that Im not getting the full browser screen. Its chops 
> off at the bottom
>
> After do |scenario|
>  take_screenshot(@browser, scenario)
> end
>
>
> def take_screenshot(browser, scenario)
>   time = Time.now.strftime("%Y-%m-%d_%H%M")
>   if scenario.failed?
> scenario_name = scenario.name.gsub(/[^\w\-]/, ' ')
> screenshot_path =  "#{scenario_name}" + "_failure_" + time
> @browser.screenshot.save("./screenshots/#{screenshot_path}.png")
>   end
> end
>
>
> By the way my before hooks looks like this.
>
> Before do|scenario|
> ENV['HTTP_PROXY'] = ENV['http_proxy'] = nil
> @browser.goto "https://www.sandbox.paypal.com;
> @browser.cookies.clear
> @browser.goto "https://portal-sandbox.afterpay.com;
> @browser.cookies.clear
> @browser.goto "https://i-pay.co.za;
> @browser.cookies.clear
> @browser.goto("ci.XXX.com/")
> @browser.window.maximize
> @browser.driver.manage.timeouts.implicit_wait = 0
> @browser.cookies.clear
> @browser.driver.manage.window.maximize
> PageObject.default_element_wait=(10)
> PageObject.javascript_framework = :jquery
> end #before scenario
>
>
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
In short: search before you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How to take full screen, screenshots after test fails

2018-09-20 Thread Sam Nissen
Hi Navi -- I created that gem, help maintain it, and would be happy to help 
you if you run across any issues.

On Thursday, September 20, 2018 at 2:33:00 PM UTC+1, NaviHan wrote:
>
> Thanks Justin, Let me give it a go..
>
> On Thursday, 20 September 2018 21:14:17 UTC+10, NaviHan wrote:
>>
>> Hi 
>>
>> I have put this code in the hooks which takes scresnshot when a test 
>> fails. The issue is that Im not getting the full browser screen. Its chops 
>> off at the bottom
>>
>> After do |scenario|
>>  take_screenshot(@browser, scenario)
>> end
>>
>>
>> def take_screenshot(browser, scenario)
>>   time = Time.now.strftime("%Y-%m-%d_%H%M")
>>   if scenario.failed?
>> scenario_name = scenario.name.gsub(/[^\w\-]/, ' ')
>> screenshot_path =  "#{scenario_name}" + "_failure_" + time
>> @browser.screenshot.save("./screenshots/#{screenshot_path}.png")
>>   end
>> end
>>
>>
>> By the way my before hooks looks like this.
>>
>> Before do|scenario|
>> ENV['HTTP_PROXY'] = ENV['http_proxy'] = nil
>> @browser.goto "https://www.sandbox.paypal.com;
>> @browser.cookies.clear
>> @browser.goto "https://portal-sandbox.afterpay.com;
>> @browser.cookies.clear
>> @browser.goto "https://i-pay.co.za;
>> @browser.cookies.clear
>> @browser.goto("ci.XXX.com/")
>> @browser.window.maximize
>> @browser.driver.manage.timeouts.implicit_wait = 0
>> @browser.cookies.clear
>> @browser.driver.manage.window.maximize
>> PageObject.default_element_wait=(10)
>> PageObject.javascript_framework = :jquery
>> end #before scenario
>>
>>
>>
>>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
In short: search before you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[wtr-general] Re: How to take full screen, screenshots after test fails

2018-09-20 Thread Justin Ko
Hi Navi,

Selenium only screenshots the content in the viewport. If you want the 
whole browser, you would need to take multiple screenshots.

There was a gem recently released to do this - 
https://github.com/samnissen/watir-screenshot-stitch

Though I haven't tried it myself.

Justin


On Thursday, September 20, 2018 at 7:14:17 AM UTC-4, NaviHan wrote:
>
> Hi 
>
> I have put this code in the hooks which takes scresnshot when a test 
> fails. The issue is that Im not getting the full browser screen. Its chops 
> off at the bottom
>
> After do |scenario|
>  take_screenshot(@browser, scenario)
> end
>
>
> def take_screenshot(browser, scenario)
>   time = Time.now.strftime("%Y-%m-%d_%H%M")
>   if scenario.failed?
> scenario_name = scenario.name.gsub(/[^\w\-]/, ' ')
> screenshot_path =  "#{scenario_name}" + "_failure_" + time
> @browser.screenshot.save("./screenshots/#{screenshot_path}.png")
>   end
> end
>
>
> By the way my before hooks looks like this.
>
> Before do|scenario|
> ENV['HTTP_PROXY'] = ENV['http_proxy'] = nil
> @browser.goto "https://www.sandbox.paypal.com;
> @browser.cookies.clear
> @browser.goto "https://portal-sandbox.afterpay.com;
> @browser.cookies.clear
> @browser.goto "https://i-pay.co.za;
> @browser.cookies.clear
> @browser.goto("ci.XXX.com/")
> @browser.window.maximize
> @browser.driver.manage.timeouts.implicit_wait = 0
> @browser.cookies.clear
> @browser.driver.manage.window.maximize
> PageObject.default_element_wait=(10)
> PageObject.javascript_framework = :jquery
> end #before scenario
>
>
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
In short: search before you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com
--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to watir-general+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.