question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using Protractor to run tests against multiple user roles

See original GitHub issue

I am trying to run the same test for different roles in the application.

The problem is since there is no logout/login page(SSO magic). I can’t logout and login is a different user on the same browser.

I have been trying to get around this and look up a way to pull up a new browser instance or anything.

The only thing that got kind of close was if I tried to use multiCapabilities:

multiCapabilities: [{
    browserName: 'chrome',
    acceptSslCerts: true,
    trustAllSSLCertificates: true,
    specs: ['claimsoverview/login-claims-analyst.spec.js']
}, {
    browserName: 'chrome',
    acceptSslCerts: true,
    trustAllSSLCertificates: true,
    specs: ['claimsoverview/login-supervisior.spec.js']
}],

Each individual spec works, but when I run them together they do not and I get Unknown error unsupported protocol. And also Error: Error while waiting for Protractor to sync with the page: {}

Before each test I have to hit an Oracle SSO page which is non-angular then I can finally be re-routed to the url that is angular.

//Here is the beginning of one spec..
it('should load homePage from Oracle Sign in Page', function() {

   var dvr = browser.driver;

    //To get around the untrusted cert issue per browser
    dvr.get('https://url');
    UntrustedCertOverride(dvr);

    //Get SSO PageObject and run login()
    var oracleSsoPage = new OracleSsoPage(dvr);
    oracleSsoPage.login(browser.params.claimsAnalyst.userName, browser.params.claimsAnalyst.password);

    //Expect the title to be ConDOR
    expect(browser.getTitle()).toEqual("homePage");
});

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
stgakkicommented, Jul 22, 2017
  1. Write one function for login.
  2. Add multiple credentials in json file
  3. Include json file using [ var myjsonData = require(“…/myjson.json”); ]
  4. Iterate using loop and call login function in it and pass parameters to function as data in json file randomly.
0reactions
makwanaparth94commented, Jun 12, 2017

I want to add multiple credential at run time while running my automation test for Login screen. How can i do that?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to run protractor suites with multiple users - Stack Overflow
For the suites you can use --suite=loginAndNavigate or if more than one then --suite=loginAndNavigate,homepage to choose what to run.
Read more >
Run Protractor Test - Multiple Browser - YouTube
# protractor #seleniumgrid #letcode Run Protractor Test - Multiple Browser | Protractor Tutorial In this video, we'll learn how to run our ...
Read more >
Protractor Testing Tool for End-to-end Testing of AngularJS ...
Protractor testing tutorial - it's an end to end behavior driven automation testing framework designed keeping Angular JS applications ...
Read more >
Setting Up the Browser - Protractor
If you would like to test against multiple browsers, use the multiCapabilities configuration option. ... Protractor will run tests in parallel against each...
Read more >
Angular: End to End Testing With Protractor - Medium
In essence, Protractor is capable of executing tests against an Angular application running in a real browser, interacting with it as a user...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found