robotframework-SikuliLibrary icon indicating copy to clipboard operation
robotframework-SikuliLibrary copied to clipboard

Get Text From Region

Open ksokolowski opened this issue 6 years ago • 17 comments

Hello.

Would it be possible to add new keywords for extracting text only from selected region of the screen? To do it we should also somehow set coordinates of e.g. some text box that we would like OCR. For this it would be needed to Get Image Coordinates keyword. In general I find current list of keywords in SikuliLibrary quite limited compared to python/jython list of functions. http://doc.sikuli.org/region.html#Region.text Are there any plans for bring more core Sikuli functionality as keywords to RF-SikuliLibrary?

ksokolowski avatar Jun 26 '18 10:06 ksokolowski

hi,

Yes, i think it could be implemented. You are right, i implemented several keywords based on my expeirence.

it would be great, If you could give me a keyword list you want to have.

rainmanwy avatar Jul 03 '18 09:07 rainmanwy

Are you accepting PRs? How could I contribute?

edsonharantes avatar Sep 21 '18 16:09 edsonharantes

@edsonnarantes , yes, PRs are welcome.

rainmanwy avatar Sep 25 '18 03:09 rainmanwy

@edsonnarantes , seems sikulixapi 1.1.4 is not exist in "https://oss.sonatype.org/content/groups/public", could you confirm that?

i could only find "1.1.2-SNAPSHOT" in that repo.

rainmanwy avatar Oct 10 '18 10:10 rainmanwy

Sorry @rainmanwy, I made the PR with this mistake, there is a 1.1.4-SNAPSHOT in https://oss.sonatype.org/content/groups/public/com/sikulix/sikulixapi/

I'm using this in my project. Really sorry.

edsonharantes avatar Oct 10 '18 11:10 edsonharantes

Thanks @edsonnarantes , I could find "1.1.4-SNAPSHOT" in that repo. So could you also upload "sikulixlibswin", "sikulixlibslux" and "sikulixlibsmac" to that repo. Or i could continue to use old version, whether it is compatible with sikulixapi?

rainmanwy avatar Oct 11 '18 01:10 rainmanwy

@edsonnarantes , i have checked sikulixapi, it is included libs already. thanks!

rainmanwy avatar Oct 11 '18 01:10 rainmanwy

@edsonnarantes , seems 1.1.4 could not work in my Linux OS, so i downgrade to 1.1.2. Looks everything is ok, and the keywords you provided also could work when using version 1.1.2.

rainmanwy avatar Oct 11 '18 02:10 rainmanwy

@rainmanwy There's a special steep in Linux OS in order to work with the 1.1.4 as the documentation says.

I made more functions and before the PR I will test them with the 1.1.2 👍

edsonharantes avatar Oct 11 '18 11:10 edsonharantes

@edsonnarantes , thanks for this information. I have update my env, and now it works with 1.1.4.

rainmanwy avatar Oct 26 '18 05:10 rainmanwy

@rainmanwy comments on using 1.1.4 sikulixapi.jar:

  • will only be available as 1.1.4-SNAPSHOT the next 2-3 months
  • runs on Java 8+ (recommended 8 or 11)
  • on Mac and Windows runs out of the box (all dependencies on Maven, native libs included)
  • on Linux OpenCV and Tesseract have to be made available by the user

In the SikuliX docs there is a special topic News on 1.1.4, where I track the changes and current problems.

As mentioned by @edsonnarantes above, there is a special for Linux users

For your users IMHO you should:

  • make a release here, that freezes the state with 1.1.2 or 1.1.3, to have a chance to step back if needed
  • you should implement a versioning scheme that documents major changes (like switching to 1.1.4)
  • at a prominent place place an info Important for users of the latest version, that contains some of the 1.1.4 related infos and pointers.

RaiMan avatar Oct 26 '18 08:10 RaiMan

Thanks @RaiMan for your suggestion. I plan to create a tag for 1.1.2 dependency, and add a section in README to mention the version mapping between robotframework-SikuliLibrary and sikulix. Not sure my understand is correct:)

About the 1.1.4 SNAPSHOT version, is there a issue or something i could "watch" and track, so that i could know that 1.1.4 is released to maven repo?

rainmanwy avatar Oct 26 '18 09:10 rainmanwy

@rainmanwy

Not sure my understand is correct

Yes, you understood.

is there a issue or something i could "watch" and track

You have to be prepared, to get requests about new features and their usage (Pattern.resize(), transparency, text/OCR)

Since I will switch now to a dev-branch, to make major changes/revisions towards a 1.1.5 or even 2.0.0, you are save with the current situation. As mentioned: somewhen beginning next year there will be a 1.1.4 final on MavenCentral.

... but of course there will be minor changes/revisions/fixes meanwhile in 1.1.4-SNAPSHOT. Just from time to time scan the commit list in the SikuliX1 repo.

RaiMan avatar Oct 26 '18 10:10 RaiMan

@KEYSERQA I think you should raise a new issue about your problem.

You should enable OCR functions before using them. Look at the "Set Ocr Text Read" keyword from keyword documentation.

Marnok avatar Dec 12 '18 13:12 Marnok

Hello @KEYSERQA, from the image you posted, the argument is wrong (check the line "Params"), it should be something like this: [1010, 304, 101, 27] (with only one pair of brackets) you could check how are you passing this param to the keyword.

edsonharantes avatar Dec 12 '18 13:12 edsonharantes

SikuliLibrary.Get Text seems very flakey. For instance using the same image (example) [Click chromeRead.png] works every time but in the same testcase using Get Text [com.github.rainmanwy.robotframework.sikulilib.exceptions.ScreenOperationException: Could not find readChromeText.png]

Suzypasha avatar Oct 13 '20 14:10 Suzypasha

@rainmanwy I dont know if I am right here, I wanted to ask is it possible to use Region Click Text when I have multiple same words in the Region?? I want to click on the 3rd word in that region. Is that possible?

Sirad1980 avatar May 06 '22 11:05 Sirad1980