简体   繁体   English

在Internet Explorer 11中使用Selenium进行基本身份验证

[英]Basic authentication with Selenium in Internet Explorer 11

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. 在Internet Explorer 10中阅读了使用Selenium进行基本身份验证,并且更改了注册密钥,当我使用用户并传递url时,我没有看到基本身份验证弹出窗口,但实际上该页面未加载。 I see blank page! 我看到空白页!

I see my url in the IE but nothing happened - I see white page. 我在IE中看到了我的网址,但没有任何反应-我看到了白页。 Must I change somethin in IE too? 我也必须在IE中更改一些内容吗?

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. 我还需要相同的功能,并且先前的SO答案可以确认,这是不可能的还是失败的可能性很高。

One thing I learned about Protrator is not to try to make too complicated stuff with it, or I'll have a bad time. 我从Protrator中学到的一件事是不要尝试用它制作太复杂的东西,否则我会度过一段糟糕的时光。

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. 至于功能-我最终使分度器启动Node.js任务,该任务使用请求进行身份验证并提供数据。

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'
            }
        });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM