Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/26.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
Angular “无法运行”;Firefox浏览器中的量角器测试脚本;至于;角度4应用“;_Angular_Jasmine_Webdriver_Protractor - Fatal编程技术网

Angular “无法运行”;Firefox浏览器中的量角器测试脚本;至于;角度4应用“;

Angular “无法运行”;Firefox浏览器中的量角器测试脚本;至于;角度4应用“;,angular,jasmine,webdriver,protractor,Angular,Jasmine,Webdriver,Protractor,我不熟悉量角器工具。我无法在多个浏览器中运行测试脚本,只能在Chrome中运行 我正在使用 节点:v6.11.3 净现值:3.10.10 量角器:5.1.2 我需要使用Visual studio代码IDE自动化Angular 4应用程序。我在dragrator.conf.js中添加了“多功能”选项,如下所示 multiCapabilities:[{ 'browserName' : 'chrome'}, {'browserName':'firefox'}] 测试脚本仅在chrome浏览器

我不熟悉量角器工具。我无法在多个浏览器中运行测试脚本,只能在Chrome中运行

我正在使用

  • 节点:v6.11.3
  • 净现值:3.10.10
  • 量角器:5.1.2
  • 我需要使用Visual studio代码IDE自动化Angular 4应用程序。我在dragrator.conf.js中添加了“多功能”选项,如下所示

    multiCapabilities:[{
      'browserName' : 'chrome'},
      {'browserName':'firefox'}]
    
    测试脚本仅在chrome浏览器中运行,对于firefox,它显示以下错误

    [11:47:37] I/launcher - 0 instance(s) of WebDriver still running
    [11:47:37] I/launcher - firefox #01 failed with exit code: 135
    [11:47:37] I/launcher - chrome #11 passed
    [11:47:37] I/launcher - overall: 1 process(es) failed to complete
    [11:47:37] E/launcher - Process exited with error code 100
    

    如何在多个浏览器中并行设置和运行测试脚本?

    我能想到您出现错误的几个原因。以下是一些建议:

    默认情况下,量角器仅更新Chrome驱动程序。因此,请尝试
    webdriver管理器更新

    如果这没有奏效,请检查您的firefox驱动程序是否位于预期位置


    如果您仍然运气不佳,您可能发现当前Firefox驱动程序与最新Firefox浏览器之间不兼容(即,如果您测试了新的Firefox浏览器版本)。当然,它对Firefox的工作方式也是一样。

    对于Firefox v48及以上版本,您还需要添加木偶功能:

    multiCapabilities:[
      {'browserName' : 'chrome'},
      {'browserName':'firefox',
       'marionette': true}]
    
    更新: 量角器5.1.1中引入了一个。解决方法是手动将
    directConnect
    替换为
    seleniumAddress
    ,并按照错误中的指定手动启动
    webdriver manager

    解决方案是在使用Firefox进行测试时使用selenium standalone。 selenium独立服务器的最新版本是兼容的 使用量角器的selenium JS绑定和geckodriver。你可以 使用更新并启动独立服务器

    webdriver-manager update
    webdriver-manager start
    
    并设置
    seleniumAddress:http://localhost:4444/wd/hub


    谢谢你的回复。我尝试了“木偶”选项,但它对我不起作用,同样的错误仍然显示出来。量角器5.1.1中引入了一个错误,我错误地认为它已经修复了。我已经用变通方法编辑了我的答案。我遵循了上面的更新,现在它显示“无法解析新会话响应”错误消息。进程已退出,错误代码为199。我安装了gecko驱动程序,并将其添加到系统路径变量中。当我将seleniumAddress:更改为seleniumAddress:时,测试脚本现在正在“fire fox”中运行!如您所述,我已编辑了seleniumAddress值。你能帮我一个忙,接受我的回答吗。