Discussion:
[wtr-general] How to take full screen, screenshots after test fails
NaviHan
2018-09-20 11:14:17 UTC
Permalink
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-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Justin Ko
2018-09-20 13:23:57 UTC
Permalink
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
Post by NaviHan
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|
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-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
NaviHan
2018-09-20 13:33:00 UTC
Permalink
Thanks Justin, Let me give it a go..
Post by NaviHan
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|
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-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sam Nissen
2018-09-20 15:01:36 UTC
Permalink
Hi Navi -- I created that gem, help maintain it, and would be happy to help
you if you run across any issues.
Post by NaviHan
Thanks Justin, Let me give it a go..
Post by NaviHan
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|
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-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Titus Fortner
2018-09-20 16:01:42 UTC
Permalink
Hey Sam. Is now a good time to release the update and publish a blog post
about it? :)
Post by Sam Nissen
Hi Navi -- I created that gem, help maintain it, and would be happy to
help you if you run across any issues.
Post by NaviHan
Thanks Justin, Let me give it a go..
Post by NaviHan
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|
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-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
NaviHan
2018-09-20 15:24:45 UTC
Permalink
Hi Sam

Thanks for reaching out. I will try that out tomorrow from office. Will let
you know the outcome :-)
Post by NaviHan
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|
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-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
NaviHan
2018-09-21 06:58:53 UTC
Permalink
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)
Post by NaviHan
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|
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-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
NaviHan
2018-09-21 10:37:48 UTC
Permalink
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
Post by NaviHan
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|
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-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sam Nissen
2018-09-21 10:45:02 UTC
Permalink
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
Post by 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
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|
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 <https://www.sandbox.paypal.com/>"
@browser.cookies.clear
@browser.goto "https://portal-sandbox.afterpay.com <https://portal-sandbox.afterpay.com/>"
@browser.cookies.clear
@browser.goto "https://i-pay.co.za <https://i-pay.co.za/>"
@browser.cookies.clear
@browser.goto("ci.XXX.com/ <http://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 <https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group>.
In short: search before you ask, be nice.
http://groups.google.com/group/watir-general <http://groups.google.com/group/watir-general>
---
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 <https://groups.google.com/d/topic/watir-general/Cp8TbjnWpn8/unsubscribe>.
For more options, visit https://groups.google.com/d/optout <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-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
NaviHan
2018-09-24 06:13:33 UTC
Permalink
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
Post by NaviHan
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|
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-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
NaviHan
2018-09-24 08:19:33 UTC
Permalink
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'
Post by NaviHan
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|
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-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
NaviHan
2018-09-24 15:04:15 UTC
Permalink
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!!!
Post by NaviHan
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|
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-***@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+***@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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...