You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Polymer 2测试报错求助:指定Chrome却请求微软地址及启动失败

Fixing Polymer 2 Testing Issues on Windows 7

Hey there, let's work through these two frustrating test errors you're hitting with Polymer 2 on Windows 7. I've seen similar quirks with Web Component Tester (WCT) on older Windows systems, so here's how to tackle each problem:

Problem 1: polymer test -l chrome tries to download MicrosoftWebDriver

Even though you're only targeting Chrome, WCT has a default behavior on Windows that checks for IE driver files—hence the failed request to Microsoft's download server. Here's how to override this:

  1. Create a wct.conf.json file in your project root directory if you don't already have one.
  2. Add this configuration to explicitly target Chrome and disable IE-related checks:
{
  "plugins": {
    "local": {
      "browsers": ["chrome"],
      "skipSeleniumInstall": true,
      "chrome": {
        "binary": "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe",
        "driver": "C:/path/to/your/chromedriver.exe"
      }
    }
  }
}
  1. Important: Download the correct version of ChromeDriver that matches your installed Chrome version (check Chrome's "About" page for your version number). Place the chromedriver.exe in the path you specified above, or add it to your system's PATH environment variable.

Problem 2: polymer test --skip-selenium-install throws "session not created" error

This error happens because you skipped the auto-install, but WCT can't find a valid ChromeDriver to start the test session. Follow these steps to fix it:

  • Match Chrome and ChromeDriver versions: Windows 7 only supports Chrome up to version 109, so if you're running a newer Chrome, downgrade to 109 and grab the corresponding ChromeDriver. Always ensure your ChromeDriver version exactly matches your Chrome browser version.
  • Verify ChromeDriver accessibility: Either add ChromeDriver to your system PATH, or specify its full path in the wct.conf.json as shown in the first fix.
  • Run with admin privileges: Sometimes Windows 7's file permissions block WCT from accessing driver files. Try opening your command prompt as Administrator before running the test command.

Bonus Troubleshooting Tips

  • Update your polymer-cli and web-component-tester to the latest stable versions (run npm update -g polymer-cli). Older versions had more compatibility issues with Windows 7.
  • If you still hit network-related hiccups, double-check your firewall settings—sometimes corporate or local firewalls block access to driver download servers (though we're bypassing that with manual driver setup anyway).

内容的提问来源于stack exchange,提问作者Jim C

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 09:05:44