Problems with the function ScrollTable()
Posted: Thu Jan 09, 2014 12:20 pm
Hi,
I have some problems with the function ScrollTable() and need some help!
In our app we have a table where every cell represents a file.
My test case is to verify that every file in the table can be opened.
It is possible that the table contains different sections and each displayed section has at least one file entry.
I wrote a function in my usercode that opens every displayed item and I use the scrollTable()-function to get the next item if it isn't displayed
The problem occurs after the second scroll because the ranorex-index of the cells has changed.
I wrote a sample app with a MasterDetailView with 25 menu items. When I start the app the menu contains 16 visible items.
After the first call of scrollTable() I see the next item and I could tap on the item.
After the second call of scrollTable() the ranorex-index of the displayed items changed and I couldn't tap the item which should be the next to open.
Why does the ranorex-index change after the second scroll?
Do you have any idea to solve the problem?
Here is my usercode:
I use Ranorex 4.1.3 with the libRxAutomationUni_413.a.
The test device is an iPad with iOS 7.0.4.
Thanks a lot.
Best Regards,
Joerg
I have some problems with the function ScrollTable() and need some help!
In our app we have a table where every cell represents a file.
My test case is to verify that every file in the table can be opened.
It is possible that the table contains different sections and each displayed section has at least one file entry.
I wrote a function in my usercode that opens every displayed item and I use the scrollTable()-function to get the next item if it isn't displayed
The problem occurs after the second scroll because the ranorex-index of the cells has changed.
I wrote a sample app with a MasterDetailView with 25 menu items. When I start the app the menu contains 16 visible items.
After the first call of scrollTable() I see the next item and I could tap on the item.
After the second call of scrollTable() the ranorex-index of the displayed items changed and I couldn't tap the item which should be the next to open.
Why does the ranorex-index change after the second scroll?
Do you have any idea to solve the problem?
Here is my usercode:
Code: Select all
public void TouchEveryItemWithScrollingAfterLastDisplayedCellIsReached()
{
var adapter = repo.SimpleMasterDetailApp.EmptyList.As<Ranorex.IosTable>();
int sections = adapter.NumOfSections;
int shownRows = repo.SimpleMasterDetailApp.EmptyList.Find<Cell>("./container/cell", 1000).Count;
char[] delimiters = new char[] { '[', ']', ',', ' '};
int[] rowsPerSection = tointarray(adapter.NumOfRowsPerSection, delimiters);
Report.Info("Cound of displayed cells: " + shownRows);
for(int sektionidx = 0; sektionidx < sections; sektionidx++)
{
int rowsInCurrentSection = rowsPerSection[sektionidx];
int scrollidx = 1;
for(int rowidx = 1; rowidx <= rowsInCurrentSection; rowidx++)
{
if(rowidx > shownRows)
{
scrollidx++;
adapter.ScrollTable(sektionidx, scrollidx);
Report.Info(string.Format("Called ScrollTable({0},{1})",sektionidx, scrollidx));
}
var aktItem = repo.SimpleMasterDetailApp.EmptyList.FindSingle(string.Format(".//cell[{0}]/container/cell[1]", rowidx));
Touch.Tap(aktItem);
Report.Info("current element: " + repo.SimpleMasterDetailApp.LabelDetailView.Element.GetAttributeValueText("caption"));
}
}
}
public int[] tointarray(string value, char[] seperator)
{
string[] stringArray = value.Split(seperator, StringSplitOptions.RemoveEmptyEntries);
int[] intArray = new int[stringArray.Length];
for (int i = 0; i < intArray.Length; ++i)
{
int j;
string s = stringArray[i];
if (int.TryParse(s, out j))
{
intArray[i] = j;
}
}
return intArray;
}
The test device is an iPad with iOS 7.0.4.
Thanks a lot.
Best Regards,
Joerg