Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/384.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
Can';t在Selenium(Javascript)中使用findElement_Javascript_Selenium_Selenium Webdriver_Selenium Chromedriver - Fatal编程技术网

Can';t在Selenium(Javascript)中使用findElement

Can';t在Selenium(Javascript)中使用findElement,javascript,selenium,selenium-webdriver,selenium-chromedriver,Javascript,Selenium,Selenium Webdriver,Selenium Chromedriver,我尝试使用Selenium中的findElements,但一直在使用 Then("a Cucumber sentence", async function () { await driver.findElements(By.xpath('/html/body')) }); 我能为此做些什么吗?我看到它像这样导入(我觉得很奇怪): ReferenceError: By is not defined var webdriver = require('selenium-webdriver'

我尝试使用Selenium中的findElements,但一直在使用

Then("a Cucumber sentence", async function () {

  await driver.findElements(By.xpath('/html/body'))

});

我能为此做些什么吗?

我看到它像这样导入(我觉得很奇怪):

ReferenceError: By is not defined
var webdriver = require('selenium-webdriver'),
  By = webdriver.By,
  until = webdriver.until;