标签: appium

解决"adb服务器版本与此客户端不匹配"错误

我用Python而不是py.test运行我的Appium脚本,因为py.test不能很好地处理我想从文本文件中获取的变量.当我用python运行我的脚本时,除了我的第一个方法总是有错误外,一切正常.

有谁知道如何修复以下错误?

adb server version (31) doesn't match this client (36) adb server version (32) doesn't match this client (36); killing...

android adb appium

96
推荐指数
10
解决办法
16万
查看次数

运行命令 ffmpeg 时出错:库未加载:'/opt/homebrew/opt/mbedtls/lib/libmbedcrypto.13.dylib'

我想与 appium doctor 一起安装 appium。当我运行 appium-doctor 命令时,ffmpeg 出现错误。然后我运行命令调用ffmpeg -version,出现以下错误:

dyld[89251]: Library not loaded: '/opt/homebrew/opt/mbedtls/lib/libmbedcrypto.13.dylib'
  Referenced from: '/opt/homebrew/Cellar/librist/0.2.7_2/lib/librist.4.dylib'
  Reason: tried: '/opt/homebrew/opt/mbedtls/lib/libmbedcrypto.13.dylib' (no such file), '/usr/local/lib/libmbedcrypto.13.dylib' (no such file), '/usr/lib/libmbedcrypto.13.dylib' (no such file), '/opt/homebrew/Cellar/mbedtls/3.4.1/lib/libmbedcrypto.13.dylib' (no such file), '/usr/local/lib/libmbedcrypto.13.dylib' (no such file), '/usr/lib/libmbedcrypto.13.dylib' (no such file)
zsh: abort      ffmpeg -version
Run Code Online (Sandbox Code Playgroud)

我用的是苹果M1。 在此输入图像描述

我已经卸载,然后使用自制程序重新安装它,但仍然没有运气。有人可以帮忙吗?谢谢

ffmpeg appium apple-m1

51
推荐指数
1
解决办法
1万
查看次数

使用Appium测试NativeScript应用程序

我正在学习NativeScript.我正在尝试用Jasmine编写一些自动化测试.根据我的理解,我可以使用Appium和Jasmine在模拟器中运行自动化测试.这时,我已将appium-gulp-plugins添加到我的package.son文件中.我还有一个基本的JavaScript文件,只有一个测试.那个文件看起来像这样:

describe('MyApp', function() {
  describe('Login', function() {
    it('should successfuly login', function() {
      // set username field value
      // set password field value
      // click "login" button.
      // get response.
      expect(true).toBe(true);
    });           
  });        
});
Run Code Online (Sandbox Code Playgroud)

我有两个挑战:

  1. 如何从测试中与NativeScript视图进行交互?
  2. 我如何实际运行测试?就像现在一样,它只是直接茉莉花,所以我可以做到以下几点:

    gulp.src('./path/to/tests.js').pipe(jasmine());
    
    Run Code Online (Sandbox Code Playgroud)

但是,在混合使用Appium时,我不确定如何将其作为运行测试的一部分进行集成.

javascript automated-tests appium nativescript

45
推荐指数
1
解决办法
2018
查看次数

无法从SDK Manager安装"Android SDK平台工具"

安装期间显示以下错误:

Done loading packages.
Preparing to install archives
Downloading Android SDK Platform-tools, revision 26.0.2
Download interrupted: Connection to https://dl.google.com refused
Done. Nothing was installed.
Preparing to install archives
Downloading Android SDK Platform-tools, revision 26.0.2
Download finished with wrong checksum. Expected 98832431e339c82be1fe910a733a3782071200fd, got aa3ef6f18eff4b8f12dbdf980647a6ce6c2ebe8c.
Done. Nothing was installed.
Run Code Online (Sandbox Code Playgroud)

sdk android appium

22
推荐指数
2
解决办法
2万
查看次数

如何在Ubuntu中为Android设置Appium

我是新的appium(自动化测试技术).

我正在使用运行Ubuntu Linux的PC.

我搜索了这个主题,但我没有任何有用的教程.谁能指出我正确的文件?

ubuntu android appium

21
推荐指数
3
解决办法
5万
查看次数

我们可以在appium中通过ID找到元素

以下链接提到我们可以通过给出id找到元素...但我无法找到它.

https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/finding-elements.md

通过"名称"查找(即文本,标签或开发人员生成的ID,也称为元素的"accessibilityIdentifier")

我试过以下代码:

WebElement el = driver.findElement(By.name("txtLogin"));
Run Code Online (Sandbox Code Playgroud)

其中txtLogin是登录按钮的id

它给出了以下例外:

org.openqa.selenium.NoSuchElementException: An element could not be located on the page using the given search parameters. (WARNING: The server did not provide any stacktrace information)
Run Code Online (Sandbox Code Playgroud)

可以请任何人解释什么是在appium中找到元素的所有方法

android appium

20
推荐指数
3
解决办法
3万
查看次数

在app中运行仪器测试并等待结果

我正在开发一种QA自动化解决方案,可以在Android上记录/回放QA测试.关键业务要求是在回放录制的测试时不依赖于连接的PC.为此,我试图在没有连接PC的情况下运行仪器测试.(具体来说,是Appium UiAutomator2测试).

