In Gauge [python] custom_screenshot_writer not working when driver is none #2428
KrishnaAstra
started this conversation in
General
Replies: 2 comments 1 reply
-
Additional information Gauge version: 1.4.3 Pluginshtml-report (4.2.0) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Have you tried modifying your code to return a blank screenshot when there's a exception?
Please note this code was suggested by copilot so might want to test this. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use Gauge and have created the following Custom screenshot method to get full screen screenshots, It works fine.. However when the script fails before driver instantiation I had returned None but it fails...
Custom method:
@custom_screenshot_writer
def take_screenshot():
"""Custom Utility for Screenshot capture as per the called drivers
Error Message: Exception calling application: expected str, bytes or os.PathLike object, not NoneType
I have some precondition and db verification steps which does not need driver to be present and where I dont have to have screesnhots as well. So what should I return so that Gauge does not throw me error
![Gauge error](https://private-user-images.githubusercontent.com/150243366/281373592-f546007c-3380-4b2b-99a4-7a084c81a763.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwOTgxMDksIm5iZiI6MTczOTA5NzgwOSwicGF0aCI6Ii8xNTAyNDMzNjYvMjgxMzczNTkyLWY1NDYwMDdjLTMzODAtNGIyYi05OWE0LTdhMDg0YzgxYTc2My5QTkc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwOVQxMDQzMjlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iMThmMDgxNWZkOTVlNzRiODQyMmIyNDk3NmY4YzI0Y2U5NTA1ZjMxYzU4MzczN2RkOWE4OWJmODQwN2FhMzIxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.79L-1mFgHOSXNM8pjRlkMO9ElXlteePKy6DBz_datG4)
Beta Was this translation helpful? Give feedback.
All reactions