Skip to content

Commit 5ec6ae3

Browse files
Merge pull request #168 from AutomationSolutionz/ss_quality
Ss quality
2 parents b553206 + b3b1c4c commit 5ec6ae3

File tree

3 files changed

+15
-20
lines changed

3 files changed

+15
-20
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
# Changelog
22

3-
# Version 14
3+
# Version 15
44

55
### [Current changes]
66
- _
77

8+
### [15.0.1][April 26, 2022]
9+
- **[Change]** Screenshot image quality upgraded to resolution 1920,1080
10+
811
### [15.0.0][April 16, 2022]
912
- **[Add]** Added capability for handling alert as desired.
1013
- **[Add]** Added action read scanned pdf
@@ -23,6 +26,8 @@
2326
- **[Fix]** import pyautogui fix for ui-less machine
2427
- **[Remove]** SSL validation is bypassed while installing webdriver
2528

29+
# Version 14
30+
2631
### [14.11.2][March 30, 2022]
2732
- **[Fix]** Pyautogui import fix for ui-less machine
2833
- **[Add]** Added missing commits of `Alert` and `Android browser`

Framework/Utilities/CommonUtil.py

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -753,8 +753,8 @@ def Thread_ScreenShot(function_name, image_folder, Method, Driver, image_name):
753753
r"\/",
754754
r":",
755755
] # Symbols that can't be used in filename
756-
picture_quality = 20 # Quality of picture
757-
picture_size = 800, 600 # Size of image (for reduction in file size)
756+
picture_quality = 100 # Quality of picture
757+
picture_size = 1920, 1080 # Size of image (for reduction in file size)
758758

759759
# Adjust filename and create full path (remove invalid characters, convert spaces to underscore, remove leading and trailing spaces)
760760
trans_table = str.maketrans(
@@ -773,9 +773,7 @@ def Thread_ScreenShot(function_name, image_folder, Method, Driver, image_name):
773773
image.save(ImageName, format="PNG") # Save to disk
774774

775775
# Exit if we don't have a driver yet (happens when Test Step is set to mobile/web, but we haven't setup the driver)
776-
elif Driver == None and (
777-
Method == "mobile" or Method == "web"
778-
):
776+
elif Driver is None and Method in ("mobile", "web"):
779777
ExecLog(
780778
sModuleInfo,
781779
"Can't capture screen, driver not available for type: %s, or invalid driver: %s"
@@ -786,15 +784,11 @@ def Thread_ScreenShot(function_name, image_folder, Method, Driver, image_name):
786784

787785
# Capture screenshot of web browser
788786
elif Method == "web":
789-
Driver.get_screenshot_as_file(
790-
ImageName
791-
) # Must be .png, otherwise an exception occurs
787+
Driver.get_screenshot_as_file(ImageName) # Must be .png, otherwise an exception occurs
792788

793789
# Capture screenshot of mobile
794790
elif Method == "mobile":
795-
Driver.save_screenshot(
796-
ImageName
797-
) # Must be .png, otherwise an exception occurs
791+
Driver.save_screenshot(ImageName) # Must be .png, otherwise an exception occurs
798792
else:
799793
ExecLog(
800794
sModuleInfo,
@@ -805,12 +799,8 @@ def Thread_ScreenShot(function_name, image_folder, Method, Driver, image_name):
805799
# Lower the picture quality
806800
if os.path.exists(ImageName): # Make sure image was saved
807801
image = Image.open(ImageName) # Re-open in standard format
808-
image.thumbnail(
809-
picture_size, Image.ANTIALIAS
810-
) # Resize picture to lower file size
811-
image.save(
812-
ImageName, format="PNG", quality=picture_quality
813-
) # Change quality to reduce file size
802+
image.thumbnail(picture_size, Image.ANTIALIAS) # Resize picture to lower file size
803+
image.save(ImageName, format="PNG", quality=picture_quality) # Change quality to reduce file size
814804

815805
# Convert image to bytearray and send it to ws for streaming.
816806
image_byte_array = pil_image_to_bytearray(image)

Framework/Version.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[ZeuZ Python Version]
2-
version = 15.0.0
2+
version = 15.0.1
33
[Release Date]
4-
date = April 16, 2022
4+
date = April 26, 2022

0 commit comments

Comments
 (0)