我目前的方法是尝试从我的应用程序以编程方式运行测试.如果我通常从连接的PC运行测试,我会使用该命令adb shell am instrument -w.我尝试从我的应用程序访问ADB Shell并运行am instrument -w,但这会产生错误,我错过了INTERACT_ACROSS_USERS_FULL权限.

为了解决这个问题,我尝试使用startInstrumentation运行测试.这成功地开始了测试.但是,测试立即崩溃.经过进一步调查,我将崩溃追踪到NPE:测试试图检索InstrumentationRegistry.getInstrumentation.getUiAutomation(0),但是返回null.

如何以编程方式运行测试并授予其访问所需的UiAutomation实例的权限?

这就是我开始测试的方式:

public void runTest() {
    final String pm = getPackageName().replaceFirst(".test$", "");
    final InstrumentationInfo info = getInstrumentationInfo(pm);
    if (info != null) {

        final ComponentName cn = new ComponentName(info.packageName,
                info.name);

        Bundle arguments = new Bundle();
        arguments.putString("class", "io.testim.appiumwrapper.test.AppiumUiAutomator2Server");
        //cn = {io.extension.test/android.support.test.runner.AndroidJUnitRunner}
        startInstrumentation(cn, null, arguments);

    } 
}
Run Code Online (Sandbox Code Playgroud)

android android-testing appium android-instrumentation appium-android

20
推荐指数
1
解决办法
788
查看次数

在Sikuli X Java中查找图像

我在尝试在屏幕上找到图像时遇到问题,我尝试以两种不同的方式进行操作,但它似乎对我不起作用.我试图用在IOS模拟器上运行的Appium来显示屏幕,所以我不认为这是一个截图的问题.

我正在运行MAC OSX El Capitan我已经在我的项目中导入了Sikuli X java API

我是否还需要导入MAC Sikuli Library jar?

这是我到目前为止所尝试的:

1.

Screen s = new Screen();
Pattern test = new Pattern("/Users/ealiaj/Desktop/Automation/workspace/WheelsUp - IOS/screenshot.jpg");
try {
    s.find(test);
} catch (FindFailed e) {

}
Run Code Online (Sandbox Code Playgroud)

2.

Screen s = new Screen();
try {
    s.find("screenshot.jpg");
} catch (FindFailed e) {

}
Run Code Online (Sandbox Code Playgroud)

我一直在找不到错误.

错误信息:

FindFailed:找不到/ Users/ealiaj/Desktop/Automation/workspace/WheelsUp - IOS/screenshot1.jpg in S(0)[0,0 1440x900] Line 2189,in文件Region.java

图像试图找到 这是屏幕上的图像,大红色矩形是我为其创建屏幕截图并尝试查找的图像,但得到了该错误.

我唯一能够成功找到的是灰色矩形,或者至少它不会引发错误.

java webdriver sikuli selenium-webdriver appium

19
推荐指数
1
解决办法
2300
查看次数

如何在Mac OS上设置Appium,以便在Android和iOS设备上运行JAVA类的自动化测试

我在Appium面临的问题,我决定在下面.我没有找到一种方法来安装Appium所需的组件而不使用SUDO.在使用SUDO安装它之后,然后尝试运行Appium,我收到的错误是Appium和NODE应该在没有SUDO的情况下安装.尝试在线搜索解决方案花了我很长一段时间,因为在使用JAVA开发测试时,Appium在线上几乎没有教程可以在MAC上运行.以下是有关如何在Mac OS上设置Appium并在Java类中运行第一个测试的分步说明.只需将命令复制并粘贴到Mac上的终端中,即可进行设置.我希望在Appium上有更清晰的分步教程.Appium开发人员编写的教程非常模糊,我甚至不建议在他们的网站上寻找答案.

java macos android ui-automation appium

18
推荐指数
1
解决办法
8万
查看次数

在自动化方面做了很多努力后,无法找到Android本机应用程序的验证

我正在进行Android原生应用程序的自动化,并希望通过文本验证登录验证.当我尝试使用Appium检查器和Uiautomator选择它时.两者都无法找到验证部分,因此很难选择它.

在此输入图像描述

我尝试了来自不同论坛和Appium讨论的代码,但仍然无法通过自动化找到验证.我尝试过以下方法:

代码1

JavascriptExecutor js = (JavascriptExecutor)driver;

WebElement field = driver.findElement(By.xpath("//android.widget.EditText[@text='Enter mobile number']"));
// Boolean is_valid = (Boolean)js.executeScript("return arguments[0].checkValidity();", field);

try {
    String message = (String) js.executeScript("return arguments[0].validationMessage;", field);
} catch (Exception E) {
Run Code Online (Sandbox Code Playgroud)

输出:

例外:org.openqa.selenium.WebDriverException:方法尚未实现

代码2

public boolean IsValidationFired() {
    if(driver.getPageSource().contains("Invalid")) {
        System.out.println("PASS");
    } else {
        System.out.println("FAIL");
    }
}
Run Code Online (Sandbox Code Playgroud)

输出:

打印=失败

我不确定它是javascript弹出窗口还是本机应用程序弹出窗口或Toast message.But要检查它并通过自动化验证.

更新

用于启动验证的代码是: contactnu.setError("Invalid phone number.");

java validation android selenium-webdriver appium

17
推荐指数
1
解决办法
638
查看次数