Selenium webdriver Serenity BDD-原因:java.lang.ClassNotFoundException:com.google.common.base.Optional

Selenium webdriver Serenity BDD-原因:java.lang.ClassNotFoundException:com.google.common.base.Optional,selenium-webdriver,serenity-bdd,cucumber-serenity,Selenium Webdriver,Serenity Bdd,Cucumber Serenity,我不熟悉Serenity Bdd框架;我克隆了这个回购协议: 我知道我丢失了一些jar或库,但不确定如何添加它们或添加什么。 我猜我应该更新maven pom.xml以添加缺少的依赖项 更新: 原来pom.xml指向的是较旧的库版本,所以我更新了它们,现在出现了这个新错误: 错误n.t.core.webdriver.WebDriverFacade-无法创建新的 WEBDRIVER\u驱动程序实例类 org.openqa.selenium.chrome.ChromeDriver:无法实例化新的 类

我不熟悉Serenity Bdd框架;我克隆了这个回购协议:

我知道我丢失了一些jar或库,但不确定如何添加它们或添加什么。 我猜我应该更新maven pom.xml以添加缺少的依赖项

更新:

原来
pom.xml
指向的是较旧的库版本,所以我更新了它们,现在出现了这个新错误:

错误n.t.core.webdriver.WebDriverFacade-无法创建新的 WEBDRIVER\u驱动程序实例类 org.openqa.selenium.chrome.ChromeDriver:无法实例化新的 类类型的WebDriver实例 org.openqa.selenium.chrome.ChromeDriver(ChromeDriver的路径 驱动程序可执行文件必须由webdriver.chrome.driver系统设置 属性;有关详细信息,请参阅 这个 最新版本可从


消息“未能创建新的WEBDRIVER\u驱动程序实例”表示Selenium无法连接到WEBDRIVER。消息的其余部分(“chromedriver驱动程序可执行文件的路径必须由WEBDRIVER.chrome.DRIVER系统属性设置…”解释您需要执行的操作。您需要下载最新的chromedriver可执行文件并将其放置在系统路径上。Serenity将为您设置webdriver.chrome.driver属性-请勿、重复请勿、在测试类或属性文件中硬编码此路径(对chromedriver路径进行硬编码是一种常见但严重错误的反模式,因为它使您的测试非常不可移植)。

哇,John Smart本人!我终于能够让测试启动chrome驱动程序;但是,由于:[main]的原因,没有任何测试运行错误net.serenitybdd.core.Serenity-发生以下错误:未启用预期启用的元素我必须更新pom.xml。此外,我可能需要深入查看代码,但您是否通过Selenium在浏览器中注入cookie以登录,而不是键入用户名/密码?如果您是,这非常聪明,因为您似乎没有在任何地方输入用户名或密码!如果我能运行这些测试,我将在我自己的项目中模仿这种技术。
Os: Ubuntu: 17.04 
Intellij IDEA Community 2017.3 
Pom.xml: https://github.com/serenity-bdd/serenity-screenplay-train-demo/blob/master/pom.xml

<dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-core</artifactId>
            <version>${serenity.version}</version>
        </dependency>
        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-screenplay</artifactId>
            <version>${serenity.version}</version>
        </dependency>
net.thucydides.core.webdriver.UnsupportedDriverException: 
Could not instantiate class org.openqa.selenium.chrome.ChromeDriver
.
.
.
Caused by: net.thucydides.core.webdriver.UnsupportedDriverException: Could 
not instantiate new WebDriver instance of type class 
org.openqa.selenium.chrome.ChromeDriver (The path to the chromedriver driver 
executable must be set by the webdriver.chrome.driver system property; for 
more information, see 
https://sites.google.com/a/chromium.org/chromedriver/downloads. The latest 
version can be downloaded from 
https://sites.google.com/a/chromium.org/chromedriver/downloads
.
.
.
.
Caused by: java.lang.IllegalStateException: The path to the chromedriver 
driver executable must be set by the webdriver.chrome.driver system 
property; for more information, see 
https://sites.google.com/a/chromium.org/chromedriver/downloads. The latest 
version can be downloaded from 
https://sites.google.com/a/chromium.org/chromedriver/downloads