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\DefaultBrowser 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