python - Detect location of specific text -


appium 1.5.0  xcode  7.3  ios 10.11.4 osx ei capitan using on:simulator ios 8.1 

suppose have text field to see more information clickhereand more click here.

so identified text using xpath , can location , size. can somehow location of here .i need click it, because not element cannot search it. somehow if can location, can tap @ that.

but how can location , still keep generic runs on different devices?

there isn't direct way achieve this(no api available in appium itself). however, solution generic , work on devices(android , ios), programming language implementation.

  1. [you have done] location , size of element.
  2. take screenshot of current screen.
  3. crop image screenshot using location , size of image.[this step can skipped if there not ambiguous targets]
  4. [you need 1 time manually] crop out image portion want location.
  5. search location of cropped image, location , perform precise tap/click.

for image search refer here : how find image within image using python


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -