Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find a way to run Karma in Incognito Chrome and Private Firefox on BrowserStack #560

Open
Finesse opened this issue Oct 9, 2020 · 1 comment

Comments

@Finesse
Copy link
Member

Finesse commented Oct 9, 2020

We use Karma and BrowserStack to test FingerprintJS v3 in many browsers. Fingerprint must persist between regular and incognito mode of browser, therefore we should run our tests in incognito browsers too.

But I haven't succeeded to start an incognito browser on BrowserStack. We are trying to solve it with the BrowserStack support. This is what I've got so far: https://github.com/Finesse/karma-browserstack-example/blob/incognito/karma.conf.js. I've tried many other parameters of BrowserStack custom launchers, they all have started browsers in regular mode. Does anybody have similar experience? We will appreciate a lot if you help to setup the incognito testing.

A similar setup that uses Selenium to control a BrowserStack browser directly works as expected:

Python code
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from time import sleep
from datetime import datetime
import os

desired_cap = {
    "browser": "Chrome",
    "goog:chromeOptions": {
        "args": ["incognito", ],
        "w3c": False
    },
}

driver = webdriver.Remote(
    # The environment variable value must be 'http://your-username:your-password@hub-cloud.browserstack.com/wd/hub'
    command_executor=os.environ.get('BROWSERSTACK_HUB_URL'),
    desired_capabilities=desired_cap
)

print("Session: https://automate.browserstack.com/dashboard/v2/sessions/" + driver.session_id)
print("protocol w3c:" + str(driver.w3c))

driver.get("https://google.com/")
driver.quit()

A fallback solution is to run incognito browsers in the CI directly like it's done in v2. But in contrast to v2, there should be multiple versions of browsers.

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

No branches or pull requests

1 participant