I am using Appium and Cucumber with Ruby to carry out some UI tests on our application. I want to use the code below to select a button, with the same name but found in two different cells, for example cell 1 and cell 2. I do not want to use Xpath for this, I would really prefer to stick to using name.
Then(/^I click 'Like' on first file$/) do find_element(:name, "Like").click end
Then(/^I click 'Like' on second file$/) do find_element(:name, "Like").click end
Does anybody have any ideas on how to achieve this? Using each of these lines of code will only interact with the first button, and I would like a way to be able to interact with any of the 'Like' buttons in the Table Cells without resorting to Xpath.
Thanks in advance!