app launches new (local) chrome browser instead of launching new tab in selenium chrome browser

50 views
Skip to first unread message

lxnm

unread,
Apr 28, 2024, 2:16:13 PMApr 28
to Selenium Users
I have an app that redirects user to a login webpage on chrome when user clicks on a button. My workflow is this:
1. Kill all current Chrome processes (chrome.exe) 
2. Start a fresh chrome browser process with selenium chromedriver first 
3. Launch my app and click on button to redirect to login url

However, a new chrome browser is launched currently instead of opening the url in the already open existing Selenium-automated chrome browser.

    # Set protocols for Chrome browser permissions
    browser_protocols = create_protocols()

    # Configuration of options specific to browser
    if browser_name == "Google Chrome":
        browser_options.add_experimental_option(
            "prefs",
            {"protocol_handler.allowed_origin_protocol_pairs": browser_protocols},
        )
        chrome_options = config_file["selenium"]["Google Chrome"]["options"]
        for option in chrome_options:
            browser_options.add_argument(option)

        web_driver = selenium_webdriver.Chrome(ChromeDriverManager().install(), options=browser_options)

            activate_win_app(self.appium_driver, TESTAPP_PATH_1)
            click_login(self.appium_driver)

Here is the browser version info for the Selenium-automated browser:
Command Line: "C:\Program Files\Google\Chrome\Application\chrome.exe" --allow-pre-commit-input --disable-background-networking --disable-backgrounding-occluded-windows --disable-client-side-phishing-detection --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-hang-monitor --disable-popup-blocking --disable-prompt-on-repost --disable-sync --enable-automation --enable-logging --log-level=0 --no-first-run --no-sandbox --no-service-autorun --password-store=basic --remote-debugging-port=9222 --test-type=webdriver --use-mock-keychain --user-data-dir=/tmp --window-size=595,850 --flag-switches-begin --flag-switches-end
Executable Path C:\Program Files\Google\Chrome\Application\chrome.exe
Profile Path C:\tmp\Default


Browser version info for the (local) browser launched by the app:
Command Line: "C:\Program Files\Google\Chrome\Application\chrome.exe" --flag-switches-begin --flag-switches-end --single-argument https://developer.api.companyloginurl.com
Executable Path C:\Program Files\Google\Chrome\Application\chrome.exe
Profile Path C:\Users\mnxl\AppData\Local\Google\Chrome\User

Soos Laszlo

unread,
Jun 14, 2024, 8:35:12 AM (4 days ago) Jun 14
to Selenium Users
Actually this is what I have been looking for to start en existing browser session which is already logged in. Thanks.
Reply all
Reply to author
Forward
0 new messages