1

I read Basic authentication with Selenium in Internet Explorer 10 And I change my register key and when I use the user and pass in the url I don't see the basic authentication popup, but actually the page is not load. I see blank page!

I see my url in the IE but nothing happened - I see white page. Must I change somethin in IE too?

Community
  • 1
  • 1
Stanislava
  • 91
  • 2
  • 9

1 Answers1

1

It is not possible without some workarounds.

I also needed the same feature and previous SO answer confirms, that is it either impossible or possible with high probability of failure.

One thing I learned about Protrator is not to try to make too complicated stuff with it, or I'll have a bad time.

As for the feature- I ended up making Protractor to initiate Node.js task, which use request to make the authentication and provide back the data.

Taken straight from request module:

request.get('http://some.server.com/').auth('username', 'password', false);
        // or 
        request.get('http://some.server.com/', {
            'auth': {
                'user': 'username',
                'pass': 'password',
                'sendImmediately': false
            }
        });
        // or 
        request.get('http://some.server.com/').auth(null, null, true, 'bearerToken');
        // or 
        request.get('http://some.server.com/', {
            'auth': {
                'bearer': 'bearerToken'
            }
        });
Dejan Toteff
  • 2,075
  • 3
  • 21
  • 30
  • Hi Dejan thank you very much for your advice. But I really can not imagine how the node.js task will open the url and login and then the protractor "it" tests will continue... – Stanislava Aug 17 '15 at 08:13