robotframework-SikuliLibrary
robotframework-SikuliLibrary copied to clipboard
Get Text From Region
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?
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.
Are you accepting PRs? How could I contribute?
@edsonnarantes , yes, PRs are welcome.
@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.
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.
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?
@edsonnarantes , i have checked sikulixapi, it is included libs already. thanks!
@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 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 👍
@edsonnarantes , thanks for this information. I have update my env, and now it works with 1.1.4.
@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.
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
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.
@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.
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.
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]
@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?