appium: Matched JSONWP error code 7 to NoSuchElementError

The problem

Hi, I tried in our project switch to UiAutomator2 from default Appium automation engine. Main reason why we decide to do this, were issues here on git, where some commiters writed that UIAutomation2 is more stable then Appium automation engine. Now with UiAutomator2 i have problem, that i can’t call .FindElement() on another element to find his son element. Or at least I think that this is a this problem. Can you look on this two logs and say what can be wrong?

If you need additional resources for investigation, do not be afraid to write me.

Environment

  • Appium version (or git revision) that exhibits the issue: 1.8.1
  • Last Appium version that did not exhibit the issue (if applicable): 1.8.1
  • Desktop OS/version used to run Appium: Win 10
  • Node.js version (unless using Appium.app|exe): .exe (1.6.2)
  • Mobile platform/version under test: And 7 (API 24)
  • Real device or emulator/simulator: emulator
  • Appium CLI or Appium.app|exe: .exe

Link to Appium logs

Log of function test with Appium automation engine: https://gist.github.com/MioOgbeni/50b11441dd4c1bff031bd0721c7c07a6

Log of non-function test with UiAutomator2: https://gist.github.com/MioOgbeni/9a5fc62351ebb80717fef8ee8688944b

Code To Reproduce Issue [ Good To Have ]

        [FindsBy(How = How.XPath, Using = "//android.support.v7.widget.RecyclerView[@index='0']/android.widget.LinearLayout")]
        private IList<IWebElement> Rows { get; set; }

        public List<SettingPageRow> RowList = new List<SettingPageRow>();

        public void FindRows()
        {
            if (!AmIOnSettingPage()) return;
            RowList.Clear();
            foreach (var item in Rows)
            {
                var row = new SettingPageRow();
                try
                {
                    row.Value = item.FindElement(By.Id("summary"));
                }
                catch
                {
                    row.Value = null;
                }

                try
                {
                    row.CheckBox = item.FindElement(By.Id("switchWidget"));
                }
                catch
                {
                    try
                    {
                        row.CheckBox = item.FindElement(By.Id("checkbox"));
                    }
                    catch
                    {
                        row.CheckBox = null;
                    }
                }

                try
                {
                    row.Text = item.FindElement(By.Id("title"));
                }
                catch
                {
                    row.Text = null;
                }

                RowList.Add(row);
            }
        }

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 20 (1 by maintainers)

Most upvoted comments