Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.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
Linux 无法在Ubuntu命令行中启动WebDrivero_Linux_Selenium_Ubuntu_Error Handling_Webdriver Io - Fatal编程技术网

Linux 无法在Ubuntu命令行中启动WebDrivero

Linux 无法在Ubuntu命令行中启动WebDrivero,linux,selenium,ubuntu,error-handling,webdriver-io,Linux,Selenium,Ubuntu,Error Handling,Webdriver Io,我按照以下步骤在linux机器(Ubuntu)上安装Webdriver 创建目录:mkdir-webdriverio测试和&cd-webdriverio测试 下载selenium独立服务器: curl-Ohttp://selenium-release.storage.googleapis.com/3.5/selenium-server-standalone-3.5.3.jar 下载gheckodriver: curl-Lhttps://github.com/mozilla/geckodriv

我按照以下步骤在linux机器(Ubuntu)上安装Webdriver

  • 创建目录:
    mkdir-webdriverio测试和&cd-webdriverio测试

  • 下载selenium独立服务器:
    curl-Ohttp://selenium-release.storage.googleapis.com/3.5/selenium-server-standalone-3.5.3.jar

  • 下载gheckodriver:

curl-Lhttps://github.com/mozilla/geckodriver/releases/download/v0.16.0/geckodriver-v0.16.0-linux64.tar.gz |tar xz

  • 启动SeleniumWebDriver:
    java-jar-Dwebdriver.gecko.driver=./geckodriver selenium-server-standalone-3.5.3.jar

  • 创建
    test.js
    脚本:


  • 最后,在另一个窗口中运行
    selenium server standalone
    时,在另一个终端窗口中运行上述脚本
!!!问题:运行命令后,脚本失败,尽管它正在打开Mozilla浏览器。我做错了什么

  • 堆栈跟踪错误:

试试chromedriver:

1.转到包含测试的文件夹:

cd webdriverio-test

2.下载chromedriver:

wget https://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip

unzip chromedriver_linux64.zip
./chromedriver -port=4444 -url-base=/wd/hub -verbose

3.启动chromedriver:

wget https://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip

unzip chromedriver_linux64.zip
./chromedriver -port=4444 -url-base=/wd/hub -verbose

4.打开新终端窗口并运行测试:

node test.js

感谢您提出的宝贵建议,但我成功地将selenium standalone和gecko驱动程序版本更改为最新版本。