Hi Telmo, thank you so all your solutions. it is working fine for me.
I am facing one more problem. When I want to validate whether the data is value1 or value 2 I am unable to run it.
here is the below code and unfortunately expect is not working here. I am not sure what is the issue here
data = batchlistPage.getRowText(rowNum)
expect(data).to eq(value1) | eq(value2)
//ABOVE LINE IS NOT EXECUTING AND IT COMES UP WITH FAIL MESSAGE
# expect(data.to eql? value1 || (data.to eql? value2)