Matched JSONWP error code 7 to NoSuchElementError
See original GitHub issueThe 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);
}
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:20 (1 by maintainers)
Top GitHub Comments
You can get more details from the source code: https://github.com/appium/appium-uiautomator2-server/blob/20de6220d4d9b888892b8e148a1e16b6aa8b874d/app/src/main/java/io/appium/uiautomator2/handler/FindElement.java#L95
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.