Skip to content

Commit

Permalink
Add an optional parameter to hide elements from get_elements function
Browse files Browse the repository at this point in the history
  • Loading branch information
Nabil Elqatib committed Jun 16, 2020
1 parent 2dbef0a commit bcc6ae6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Screenshot/Screenshot_Clipping.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def full_Screenshot(self, driver: WebDriver, save_path: str = '', image_name: st
stitched_image.save(save_path)
return save_path

def get_element(self, driver: WebDriver, element: WebElement, save_location: str) -> str:
def get_element(self, driver: WebDriver, element: WebElement, save_location: str, to_hide: list = None) -> str:
"""
Usage:
Capture Element screenshot as a image
Expand All @@ -129,7 +129,7 @@ def get_element(self, driver: WebDriver, element: WebElement, save_location: str
Raises:
N/A
"""
image = self.full_Screenshot(driver, save_path=save_location, image_name='clipping_shot.png')
image = self.full_Screenshot(driver, save_path=save_location, image_name='clipping_shot.png', elements=to_hide)
location = element.location
size = element.size
x = location['x']
Expand Down

0 comments on commit bcc6ae6

Please sign in to comment.