Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Can we use golem with already open browser? #229

Open
Captain05 opened this issue Nov 12, 2021 · 1 comment
Open

Can we use golem with already open browser? #229

Captain05 opened this issue Nov 12, 2021 · 1 comment

Comments

@Captain05
Copy link

I want to use golem with my default browser which is already logged in to websites. is it possible to open my default browser or the browser that I want?

@Sunil-Rathore
Copy link
Collaborator

Sunil-Rathore commented Nov 17, 2021

you can follow this below instruction to use already open default browser using golem gui.

  1. first need to open browser using this below command to run on specific port like example below for chrome
    C:\Program Files\Google\Chrome\Application>chrome.exe -remote-debugging-port=9222 -user-data-dir=C:\Users<user name>\AppData\Local\Google\Chrome\User Data
    now do it manually logged in which url want to already logged always using golem.

  2. customize the default browser using below link.
    https://golem-framework.readthedocs.io/en/latest/browsers.html#custom-browser-boot-up
    add this below line in my_custom_chrome func in browser.py file.
    chrome_options = webdriver.ChromeOptions()
    chrome_options.add_experimental_option("debuggerAddress", "localhost:9222")
    chrome_options.add_argument("user-data-dir=C:\Users\user name\AppData\Local\Google\Chrome\User Data")
    return GolemChromeDriver(executable_path="chrome driver path",
    chrome_options=chrome_options)`

  3. add this below line in setting on gui to use default as already open
    {
    "default_browser": "my_custom_chrome"
    }

  4. now run the suite or test with my_custom_chrome or without given any browser name using gui so it will take default browser.
    result: it will execute script already logged in website.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants