重庆分公司,新征程启航

为企业提供网站建设、域名注册、服务器等服务

appium-java中if-elseif学习

/** 我的页面通过名字跳转到二维码点击分享好友

     * @throws Exception 
     * 1、点击我的
     * 2、点击我的名字
     * 3、点击二维码
     * 4、点击保存
     * */
    public static void  PersonalSettingsPagesShareFriends() throws Exception
    {
        Thread.sleep(5000);
        driver.findElement(GetByLocator.getLocator("MyInfo")).click();
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        driver.findElement(GetByLocator.getLocator("PrivateCardName")).click();
        //#二维码:
        driver.findElement(GetByLocator.getLocator("PrivateCardNamerq")).click();

        //分享
        driver.findElement(GetByLocator.getLocator("QrCodeShare")).click();
        /**
         * 截图*/
        TJTAppiumTest.ScreenshotAsDate("QrCodeShare");

        List My_FriendsList =  driver.findElements(GetByLocator.getLocator("My_Friends"));

        for(AndroidElement ls:My_FriendsList)
        {
            String My_FriendsListName = ls.getAttribute("text");
            System.out.println("My_FriendsListName:" + My_FriendsListName);

            if(My_FriendsListName.equals("好友"))
            {
                driver.findElement(GetByLocator.getLocator("My_Friends")).click();
            }else if(My_FriendsListName.equals("小组")){

            } else if(My_FriendsListName.equals("微信好友")){

            } else if(My_FriendsListName.equals("微博")){

            }else if(My_FriendsListName.equals("QQ好友")){

            }else if(My_FriendsListName.equals("QQ空间")){

            }else if(My_FriendsListName.equals("信息")){

            }else {
                System.out.println("没有找到!!");
            }
        }

        //driver.findElement(GetByLocator.getLocator("My_Friends")).click();
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        driver.findElement(GetByLocator.getLocator("friend_share_contact")).click();
        driver.findElement(GetByLocator.getLocator("Friends_share_search")).sendKeys("美丽的开始");//搜索好友名称
        driver.findElement(GetByLocator.getLocator("SelectTheSearchResults")).click();
        driver.findElement(GetByLocator.getLocator("Share_send")).click();
        TJTAppiumTest.ScreenshotAsDate("Share_send");
        driver.pressKeyCode(AndroidKeyCode.BACK);
        driver.pressKeyCode(AndroidKeyCode.BACK);
        driver.pressKeyCode(AndroidKeyCode.BACK);

    }

网页名称:appium-java中if-elseif学习
网站路径:http://cqcxhl.com/article/jphcoj.html

其他资讯

在线咨询
服务热线
服务热线:028-86922220
TOP