我正在尝试使用UIAutomator进行滚动。这个场景是这样的:我进入选项卡中的设置菜单,然后点击应用程序选项,这会给我一个选项卡中所有应用程序的列表。NOw我想滚动应用程序列表,这就是我面对的位置,issues.It滚动的是设置选项,而不是应用程序列表。我附上了一个屏幕截图和我的代码片段。
UiScrollable scroll = new UiScrollable(
new UiSelector().scrollable(true));
scroll.setAsVerticalList();
我使用这段代码来选择元素
public static void swipe()
{
MobileElement element = driver.findElementByAndroidUIAutomator(
"new UiScrollable(new UiSelector().class(\"android.widget.ImageView\")).getChildByText("
+ "new UiSelector().resourceId(\"com
我想要得到这样的东西。
Open Gmail app, look for a particular mail (scroll also) and click on it.
在下面的方法中,我能够搜索并点击特定的邮件。
public void openMailWithParticularTitle(){
UiObject2 obj = Utils.getDeviceInstance().findObject(By.res("com.google.android.gm:id/recycler_list_view"));
List<UiObj
我正在努力学习如何使用android.support.test.uiautomator中的UiSelector类。我已经尝试了几次来链接这些方法,但都没有找到一种方法。我尝试的最后一件事是这样的:
self.driver.find_element_by_android_uiautomator('
new UiSelector().fromParent("
new UiSelector().resourceId(\"com.android.app:id/content_container\
我无法让UiWatcher在我的代码中工作,即使在UiSelector不匹配的情况下,它似乎也不会被调用。
public void runWirelessWatcher() throws UiObjectNotFoundException {
String NONETWORKWATCHER_STRING = "CancelWirelessWatcher";
UiWatcher CancelWirelessWatcher= new UiWatcher() {
@Override
public b
我的滚动条一直滚动到底部。
但我需要向下滚动到“手表部分”,这是我无法执行的。
loginpage.getMensFashionList().click();//clicks on Mens Fashion
//Scroll to watches section.
driver.findElementByAndroidUIAutomator("new UiScrollable(new UiSelector().scrollable(true).instance(0)).scrollIntoView(new UiSelector().textMatches(\
我使用下面的代码获取uiautomator的子级,但不起作用
UiObject my = new UiObject(new UiSelector().className("android.widget.LinearLayout").instance(2));
int cound = my.getChildCount();
for(int i = cound - 1; i >= 0; i--) {
UiObject childmy2 = my.getChild(my.getSelector().childSelector(new U
我有使用python中的行为框架进行自动化测试的学习案例,我必须在滚动视图android中找到列表中的元素。对于示例列表:List A1、List A2、List A3、List B1、List B2、.、List Z100。我必须使用滚动页上的自动化测试在列表List Y27中找到一个元素,直到该元素被查看,并且在找到元素之后自动滚动将停止。与以前一样,对于滚动手册中的示例代码自动化,我使用以下代码:
@when('I want to buy again') #This is for condition in test case.
def toMyPurchase(conte
This is my code snap.This代码将选择元素,但不会滚动到确切的元素并选择值.Please帮助我修改它? public void applyBedTimefromdate() throws InterruptedException {
MobileElement element = (MobileElement) driver
.findElementsByAndroidUIAutomator(
"new UiScrollable(new UiSelector().resourceI
变量扩展没有在多个引号内发生。以下是代码
products = ['One','Two','Three']
for i in range(0,len(products)):
el = self.driver.find_element_by_android_uiautomator('new UiSelector().text("{}")').format(products[i])
print (el)
预期结果应为:
el = self.driver.find_elemen
在Nexus 7平板电脑上搜索某些东西时,我无法按“Go”按钮。对于键盘上的“Go”按钮,我们没有任何文本或内容说明。我试着用下面的-
//Search something say "fun"
new UiObject(new UiSelector().text("Enter URL or Search & Win")).setText("fun");
getUiDevice().pressEnter();
OR
getUiDevice().pressSearch();
Also tried :
getUiDevice()
如何正确地处理任何形式的错误/断言错误,以便当一个测试用例失败时,随后的测试仍会运行?还是只在一个JavaScript文件中有一个测试用例对我更好?
describe('SMP Service Login Page', function() {
describe('Loggin in', function() {
// Unhappy flow always first
var assert = require('assert');
var useridField;
var
我对测试非常陌生,我正在尝试自动化我的测试来测试应用程序。它有电子邮件和密码字段和登录。我填写电子邮件,然后输入密码,然后点击登录按钮。
new UiObject(new UiSelector().className("android.widget.EditText").resourceId("com.yml.usemefinal:id/email2")).setText("admin");
new UiObject(new UiSelector().className("android.widget.EditText&