Calabash Cucumber, how to set up a step definition to select the first file from a list

I am automating a test for selecting the first file in a list of files. This is a list of *.xml files. These files has to be selected and have to be read by the app.

Now i have te following step definition:

Then (/^i select a XML file$/) do
touch("webView css:'a'textContent:'TCFM3-A.xml'")
sleep 2
end

So this means that when I want to select another file then 'TCFM3-A.xml' I have to update the step definition. I would like to have a step definition which will automatically select the first file in the present list and after that select the following file.

Thanks in advance to help me out

Sign In or Register to comment.