0

I have just started learning Appium to Automate Android ans iOS applications. I am using Python with OpenCV for image recognition to automate an App made with Unity. But taking screenshots consume a big amount of time. Is there a way to reduce this time, or some faster tool or framework to do this?

browser = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
screen = browser.get_screenshot_as_base64()
img = Image.open(BytesIO(base64.b64decode(screen)))

My issue is with the browser.get_screenshot_as_base64(), that takes between 7 and 10 seconds. I also tried browser.save_screenshot("image.png") but with the same results

Thanks in advance and sorry for my english

  • can you share how you are taking the screenshots? – AllenMoh Aug 25 '17 at 18:17
  • Hi, i have just addedd – sirchompoldus Aug 25 '17 at 20:34
  • I am not familiar with Image.open(). What is the purpose of the line `img = Image.open(BitesIO(base64.b64decode(screen)))` ? It looks like you take a screenshot, encode it to base 64, then you decode it from base 64 into the variable img – AllenMoh Aug 25 '17 at 20:56
  • Exactly, The Image.open() from the PIL library so then i can do some stuff with it. But the get_screenshot is what takes so much time. I also try: `browser.save_screenshot("filename.png")` but with the same results – sirchompoldus Aug 25 '17 at 21:33

0 Answers0