Desktop automation

Hi!

I would like to know if there is a way i always open the chome browser instead of the default browser installed. Is it possible?

Hi @diego.prosoft,

The Desktop framework (DesktopBot) will always open the defined default browser. But, with the Web Framework (WebBot), it is possible to use the browser you prefer, however it is necessary to download the webdriver for it to happen.

After downloading the webdriver, follow the code below to open browser Chrome in BotCity site:

class Bot(WebBot):
    def action(self, execution=None):
        # Defini se irá rodar em modo headless ou não, padrão é False
        self.headless = False

        # Defini qual navegador usará, no caso Chrome
        self.browser = Browser.CHROME

        # Passa o caminho do webdriver baixado
        self.driver_path = "<caminho do seu webdriver chrome>"

        # Abre site da BotCity no navegador Chrome
        self.browse("https://www.botcity.dev")

You can find the links to download the webdriver in this tutorial, it also has more specific information on creating web automation with BotCity.

Thanks, Livia. It really helped me.