Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SyntaxError: Unexpected identifier in selenium-webdriver/lib/http.js:454 async execute(command)

I have recently installed selenium-webdriver javascript(node) client 3.6.0

steps are follows;

# npm install webdriver
# npm install selenium-webdriver
# npm install chromedriver

install them into my project folder

then make a js file into that name "library.js"

var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().forBrowser('chrome').build();
By = webdriver.By;
until = webdriver.until;


driver.get('http://www.google.co.in');

enter image description here

This is showing async execute(command) error at require('selenium-webdriver')

node version V7.1.0. npm version 3.10.9 chrome Version - ChromeDriver 2.35.528139 (47ead77cb35ad2a9a83248b292151462a66cd881)

Help my in this how to run this

like image 690
Ashish Kumar Avatar asked Jan 31 '18 12:01

Ashish Kumar


2 Answers

I ran into this issue. Run node -v if your version is under 8 it doesn't have the ability to handle the async command. You'll have to update Node.

like image 98
Faraji Anderson Avatar answered Nov 15 '22 07:11

Faraji Anderson


The same issue, fix by upgrade Node to v8.9.4 as Faraji said above.

like image 24
mecal Avatar answered Nov 15 '22 08:11

mecal