In Nightwatchjs, how to use maximum or defined number of instances of browser in a node using Selenium Grid till execution completed #3262
Unanswered
aniketkumar2012
asked this question in
Help Needed
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I execute more than 280 testsuites with 3000+ test cases in parallel using NightwatchJs via Selenium Grid. I have allocated 26 node(running on AWS Fargate) and configured my node to supports 5 instance where total instances are 130 available.
then configured worker=43 in nightwatch.json file like:
`
{
"src_folders": [
"tests"
],
"output_folder": "reports",
"custom_commands_path": "./custom/commands",
"custom_assertions_path": "",
"page_objects_path": "pages",
"globals_path": "./custom/globals.js",
"live_output": true,
"detailed_output": false,
"selenium": {
"start_process": false,
"server_path": "lib/drivers/selenium-server-standalone-3.9.1.jar",
"selenium_port": 4444,
"screenshots": {
"enabled": false,
"on_failure": false,
"on_error": false,
"path": "screenshots/"
},
"cli_args": {
"webdriver.chrome.driver": ""
}
},
"test_settings": {
"default": {
"launch_url": "someWebsite.com",
"selenium_port": 4444,
"selenium_host": "selenium-abc.selenium.xyz.com",
"silent": true,
"use_xpath": true,
"end_session_on_fail": false,
"skip_testcases_on_fail": false,
"request_timeout_options": {
"timeout": 120000
},
"screenshots": {
"enabled": true,
"path": "screenshots/chrome/",
"on_failure": true,
"on_error": true
},
"desiredCapabilities": {
"browserName": "chrome",
"goog:chromeOptions": {
"w3c": false,
"args": [
"--use-fake-ui-for-media-stream",
"--window-size=1920,1080",
"--disable-gpu",
"--disable-dev-shm-usage",
"--disable-extensions",
"--no-sandbox",
"disable-infobars",
"--start-maximized",
"--whitelisted-ips"
]
}
}
},
"dev": {
"launch_url": "someWebsite.com"
},
"local-chrome": {
"desiredCapabilities": {
"browserName": "chrome",
"chromeOptions": {
"w3c": false,
"args": [
"disable-web-security",
"ignore-certificate-errors",
"--test-type"
]
}
}
},
"edge": {
"desiredCapabilities": {
"browserName": "MicrosoftEdge"
}
}
},
"parallel_process_delay": 10000,
"test_workers": {
"enabled": true,
"workers": 43
}
}
`
nightwatch.conf.js file look like
`module.exports = (function (settings) {
})(require('./nightwatch.json'));`
So that it will use 43 browser instances while executions through Jenkins but this is not the case.
At starting it uses around 30 instances but after some time it went down to 4 to 5 instances only or even low because after first batch of testsuites execution completed, it is not able to utilize the rest or free instances available. Due to which our execution time went to around 2 and half hours.
So here is my question, is there any way to utilize all the instances available till completion of execution. So that my resource will not go waste.
Please let me know if more information needed.
Beta Was this translation helpful? Give feedback.
All reactions