Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error is thrown when character is not recognized #18

Open
AndreiTsialenchanka opened this issue Nov 3, 2022 · 4 comments
Open

Error is thrown when character is not recognized #18

AndreiTsialenchanka opened this issue Nov 3, 2022 · 4 comments

Comments

@AndreiTsialenchanka
Copy link

AndreiTsialenchanka commented Nov 3, 2022

NOTE: Be aware of the fact that this module is only a plugin that provides all functionality from webdriver-image-comparison. So please check if this is an issue with this plugin or with webdriver-image-comparison.

Environment (please complete the following information):

  • Node.js version: [16]
  • NPM version: [8.15.0]
  • Appium version: [1.21.0-1]
  • Platform name and version: [iOS and Android]
  • WebdriverIO version: [7.2.0]
  • wdio-ocr-service version: [1.1.3]

Config of WebdriverIO + wdio-ocr-service
An example of how you configured the wdio-ocr-service :
'ocr',
{
// The OCR options
ocrImagesPath: 'ocr-images/',
ocrLanguage: 'eng'
},

Describe the bug
On some areas of the screen following error is thrown:
Error: An error happened when parsing the getSystemOcrData, see: Error: An error happened when parsing the getSystemOcrData, see: Error: Invalid character in entity name Line: 29 Column: 7 Char:

To Reproduce
Steps to reproduce the behaviour:
Run await driver.ocrGetText()

Expected behavior
I expect service to ignore unrecognised characters while parsing the values

Screenshot with cropped out area which causes this error:
ios-1667495430812

@AndreiTsialenchanka
Copy link
Author

Also I'm getting: "2022-11-18 21:40:09 ERROR Error: An error happened when parsing the getSystemOcrData, see: Error: An error happened when parsing the getSystemOcrData, see: Error: Attribute without value
[0-0] Line: 110
[0-0] Column: 14
[0-0] Char: v"
error in some cases

@wswebcreation
Copy link
Owner

Sorry for the late response, do you have a sample I can run?

@AndreiTsialenchanka
Copy link
Author

AndreiTsialenchanka commented Dec 12, 2022

@wswebcreation, sure

  1. open this exact github page in the mobile browser (Screenshot attached),
  2. run the command on iPhone 11 simulator: await driver.ocrGetText()

Error:

Error: Error: An error happened when parsing the getSystemOcrData, see: Error: An error happened when parsing the getSystemOcrData, see: Error: Invalid character in entity name Line: 224 Column: 2 Char:

Screenshot saved by OCR:

ios-1670831723506

Screenshot of the screen in simulator:

Simulator Screen Shot - iPhone 11 - 2022-12-12 at 11 03 56

@avient
Copy link

avient commented Dec 19, 2022

This one might be related as well

Error: Error: An error happened when parsing the getSystemOcrData, see: Error: An error happened when parsing the getSystemOcrData, see: Error: Non-whitespace before first tag.
                Line: 0
                Column: 1
                Char: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants