Perform Mouse and Keyboard actions in WebBot

Is it possible to execute mouse and keyboard actions using BotCity web framework?

The website I need to automate requires ‘physical’ clicks to interact with some elements. I have tried Desktop bot, but there is a watermark on the VM’s screen that both it’s content and position changes every time we logon - it’s based on the date and time we log on the machine -, which makes it hard to navigate using computer-vision.

I have tried Selenium’s Actions class and it worked. I wonder whether it is possible to import this class in the web framework too.

Thanks!

Hey @jamaral

The BotCity web framework offers several methods related to keyboard and mouse operations.

You can easily perform move, click and type operations for example with the methods:

mouse_move()
click()
type_keys()
kb_type()

These are just a few examples, the framework offers many others as well. You can test to see if it works correctly for your case.

In this link you will find all the methods currently available in the web framework: Framework - BotCity Framework Web - Python

2 Likes

@joaovoltarelli

Thank you! I thought it would only be possible for DesktopBot. I just needed to get the element’s location as follows an it worked:

elem_coord = self.find_element('//*[@id="search-input"]', By.XPATH).location

self.click_at(elem_coord["x"] + 10, elem_coord["y"] + 10)
2 Likes