{"id":18817058,"url":"https://github.com/atyors/robotframework-imagerobot","last_synced_at":"2025-04-13T22:33:28.499Z","repository":{"id":62570556,"uuid":"216737930","full_name":"Atyors/robotframework-ImageRobot","owner":"Atyors","description":"Image recognition for Robot Framework and some other features.","archived":false,"fork":false,"pushed_at":"2023-10-10T09:38:19.000Z","size":146,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T17:17:38.388Z","etag":null,"topics":["automation","image","image-recognition","python3","robotframework","robotframework-library"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Atyors.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-22T06:21:59.000Z","updated_at":"2024-09-26T10:37:34.000Z","dependencies_parsed_at":"2022-11-03T17:15:37.771Z","dependency_job_id":null,"html_url":"https://github.com/Atyors/robotframework-ImageRobot","commit_stats":null,"previous_names":["atyors/imagerobot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Atyors%2Frobotframework-ImageRobot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Atyors%2Frobotframework-ImageRobot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Atyors%2Frobotframework-ImageRobot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Atyors%2Frobotframework-ImageRobot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Atyors","download_url":"https://codeload.github.com/Atyors/robotframework-ImageRobot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248790877,"owners_count":21162105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","image","image-recognition","python3","robotframework","robotframework-library"],"created_at":"2024-11-08T00:09:03.483Z","updated_at":"2025-04-13T22:33:24.200Z","avatar_url":"https://github.com/Atyors.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RobotFramework-ImageRobot\n\n- [Updates](#updates)\n- [Introduction](#introduction)\n- [Requirements](#requirements)\n- [Image recognition](#image-recognition)\n- [Installation](#installation)\n- [Window focus](#window-focus)\n- [Mouse control](#mouse-control)\n- [Keyboard input](#keyboard-input)\n\n\n## Now available on PyPI\n\nJust use pip to install the package:\n\n\n    python -m pip install ImageRobot\n\n\nYou no longer need to copy nor clone the repository to get the package.\n\n## Updates\n\n- Add \"set_region_around_image\" in Image\n- Fix requirements.txt error with pip install\n- Add \"position\" parameter to make it easier to click / move the mouse\n- Add new method \"set_region_around_position\"\n- Add region parameter to set_region_method()\n- Improve location when using set_region() method\n\n\n## Introduction\n\nThe purpose of this module is to bring to Robot Framework user a way to do image recognition.\nThis module has been created in 4 different parts:\n- Image recognition\n- Window focus\n- Mouse control\n- Keyboard input\n\nWith this module you will be able to do the basics of image recognition using Robot Framework.\n\nThe functions for the mouse control and the keyboard input are mostly wrapers from other libraries.\n\n\n## Requirements\n\nPython version: 3.6+\n\nModules required:\n- keyboard\n- numpy\n- opencv-python\n- pyautogui\n- pygetwindow\n- robotframework\n\nAs pygetwindow is only usable with Windows, the Focus object cannot be used on other platforms. You can use the project as base for your work if needed.\n\n## Installation\n\nIt can simply be installed using pip once the project has been cloned or downloaded:\n    \n    python -m pip install ImageRobot\n\n\n## Image recognition\n\nImage recognition example in Robot Framework:\n\n    ${img}=  BuiltIn.Set Variable  .${/}google.png\n    ${pos}=  ImageRobot.Search Image  ${img}\n\nIn this example, your Robot will look for the image at the path \"./google.png\" and return the position on the screen\nwhere the image has been found.\n\nIf the image may appear because the loading takes time, you can use the \"wait_until_image_appear\" function which will \nwait a certain amount of time before going in timeout. Example:\n\n    ${img}=  BuiltIn.Set Variable  .${/}google.png\n    ${pos}=  ImageRobot.Wait Until Image Appear  ${img}  timeout=30\n\nIf the image has not been found in the next 30 seconds, the Robot will show a failure message telling\nthat it did not happen. Otherwise the \"pos\" variable will get the position of the image found.\n\nYou can highlight the image you are looking for with the \"highlight image\" function. If the image\nis found multiple times, it will draw a rectangle arround each.\n\n    ImageRobot.Highlight Image  ${img}\n\nThis function will save the image on the disk. If too many screenshots already exist, it will throw\nan error telling to clean the repository. It happens when there is 999 screenshots in the repository\nfrom where the robot is launched.\n\nIf you need to find an image in a specific region, in order to optimize performance you can use the\n\"set region\" function. The screenshot will be taken for only the part until it has been released with\n\"release region\".\n\n    ImageRobot.Set Region  0  0  500  500\n    ImageRobot.Highlight Image  ${img}\n    ImageRobot.Release Region\n\nThis sequence will try to find and highlight the image in the upper-left region of the screen. Then it releases the region\nso next searchs will be done on the whole screen.\n\n\n## Window focus\n\nThe Focus class gives you a tool to select specific windows and do action on it.\nOnce the window has been set in focus, it is possible to put it foreground, minimize, maximize and restore it.\nExample:\n\n    ImageRobot.Focus Window Containing  Firefox\n    ImageRobot.Restore Window\n    ImageRobot.Maximize Window\n\nThis sequence will check if a window containing \"Firefox\" in the name is found. If so it will create a focus on it\nThen we restore the window. It means that if the window has been reduced in the desk bar, it will show it up again.\nFinaly the Robot maximize the window making it full screen as if you clicked the maximize button.\n\n\n## Mouse control\n\nThe Mouse class gives you some functions dedicated to mouse control.\nYou can find the classics \"Click Position\" - to click at specific coordinates -, \"Click Image\" - to click on an image\nif the image has been found -, \"Move Cursor To Position\" - to move the cursor at specific coordinates - and so on.\n\nIf you use the click image without giving a timestamp, you will not see the cursor move before the click.\n\nEven if the \"Set Region\" function has been used, the mouse will not use it. So it is preferable to use a sequence of\nactions like the example above:\n\n    ImageRobot.Set Region  0  0  960  1080\n    ${pos}=  ImageRobot.Search Image  ${img}  center=True\n    BuiltIn.Run Keyword If  ${pos}[0] != -1  ImageRobot.Click Position  ${pos}[0]  ${pos}[1]\n    ImageRobot.Release Region\n\nWith the \"Set Region\" we cut the left half part of a screen width 1920 * 1080. We search in this cut part.\nIf the value returned is different than \"-1\", it means the image has been found so we can click at the position returned.\nFinally we release the region set.\n\n\n## Keyboard input\n\nThe Keyboard class gives you some functions dedicated to keyboard control.\nThe classic functions are available like the \"Input Text\" function. It does not need any locator to be used.\nThere is also a function named \"Execute Hotkey\" which gives the user a tool to use hotkeys.\nExample :\n\n    ImageRobot.Execute Hotkey  ctrl+shift+escape\n\nThis line will open the task manager.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatyors%2Frobotframework-imagerobot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatyors%2Frobotframework-imagerobot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatyors%2Frobotframework-imagerobot/lists"}