public static void UnFollow() { try { MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_Weibo.Myself); MobileAndroidDriver.GetElementByXpath(MobileCommonElement_Weibo.Follow).Click(); MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_Weibo.AllFollowed); //MobileAndroidDriver.GetElementByName(Element_Weibo.Followed_Search).SendKeys("啊"); //ResetKeyboard("搜狗输入法小米版"); //MobileAndroidDriver.androidDriver.PressKeyCode(AndroidKeyCode.KeycodeNumpad_ENTER); MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_Weibo.FollowedAccount); MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_Weibo.Chat); //clearAllMessage MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_Weibo.Setting); MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_Weibo.ClearHistory); MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_Weibo.ClearConfirm); MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_Weibo.Back); MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_Weibo.Back); MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_Weibo.Followed); MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_Weibo.UnFollowed); MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_Weibo.UnFollowed_Confirm); Mobile_WeChat_Utility.BackButtonClick(); //MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement.Cancle); Mobile_WeChat_Utility.BackButtonClick(); } catch (Exception e) { Mobile_WeChat_Utility.BackButtonClick(); } }
public static void ResetKeyboard(string keyboard) { Mobile_WeChat_Utility.BackToHome(); MobileAndroidDriver.GetElementByXpath("//android.widget.FrameLayout[contains(@content-desc,'设置')]").Click(); FaceRankingMobilePage_WeChat.SwipeSetting(); MobileAndroidDriver.ClickElemnetPerName("语言和输入法"); MobileAndroidDriver.ClickElemnetPerName("当前输入法"); MobileAndroidDriver.ClickElemnetPerName(keyboard); Mobile_WeChat_Utility.BackToHome(); OpenWeChatFromHome(); }
public static void CheckLinkAvailable() { try { FaceRankingMobilePage_WeChat.BackWards(); FaceRankingMobilePage_WeChat.BackWards(); MobileAndroidDriver.GetElementByName(MobileCommonElement_WeChat.ContactList).Click(); MobileAndroidDriver.GetElementByName(MobileCommonElement_WeChat.ShareUser).Click(); Thread.Sleep(2 * 1000); MobileAndroidDriver.GetElementByName(FaceRankingMobileElement.ChatWith).Click(); Mobile_WeChat_Utility.GetLatestMessageElement().Click(); } catch (Exception e) { throw new Exception(e.Message); } }
public static void ShareToWeChat() { try { MobileAndroidDriver.GetElementByXpath(FaceRankingMobileElement.Weibo_More).Click(); MobileAndroidDriver.ClickElemnetPerName(FaceRankingMobileElement.WeChat_Moment); MobileAndroidDriver.ClickElemnetPerName(FaceRankingMobileElement.Send); Mobile_WeChat_Utility.BackToHome(); MobileAndroidDriver.androidDriver.Dispose(); MobileAndroidDriver.AndroidInitialize(); MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_WeChat.Discover); MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_WeChat.Moments); MobileAndroidDriver.GetElementByXpath(FaceRankingMobileElement.Webo_Share).Click(); } catch (Exception e) { } }
public static void UnFollowWeChatOffcialAccount() { try { MobileAndroidDriver.GetElementByName(MobileCommonElement_WeChat.ContactList).Click(); MobileAndroidDriver.GetElementByName(MobileCommonElement_WeChat.OfficialAccount).Click(); MobileAndroidDriver.GetElementByName(MobileCommonElement_WeChat.TestAccout).Click(); //MobileAndroidDriver.GetElementByXpath("com.tencent.mm:id/qa").Click(); //MobileAndroidDriver.GetElementByXpath(FollowedAutoReplyElement.H5OfficialAccount).Click(); MobileAndroidDriver.GetElementByName("聊天信息").Click(); MobileAndroidDriver.GetElementByName("更多").Click(); MobileAndroidDriver.GetElementByXpath("//android.widget.LinearLayout[@index='3']").Click(); Thread.Sleep(3 * 1000); MobileAndroidDriver.GetElementByName("不再关注").Click(); //MobileAndroidDriver.GetElementByXpath("//android.widget.Button[contains(@resource-id,'com.tencent.mm:id/a_y')]").Click(); } catch (Exception e) { Mobile_WeChat_Utility.BackButtonClick(); } }
public static void Follow() { try { MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_Weibo.Discovery); MobileAndroidDriver.GetElementByXpath(MobileCommonElement_Weibo.SearchEdit).SendKeys("啊_"); //MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_Weibo.Users); MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_Weibo.FollowedAccount); if (Mobile_WeChat_Utility.IsAtPerName("加关注")) { MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_Weibo.AddFollow); MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_Weibo.SaveButton); } MobileAndroidDriver.GetElementsByName("啊_荀")[1].Click(); MobileAndroidDriver.ClickElemnetPerName(MobileCommonElement_Weibo.Chat); } catch (Exception e) { } }