Robot Class is used in Selenium because, in certain Selenium automation tests, users need control over keyboard or mouse to interact with OS windows like download pop-ups, print pop-ups, etc. and native applications like notepad, calculator, etc. Selenium Webdriver cannot handle these pop-ups/applications, so in Java version 1.3, robot class was introduced which can handle OS pop-ups/applications.
Benefits of Robot Class
Robot Class can simulate Keyboard and Mouse Event
Robot Class can help in upload/download of files when using selenium web driver
Robot Class can easily be integrated with current automation framework (keyword, data-driven or hybrid)
Disadvantages of Robot Class
Robot framwork has few disadvantages mentioned below:
Keyboard/mouse event will only works on current instance of Window. E.g. suppose a code is performing any robot class event, and during the code execution user has moved to some other screen then keyword/mouse event will occur on that screen.
Most of the methods like mouseMove is screen resolution dependent so there might be a chance that code working on one machine might not work on other
Смотрите видео Robot Class in Selenium WebDriver(Java)|| Upload File Using Robot Class онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Programming with Pallavi 19 Июль 2023, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 139 раз и оно понравилось 1 людям.