-2

I have two parameters [username and password]. These two could be read from excel into the API. But when I use these values in the API, I could not get the response in the API. Kindly help me with the solution. Thanks in advance.

I am using excel to read the parameters.

println ("...Fetching Username         : "+Username)
println (".. Fetching Password         : "+Password)
WS.sendRequest(findTestObject('SIT_BDA/LoginAPI',[ ('Username'): Username, ('Password') : Password]))

I wanted to use the username and password which are being read from the excel and get the response in the API.

Mate Mrše
  • 7,997
  • 10
  • 40
  • 77
  • Please, post the outcome of the above code (error trace, etc.). – Mate Mrše May 07 '19 at 06:48
  • What do you use to read data from xls file? Could you post some code? – plaidshirt May 07 '19 at 13:07
  • @MateMrše : Thanks for the response. I could get the output I was expecting. I have set a variable for the response I received from the first API and used the same in the next API. – Asayadeepak May 09 '19 at 04:41
  • @plaidshirt: Initially we need to read the data from the excel under the option Data Files.Then in the test suite we need to bind the desired data. Then we can create a test case to read the same. This test case needs to be executed from the test suite where we are referring the Data Binding. – Asayadeepak May 09 '19 at 04:47
  • @plaidshirt The code is as below: println ("...Fetching Username : "+Username) println (".. Fetching Password : "+Password) WS.sendRequest(findTestObject('SIT_BDA/LoginAPI',[ ('Username'):Username, ('Password') : Password])) – Asayadeepak May 09 '19 at 04:48
  • @Asayadeepak : I answered it. – plaidshirt May 09 '19 at 10:31

1 Answers1

0

To read XLS you can use Data Files in Katalon Studio. Create a new one and set input file. To write XLS file you can use Apache POI Java API, which you can set in a custom keyword. There is a detailed tutorial.

plaidshirt
  • 5,189
  • 19
  • 91
  • 181