Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 使用量角器如何设置internet explorer配置?_Windows_Angularjs_Internet Explorer_Protractor - Fatal编程技术网

Windows 使用量角器如何设置internet explorer配置?

Windows 使用量角器如何设置internet explorer配置?,windows,angularjs,internet-explorer,protractor,Windows,Angularjs,Internet Explorer,Protractor,我正在使用量角器1.3.1并在安装了IE11(windows)的情况下运行iedriverserver.exe 2.43.0.0。 这是我的规格: describe('quick test IE driver', function () { it('should go to ng homepage', function () { browser.driver.get('https://angularjs.org/'); var title =element

我正在使用量角器1.3.1并在安装了IE11(windows)的情况下运行iedriverserver.exe 2.43.0.0。 这是我的规格:

describe('quick test IE driver', function () {
    it('should go to ng homepage', function () {
        browser.driver.get('https://angularjs.org/');
        var title =element(by.css('h1')).getText();
        expect(title).toBe('HTML enhanced for web apps!');
    });
});
这是我的dragrator.conf.js:

exports.config = {
    // The address of a running selenium server.
    //seleniumAddress: 'http://localhost:4444/wd/hub',

    capabilities: {
        'browserName': 'internet explorer',
        'platform': 'ANY',
        'version': '11'
    },


    // Spec patterns are relative to the current working directly when
    // protractor is called.
    specs: ['main.spec.js'],

    // Options to be passed to Jasmine-node.
    jasmineNodeOpts: {
        showColors: true,
        defaultTimeoutInterval: 30000,
        isVerbose:true,
        includeStackTrace:true

    }
};
但是,如果遇到此错误,有什么解决方案:

UnknownError: The path to the driver executable must be set by the webdriver.ie.driver system property; 

下载IEDriverServer.exe 请在配置文件中指定相同的名称

seleniumArgs: ['-Dwebdriver.ie.driver=<path to IEDriverServer.exe>']
seleniumArgs:['-Dwebdriver.ie.driver=']

我花了几个小时研究这个问题,最好的办法似乎是:

1) 下载 webdriver管理器--ie更新

这应该可以从google下载驱动程序。。硒。。。释放文件夹并将其直接放置在npm本地存储库中的适当位置

2) 在测试的config.js文件中设置:

。。。 3) 设置IE:

跟贴

注:关于IE的“保护模式”设置,重要的是所有区域都有相同的设置。我更喜欢所有区域的保护模式“打开”

4) 修补注册表

如下所述:

[HKEY\U LOCAL\U MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE\BFCACHE] “iexplore.exe”=dword:00000000

5) IE 11更新中断了系统的工作方式:

我的最新问题是“服务器没有提供任何堆栈跟踪…”这是由于2014年12月17日的更新。卸载它,然后它就好了

疯狂的道路,使它运行。从长远来看不可能是这样,请用你的经验/反馈评论我的帖子


Richard更新IE的web管理器

第一步是使用webdriver管理器更新ie webdriver

webdriver-manager update --ie
在此步骤中转到npm位置移动到npm_位置(系统中安装npm的文件夹)。移动到此位置的以下路径“npm_位置\节点_模块\量角器\硒”,检查IEDriverServer.exe是否存在

更改conf.js中的IE

// conf.js exports.config = {   seleniumAddress: 'http://localhost:4444/wd/hub',   specs: ['specs.js'],   capabilities: {
    'browserName': 'internet explorer' // conf for internet explorer     } }


// spec.js describe('Protractor Demo App', function() {   it('should have a title', function() {
    browser.get('http://juliemr.github.io/protractor-demo/');
    expect(browser.getTitle()).toEqual('Super Calculator');   }); });
现在运行progrator conf.js

注意:请确保通过-->webdriver manager start重新启动服务器

摘自:

根据,配置值
“seleniumArgs”
已弃用

因此,要获得包含所有信息的单一答案,以下是简化的步骤:

  • 全局安装Proactor:

    npm install -g protractor
    
  • 运行以更新Proactor使用的Selenium驱动程序。请注意您是否正在运行全局
    Web驱动程序管理器
    本地Web驱动程序管理器(即
    /node\u模块。/bin/webdriver管理器更新帮助
    );他们将在不同的位置解压驱动程序;只有本地将在
    [Project dir]

  • 查看上一个命令的日志。它必须显示驱动程序已在特定文件夹中解压缩。转到该文件夹并找到IEDriverServer。在我的示例中,它是:
    “[Project dir]\node_modules\dragrator\node_modules\webdriver manager\selenium\IEDriverServer_x64\u X.XX.X.exe
    。您需要在下一步中给出此文件的相对路径

  • conf.js
    文件中,添加以下键和值。注意使用
    localSeleniumStandaloneOpts
    ,这意味着您应该删除该属性:

    多容量:[
    {
    'browserName':'chrome'
    }, {
    “浏览器名”:“internet explorer”
    }
    ],
    localSeleniumStandaloneOpts:{
    jvmArgs:[“-Dwebdriver.ie.driver=“]”//例如:“节点\模块/量角器/节点\模块/webdriver管理器/selenium/IEDriverServer\ u x64\ u X.XX.X.exe”
    },
    

  • 这就是我所需要做的。我没有事先启动服务器,我只是运行
    protector conf.js
    。我想现在更容易了。

    这是我的配置文件:

    exports.config = {
    
    seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
    capabilities: {
    'browserName': 'internet explorer',
     },
    
    framework: 'jasmine',
    
    // Spec patterns are relative to the current working directory when
    // protractor is called.
    specs: ['your_spec_file.js'],
    
    })

    在IE中运行的步骤:

  • 需要Visual Studio代码中的两个终端, 在第一个终端中,运行命令“webdriver manager start”以启动selenium服务器
  • 在第二个终端中,按以下方式运行js配置文件: 量角器conffile_name.js
  • 这将成功启动Internet explorer。
    谢谢

    如果
    webdriver manager
    不在全局路径中,我猜我需要通过npm?使用
    -g
    ?安装它。我只想添加一个小更新,他们添加了一个--ie32选项,将安装32位驱动程序。64位驱动程序由于sendKeys()而几乎损坏每按一次键需要几秒钟。请注意,您还必须将--ie32开关添加到start命令中。谢谢您-这是针对IE运行“开箱即用”的正确答案,无需设置单独的selenium/web驱动程序实例,上述答案不适用于该用例。我感到您的痛苦兄弟。我是e体验同样的经历/
    multiCapabilities : [
      {
        'browserName' : 'chrome'
      }, {
        'browserName' : 'internet explorer'
      }
    ],
    
    localSeleniumStandaloneOpts : {
      jvmArgs : ["-Dwebdriver.ie.driver=<RELATIVE PATH TO IE DRIVER>"] // e.g: "node_modules/protractor/node_modules/webdriver-manager/selenium/IEDriverServer_x64_X.XX.X.exe"
    },
    
    exports.config = {
    
    seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
    capabilities: {
    'browserName': 'internet explorer',
     },
    
    framework: 'jasmine',
    
    // Spec patterns are relative to the current working directory when
    // protractor is called.
    specs: ['your_spec_file.js'],