/**
* 设置增加群组用户 没有搞定(获取列表值有问题)
* @throws Exception */
public static void Group_Add_Team_members() throws Exception
{
/**加号*/
AndroidElement plusElement;
/**减号*/
AndroidElement immElement;
Thread.sleep(3000);
/**获取设置全部列表用户*/
List<AndroidElement> Group_list = driver.findElements(GetByLocator.getLocator("Group_user_list"));
System.out.println("获取增加之前的群里设置列表人数:"+Group_list.size());
plusElement = Group_list.get(Group_list.size()+1);//获取倒是第二个
immElement = Group_list.get(Group_list.size()-1); //获取倒是第一个
System.out.println("验证是否是加号:"+plusElement);
Thread.sleep(5000);
plusElement.click();
driver.findElement(GetByLocator.getLocator("BusinessCardCearch")).click();
driver.findElement(GetByLocator.getLocator("SearchBoxTextInput")).sendKeys("美丽的开始");
driver.findElement(GetByLocator.getLocator("SelectTheSearchResults")).click();
driver.findElement(GetByLocator.getLocator("Click_ok")).click();
/**获取设置全部列表用户*/
List<AndroidElement> Group_list_new = driver.findElements(GetByLocator.getLocator("Group_user_list"));
System.out.println("获取增加之前的群里设置列表人数:"+Group_list_new.size());
Assert.assertEquals(Group_list.size(), Group_list_new.size(),1);
driver.pressKeyCode(AndroidKeyCode.BACK);
}
属性需要获取成功,才能这样进行操作
转载于:https://blog.51cto.com/357712148/2050791