skip to Main Content

Below is a snapshot of our application in test. iOS app in react native. The hierarchy is too deep.
test image

We are already using snapshotmaxdepth – 60 as one of the capabilities.

Other capabilities include udid, bundleid, includeSafariInWebViews, connectHardwarekeyboard, simpleVisibleCheck and UseNativeCaching Strategy, etc…

The developement partner is suggesting to use pytesseract to extract the portfolioNumberValue, and had an argument about the application of pytesseract in this scenario.

This is just one element out many where we are having issue identifying using element-attributes (accessibilityid, classchain etc…). The value is no where to been seen in the selected element list.

I see a lot of disadvantage in using right from stability, incorrect application of tesseract, performance, reliability and pragmatic solution.

We have issue only with iOS and not Android

Question:

Is it general practice to user pytesseract in selenium automation to identify iOS elements? (our framework is in python/pytest)

What other options do we have here to enable automation?

Any other suggestion?

Went back several time to dev vendor to increase the depth/navigation, it worked for some but now they are saying use pytesseract

2

Answers


  1. Of course, the best way is to ask your developers to add this value as an attribute to the DOM, so you’ll be able to read it using Appium.

    OCR could be an option. However, as you already mentioned, this approach will not be as effective and resilient. The good part about Tesseract is that it is an open-source solution. If you have some flexibility in terms of budget, you may consider commercial solutions, such as AWS Rekognition.

    Login or Signup to reply.
  2. It would be extremely perfect if developers could adjust the elements so that Appium could recognize them. However, in some cases, such as hybrid language development (like React, Flutter…) it may not work, as in these cases.

    Have you tried locating these elements directly through Appium, rather than relying exclusively on Appium Inspector?

    Personally, I’ve had problems with certain attributes that Appium Inspector didn’t detect correctly, but Appium found them without a problem. I recommend that you also try Accessibility Inspector (a native MacOS application), as this approach solved my problem.

    As for using OCR, it could be a viable option. However, like any stopgap solution, it can have its drawbacks. If the element is being found without the necessary attributes, I suggest considering extracting the information directly using Pytesseract instead of OCR plugin.

    I hope these suggestions help to resolve your issue.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search