appium / java-client

Java language binding for writing Appium Tests, conforms to W3C WebDriver Protocol
Apache License 2.0
1.19k stars 752 forks source link

getImagesSimilarity(byte[] base64image1, byte[] base64Image2) is not supported by the mapped resource #2163

Closed wazzeps closed 2 months ago

wazzeps commented 2 months ago

Description

getImagesSimilarity(byte[] base64image1, byte[] base64Image2) method of ComparesImages interface is not supported by the mapped resource.

Environment

Details

This doesn't seem to be a java client issues as this occurs in both 8 and 9 major versions. The behavior started with major version 3 of either the driver or the images plugin.

Code To Reproduce Issue [ Good To Have ]

driver.getImagesSimilarity(expectedIcon, actualIcon).getScore();

Exception Stacktraces

The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource... at org.openqa.selenium.remote.ErrorCodec.decode(ErrorCodec.java:167) at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:138) at org.openqa.selenium.remote.codec.w3c.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:50) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:190) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:237) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:518) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:591) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:302) at io.appium.java_client.CommandExecutionHelper.execute(CommandExecutionHelper.java:36) at io.appium.java_client.ComparesImages.getImagesSimilarity(ComparesImages.java:194) at io.appium.java_client.ComparesImages.getImagesSimilarity(ComparesImages.java:178) ...

Link To Appium Logs

[HTTP] --> POST /session/911b759f-881b-4b4a-bc27-9a0789a751a3/appium/compare_images [HTTP] {"mode":"getSimilarity","firstImage":"xxx","secondImage":"yyy... [HTTP] No route found for /session/911b759f-881b-4b4a-bc27-9a0789a751a3/appium/compare_images [HTTP] <-- POST /session/911b759f-881b-4b4a-bc27-9a0789a751a3/appium/compare_images 404 1 ms - 262

mykola-mokhnach commented 2 months ago

You must have https://github.com/appium/appium/tree/master/packages/images-plugin installed and enabled for this to work

mykola-mokhnach commented 2 months ago

Please provide the full server log

wazzeps commented 2 months ago

My apologies. I didn't notice the warning about an incompatible version of Node.js.

Shouldn't appium then cancel its launch with the plugin flag set?