简体   繁体   English

Appium不会更新列表元素和子元素中的视图

[英]Appium doesn't update it's view in list element and subelements

I am working on iOS native app and when trying to read from tableView/tableCells I have a problem getting the updated values. 我正在使用iOS本机应用程序,并且尝试从tableView / tableCells中读取时,在获取更新值时遇到问题。 At the first time i enter the page/screen I can see all cells. 第一次进入页面/屏幕时,我可以看到所有单元格。 But , if i create an action that adds another cell to the table view when I try to get the list of cells I see an empty list. 但是,如果我创建一个尝试在尝试获取单元格列表时向表视图添加另一个单元格的动作,则会看到一个空列表。 Also, When i change a subelement in that cell I can't see the changed sub element both in inspector and in the code. 另外,当我在该单元格中更改子元素时,在检查器和代码中都看不到更改后的子元素。 I tried switching to a different page and also changing tabs in that page and reread the table/cell and subelements but it didn't help. 我尝试切换到另一个页面并更改该页面中的选项卡,然后重新读取表/单元格和子元素,但这没有帮助。

I've had this issue before. 我以前有过这个问题。 There is no actual reload elements kind of function that I've seen. 我没有看到实际的重载元素那种功能。 However a workaround I've found that works is to simply find an element that exists and it'll reload the elements after it does that. 但是,我发现一种可行的解决方法是简单地找到一个存在的元素,并在这样做之后重新加载这些元素。

For example: 例如:

yourMethodThatLoadsNewElements();
driver.findElementBy(pathToElementThatExistedBefore);
driver.findElementBy(pathToElementThatWasJustLoaded);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM