安装npm i protractor -g
并在Tutorial中运行webdriver-manager update
后,下一个命令webdriver-manager start
会抛出错误:
$ webdriver-manager start seleniumProcess.pid: 63737 Exception in thread "main" java.lang.UnsupportedClassVersionError: org/openqa/grid/selenium/GridLauncher : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:700) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$000(URLClassLoader.java:56) at java.net.URLClassLoader$1.run(URLClassLoader.java:195) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:319) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330) at java.lang.ClassLoader.loadClass(ClassLoader.java:254) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:399) Selenium Standalone has exited with code 1
这里是安装输出:
npm i protractor -g > bufferutil@1.2.1 install /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/node_modules/ws/node_modules/bufferutil > node-gyp rebuild child_process: customFds option is deprecated, use stdio instead. No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'. No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'. CXX(target) Release/obj.target/bufferutil/src/bufferutil.o SOLINK_MODULE(target) Release/bufferutil.node SOLINK_MODULE(target) Release/bufferutil.node: Finished > utf-8-validate@1.2.1 install /usr/local/lib/node_modules/protractor/node_modules/selenium-webdriver/node_modules/ws/node_modules/utf-8-validate > node-gyp rebuild child_process: customFds option is deprecated, use stdio instead. No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'. No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'. CXX(target) Release/obj.target/validation/src/validation.o SOLINK_MODULE(target) Release/validation.node SOLINK_MODULE(target) Release/validation.node: Finished /usr/local/bin/protractor -> /usr/local/lib/node_modules/protractor/bin/protractor /usr/local/bin/webdriver-manager -> /usr/local/lib/node_modules/protractor/bin/webdriver-manager protractor@2.5.1 /usr/local/lib/node_modules/protractor ├── jasminewd@1.1.0 ├── jasminewd2@0.0.6 ├── html-entities@1.1.3 ├── q@1.0.0 ├── minijasminenode@1.1.1 ├── adm-zip@0.4.4 ├── optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10) ├── jasmine@2.3.2 (exit@0.1.2, jasmine-core@2.3.4) ├── glob@3.2.11 (inherits@2.0.1, minimatch@0.3.0) ├── saucelabs@1.0.1 (https-proxy-agent@1.0.0) ├── accessibility-developer-tools@2.6.0 ├── source-map-support@0.2.10 (source-map@0.1.32) ├── lodash@2.4.2 ├── request@2.57.0 (caseless@0.10.0, aws-sign2@0.5.0, forever-agent@0.6.1, stringstream@0.0.5, tunnel-agent@0.4.1, oauth-sign@0.8.0, isstream@0.1.2, json-stringify-safe@5.0.1, node-uuid@1.4.7, combined-stream@1.0.5, qs@3.1.0, form-data@0.2.0, mime-types@2.0.14, tough-cookie@2.2.1, http-signature@0.11.0, bl@0.9.4, har-validator@1.8.0, hawk@2.3.1) └── selenium-webdriver@2.47.0 (tmp@0.0.24, rimraf@2.4.3, xml2js@0.4.4, ws@0.8.0)