error no keyword found in script

32 views
Skip to first unread message

Amandeep kaur

unread,
Feb 1, 2023, 6:58:45 AM2/1/23
to robotframework-users
using a keyword $index = -1 to initiate a for loop but getting no keyword found after executing it "
Please let me knw how to resolve it
# Validate Effective Date, Sub Start Date
@{effective_dates} = Get Value From Json ${json_content} $..effectiveDate
Should Be Equal As Strings ${effective_dates}[0] ${Effective_Date}
@{start_dates} = Get Value From Json ${json_content} $..subscription.startDate
Should Be Equal As Strings ${start_dates}[0] ${START_DATE}
# Validate Provider Type and Dates
@{provider_types} = Get Value From Json ${json_content} $..template.type
@{effective_dates} = Get Value From Json ${json_content} $..effectiveDate
@{start_dates} = Get Value From Json ${json_content} $..subscription.startDate
@{hardend_dates} = Get Value From Json ${json_content} $..hardEndDate
${index} = -1
FOR ${provider_type} IN @{provider_types}
${index} = ${index} + 1
IF "${provider_type}" == "SP"
Screenshot 2023-01-18 at 11.49.18 AM.png

Craig Despeaux

unread,
Feb 1, 2023, 1:25:55 PM2/1/23
to robotframework-users
Change ${index} = -1 to:

Set Test Variable  ${index}  -1

Change ${index} = ${index} + 1 to:

${index}  Evaluate  ${index| +1

Craig



Ankush Saxena

unread,
Feb 13, 2023, 7:20:27 PM2/13/23
to robotframework-users
you should use Set Variable   

${index}   Set Variable   -1

Reply all
Reply to author
Forward
0 new messages