diff --git a/appium/webdriver/webdriver.py b/appium/webdriver/webdriver.py index e07542c3..94deb79b 100644 --- a/appium/webdriver/webdriver.py +++ b/appium/webdriver/webdriver.py @@ -355,7 +355,7 @@ def find_element_by_image(self, png_img_path, """ screenshot = self.get_screenshot_as_base64() with open(png_img_path, 'rb') as png_file: - b64_data = base64.encodestring(png_file.read()) + b64_data = base64.b64encode(png_file.read()).decode('UTF-8') try: res = self.find_image_occurrence(screenshot, b64_data, threshold=match_threshold)