Coachmark并未在Apium的Android应用中关闭

问题描述

当我在Apium中运行我的应用程序时,我能够成功登录登录后,有一个标记可以帮助初次使用的用户。我无法使用Apium方法解散该coachmak。我尝试了如下多种方法-

(1)Thread.sleep(5000);

(2)webdriverwait等待=新的webdriverwait(driver,15,3000); wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(xPath)));

(3)findElementByXPath和findElementById都

我得到的错误是: org.openqa.selenium.NoSuchElementException:使用给定的搜索参数无法在页面上找到元素。 有关此错误的文档,请访问:https://www.seleniumhq.org/exceptions/no_such_element.html

这是我的方法的样子:

void logInBeforeOtherTestcases() throws Exception {
    // LogIn login = new LogIn();
    if (readFile(ExcelFilePath,ExcelTestSuite,ExcelTestSuiteSheetName,"GenerateSmartPractice") &&
            readFile(ExcelFilePath,ExcelTestCase,ExcelTestCaseSheetName,"smartPractice")) {
        logIn();
        smartPractice();
        if (readFile(ExcelFilePath,"smartPracticeReportedQuestion")) {
            smartPracticeReportedQuestion();
        }
    } else {
        logger.info("Login not excecuted check excel file configuration");
    }
}

void smartPractice() throws Exception {
    logger.info("Smart Practice Start");
    Thread.sleep(mili5000);

    String name = findByXpath("/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.ViewGroup/androidx.viewpager.widget.ViewPager/android.view.ViewGroup/android.view.ViewGroup/android.widget.LinearLayout[1]/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.RelativeLayout/android.widget.LinearLayout[1]/android.widget.TextView[1]").getText();
    logger.info("name is :- "+name);

    findById("com.abcd.test:id/linRewardCount").click();

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)