appium-boneyard / appium-plugins

Officially-maintained plugins for the Appium server
Apache License 2.0
32 stars 7 forks source link

Images plugin - FindImageOccurence returns `undefined` 500 error #102

Open UrsusOptimus opened 2 years ago

UrsusOptimus commented 2 years ago

If FindImageOccurence is called multiple times eventually the server throws an undefined 500 error (see log below) and all susequent calls of that method return the same error until the server is restarted. The number of calls that return a 200/500 Cannot find any occurrences of the partial image in the full image. before the undefined error is variable.

I am using Appium2.0(latest) with the c# agent and the xcuitest driver.

I tested the followin scenarios:

[debug] [XCUITestDriver@8e1d (78d9b176)] Calling AppiumDriver.compareImages() with args: ["matchTemplate","iVBORw0KGgoAAAANSUhEUgAADgAAAAi+CAYAAAB60mt2AAAMa2lDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnluSkJDQAhGQEnoTRHqREkKLVKmCjZAEEkqMCUHFhsqigmsXUbChqyCKrq6ALCpiL4ti74sFFWVd1EVRVN6EBHTdV7538s2dP2fO/KfcmXvvAKDZx5VIclAtAHLFedK4sCDmhJRUJukpwIAWoMKfOZcnk7BiYyMBlKH+7/LuBkAU/VVHBdc/x/+r6PAFMh4AyCSI0/kyXi7ELQDglTyJNA8AokJvMSNPosCFEOtKYYAQr1XgTCWuVuB0JW4etEmIY0N8GQA1KpcrzQRA4x7UM/N5mZBH4xPEzmK+SAyA5iiI/XlCLh9iReyjcnOnKXA5xLbQXgIxjAd4pX/Dmfk3/vRhfi43cxgr8xoUtWCRTJLDnfV/luZ/S26OfMiHNWxUoTQ8TpE/rOGt7GkRCkyFuFucHh2jqDXEfSK+su4AoBShPDxRaY8a8WRsWD/AgNiZzw2OgNgI4lBxTnSkSp+eIQrlQAxXCzpTlMdJgFgf4iUCWUi8ymardFqcyhdanyFls1T6s1zpoF+Frwfy7ESWiv+NUMBR8WMaBcKEZIgpEFvmi5KiIdaA2EmWHR+hshlbIGRHD9lI5XGK+C0hjhOIw4KU/Fh+hjQ0TmVfkisbyhfbKhRxolX4QJ4wIVxZH+wkjzsYP8wFuywQsxKHeASyCZFDufAFwSHK3LHnAnFivIqnT5IXFKeci1MkObEqe9xckBOm0JtD7CbLj1fNxZPy4OJU8uMZkrzYBGWceEEWd1ysMh58JYgEbBAMmEAOWzqYBrKAqK27oRv+U46EAi6QgkwgAI4qzdCM5MERMbzGgwLwB0QCIBueFzQ4KgD5UP95WKu8OoKMwdH8wRnZ4CnEuSAC5MD/8sFZ4mFvSeAJ1Ij+4Z0LGw/GmwObYvzf64e0XzUsqIlUaeRDHpmaQ5bEEGI...
[AppiumDriver@ff42] Plugins which can handle cmd 'compareImages': images
[AppiumDriver@ff42] Plugin images is now handling cmd 'compareImages'
[AppiumDriver@ff42] Command 'compareImages' was *not* handled by the following behaviours or plugins, even though they were registered to handle it: ["default"]. The command *was* handled by these: ["images"].
[debug] [XCUITestDriver@8e1d (78d9b176)] Encountered internal error running command: Error: Cannot find any occurrences of the partial image in the full image. Original error: undefined
[debug] [XCUITestDriver@8e1d (78d9b176)]     at getImageOccurrence (/Users/toby.short/.appium/node_modules/@appium/images-plugin/node_modules/@appium/opencv/lib/index.js:552:13)
[debug] [XCUITestDriver@8e1d (78d9b176)]     at compareImages (/Users/toby.short/.appium/node_modules/@appium/images-plugin/lib/compare.js:50:16)
[debug] [XCUITestDriver@8e1d (78d9b176)]     at ImageElementPlugin.compareImages (/Users/toby.short/.appium/node_modules/@appium/images-plugin/lib/plugin.js:42:12)
[debug] [XCUITestDriver@8e1d (78d9b176)]     at /usr/local/lib/node_modules/appium/lib/appium.js:584:18
[debug] [XCUITestDriver@8e1d (78d9b176)]     at AppiumDriver.executeWrappedCommand (/usr/local/lib/node_modules/appium/lib/appium.js:620:16)
[debug] [XCUITestDriver@8e1d (78d9b176)]     at AppiumDriver.executeCommand (/usr/local/lib/node_modules/appium/lib/appium.js:549:17)
[debug] [XCUITestDriver@8e1d (78d9b176)]     at asyncHandler (/usr/local/lib/node_modules/appium/node_modules/@appium/base-driver/lib/protocol/protocol.js:315:19)
[HTTP] <-- POST /session/78d9b176-6586-464f-866f-22898eef9ac4/appium/compare_images 500 1884 ms - 685
[HTTP]
[HTTP] --> POST /session/78d9b176-6586-464f-866f-22898eef9ac4/appium/compare_images
[HTTP] {"mode":"matchTemplate","firstImage":"iVBORw0KGgoAAAANSUhEUgAADgAAAAi+CAYAAAB60mt2AAAMa2lDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnluSkJDQAhGQEnoTRHqREkKLVKmCjZAEEkqMCUHFhsqigmsXUbChqyCKrq6ALCpiL4ti74sFFWVd1EVRVN6EBHTdV7538s2dP2fO/KfcmXvvAKDZx5VIclAtAHLFedK4sCDmhJRUJukpwIAWoMKfOZcnk7BiYyMBlKH+7/LuBkAU/VVHBdc/x/+r6PAFMh4AyCSI0/kyXi7ELQDglTyJNA8AokJvMSNPosCFEOtKYYAQr1XgTCWuVuB0JW4etEmIY0N8GQA1KpcrzQRA4x7UM/N5mZBH4xPEzmK+SAyA5iiI/XlCLh9iReyjcnOnKXA5xLbQXgIxjAd4pX/Dmfk3/vRhfi43cxgr8xoUtWCRTJLDnfV/luZ/S26OfMiHNWxUoTQ8TpE/rOGt7GkRCkyFuFucHh2jqDXEfSK+su4AoBShPDxRaY8a8WRsWD/AgNiZzw2OgNgI4lBxTnSkSp+eIQrlQAxXCzpTlMdJgFgf4iUCWUi8ymardFqcyhdanyFls1T6s1zpoF+Frwfy7ESWiv+NUMBR8WMaBcKEZIgpEFvmi5KiIdaA2EmWHR+hshlbIGRHD9lI5XGK+C0hjhOIw4KU/Fh+hjQ0TmVfkisbyhfbKhRxolX4QJ4wIVxZH+wkjzsYP8wFuywQsxKHeASyCZFDufAFwSHK3LHnAnFivIqnT5IXFKeci1MkObEqe9xckBOm0JtD7CbLj1fNxZPy4OJU8uMZkrzYBGWceEEWd1ysMh58JYgEbBAMmEAOWzqYBrKAqK27oRv+U46EAi6QgkwgAI4qzdCM5MERMbzGgwLwB0QCIBueFzQ4KgD5UP95WKu8OoKMwdH8wRnZ4CnEuSAC5MD/8sFZ4mFvSeAJ1Ij+4Z0LGw/GmwObYvzf64e0XzU...
jlipps commented 2 years ago

thanks for the report; can you provide a full log so I can compare versions etc?