gpt4 book ai didi

java - ubuntu 中 webdriver.jar 的类路径

转载 作者:太空宇宙 更新时间:2023-11-04 14:53:26 25 4
gpt4 key购买 nike

我从 webdriver downloads page 下载了 webdriver jars并将它们放入我的 bin 文件夹中并尝试运行我的 java 测试

javac -cp folderpath/bin mytest.java

它给了我一些与 Selenium 库安装相关的错误。如何在 ubuntu 中安装 java webdriver?编译时出现以下错误:

something.java:4: error: package org.openqa.selenium.support.ui does not exist
import org.openqa.selenium.support.ui.Select;
^
something.java:5: error: package org.openqa.selenium.interactions does not exist
import org.openqa.selenium.interactions.Actions;
^
something.java:6: error: package org.openqa.selenium.firefox does not exist
import org.openqa.selenium.firefox.FirefoxDriver;
^
something.java:7: error: package org.openqa.selenium does not exist
import org.openqa.selenium.*;
^
something.java:8: error: package org.openqa.selenium does not exist
import static org.openqa.selenium.OutputType.*;
^
something.java:20: error: cannot find symbol
public static boolean isAlertPresent(FirefoxDriver wd) {
^
symbol: class FirefoxDriver
location: class something
something.java:12: error: cannot find symbol
FirefoxDriver wd;
^
symbol: class FirefoxDriver
location: class something
something.java:13: error: cannot find symbol
wd = new FirefoxDriver();
^
symbol: class FirefoxDriver
location: class something
something.java:16: error: cannot find symbol
wd.findElement(By.linkText("Restore some mysql databases")).click();
^
symbol: variable By
location: class something
something.java:24: error: cannot find symbol
} catch (NoAlertPresentException e) {
^
symbol: class NoAlertPresentException
location: class something
10 errors

最佳答案

假设您位于 mytest.java 的目录中,使用相同的命令,但将星号添加到路径中,javac -cpfolderpath/bin/* mytest.java。为什么不使用IDE呢?

关于java - ubuntu 中 webdriver.jar 的类路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23495198/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com