I have a situation where I need to pass a different variety of Date type variables in Karate. For this, I created a JAVA method and calling it in a feature file as shown below.
I read that its cucumber limitation which can not support dynamic variables in Scenario Outline. I also read https://github.com/intuit/karate#the-karate-way but somehow, I am not getting any idea how to solve the below situation.
Scenario Outline: test scenario outline
* def testData = Java.type('zoomintegration.utils.DataGenerator')
* def meetDate = testData.futureDate(2)
* def jsonPayLoad =
"""
{
"meetingSource": <meetingSource>,
"hostId": <host>,
"topic": <topic>,
"agenda": <topic>,
"startDateTime": <meetingDate>",
"timeZone": "Asia/Calcutta",
"duration": <duration>
}
"""
* print jsonPayLoad
Examples:
|meetingSource|host|topic|duration|meetingDate|
|ZOOM | abc |Quarter meeting|30|0|
|SKYPE | abc |Quarter meeting|30|'1980-08-12'|
|MS | abc |Quarter meeting|30|'2030-12-12'|