0

我尝试在我的应用程序中使用 Selenium,因此我已将库selenium-java-2.30.0.jar 添加到构建路径,并将以下导入添加到活动类中:

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.android.AndroidDriver;

然而; 每当我尝试在模拟器(avd 2.2 和 4.2)中运行应用程序时,我都会收到以下错误:

[2013-02-21 19:03:46 - xxxx] The library 'selenium-java-2.30.0.jar' contains native libraries that will not run on the device.
[2013-02-21 19:03:46 - xxxx] The following libraries were found:
[2013-02-21 19:03:46 - xxxx]  - org/openqa/selenium/firefox/amd64/libibushandler.so
[2013-02-21 19:03:46 - xxxx]  - org/openqa/selenium/firefox/amd64/x_ignore_nofocus.so
[2013-02-21 19:03:46 - xxxx]  - org/openqa/selenium/firefox/x86/libibushandler.so
[2013-02-21 19:03:46 - xxxx]  - org/openqa/selenium/firefox/x86/x_ignore_nofocus.so

并取消发射。我已经清理了项目,但仍然收到相同的消息。这是模拟器问题还是我使用了错误的库?

4

1 回答 1

0

我已经找到了解决方案。我没有使用http://code.google.com/p/selenium/downloads/list的下载部分中提供的selenium-java-2.30.0.jar ,而是去了 Android SDK 管理器并从那里安装了适当的库。

在 Eclipse 中转到 Window -> Android SDK Manager -> 选择:Available packages → Extras → Google → WebDriver

安装 GoogleWebDriver 后,进入android/sdk/extras/google/webdriver/目录,找到并复制android_webdriver_library.jar库并将其粘贴到项目的 lib 文件夹中。之后,您可以导入前面提到的语句并使用 Selenium Web 驱动程序类。

于 2013-02-22T03:34:49.603 回答