Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can protractor be used to test multiple browser session interactions?

For example, I would like to test a chat feature between two logged in users implemented using AngularJS.

The test needs to verify two or more separate sets of browser actions occur in the proper sequence. For example, user A logs in, user B logs in, user A sees B is logged in, user A sends user B chat text, user B receives chat text. user B responds to user A.

Is this something that can be done using protractor? If not, is there another way to automatically test multiple browser session workflows?

like image 214
softweave Avatar asked May 08 '14 14:05

softweave


People also ask

Does Protractor support multiple browsers?

If you would like to test against multiple browsers, use the multiCapabilities configuration option. Protractor will run tests in parallel against each set of capabilities. Please note that if multiCapabilities is defined, the runner will ignore the capabilities configuration.

What browsers work with protractor?

Protractor supports the two latest major versions of Chrome, Firefox, Safari, and IE. These are used in Protractor's own suite of tests.

How do you launch a browser with a protractor?

Launching a browser locally Depending on the configuration file, protractor runner loads one of the driver providers. For a locally hosted selenium server, the driver provider will then use the selenium-webdriver node module (client) to create new session of the browser.

How to run protractor tests on multiple browsers in protractor?

In order to run protractor tests on multiple browsers, Protractor offers multiCapabilities configuration option. These options should be defined as an array of objects. As we know we can run protractor specs on different browsers by setting the browser name property of the capabilities in the conf.js file.

Why protractor for Selenium Grid?

Protractor make use of Selenium Grid to initialize, control and run browser instance. Can easily integrate with jasmine, mocha and cucumber framework to write your test. Excellent speed compare with other tools or libraries. Support cross browser parallel testing through multiple browsers.

What is protractor and how does it work?

What Is Protractor? Protractor is a JavaScript framework, end-to-end test automation framework for Angular and AngularJS application. It test against your application in real browser, like a real user would. Protractor is built on top of WebDriver JS (Selenium) and apart from default locator, it comes up with Angular-specific locator strategies.

Do I need to monitor test cases in protractor?

Tests that pass don’t need to be strictly monitored since an increase in run time could slow down operations if a large number of tests have to be executed. As always, it is important to run the Protractor Selenium tests on real browsers and devices.


1 Answers

UPDATE This feature has finally being added see example usage and docs and tests here or see below:

browser.get('http://www.angularjs.org');

// To create a new browser with url as 'http://www.angularjs.org':
var browser2 = browser.forkNewDriverInstance(true);

// Interaction in the first browser
element(by.model(...)).click();

// Interaction in the second browser
browser2.$('.css').click();

Note that IE and Safari won't isolate cookies or cache so don't expect to be able to login with different users at the same time there unless your selenium provider is a grid that always uses a clean session like SauceLabs or BrowserStack.

like image 60
Leo Gallucci Avatar answered Sep 19 '22 17:09

Leo Gallucci