Can Selenium Command Line Runner run .side files using a local, authenticated Chrome profile?

For lord knows what reason, I'm trying to use Selenium Command Line Runner to run some tests inside a particular Selenium IDE .side file that crawl the UI of a logged-in G Suite account. This is not a problem in the IDE--I can log into the G Suite account, install the Selenium IDE extension, open my .side file, and run all its tests--the browsers are all authenticated. Is there any way for me to launch that .side file from the command line instead?

The first thing I thought to try was to see if the command line runner could run the tests inside a particular .side file using a particular local chrome profile, one that was already authenticated. However:

selenium-side-runner -c "browserName='chrome' chromeOptions.args=[profile-directory='Profile 2', user-data-dir='/Users/username/Library/Application Support/Google/Chrome/']" Calendar\ Settings.side

merely launches the file in the typical default, unauthenticated Chrome profile. Because my test is configured to open a URL that assumes one has already authenticated, I'm brought to Google's authentication screen.

I'd like either to a) have the command line runner run the .side file in an already-authenticated chrome profile, or b) have the .side file's suite of tests begin with an authentication flow, then have the remaining tests in the suite run in the authenticated chrome profile. Is there a way to do either?

1 answer

  • answered 2019-07-11 07:37 Jim Grigoryan

    I'd like either to a) have the command line runner run the .side file in an already-authenticated chrome profile,

    This is not supported by design. SIDE runner always starts a fresh instance.

    The alternative solution is to use the Selenium IDE++ from UI.Vision (a different open-source project) and then start it with its command line API. Unlike the SIDE runner, the UI.Vision tool command line runs in the current Chrome profile, so it will use the profile that was already authenticated.

    b) have the .side file's suite of tests begin with an authentication flow,

    This should work by using test suites, or do I overlook something here?

    A Selenium IDE test suite is a set of tests in a project that are run together as a single entity.