qentinelqi / qweb

Keyword driven automation for the web
https://github.com/qentinelqi/qweb
Apache License 2.0
40 stars 17 forks source link

save_screenshot does not overwrite screenshot.png #22

Closed mikalindh closed 3 years ago

mikalindh commented 3 years ago

Describe the bug ClickIcon makes comparison against screenshot.png. However this only works once as save_screenshot is not overwriting screenshot.png when new is taken but renames those as screenshot_000, etc.. If there is multiple Icon related keywords in test suite those latter ones are failing because of this.

I believe this only happens in Linux and is pyautogui/scrot -related issue with newer Python versions (at least i haven't noticed it before with older versions).

tkoukkari commented 3 years ago

Hi, Thanks for reporting this. I may not understand the use case fully. Can you elaborate it a bit? Any snippet of script that could reproduce this?

Best regards, Tuomas

mikalindh commented 3 years ago

I dont have log (this came from customer) and it's already fixed using workaround but i am trying to explain:

We have script like this: ClickIcon some_image Do something else ClickIcon some_other_image

Now when we reach that first ClickIcon it takes screenshot.png and after that makes comparision if screenshot.png matches to some_image = all is good. Problem appears when we reach ClickIcon some_other_image. It again takes screenshot, but as we already have screenshot.png in our folder it names this new one to screenshot_000.png instead of overwriting screenshot.png. However comparision is still made against screenshot.png, which in this case is obviously wrong picture and we are getting Fail.

mikalindh commented 3 years ago

I believe combination where this happened was Ubuntu, Python 3.7 or 3.8 and newest QWeb

tkoukkari commented 3 years ago

Ok, thanks for the clarification. Sounds weird, but we'll debug this.

tkoukkari commented 3 years ago

Could not repro this with Ubuntu and python 3.7/3.8. Turns out you need a newer scrot version which is included in Ubuntu 20; the default operation of scrot is different.

Since this is not yet fixed in pyautogui, we fixed this by removing the file. Fix should be included in release 1.0.5 later this week.