简体   繁体   English

selenium jar 文件在项目构建路径中显示为缺失

[英]selenium jar files show as missing in project build path

enter image description here Adding jar files from the latest version of selenium 3.141.59 show missing after adding them inside the build path of my project.在此处输入图像描述从最新版本的 selenium 3.141.59 添加 jar 文件在我的项目的构建路径中添加它们后显示丢失。

Windows 10, Eclipse, selenium 3.141.59 Windows 10, Eclipse, selenium 3.141.59

the client- combined files shouldn't be missing.不应丢失客户端组合文件。 previously it worked out.以前它解决了。

目录

If you are using the Selenium Java Client in addition to adding client-combined-3.141.59.jar with the build path of your project you also have to add the following jars from the libs sub-directory: If you are using the Selenium Java Client in addition to adding client-combined-3.141.59.jar with the build path of your project you also have to add the following jars from the libs sub-directory:

  • byte-buddy-1.8.15.jar
  • commons-exec-1.3.jar
  • guava-25.0-jre.jar
  • okhttp-3.11.0.jar
  • okio-1.14.0.jar

Snapshot of libs sub-directory: libs子目录的快照:

Selenium_libs_directory

Refreshing/Updating as @Rakib mentioned in comments might work.像评论中提到的@Rakib一样刷新/更新可能会起作用。

However, I would suggest having some Build Tools such as Ant, Maven or Gradle in place for Dependency Management.但是,我建议使用一些构建工具,例如 Ant、Maven 或 Gradle 用于依赖管理。 This would automatically resolve and import the required jar files.这将自动解析并导入所需的 jar 文件。

The current format of handling jar files would be confined to local and if you try to export the project into a different operating system that would throw an error defining missing jar files.当前处理 jar 文件的格式将仅限于本地,如果您尝试将项目导出到不同的操作系统,则会引发错误,定义缺少 jar 文件。

I have added all the jar files but still showing error for particular client combined jar files.我已经添加了所有 jar 文件,但对于特定客户端组合 jar 文件仍然显示错误。 show as corrupted.显示为损坏。 However I managed to download it from the following link: https://www.seleniumhq.org/download/但是我设法从以下链接下载它: https://www.seleniumhq.org/download/

enter image description here在此处输入图像描述

Use maven.使用 maven。 It is very easy to maintain java projects with it.使用它维护 java 项目非常容易。 In case you are missing something, you can easily add dependency, or in case everything is on your project, but not on your local machine, you will just need to refresh your dependencies and maven will do the rest.如果您缺少某些内容,您可以轻松添加依赖项,或者如果所有内容都在您的项目中,但不在本地计算机上,您只需要刷新您的依赖项,maven 将执行 rest。 here is the link: http://maven.apache.org/这是链接: http://maven.apache.org/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM