Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
1.6k views
by Contributing Tester (78 points)
Give the steps to do API testing with excel data in katalon studio.

I have passed this parameter.

{

"username":"${Email}",

"password":"${Password}"

}

But its not working.Param is not used in my api.I have passed the data through body only.
by The go-to Tester (142 points)
Can you share your existing code/method that you have already tried to retrieve data?

Also, post the error that you are getting.
by Contributing Tester (78 points)
Sir.Actually I have not write any code.Manually I have added the API link,method and body in object.Then call that object in testcase and verify the status code.

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint

import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase

import static com.kms.katalon.core.testdata.TestDataFactory.findTestData

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint

import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile

import com.kms.katalon.core.model.FailureHandling as FailureHandling

import com.kms.katalon.core.testcase.TestCase as TestCase

import com.kms.katalon.core.testcase.TestCaseFactory as TestCaseFactory

import com.kms.katalon.core.testdata.TestData as TestData

import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory

import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository

import com.kms.katalon.core.testobject.TestObject as TestObject

import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords

import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

import internal.GlobalVariable as GlobalVariable


var1 = WS.sendRequest(findTestObject('LoginWithValidData'))

WS.verifyResponseStatusCode(var1, 200)

1 Answer

0 like 0 dislike
by The go-to Tester (142 points)
selected by
 
Best answer
To read data from Excel file using Java, I suggest you go through this Apache POI tutorial and try to write a code,

https://www.journaldev.com/2562/apache-poi-tutorial

If you get stuck, you can ask as a new question.
by Contributing Tester (78 points)
Sir.Actually i get stuck with variable and assign that variable into my request body.Where i have to create variable.That is i know.I dont know ,How to assign that variable in object.
I have configured for UI Testing.I dont know the steps for API testing to add and assigned the excel variable into body.(KATALON STUDIO)
by The go-to Tester (142 points)
In katalon studio, you have inbuild method to read data from excel file as well, you can point an excel file with test data and your in test data tab, you can create a new variable.

Say username and password,

You can call above variable in the script as,

{

"username":username,

"password":password

}

make sure that your header, i.e. the first row in the excel file and the variables you are creating are the same.

You can go through this video to get a visual, https://www.youtube.com/watch?v=XoCzZRdEKqM
by Contributing Tester (78 points)
Thank you sir spending your precious time.


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

1.4k questions

1.6k answers

866 comments

1.9k users

...