Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Appium Automation manipulates fields through indexing

Shulou Source: shulou.com Published: 2022-06-03 04:45:42 11月25日 Update

/ * added group users did not get it (there is a problem getting list values) * @ throws Exception * / public static void Group_Add_Team_members () throws Exception {/ * * plus * / AndroidElement plusElement; / * * minus * / AndroidElement immElement; Thread.sleep (3000) / * * get set all list user * / List Group_list = driver.findElements (GetByLocator.getLocator ("Group_user_list")); System.out.println ("get the number of people in the group set list before it is added:" + Group_list.size ()); plusElement = Group_list.get (Group_list.size () + 1) / / get the second immElement = Group_list.get (Group_list.size ()-1); / / get the first System.out.println ("verify whether it is a plus sign:" + plusElement); Thread.sleep (5000); plusElement.click (); driver.findElement (GetByLocator.getLocator ("BusinessCardCearch")). Click () Driver.findElement (GetByLocator.getLocator ("SearchBoxTextInput"). SendKeys ("Beautiful start"); driver.findElement (GetByLocator.getLocator ("SelectTheSearchResults")). Click (); driver.findElement (GetByLocator.getLocator ("Click_ok")). Click (); / * get the full list of settings user * / List Group_list_new = driver.findElements (GetByLocator.getLocator ("Group_user_list")) System.out.println ("get the number of people in the group setting list before the increase:" + Group_list_new.size ()); Assert.assertEquals (Group_list.size (), Group_list_new.size (), 1); driver.pressKeyCode (AndroidKeyCode.BACK);}

Property needs to be obtained successfully in order to operate like this

Tags: Users number of people however plus sign beauty success minus sign attribute problem validation field index automation Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Shulou Information MySQL Redmi macOS