I am trying to use appium image comparison and used the reference code
byte[] screenshot = Base64.encodeBase64(driver.getScreenshotAs(OutputType.BYTES));
OccurrenceMatchingResult result = driver
.findImageOccurrence(screenshot, partialImage, new OccurrenceMatchingOptions()
.withEnabledVisualization());
assertThat(result.getVisualization().length, is(greaterThan(0)));
assertNotNull(result.getRect());
I see the following error:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: opencv4nodejs module is required to use OpenCV features. Please install it first (npm i -g opencv4nodejs) and restart Appium. Read https://github.com/justadudewhohacks/opencv4nodejs#how-to-install for more details on this topic.
My project is in java and I am really not sure about performing npm i -g opencv4nodejs. Should I do npm i -g opencv4nodejs under the project root, though the project doest not have package.json
If necessary, describe the problem you have been experiencing in more detail.
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: opencv4nodejs module is required to use OpenCV features. Please install it first (npm i -g opencv4nodejs) and restart Appium. Read https://github.com/justadudewhohacks/opencv4nodejs#how-to-install for more details on this topic.
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
System info: host: 'ICF2008045', ip: 'fe80:0:0:0:46:b040:b1:8193%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '1.8.0_181'
Driver info: io.appium.java_client.ios.IOSDriver
Capabilities {app: /Users/sadla/Library/Develo..., autoWebview: true, automationName: XCUITest, browserName: , bundleId: com.icfi.energystarhome, databaseEnabled: false, deviceName: iPad Air 2, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: false, platform: MAC, platformName: iOS, platformVersion: 11.1, takesScreenshot: true, udid: D4469918-75D5-4277-A205-808..., webStorageEnabled: false}
Session ID: 5ae7aa6a-3eb7-45a4-9458-c88296598bb7
Did you read the howto document from the error message above?
Yes sir, I did. I use a mac and I am unable to realize how to install opencv4nodejs. Can you please refer on the how to doc, what's exactly need to be done to install it.
How did you install appium?
npm i -g opencv4nodejs is one way to install it as described in the error message like Appium, npm i -g appium
Try to read https://docs.npmjs.com/ to know more about npm and NodeJS packaging system
@KazuCocoa, I used the command npm i -g opencv4nodejs quite many times and restarted the appium. I was getting the same error again and again. (error: opencv4nodejs module is required to use OpenCV features).
@mykola-mokhnach, Sure. Thanks
If you handle appium with package.json, you need to add opencv4nodejs into package.json.
(It is npm stuff)
Could you share your log when you run npm i -g opencv4nodejs? I wondered if you faced installing issue for the lib.
The same problem, does anyone fix it?
In general, this is npm(and PATH issue) thing in your environment.
If you manage your project with package.json, you can make sure if your managed project has opencv4nodejs as below. Then, appium installed in the project can find them.
$ npm list opencv4nodejs # no opencv4nodejs
your/project
βββ (empty)
$ npm list opencv4nodejs # has opencv4nodejs
your/project
βββ [email protected]
If you manage your Appium environment with -g command, below can call. Then, appium installed by -g option can find them.
$ npm list -g opencv4nodejs # no opencv4nodejs
/Users/kazuaki/.nodebrew/node/v11.4.0/lib
βββ (empty)
$ npm list -g opencv4nodejs # has opencv4nodejs
/Users/kazuaki/.nodebrew/node/v10.11.0/lib
βββ [email protected]
If you cannot find correct dependencies on your local, you probably make sure your node/npm environment in order node/npm can resolve their dependencies, first.
As mykola addressed in https://github.com/appium/appium/issues/11865#issuecomment-448498644 , I would recommend you to read npm documentation if you are using package.json stuff.
macmini550:~ vkuhi$ npm list opencv4nodejs
/Users/vkuhi
βββ [email protected]
It is in the node_modules package, how can I get access to it from my java project?
If the node_modules is a global environment for npm, your node/npm command can find it by modules installed by -g option. You have installed Appium via -g option, your appium env can find it launching appium in your home directory, for example.
If your Java project manages appium by package.json, I would recommend you to read https://docs.npmjs.com/ .
I do not have any package.json in my Java project. How does the appium will know where this package located?
How does the appium will know where this package located?
it depends on npm/node. Appium depends on them to resolve dependencies.
@vkuhi Initially I ran appium desktop app. I later (after reading the suggestions from in here) realized that the appium I am running and opencv4nodejs i installed are not from the same package/node_modules. So the shutdown the appium desktop app and verfiied the version of global appium, which was 1.7.2. I upgraded it to 1.9. Now that both appium and opencv4nodejs come from same package or node_modules, starting the appium from there solved my issue.
Thanks @KazuCocoa and @mykola-mokhnach for your prompt help :-)
Ah... I see. Thanks.
I only explained about appium which is CLI tool. In desktop's case, that has its own package info. so, it can not find global opencv4nodejs.
I would link https://github.com/appium/appium-desktop/issues/714
I have same issue, node can't find opencv, working with win 10, any help will be appriciate.
Appium server:
I have already installed the opencv through npm,
When I run any driver.findByImage(βpath.pngβ)
I get this error from appium server:
mime must be a string
[W3C] Encountered internal error running command: Error: opencv4nodejs module is required to use OpenCV features. Please install it first (npm i -g opencv4nodejs) and restart Appium. Read https://github.com/justadudewhohacks/opencv4nodejs#how-to-install1 for more details on this topic.
[W3C] at initOpenCV (C:node_modulesappiumnode_modulesappium-supportlibimage-util.js:100:11)
[W3C] at Object.getImageOccurrence$ (C:node_modulesappiumnode_modulesappium-supportlibimage-util.js:420:3)
[W3C] at tryCatch (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:67:40)
[W3C] at GeneratorFunctionPrototype.invoke [as _invoke] (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:315:22)
[W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:100:21)
[W3C] at invoke (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:136:37)
[W3C] at enqueueResult (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:185:17)
[W3C] at new Promise ()
[W3C] at new F (C:node_modulesappiumnode_modulescore-jslibrarymodules$.export.js:30:36)
[W3C] at AsyncIterator.enqueue (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:184:12)
[W3C] at AsyncIterator.prototype.(anonymous function) [as next] (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:100:21)
[W3C] at Object.runtime.async (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:209:12)
[W3C] at Object.getImageOccurrence (C:node_modulesappiumnode_modulesappium-supportbuildlibimage-util.js:632:30)
[W3C] at AndroidDriver.callee$0$0$ (C:node_modulesappiumnode_modulesappium-base-driverlibbasedrivercommandsimages.js:47:32)
[W3C] at tryCatch (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:67:40)
[W3C] at GeneratorFunctionPrototype.invoke [as _invoke] (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:315:22)
[W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:100:21)
[W3C] at invoke (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:136:37)
[W3C] at enqueueResult (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:185:17)
[W3C] at new Promise ()
[W3C] at new F (C:node_modulesappiumnode_modulescore-jslibrarymodules$.export.js:30:36)
[W3C] at AsyncIterator.enqueue (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:184:12)
[W3C] at AsyncIterator.prototype.(anonymous function) [as next] (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:100:21)
[W3C] at Object.runtime.async (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:209:12)
[W3C] at AndroidDriver.callee$0$0 [as compareImages] (C:node_modulesappiumnode_modulesappium-base-driverbuildlibbasedrivercommandsimages.js:55:30)
[W3C] at AndroidDriver.condition$ (C:node_modulesappiumnode_modulesappium-base-driverlibbasedrivercommandsfind.js:111:26)
[W3C] at tryCatch (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:67:40)
[W3C] at GeneratorFunctionPrototype.invoke [as _invoke] (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:315:22)
[W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:100:21)
[W3C] at GeneratorFunctionPrototype.invoke (C:node_modulesappiumnode_modulesbabel-runtimeregeneratorruntime.js:136:37)
I am mantion that I already use install opencv in various ways:
npm install --save opencv4nodejs
npm i -g opencv4nodejs
And also tried mannually, the appium doctor keep saying:
WARN AppiumDoctor :heavy_multiplication_x: opencv4nodejs cannot be found
But I got indication that the opencv is installed success when install from npm,
maybe Windows 10 path is wrong ? I add mannually all the pathes that I could,
I donβt know what else to do in order that the npm/Windows recognize the opencv and activate him.
What result can you get with npm list -g opencv4nodejs?
Did you use appium CLI (not from appium-desktop), right? (because of https://github.com/appium/appium-desktop/issues/714 )
What result can you get with
npm list -g opencv4nodejs?
Did you use appium CLI (not from appium-desktop), right? (because of appium/appium-desktop#714 )
That's the output:
C:UsersOSN20933AppDataRoamingnpm
`-- [email protected]
I am using appium server from java code, I am not using appium gui client desktop.
thanks.
It appreciates if you could try https://github.com/appium/appium-support/pull/105
thanks.
It appreciates if you could try appium/appium-support#105
I enter there, But honestly I have no idea what to do according that post,
Can you direct me please ?
Thanks
One is building Appium code. Another is waiting for the PR's release in beta
building Appium from code
$ git clone [email protected]:appium/appium-support.git
$ cd appium-support
$ git checkout isaac-opencv
$ npm install
# copyappium-support/build/intoappium/node_modules/appium-support/build
# move toappium`Or just wait for the PR will release.
Then, you can install it as a beta like:
$ npm uninstall -g appium
$ npm install -g appium@beta
One is building Appium code. Another is waiting for the PR's release in beta
building Appium from code
- Build Appium from code => https://appiumpro.com/editions/47
- below commands:
$ git clone [email protected]:appium/appium-support.git $ cd appium-support $ git checkout isaac-opencv $ npm install # copy `appium-support/build/` into `appium/node_modules/appium-support/build` # move to `appium` # node . # then appium launchesOr just wait for the PR will release.
Then, you can install it as a beta like:$ npm uninstall -g appium $ npm install -g appium@beta
didn't help,
I have removed npm and node.js and appium from my pc,
Trying to install all from the begining, hope it may help....
Nothing help so far....
I tried averything
Update:
After remove node.js and npm and appium from pc, install all from the begining, it solve the error
thanks. I guess node dependencies affected that...
I have install opencv4nodejs by npm install -g opencv4nodejs.
Run appium-doctor --ios, return opencv4nodejs is installed at: /usr/local/lib. Installed version is: 5.1.0
Start appium desktop and run the test, still return below error message:
An unknown server-side error occurred while processing the command. Original error: opencv4nodejs module is required to use OpenCV features. Please install it first (npm i -g opencv4nodejs) and restart Appium. Read https://github.com/justadudewhohacks/opencv4nodejs#how-to-install for more details on this topic.
How should I install the opencv4nodejs and anything need to be configured?
I could not find the solution for desktop https://github.com/appium/appium-desktop/issues/714
You can run appium CLI separately and connect to it from the desktop app via the custom server tab in the inspector.
I could not find the solution for desktop appium/appium-desktop#714
You can run appium CLI separately and connect to it from the desktop app via the custom server tab in the inspector.
How to run appium CLI separately and how to connect to desktop? Could you provide more details?
Launch Appium => http://appium.io/docs/en/about-appium/getting-started/#installing-appium
Connect to the server from custom server tab in https://github.com/appium/appium-desktop#the-new-session-window (You can open the window from the menu bar -> _Appium_ -> _New Session Window..._)
Launch Appium => http://appium.io/docs/en/about-appium/getting-started/#installing-appium
Connect to the server from custom server tab in https://github.com/appium/appium-desktop#the-new-session-window (You can open the window from the menu bar -> _Appium_ -> _New Session Window..._)
Do you mean to install appium by npm install -g appium?
yes
Thanks, it is sovled. but here click the image in the wrong place, below is the setting, could you please help to check what's wrong with the setting?
((HasSettings) driver.getAppiumDriver()).setSetting(Setting.IMAGE_MATCH_THRESHOLD, 0.2);
((HasSettings) driver.getAppiumDriver()).setSetting(Setting.IMAGE_ELEMENT_TAP_STRATEGY, "w3cActions");
((HasSettings) driver.getAppiumDriver()).setSetting(Setting.FIX_IMAGE_FIND_SCREENSHOT_DIMENSIONS, false);
((HasSettings) driver.getAppiumDriver()).setSetting(Setting.FIX_IMAGE_TEMPLATE_SIZE, true);
((HasSettings) driver.getAppiumDriver()).setSetting(Setting.CHECK_IMAGE_ELEMENT_STALENESS, false);
((HasSettings) driver.getAppiumDriver()).setSetting(Setting.UPDATE_IMAGE_ELEMENT_POSITION, true);
You can debug with https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/image-elements.md#debug
You should tweak settings checking the selected place.
https://discuss.appium.io also help any questions.
Had the same problem.
running npm install -g appium after successful install opencv4nodejs solved it.
thanks!
npm list -g opencv4nodejs
Hi @KazuCocoa ,
I have sucessfully installed opencv4nodejs and i can able to get the
$ npm list opencv4nodejs
/Users/XXXXXXXX
βββ [email protected]
$ npm list -g opencv4nodejs
/usr/local/lib
βββ [email protected]
but getting issue in appium 1.9.0 on identifying the image locators as
"org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: opencv4nodejs module is required to use OpenCV features. Please install it first (npm i -g opencv4nodejs) and restart Appium. Read https://github.com/justadudewhohacks/opencv4nodejs#how-to-install for more details on this topic."
kindly plz help us
Thanx in advance
Did you try out newer Appium versions?
I forgot which versions, but we added some improvements to import dependencies.
1.17.0 is the latest one. Could you try out with it again?
.Sure @KazuCocoa will try it and share the result ....
but as mentioned in bitbar's blog (https://bitbar.com/blog/how-to-use-appium-image-locator-for-finding-elements-and-image-recognition/)- "The Appium 1.9.0 release has brought us a new image locator strategy especially for image recognition, -image. Todayβs weβll look at how this new approach works."
But you have mentioned 1.17.0 version... just small doubt
Hi @KazuCocoa
Tried with 1.17.0 ., but getting the issue as
"org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: opencv4nodejs module is required to use OpenCV features. Please install it first (npm i -g opencv4nodejs) and restart Appium. Read https://github.com/justadudewhohacks/opencv4nodejs#how-to-install for more details on this topic."
hm, thanks.
Btw, did you use Appium CLI? Then, Appium resolves the dependency as https://github.com/appium/appium-support/blob/392bcc5b99a5d31ce84b3992790059e45f65599f/lib/node.js#L38-L64
I thought you was able to get the dependency as require('opencv4nodejs') or require('/global/path/to/opencv4nodejs')
Appium Desktop has an issue to resolve the dependency.
https://github.com/appium/appium-desktop/issues/714
hm, thanks.
Btw, did you use Appium CLI? Then, Appium resolves the dependency as https://github.com/appium/appium-support/blob/392bcc5b99a5d31ce84b3992790059e45f65599f/lib/node.js#L38-L64
I thought you was able to get the dependency asrequire('opencv4nodejs')orrequire('/global/path/to/opencv4nodejs')Appium Desktop has an issue to resolve the dependency.
appium/appium-desktop#714
Hi @KazuCocoa,
tried with CLI version of appium (1.17.1) and
I'm able to view opencv4nodejs in my node modules
Also tried by linking the opencv4nodejs with appium nodemodules
but got same issue..
note:- Small Doubt, In which version image recognition by locator is introduced ... iis it by 1.7.0 or 1.9.0 ?
Originally 1.9.0 https://github.com/appium/appium/blob/master/CHANGELOG.md#changes-in-version-190-from-181
Could you share the full log with debug log?
If error message in https://github.com/appium/appium-support/blob/392bcc5b99a5d31ce84b3992790059e45f65599f/lib/node.js#L38-L64 were there, maybe your node dependencies from appium has an issue..
Hi @KazuCocoa
Kindly go thorough the log below ,
---------------------------------------- Appium debug Log --------------------------------------
[HTTP] {"desiredCapabilities":{"app":"/Users/xxxxx.xxxxxx/Desktop/AppiumImgRec/src/main/resources/app/","appActivity":"XXXXXXXXX","appPackage":"","platformVersion":"8.1.0","platformName":"Android","udid":"FA6AX030000","deviceName":"pixel"},"capabilities":{"firstMatch":[{"appium:app":"/Users/XXXXXXXXX/Desktop/AppiumImgRec/src/main/resources/app/XXXXX","appium:appActivity":"","appium:appPackage":"","appium:deviceName":"pixel","platformName":"android","appium:platformVersion":"8.1.0","appium:udid":"FA6AX030000"}]}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/Users/XXXXXXXXX/Desktop/AppiumImgRec/src/main/resources/app/","appActivity":"","appPackage":"","platformVersion":"8.1.0","platformName":"Android","udid":"FA6AX030000","deviceName":"pixel"},null,{"firstMatch":[{"appium:app":"/Users/XXXXXXXXX/Desktop/AppiumImgRec/src/main/resources/app/","appium:appActivity":"","appium:appPackage":"","appium:deviceName":"pixel","platformName":"android","appium:platformVersion":"8.1.0","appium:udid":"FA6AX030000"}]}]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1589097849872 (13:34:09 GMT+0530 (India Standard Time))
[Appium] Consider setting 'automationName' capability to 'UiAutomator2' on Android >= 6, since UIAutomator framework is not maintained anymore by the OS vendor.
[Appium] Creating new AndroidDriver (v3.7.0) session
[Appium] Capabilities:
[Appium] platformName: android
[Appium] app: /Users/XXXXXXXXX/Desktop/AppiumImgRec/src/main/resources/app/
[Appium] appActivity: XXXXXXXXXXX
[Appium] appPackage: XXXXXXXXXXX
[Appium] deviceName: pixel
[Appium] platformVersion: 8.1.0
[Appium] udid: FA6AX030000
[debug] [BaseDriver] W3C capabilities {"alwaysMatch":{"platformNa... and MJSONWP desired capabilities {"app":"/Users/XXXXXXX... were provided
[debug] [BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"platformNa...
[BaseDriver] Session created with session id: 778df378-ebae-4091-840c-600fde833fc1
[AndroidDriver] Java version is: 1.8.0_181
[ADB] Checking whether adb is present
[ADB] Found 6 'build-tools' folders under '/Users/XXXXXXXXXX/Library/Android/sdk' (newest first):
[ADB] /Users/XXXXXXXXX/Library/Android/sdk/build-tools/29.0.2
[ADB] /Users/XXXXXXXXX/Library/Android/sdk/build-tools/29.0.1
[ADB] /Users/XXXXXXX/Library/Android/sdk/build-tools/28.0.3
[ADB] /Users/XXXXXXXXX/Library/Android/sdk/build-tools/27.0.3
[ADB] /Users/XXXXXXXX/Library/Android/sdk/build-tools/26.0.1
[ADB] /Users/XXXXXXXXXX/Library/Android/sdk/build-tools/23.0.2
[ADB] Using adb from /Users/XXXXXXXXXX/Library/Android/sdk/platform-tools/adb
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[AndroidDriver] Using device: FA6AX030000
[debug] [ADB] Setting device id to FA6AX030000
[debug] [ADB] Running '/Users/XXXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell getprop ro.build.version.sdk'
[debug] [ADB] Current device property 'ro.build.version.sdk': 27
[debug] [ADB] Device API level: 27
[AndroidDriver] Consider setting 'automationName' capability to 'uiautomator2' on Android >= 6, since UIAutomator framework is not maintained anymore by the OS vendor.
[BaseDriver] Using local app '/Users/XXXXXXXXXX/Desktop/AppiumImgRec/src/main/resources/app/'
[debug] [AndroidDriver] Checking whether app is actually present
[AndroidDriver] Starting Android session
[debug] [ADB] Running '/Users/XXXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 wait-for-device'
[debug] [ADB] Running '/Users/XXXXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell echo ping'
[debug] [AndroidDriver] Pushing settings apk to device...
[debug] [ADB] Getting install status for io.appium.settings
[debug] [ADB] Running '/Users/XXXXXXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell pm list packages io.appium.settings'
[debug] [ADB] App is installed
[debug] [ADB] Getting package info for 'io.appium.settings'
[debug] [ADB] Running '/Users/XXXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell dumpsys package io.appium.settings'
[ADB] Checking whether aapt is present
[ADB] Using aapt from /Users/XXXXXXXXXXX/Library/Android/sdk/build-tools/29.0.2/aapt
[debug] [ADB] The installed 'io.appium.settings' package does not require upgrade (26 > 5)
[debug] [ADB] Running '/Users/XXXXXXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell ps'
[debug] [AndroidDriver] io.appium.settings is already running. There is no need to reset its permissions.
[debug] [ADB] Device API level: 27
[debug] [ADB] Running '/Users/XXXXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell appops set io.appium.settings android:mock_location allow'
[AndroidDriver] setDeviceLanguageCountry requires language or country.
[AndroidDriver] Got language: 'null' and country: 'null'
[debug] [Logcat] Starting logcat capture
[debug] [AndroidDriver] Pushing unlock helper app to device...
[debug] [ADB] Getting install status for io.appium.unlock
[debug] [ADB] Running '/Users/XXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell pm list packages io.appium.unlock'
[debug] [ADB] App is installed
[debug] [ADB] Getting package info for 'io.appium.unlock'
[debug] [ADB] Running '/Users/XXXXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell dumpsys package io.appium.unlock'
[debug] [ADB] The installed 'io.appium.unlock' package does not require upgrade ('2.0.0' >= '2.0.0')
[ADB] Getting device platform version
[debug] [ADB] Running '/Users/XXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell getprop ro.build.version.release'
[debug] [ADB] Current device property 'ro.build.version.release': 8.1.0
[debug] [ADB] Running '/Users/XXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell wm size'
[debug] [ADB] Running '/Users/XXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell getprop ro.product.model'
[debug] [ADB] Current device property 'ro.product.model': Pixel
[debug] [ADB] Running '/Users/XXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell getprop ro.product.manufacturer'
[debug] [ADB] Current device property 'ro.product.manufacturer': Google
[debug] [ADB] Getting install status for
[debug] [ADB] Running '/Users/XXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell pm list packages '
[debug] [ADB] App is installed
[debug] [ADB] Getting install status for
[debug] [ADB] Running '/Users/XXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell pm list packages '
[debug] [ADB] App is installed
[debug] [ADB] Getting package info for ''
[debug] [ADB] Running '/Users/XXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell dumpsys package '
[debug] [ADB] The installed '' package does not require upgrade ('2020.4.0' >= '2020.4.0')
[AndroidDriver] Performing fast reset on ''
[debug] [ADB] Getting install status for
[debug] [ADB] Running '/Users/XXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell pm list packages '
[debug] [ADB] App is installed
[debug] [ADB] Running '/Users/XXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell am force-stop '
[debug] [ADB] Running '/Users/XXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell pm clear '
[debug] [AndroidDriver] Performed fast reset on the installed '' application (stop and clear)
[debug] [ADB] Running '/Users/XXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell rm -rf /data/local/tmp/strings.json'
[debug] [AndroidDriver] Extracting strings from apk
[debug] [AndroidDriver] /Users/XXXXXXXXX/Desktop/AppiumImgRec/src/main/resources/app/
[debug] [AndroidDriver] null
[debug] [AndroidDriver] /var/folders/rx/9vwknwqs38z60nljn49b972n3n7gk_/T/
[debug] [ADB] Extracting strings for language: default
[ADB] Successfully extracted 113 strings from '/Users/XXXXXXXXX/Desktop/AppiumImgRec/src/main/resources/app/' resources for '(default)' configuration
[debug] [ADB] Running '/Users/XXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 push /var/folders/rx/9vwknwqs38z60nljn49b972n3n7gk_/T//strings.json /data/local/tmp'
[debug] [AndroidBootstrap] Watching for bootstrap disconnect
[debug] [ADB] Forwarding system: 4724 to device: 4724
[debug] [ADB] Running '/Users/XXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 forward tcp:4724 tcp:4724'
[debug] [UiAutomator] Starting UiAutomator
[debug] [UiAutomator] Moving to state 'starting'
[debug] [UiAutomator] Parsing uiautomator jar
[debug] [UiAutomator] Found jar name: 'AppiumBootstrap.jar'
[debug] [ADB] Running '/Users/XXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 push /usr/local/lib/node_modules/appium/node_modules/appium-android-bootstrap/bootstrap/bin/AppiumBootstrap.jar /data/local/tmp/'
[debug] [ADB] Attempting to kill all uiautomator processes
[debug] [ADB] Getting all processes with uiautomator
[debug] [ADB] Running '/Users/XXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell ps'
[ADB] No uiautomator process found to kill, continuing...
[debug] [UiAutomator] Starting UIAutomator
[debug] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","FA6AX030000","shell","uiautomator","runtest","AppiumBootstrap.jar","-c","io.appium.android.bootstrap.Bootstrap","-e","pkg","","-e","disableAndroidWatchers",false,"-e","acceptSslCerts",false]
[debug] [UiAutomator] Moving to state 'online'
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Registered crash watchers.
[AndroidBootstrap] Android bootstrap socket is now connected
[debug] [ADB] Running '/Users/XXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell dumpsys window'
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Client connected
[AndroidDriver] Screen already unlocked, doing nothing
[debug] [ADB] Device API level: 27
[debug] [ADB] Running '/Users/XXXXXXXXX/Library/Android/sdk/platform-tools/adb -P 5037 -s FA6AX030000 shell am start -W -n / -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000'
[Appium] New AndroidDriver session created successfully, session 778df378-ebae-4091-840c-600fde833fc1 added to master session list
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1589097872232 (13:34:32 GMT+0530 (India Standard Time))
[debug] [W3C] Responding to client with driver.createSession() result: {"capabilities":{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android","app":"/Users/XXXXXXXXX/Desktop/AppiumImgRec/src/main/resources/app/","appActivity":"","appPackage":"","deviceName":"pixel","platformVersion":"8.1.0","udid":"FA6AX030000"},"platformName":"android","app":"/Users/XXXXXXXXX/Desktop/AppiumImgRec/src/main/resources/app/","appActivity":"","appPackage":"","deviceName":"FA6AX030000","platformVersion":"8.1.0","udid":"FA6AX030000","deviceUDID":"FA6AX030000","deviceScreenSize":"1080x1920","deviceModel":"Pixel","deviceManufacturer":"Google"}}
[HTTP] <-- POST /wd/hub/session 200 22367 ms - 963
[HTTP]
[HTTP] --> GET /wd/hub/session/778df378-ebae-4091-840c-600fde833fc1
[HTTP] {}
[debug] [W3C] Calling AppiumDriver.getSession() with args: ["778df378-ebae-4091-840c-600fde833fc1"]
[debug] [W3C] Responding to client with driver.getSession() result: {"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android","app":"/Users/XXXXXXXXX/Desktop/AppiumImgRec/src/main/resources/app/","appActivity":"","appPackage":"","deviceName":"pixel","platformVersion":"8.1.0","udid":"FA6AX030000"},"platformName":"android","app":"/Users/XXXXXXXXX/Desktop/AppiumImgRec/src/main/resources/app/","appActivity":"","appPackage":"","deviceName":"FA6AX030000","platformVersion":"8.1.0","udid":"FA6AX030000","deviceUDID":"FA6AX030000","deviceScreenSize":"1080x1920","deviceModel":"Pixel","deviceManufacturer":"Google"}
[HTTP] <-- GET /wd/hub/session/778df378-ebae-4091-840c-600fde833fc1 200 10 ms - 895
[HTTP]
[HTTP] --> GET /wd/hub/session/778df378-ebae-4091-840c-600fde833fc1
[HTTP] {}
[debug] [W3C] Calling AppiumDriver.getSession() with args: ["778df378-ebae-4091-840c-600fde833fc1"]
[debug] [W3C] Responding to client with driver.getSession() result: {"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android","app":"/Users/XXXXXXXXX/Desktop/AppiumImgRec/src/main/resources/app/","appActivity":"","appPackage":"","deviceName":"pixel","platformVersion":"8.1.0","udid":"FA6AX030000"},"platformName":"android","app":"/Users/XXXXXXXXX/Desktop/AppiumImgRec/src/main/resources/app/","appActivity":"XXXXXX","appPackage":"","deviceName":"FA6AX030000","platformVersion":"8.1.0","udid":"FA6AX030000","deviceUDID":"FA6AX030000","deviceScreenSize":"1080x1920","deviceModel":"Pixel","deviceManufacturer":"Google"}
[HTTP] <-- GET /wd/hub/session/778df378-ebae-4091-840c-600fde833fc1 200 2 ms - 895
[HTTP]
[HTTP] --> POST /wd/hub/session/778df378-ebae-4091-840c-600fde833fc1/element
[HTTP] {"using":"-image","value":"iVBORw0KGgoAAAANSUhEUgAAAkAAAABOCAYAAADID6lvAAAMXWlDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnltSIbQAAlJCb6JIDSAlhBapUgVRCUkgoYSYEFTs6KKCaxdRsKGrIoquBZC1InYXxd4XRFSUddEVGypvQgK6+sr3zvfNzJ8zZ/5TMnPvHQA027gSSQ6qBUCuOF8aGxrIGJ+cwiA9BjjQA7qwN+TyZBJWTEwEgDI4/lPe3gSIYrzmpOD6cf6/ig5fIOMBgKRCnM6X8XIhPgEAXsSTSPMBIAZBveXUfIkCCyHWlcIAIZ6pwJlKvFyB05V424BNfCwb4gYAyOpcrjQTAI1mqGcU8DIhj8ZjiJ3FfJEYAE1diP14Qi4f4niIR+Tm5inwXIjtoL0E4p0QM9O/4cz8B3/6ED+XmzmElXkNCDlIJJPkcKf/n6X535KbIx/0YQObulAaFqvIH9bwdnZeuAKrQ9wtTo+KVtQa4vcivrLuAKBUoTwsQWmPGvNkbFg/oA+xM58bFA6xMcQh4pyoCJU+PUMUwoEY7hZ0miifE69au0ggC45TcVZK82KjB3GGlM1Sra3lSgf8Kuyb5dkJLBX/baGAM8j/plAYnwQxFQCMWiBKjIJYA2JdWXZcuNIGsygUsqMGbaTyWEX8VhAzBeLQQCU/lpohDYlV2UtyZYP5YsVCESdKhcvzhfFhyvpgu3jcgfgNIK4TiFkJgzwC2fiIwVz4gqBgZe5Yi0CcoMoXeyjJD4xVre2R5MSo7HGyICdUobeA2EhWEKdai4/Jh5tTyY9HSPJj4pVx4mlZ3LExynjwAhAB2CAIMIActnSQB7KAqKW7vhv+Us6EAC6QgkwgAE4qzeCKpIEZMezjQCH4EyIBkA2tCxyYFYACqP88pFX2TiBjYLZgYEU2eAJxLggHOfC3fGCVeMhbIngMNaIfvPNgrDmwKeZ+1LGgJkKlk
[debug] [W3C] Calling AppiumDriver.findElement() with args: ["-image","iVBORw0KGgoAAAANSUhEUgAAAkAAAABOCAYAAADID6lvAAAMXWlDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnltSIbQAAlJCb6JIDSAlhBapUgVRCUkgoYSYEFTs6KKCaxdRsKGrIoquBZC1InYXxd4XRFSUddEVGypvQgK6+sr3zvfNzJ8zZ/5TMnPvHQA027gSSQ6qBUCuOF8aGxrIGJ+cwiA9BjjQA7qwN+TyZBJWTEwEgDI4/lPe3gSIYrzmpOD6cf6/ig5fIOMBgKRCnM6X8XIhPgEAXsSTSPMBIAZBveXUfIkCCyHWlcIAIZ6pwJlKvFyB05V424BNfCwb4gYAyOpcrjQTAI1mqGcU8DIhj8ZjiJ3FfJEYAE1diP14Qi4f4niIR+Tm5inwXIjtoL0E4p0QM9O/4cz8B3/6ED+XmzmElXkNCDlIJJPkcKf/n6X535KbIx/0YQObulAaFqvIH9bwdnZeuAKrQ9wtTo+KVtQa4vcivrLuAKBUoTwsQWmPGvNkbFg/oA+xM58bFA6xMcQh4pyoCJU+PUMUwoEY7hZ0miifE69au0ggC45TcVZK82KjB3GGlM1Sra3lSgf8Kuyb5dkJLBX/baGAM8j/plAYnwQxFQCMWiBKjIJYA2JdWXZcuNIGsygUsqMGbaTyWEX8VhAzBeLQQCU/lpohDYlV2UtyZYP5YsVCESdKhcvzhfFhyvpgu3jcgfgNIK4TiFkJgzwC2fiIwVz4gqBgZe5Yi0CcoMoXeyjJD4xVre2R5MSo7HGyICdUobeA2EhWEKdai4/Jh5tTyY9HSPJj4pVx4mlZ3LExynjwAhAB2CAIMIActnSQB7KAqKW7vhv+Us6EAC6QgkwgAE4qzeCKpIEZMezjQCH4EyIBkA2tCxyYFYACqP88pFX2TiBjYLZgYEU2eAJxLggHOfC3fGCVeMhbIngMNaIfvPNgrDmwKeZ+1LGgJkKlkQ/yMjQHLYnBxCBiGDGEaI8b4X64Dx4B+wDYXH...
[BaseDriver] Finding image element with match threshold 0.4
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"getDeviceSize","params":{}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"getDeviceSize","params":{}}
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: getDeviceSize
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [ADB] Device API level: 27
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":{"height":1794,"width":1080}}
[BaseDriver] Verifying screenshot size and aspect ratio
[BaseDriver] When trying to find an element, determined that the screen aspect ratio and screenshot aspect ratio are different. Screen is 1080x1794 whereas screenshot is 1080x1920.
[BaseDriver] Resizing screenshot to 1155.8528428093646x1920 to match screen aspect ratio so that image element coordinates have a greater chance of being correct.
[BaseDriver] Scaling screenshot from 1155.8528428093646x1920 to match screen at 1080x1794
[W3C] Encountered internal error running command: Error: opencv4nodejs module is required to use OpenCV features. Please install it first (npm i -g opencv4nodejs) and restart Appium. Read https://github.com/justadudewhohacks/opencv4nodejs#how-to-install for more details on this topic.
[W3C] at initOpenCV (/usr/local/lib/node_modules/appium/node_modules/appium-support/lib/image-util.js:100:11)
[W3C] at Object.getImageOccurrence$ (/usr/local/lib/node_modules/appium/node_modules/appium-support/lib/image-util.js:420:3)
[W3C] at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[W3C] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[W3C] at invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[W3C] at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
[W3C] at new Promise (
[W3C] at new F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
[W3C] at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
[W3C] at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[W3C] at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
[W3C] at Object.getImageOccurrence (/usr/local/lib/node_modules/appium/node_modules/appium-support/build/lib/image-util.js:632:30)
[W3C] at AndroidDriver.callee$0$0$ (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/commands/images.js:47:32)
[W3C] at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[W3C] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[W3C] at invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[W3C] at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
[W3C] at new Promise (
[W3C] at new F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
[W3C] at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
[W3C] at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[W3C] at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
[W3C] at AndroidDriver.callee$0$0 [as compareImages] (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/build/lib/basedriver/commands/images.js:55:30)
[W3C] at AndroidDriver.condition$ (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/commands/find.js:111:26)
[W3C] at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[W3C] at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[W3C] at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[W3C] at process._tickCallback (internal/process/next_tick.js:68:7)
[HTTP] <-- POST /wd/hub/session/778df378-ebae-4091-840c-600fde833fc1/element 500 2320 ms - 1519
[HTTP]

In the above screenshot, In appium node modules, I've linked with the opencv4nodejs module as procedure... Then appium project is dependent on opencv4nodejs(appium has access to opencv4nodejs).
In the above screenshot, In appium node modules, I've linked with the opencv4nodejs module as procedure... Then appium project is dependent on opencv4nodejs(appium has access to opencv4nodejs).
It is expected as npm general behaviour. npm tries to resolve the dependency by the local dependencies. So, you probably can resolve -g opencv4nodejs issue with Appium which is installed by -g option (and run the appium on no package.json place)
Hi @KazuCocoa ,
I have removed OpenCV,appium node modules and started with re-downloading the opencv4nodejs(from npm install -g opencv4node) and appium(v1.17.1) CLI globally.,
but again getting the issue as given below
Appium Logs:-
[debug] [Support] Initializing opencv
[debug] [Support] Loading local package 'opencv4nodejs'
[debug] [Support] Failed to load local package 'opencv4nodejs': dlopen(/usr/local/lib/node_modules/opencv4nodejs/build/Release/opencv4nodejs.node, 1): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
[debug] [Support] Referenced from: /usr/local/opt/ffmpeg/lib/libavformat.58.dylib
[debug] [Support] Reason: image not found
[debug] [Support] Failed to load global package 'opencv4nodejs': The "path" argument must be of type string. Received type undefined
[debug] [Support] Linking package 'opencv4nodejs'
[debug] [Support] Retrying load of linked package 'opencv4nodejs'
[Support] Unable to load package 'opencv4nodejs': dlopen(/usr/local/lib/node_modules/opencv4nodejs/build/Release/opencv4nodejs.node, 1): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
[Support] Referenced from: /usr/local/opt/ffmpeg/lib/libavformat.58.dylib
[Support] Reason: image not found
[Support] Unable to load 'opencv4nodejs': Unable to load package 'opencv4nodejs': dlopen(/usr/local/lib/node_modules/opencv4nodejs/build/Release/opencv4nodejs.node, 1): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
[Support] Referenced from: /usr/local/opt/ffmpeg/lib/libavformat.58.dylib
[Support] Reason: image not found
[debug] [W3C (02d838a1)] Encountered internal error running command: Error: 'opencv4nodejs' module is required to use OpenCV features. Please install it first ('npm i -g opencv4nodejs') and restart Appium. Read https://github.com/justadudewhohacks/opencv4nodejs#how-to-install for more details on this topic.
[debug] [W3C (02d838a1)] at initOpenCV (/usr/local/lib/node_modules/appium/node_modules/appium-support/lib/image-util.js:109:11)
[HTTP] <-- POST /wd/hub/session/02d838a1-d44b-4af2-8714-c1b46c1f4635/element 500 1663 ms - 961
issue in Java-Client:-
Exception in thread "main" org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: 'opencv4nodejs' module is required to use OpenCV features. Please install it first ('npm i -g opencv4nodejs') and restart Appium. Read https://github.com/justadudewhohacks/opencv4nodejs#how-to-install for more details on this topic.
Could you fix your installation issue? Your nodecv4nodejs module was not able to resolve libraries.
[debug] [Support] Loading local package 'opencv4nodejs'
[debug] [Support] Failed to load local package 'opencv4nodejs': dlopen(/usr/local/lib/node_modules/opencv4nodejs/build/Release/opencv4nodejs.node, 1): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
[debug] [Support] Referenced from: /usr/local/opt/ffmpeg/lib/libavformat.58.dylib
[debug] [Support] Reason: image not found
@KazuCocoa ,
By appium-doctor,
found out that issue regarding the FFMPEG as given below,
{ Error: Command 'ffmpeg -version' exited with code null
at ChildProcess.proc.on.code (/usr/local/lib/node_modules/appium-doctor/node_modules/teen_process/lib/exec.js:113:19)
at ChildProcess.emit (events.js:198:13)
at maybeClose (internal/child_process.js:982:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
stdout: '',
stderr:
'dyld: Library not loaded: /usr/local/opt/tesseract/lib/libtesseract.4.dylibn Referenced from: /usr/local/bin/ffmpegn Reason: image not foundn',
code: null }
is FFMPEG is required by OpenCV4nodejs?
or
do we need tessract lib. ? (Becoz i've removed it for issue in opencv4nodejs installation)
Simply they required libtesseract.4.dylib
Hi @KazuCocoa
The issue got resolved and working fine, able to click on element by the image...
The issue seems to be with
1.FFMPEG
2.TESSERACT
3.OpenSSL
not installed before or not updated properly
after reinstalling got solved the issue
Thanx a lot for helping me... and sparing ur valuable time...
@adityabhargav Can you please share your steps/commands in re-installing those 3 mentioned issues ?
By the way, my appium-doctor logs are below:
appium-doctor
Error: Package exports for '/Users/sumanthvakacharla/.virtualenvs/virtualEnv/lib/node_modules/appium-doctor/node_modules/uuid' do not define a valid '.' target
at resolveExportsTarget (internal/modules/cjs/loader.js:545:13)
at applyExports (internal/modules/cjs/loader.js:459:14)
at resolveExports (internal/modules/cjs/loader.js:508:12)
at Function.Module._findPath (internal/modules/cjs/loader.js:577:20)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:879:27)
at Function.Module._load (internal/modules/cjs/loader.js:785:27)
at Module.require (internal/modules/cjs/loader.js:956:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1103:10)
at Module.load (internal/modules/cjs/loader.js:914:32)
at Function.Module._load (internal/modules/cjs/loader.js:822:14)
at Module.require (internal/modules/cjs/loader.js:956:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.
(virtualEnv) svakacharla-mac:automation sumanthvakacharla$
Other info:
(virtualEnv) svakacharla-mac:automation sumanthvakacharla$ npm list -g opencv4nodejs
/Users/sumanthvakacharla/.virtualenvs/virtualEnv/lib
βββ [email protected]
@KazuCocoa
APPIUM LOGS:
BaseDriver] Verifying screenshot size and aspect ratio
[BaseDriver] Screenshot aspect ratio '0.5625' (1242x2208) matched screen aspect ratio '0.5625' (414x736)
[BaseDriver] Scaling screenshot from 1242x2208 to match screen at 414x736
[debug] [Support] Initializing opencv
[debug] [Support] Loading local package 'opencv4nodejs'
[debug] [Support] Failed to load local package 'opencv4nodejs': Cannot find module '/Users/sumanthvakacharla/.virtualenvs/virtualEnv/lib/node_modules/opencv4nodejs/build/Release/opencv4nodejs'
[debug] [Support] Require stack:
[debug] [Support] - /Users/sumanthvakacharla/.virtualenvs/virtualEnv/lib/node_modules/opencv4nodejs/lib/cv.js
[debug] [Support] - /Users/sumanthvakacharla/.virtualenvs/virtualEnv/lib/node_modules/opencv4nodejs/lib/opencv4nodejs.js
[debug] [Support] - /Users/sumanthvakacharla/.virtualenvs/virtualEnv/lib/node_modules/appium/node_modules/appium-support/build/lib/node.js
[debug] [Support] - /Users/sumanthvakacharla/.virtualenvs/virtualEnv/lib/node_modules/appium/node_modules/appium-support/build/lib/image-util.js
[debug] [Support] - /Users/sumanthvakacharla/.virtualenvs/virtualEnv/lib/node_modules/appium/node_modules/appium-support/build/index.js
[debug] [Support] - /Users/sumanthvakacharla/.virtualenvs/TvirtualEnv/lib/node_modules/appium/build/lib/logsink.js
[debug] [Support] - /Users/sumanthvakacharla/.virtualenvs/virtualEnv/lib/node_modules/appium/build/lib/main.js
[debug] [Support] Loading global package '/Users/sumanthvakacharla/.virtualenvs/virtualEnv/lib/node_modules/opencv4nodejs'
[debug] [Support] Failed to load global package 'opencv4nodejs': Cannot find module '/Users/sumanthvakacharla/.virtualenvs/TvirtualEnv/lib/node_modules/opencv4nodejs/build/Release/opencv4nodejs'
Hi @sumanthvakacharla ,
above mentioned are node libs., and need to install w.r.t to the node_modules folder where opencv4nodejs is placed...
1.FFMPEG -- npm i ffmpeg
2.TESSERACT -- npm i tesseract
3.OpenSSL -- npm i openssl
[debug] [35m[Support][39m Failed to load global package 'opencv4nodejs': The "path" argument must be of type string. Received undefined
[debug] [35m[Support][39m Linking package 'opencv4nodejs'
[debug] [35m[Support][39m Retrying load of linked package 'opencv4nodejs'
[35m[Support][39m Unable to load package 'opencv4nodejs': The specified module could not be found.
Still facing the issue on windows 10.
npm list -g --depth=0
+-- [email protected]
+-- [email protected]
+-- [email protected]
Any solution for this??
Update:
After remove node.js and npm and appium from pc, install all from the begining, it solve the error
Please explai in details how you solved this. Please?
The problem
I am trying to use appium image comparison and used the reference code
byte[] screenshot = Base64.encodeBase64(driver.getScreenshotAs(OutputType.BYTES));
OccurrenceMatchingResult result = driver
.findImageOccurrence(screenshot, partialImage, new OccurrenceMatchingOptions()
.withEnabledVisualization());
assertThat(result.getVisualization().length, is(greaterThan(0)));
assertNotNull(result.getRect());I see the following error:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: opencv4nodejs module is required to use OpenCV features. Please install it first (npm i -g opencv4nodejs) and restart Appium. Read https://github.com/justadudewhohacks/opencv4nodejs#how-to-install for more details on this topic.My project is in java and I am really not sure about performing npm i -g opencv4nodejs. Should I do npm i -g opencv4nodejs under the project root, though the project doest not have package.json
Environment
- Appium version (or git revision) that exhibits the issue: 1.10
- Last Appium version that did not exhibit the issue (if applicable):
- Desktop OS/version used to run Appium: iOS 10.13.6
- Node.js version (unless using Appium.app|exe):
- Mobile platform/version under test:iOs
- Real device or emulator/simulator:simulator
- Appium CLI or Appium.app|exe:
Details
If necessary, describe the problem you have been experiencing in more detail.
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: opencv4nodejs module is required to use OpenCV features. Please install it first (npm i -g opencv4nodejs) and restart Appium. Read https://github.com/justadudewhohacks/opencv4nodejs#how-to-install for more details on this topic.
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
System info: host: 'ICF2008045', ip: 'fe80:0:0:0:46:b040:b1:8193%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.6', java.version: '1.8.0_181'
Driver info: io.appium.java_client.ios.IOSDriver
Capabilities {app: /Users/sadla/Library/Develo..., autoWebview: true, automationName: XCUITest, browserName: , bundleId: com.icfi.energystarhome, databaseEnabled: false, deviceName: iPad Air 2, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: false, platform: MAC, platformName: iOS, platformVersion: 11.1, takesScreenshot: true, udid: D4469918-75D5-4277-A205-808..., webStorageEnabled: false}
Session ID: 5ae7aa6a-3eb7-45a4-9458-c88296598bb7
@suswari how you solved your issue reported here