I have a UITableView which contains about 50 elements. At any point only 6 of them are visible on screen. I want to select a cell which is not added to table view or say I need to select 25th item from the data list.
Now I am using this method for clicking a cell in tableview
But its not working as the 25th element is not added to the view yet. Please note that I am adding the accessibility identifier for the table view cell dynamically within the code.
I have added accessibility Identifier to tableview cell not to the text inside the cell.
So whats the option left with me to Click an element thats not displayed in table view. I tried the scrollTo() method but that didn’t work for me either.
I have the table view cell displaying two text views. Currency Short Name and Currency Long Name.
Consider the example
GBP
Great Britain Pounds
Now the accessibility Identifier for that tableview cell is set as GBP. Now I tried
driver.scrollTo(“GBP”) and driver.scrollTo(“Great Britain Pounds”)
Both didnt work. I am getting an error message
A element could not be located on the page using the Search parameter
i never used “scrollTo” and prefer to write my own code.
mine logic for iOS is:
find your element list by ID e.g. we are looking for “email_ID” in cell
in list check that some element has needed text.
if we did not found = return false, when we found go to Step4
now we have element number in list what we need to tap do in loop:
4.1) check if element location is on screen. if it is = tap on it and return true, if not ->
4.2) swipe in needed directions your table and go to step 4.1