Skip to content
This repository has been archived by the owner on Jan 19, 2021. It is now read-only.

Parallel Processing with Nightwatch and ChromeDriver without Selenium #239

Open
cortezcristian opened this issue Aug 21, 2017 · 6 comments

Comments

@cortezcristian
Copy link

Is it possible to use this framework without java and selenium?
Using nightwatch parallel auto feature directly avoiding selenium? Or is selenium a core component of Magellan?

@archlichking
Copy link
Contributor

Nope, selenium isn't a must to the magellan eco-system. There is an option to disable selenium auto launch in nightwatch.json. Similarly like http://testarmada.io/#manageAppiumLifecycle, selenium.start_process can be false so that nightwatch won't automatically launch selenium server for you.

@cortezcristian
Copy link
Author

cortezcristian commented Aug 22, 2017

I'm running a local executor, if i set start_process: false, obviously it start failing.

Where should be the place to start the chromedriver server? I mean calling chromedriver.start/stop in magellan? This is from the official guide: http://nightwatchjs.org/gettingstarted under ChromeDriver section 3.

image

Because i added the start/stop on the before/after hooks on the lib/globals.js file and the chrome instances don't show up.

Changed the port to be 9515 instead of 4444, but still failing.

@cortezcristian cortezcristian changed the title Parallel Processing with Nightwatch without Selenium Parallel Processing with Nightwatch and ChromeDriver without Selenium Aug 22, 2017
@archlichking
Copy link
Contributor

archlichking commented Aug 22, 2017

i'm afraid you need to follow all the instructions especially this one

We also need to clear the default_path_prefix, as it is set by default to /wd/hub, which is what selenium is using.

with all the changes required by the nightwatch, test works fine in my local without selenium server. the entry i use for chrome

"chrome": {
      "selenium_port"  : 9515,
      "selenium_host"  : "localhost",
      "default_path_prefix" : "",
      "desiredCapabilities": {
        "browserName": "chrome"
      },
      "selenium": {
        "start_process": false
      }
    },

@cortezcristian
Copy link
Author

I did set "default_path_prefix": "", to be empty under test_settings/default. Still failing

image

@archlichking
Copy link
Contributor

when you see error retrieving a new session ..., it means nightwatch is still looking for selenium server. you may still have selenium.start_process enabled somewhere. use --debug to have local executor to output the actual desiredCapabilities.

@cortezcristian
Copy link
Author

cortezcristian commented Aug 22, 2017

I did that:

[DEBUG][Local Executor] executor config: {
	"desiredCapabilities": {
		"browserName": "chrome",
		"chromeOptions": {
			"args": ["--no-sandbox", "start-maximized", "disable-web-security"],
			"prefs": {
				"credentials_enable_service": false,
				"profile.password_manager_enabled": false,
				"profile.managed_default_content_settings.images": 2
			}
		},
		"acceptSslCerts": true
	}
}

That's it the default settings were being overrided

image

It does work now, but i found another issue. Every time the cases run starts a new instance of chrome driver on a different port.

image

And they end all using the same one on port 9515. How can I attach the different set of workers to those separate intances of chromedriver? (I guess that's not possible)

The only solution that worked for me, was to run chromedriver as a single process before starting the suite, to avoid the the problem of multiple chromedriver instances in that scenario (when the test run in parallel).

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