Pass browser parameter through command line
See original GitHub issueHi,
I am using multiCapabilities for multiple browsers in config.js file as below,
multiCapabilities: [
{
'browserName': 'chrome',
'chromeOptions': {
'prefs': {
// disable chrome's annoying password manager
'profile.password_manager_enabled': false,
'credentials_enable_service': false,
'password_manager_enabled': false
}
}
} ,
{
browserName : 'firefox',
marionette : true,
acceptInsecureCerts : true,
firefoxOptions:{
args: ['--headless']
},
'moz:firefoxOptions': {
args: [ '--headless' ]
}
}
]
but instead of executing tests on multiple browsers, I want to make it parameterized like,
whatever the browser name I’ll pass from command line only that browser should work.
So, is there a way we can pass specific browser name through protractor command line?
Issue Analytics
- State:
- Created 5 years ago
- Comments:12
Top Results From Across the Web
How do I pass browser as a command line parameter when ...
So I would like to pass into test a command line parameter --browser chrome for example and have it only run the chrome...
Read more >How to pass command-line arguments to the browser?
With Kameleo, you can fine-tune the browsers by passing command-line arguments. The arguments are passed either by using the ...
Read more >Send parameters from command line to selenium project
This video will explain how to send parameters or values like browser name, environment, username, password etc to your selenium framework.
Read more >Fetch data from pytest command line arguments ... - YouTube
This video will explain how to fetch the pytest command line parameters and use in selenium python framework.We will parse the parameters ......
Read more >Command Line Arguments in Python - GeeksforGeeks
Using getopt module · Syntax: getopt. · Parameters: · args: List of arguments to be passed. · options: String of option letters that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@bharukaRupesh more info on process.argv can be found here… https://nodejs.org/docs/latest/api/process.html#process_process_argv
Just run
protractor conf.js
andconsole.log(process.argv)
. you will understand whats happening when you pass any parameters in addition toprotractor conf.js
those are also captured as part of process.argv and its an array. This holds good for any node js program invocation.Protractor itself provides few options you could use with “–”. Check below. you could try using --browser / --capabilities.* param.
@bharukaRupesh very simple example…
you could get more creative with this… also you can check the browser parameter and populate other capabilities as well…
Let me know if you need more details.