Sim*_*n S 3 java selenium maven
我正在使用 Maven 和 Intellij,为 jdk-12.0.2 设置项目,在 pom 1.8 中使用 maven,并在尝试运行此代码时:
WebDriverWait wait = new WebDriverWait(driver, 5);
WebElement el = wait.until(ExpectedConditions.elementToBeClickable(By.linkText("https://poczta.wp.pl")));
Run Code Online (Sandbox Code Playgroud)
我得到:
错误:(37, 30) java: 无法访问 java.util.function.Function 的 java.util.function.Function 类文件未找到
指向“等待”
尝试将 pom 中的 maven 从 1.7 更改为 1.8。>Invalidate cache/Restart
鉴于您有maven标签,我的期望是您的项目由 Maven 管理,因此由Maven Compiler Plugin构建,因此您的 IDE 语言级别设置可能源自pom.xml 中定义的内容
我建议在以下位置设置项目语言级别:
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
Run Code Online (Sandbox Code Playgroud)在项目属性页面的想法中,您可以为每个模块选择语言级别
更多信息:
| 归档时间: |
|
| 查看次数: |
7756 次 |
| 最近记录: |