1

I need some help in reading the values from 2 different columns from an excel file and compare them if they are equal in Groovy script - ReadyAPI.

Actually, I need to compare them and keep an assertion if they are equal or not.

The image of columns I need to compare

enter image description here

htshame
  • 6,599
  • 5
  • 36
  • 56
Madhav
  • 11
  • 2
  • Welcome to Stack Overflow! Unfortunately, there probably isn't enough details in your question for someone to answer. Please see this link for details on how to construct a question with sufficient details: [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) – Reginald Blue Mar 13 '19 at 14:54
  • Do you have a pro license, and thereby access to using datasources, or is that done with Groovy Scripts too? – Steen Mar 13 '19 at 21:49
  • Yes, I have a Pro license and using datasources to input the data into the request – Madhav Mar 14 '19 at 09:30
  • 1
    Well, if the spreadsheet is a datasource, it should be a breeze then. In the Groovy script window, do a 'right-mouse button' click. There should be a an option labelled 'Get Data', if you click this you should be able to drill down into the datasource and select the first column of interest. Do this against for the second column. You should now have two vars that contain the values to compare. E.g. assert varA.contains(varB); – Chris Adams Mar 14 '19 at 10:37

0 Answers0