def get_screenshot_without_items(self, filename, items=None, cordinates=None, color=(0,0,0)): self.driver.get_screenshot_as_file(filename) if cordinates: cords = [] for cord in cordinates: cords.append(cord) Utils.drawRec(filename, cords, color)
def get_screenshot_without_items(self, filename, items, coordinates, color=(0,0,0)): ''' the file name have to be ".png" type due to selenium restriction ''' self.get_screenshot_as_file(filename) cords = [] if items: for item in items: cord = [item.location["x"],item.location["y"], item.location["x"]+item.size["width"],item.location["y"]+item.size["height"]] if cord: cords.append(cord) if coordinates: for cord in coordinates: cords.append(cord) Utils.drawRec(filename, cords, color)