当前位置: 首页 > 知识库问答 >
问题:

刷卡在ios设备中不起作用

钱睿范
2023-03-14

我有一个应用程序,想要允许从设备事件的联系人。我用了(autoAlertAccess,true),但这对我不起作用。我使用appium 1.5.2,甚至我想刷那个特定的联系人聊天或打电话给那个特定的联系人。当我使用一个:

driver.manage().timeouts().implicitlyWait(50, TimeUnit.SECONDS); 
driver.findElement(By.className("android.widget.ImageButton")).click();
    size1 = driver.manage().window().getSize();   
    System.out.println(size1);    int x1 = (int) (size1.width * 0.70);

       int x2 = (int) (size1.width * 0.30);

       int starty =size1.height / 2;

       System.out.println(x1 + x2 + starty);

      driver.findElement(By.name("Demo Usr"));   
    driver.swipe(x1,starty,x2,starty,3000);

我发现了一些例外

共有1个答案

谭俊
2023-03-14

您提供的代码将从左向右滑动屏幕。但是要将元素从一个位置移动到另一个位置,请使用以下代码:

WebElement elem = driver.findElement(By.xpath("ur xpath"));//get element locator as ur wish by accesibility id or xpath. 

int startX = elem.getLocation().getX();
int startY = elem.getLocation().getY();

//this will swipe from right to left horizontally
driver.swipe(startX,startY,startX-90,startY,2000);
// use 90 or more according to ur screen position

//this will swipe from left to right horizontally
driver.swipe(startX,startY,startX+90,startY,2000);

//u must have to be sure that this location is within the screen, otherwise u will get an error

如果有任何问题,请告诉我。

 类似资料:
  • 我的测试包括一个元素列表。单击第一个以打开它,然后从右向左滑动以访问下一个并确保它们不同。 在Android上,它工作得很好,但出于某种原因,驱动程序在进入新页面后似乎没有刷新自己。 如果我试图访问一个文本我一直有元素从第一页即使我在第二或第三元素的列表 Appium iOS中是否有某种刷新页面? 这是我的代码: 寻找我的头衔 刷卡 然后重新制作“查找标题”功能,甚至我的ipad上的“难看的我”屏

  • 是否有一种方法可以在一次刷卡中实现一次只刷一张卡来解除颤振动作?

  • 我无法在iOS设备上进行测试

  • 我目前正在为Browserstack中的iOS应用程序使用Appium inspector。以前,我在搜索元素时可以很好地使用滑动功能,但在iOS上执行此操作时,它只是注册为单击。我需要知道为什么会发生这种情况,以及如何解决它。

  • 我试图使用新的Google-service-libs在我的应用中设置AdMob广告。在Genymotion模拟器广告中一切看起来都很好。但他们没有像我的Galaxy Ace GT5830i和Android 2.3.6这样的真实设备。我不知道是什么问题。 下面是一些代码: XML: 我的Ad_Unit_Id以字符串形式保存。res/文件夹中的xml文件。 java语言: 如果您需要更多代码,请告诉我

  • 我在GitHub中使用这个项目:https://github.com/gankit0701/Face-Mask-Detection-In-android-App 这个使用TensorFlow Lite for mobile(Android)。它检测一个人是否戴面具。它在面部顶部绘制一个框(红色/绿色)。 我奇怪的问题是,如果我直接在设备上安装演示APK,面罩检测工作正常。但是当我在Android