Is there a way to update protractor.conf.js configurations using the command line?

Currently, I have set up Protractor to run on our integration server. In the protractor.conf.js file, I have configured the multiCapabilities as follows:

 multiCapabilities: [{
    'browserName': 'firefox',
    'platform': 'MAC'
  }, {
    'browserName': 'chrome',
    'platform': 'MAC'
  }]

However, when running locally from the command line, I would like to override these settings. I have attempted the following command without success:

protractor --verbose --browser=chrome

Question: How can I switch to using only a single instance of Chrome when running locally from the command line?

Answer №1

This seems to be a recurring issue.

Upon examining the source code, it appears that the browser command line argument serves as an alias for capabilities.browserName.

Referencing the referenceConf.js documentation:

// If you would like to run more than one instance of WebDriver on the same
// tests, use multiCapabilities, which takes an array of capabilities.
// If this is specified, capabilities will be ignored.
multiCapabilities: [],

In simpler terms, when multiCapabilities are defined, the system overlooks the capabilities.


A potential solution is to reset multiCapabilities via the command-line:

protractor --verbose --browser=chrome --multiCapabilities

Alternatively, you could create a separate setup file to facilitate the execution of a single browser instance.


Furthermore, here are some related topics worth exploring:

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Struggling with TypeScript errors due to React.HTMLProps for HTMLAnchorElement

When trying to extend a React component with React.HTMLProps without explicitly defining onClick in the attribute list, ESLint complains when passing onClick as an attribute while using the component. Here's an example of the code: The React componen ...

AngularJS Uncaught ReferenceError: variable is not

I am facing an issue where I cannot retrieve a value from a function. I am performing REST requests for testing purposes and when trying to get a date, it always returns undefined. An Illustration $http.get('app/components/home/controller/test_calen ...

What is the best way to show JavaScript output with span style?

I have added a translation feature that allows users to switch paragraphs to French when clicked. Each paragraph now has the first word wrapped in a span with a CSS class that enlarges and colors the text. However, I am facing an issue where when switchi ...

Error: The "use client" component does not recognize either window or localStorage

I'm currently working on creating a wrapper function that can be used in every dashboard component. "use client"; const UserWrapper = ({ children }) => { const user = JSON.parse(window.localStorage.getItem("ysg_u")); retur ...

Executing the AngularJS nested controller only once

I am still new to Angularjs and just started working on an app that has several "projects" each with a local menu displayed on specific pages. The main navbar with footer is located in the Index.html: <body ng-app="ysi-app" ng-controller="MainControlle ...

Adjust the value of a select box to the chosen option using JQuery

Could someone please assist me with this code? I am trying to adapt it for use on my mobile device with jQuery Mobile. var obj = jQuery.parseJSON(finalresult); //alert(obj); var dept = '2'; $(document).ready(function () { //$("#opsContactId ...

Encountering an error of "FAIL: NoSectionError: No section: 'default'" when attempting to connect Robot Framework with MySQL

After attempting to connect with a MySQL database using my code, I encountered an error message stating "FAIL: NoSectionError: No section: 'default'". I am seeking guidance on how to establish a successful connection with a MySQL database from wi ...

Achieving a single anchor link to smoothly scroll to two distinct sections within a single page using React

There is a sidebar section alongside a content section. The sidebar contains anchor links that, when clicked, make the corresponding content scroll to the top on the right-hand side. However, I also want the sidebar link that was clicked to scroll to the ...

What is the best way to update the content of a div on an HTML page by incorporating the content of a div from a different page using JavaScript?

I have a requirement where I need to implement a link in a Table of Contents that, upon clicking, should replace the existing content of one div on a page with the content of another div on a different page. My goal is to accomplish this using only JavaScr ...

What are some effective strategies for ensuring employees consistently turn in their timesheets?

At our company, it is necessary to submit timesheets on a weekly basis every Monday. Wondering how to go about filling out the timesheets? Simply access a website Choose the previous week's data from a dropdown menu. Input the time spent on each ta ...

Utilize Vuex store in Vue without the need for import statements within components

When working with Vue 2/3 and in an ES6 environment, I often access a Vuex store in an external JS file using the following method: // example.js import { store } from '../store/index'; console.log(store.state.currentUser); While this method w ...

receiving unexpected data while using AJAX

For my PHP project, I have a function that validates a textbox using AJAX. The AJAX is working fine, but it only gives the following output for $return_value==-4 "<br /> <font size='1'><table class='xdebug-error xe-deprecated ...

The Modal Textarea refreshes each time it is clicked

Whenever I try to type on the modal with 2 textareas, it stops and exits the textarea. The issue seems to be with onChange={event => setTitle(event.target.value)}, but I'm not sure how to fix it. <Modal.Body> <form onSub ...

Tips for assessing JSON response data from an AJAX form

I am struggling with how to properly structure a question, but I would like to explain my situation. I am using AJAX to send data and receiving JSON in return. Each value in the JSON response represents a status, and I need to test and react based on these ...

What is the solution for the error message "TypeError: app.use() is seeking a middleware function"?

I am a beginner in Node.js and have encountered an issue in my passport.js or signupLogin.js file with the error message, app.use() requires a middleware function that I am struggling to resolve. I suspect it may be related to the signupLogin route, as th ...

Discover an Effective Approach for Transmitting Form-Data as a JSON Object

Hey there! I'm encountering a bit of an issue with sending some data as a JSON object. The problem arises when trying to send images using FormData. It seems like I need to convert my form data into a single JSON object. Can anyone assist me with this ...

Cannot utilize remote.require() in TypeScript due to compatibility issues

Recently, I've been facing a frustrating issue while developing an Electron application in TypeScript. I've been trying to execute a module from a renderer process using the code snippet below: import { remote } from 'electron' const ...

Having problems with the Python XPath Plugin

Can anyone help me figure out how to click on the image located at id('page-content')/x:div[6]/x:div/x:div/x:div/x:a[1]/x:img? I've attempted to use the following xpath to find and click on the image: lol=find_element_by_xpath("//div[@clas ...

I am looking to display multiple divs sequentially on a webpage using JavaScript

Looking to display a rotating set of alerts or news on my website. The goal is to show each news item for a certain number of seconds before moving on to the next one in line. However, I'm new to javascript and need help creating a code that will cont ...