-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
update SikuliX integration to interact by text, eg click some text.png #702
Conversation
Fyi @siowyisheng on a draft PR. general test seems ok, probably the only thing left to improve is to see if can throw error for snap and read step if the text on screen to search for is not present. Will ping here again when I think it's ready for your review and testing. |
@siowyisheng ready for your review, added showing error if text not found for snap and read. |
Adding on @siowyisheng, the implementation is straightforward but tedious as there is a need to update and create a lot of nested if else statements. The strategy is if a .png or .bmp is given as the locator, and that image file does not exist on the computer, then it must be referring to interacting by text on the screen. Then route the action accordingly to interact by first creating a region to find that text on screen and passing it to be acted on according to the intent. This feature is a great idea, thanks for suggesting it! |
PS - It also works for snap and read steps, and works for text with spaces. |
Adding a note call_sikuli() in tagui_parse.php and tagui_header.js needs updating to reflect this change. Same for present() and visible() in tagui_header.js. Because with the change, image file not found is no longer be an error as it gets interpreted as text OCR search. Will look into it. |
Making some draft changes above for appropriate error messages when text not found on screen, and the updated present() / visible() functions, plus visible_intent() in SikuliX tagui.py. |
@siowyisheng looks ready for your review and testing! |
It works for me, but I'm getting 2x
|
Sure we discuss more! The 2 Access is denied is due to haven't merged the PR on hacking Chrome on Windows to exit cleanly. The PR that you've merge addresses that by first making sure that the file exist before overwriting and secondly to output any error to nul. There may be error due to the file missing or user has other open Chrome sessions, which prevents TagUI from writing to the Chrome preferences file. For the writing of .png file, there is no creating of .png file. What happens is if there is no such file detected, the implementation will treat this as a text search instead of an image snapshot search base on the image file. This follows the consistent syntax of using .png / .bmp to denote that the identifier is using visual automation. I couldn't think of other ways to invoke without either adding a new step or parameter to denote using text search, so I'm comfortable to implement this way, and also implemented this way to the RPA for Python project. I'm also maintaining a fork of TagUI v5.X here on my own - https://github.com/tebelorg/TagUI/tree/rpa_python As the target user base is now different (TagUI for business user friendly), RPA for Python for Python programmers, I foresee divergence in how features are going to be implemented going forward, so I'll have to maintain a fork on my own just for the RPA for Python project. Eg log files are first-class citizens there so I didn't implement the no logging by default in v6 for that fork, but only the text search and exit Chrome cleanly for Windows, out of the many v6 features. The change for consistency in echo / check / dump /write is also something that probably will break the package current implementation so I won't be rolling it out for the package in that fork. |
Following throws error, initial finding seems to be the call for
|
Added 2 new commits above that fixes the issue. Below works now in normal run and live mode -
|
Done, looks ok for me now. For your review and testing @siowyisheng Syntax is |
tested and LGTM, merging. |
Thanks @siowyisheng ! Found an issue when trying to use this with variable. Will compile into incorrect JS code and error out. Will figure out a solution and raise another PR 🤦♂ |
#702) * update SikuliX integration to interact by text * error handling for read and snap * make verbiage appropriate for search by text * tagui_parse.php show correct generated error message * tagui_header.js show correct error message for text search * updated visible_intent() for SikuliX * Update tagui_parse.php * Update tagui.py * bug fix get_text_for_sikuli() in tagui_parse.php * bug fix for get_text_for_sikuli() in tagui_header.js * change tagui.sikuli/tagui.py to use 'using ocr' * tagui_parse.php add using ocr syntax * tagui_header.js add using ocr syntax * update tagui_parse.php get_text_for_sikuli() * update tagui_header.php get_text_for_sikuli()
No description provided.