0

The BDD sample below is written using Katalon Studio

Scenario Outline: Verify Price of <plan> Plan
 Given <accountType> account is currently logged in
 When User navigates to Publish Page
 Then The price of <plan> at publish page should be <price>
 When User selects <plan> plan
 Then The price of <plan> at confirm upgrade page should be <price> 
 Examples: 
 | accountType | plan | price |
 | Free | Android | 19.79 |
 | Free | IOS | 19.79 |
 | Free | Both | 24.99 |

Is there a similar way robot framework can iterate the same scenario outline by just using Examples data? cause I've tried to convert it my solution was to use FOR loop. I've been googling this but can't seem to find a good example, and some of the blogs I've read says there's no similar way of handling it (which I can't believe)

Here's my robot framework version of it:

*** Test Cases ***
Verify Prices of All Plan
 [Setup] Login User with Free Plan ${email} ${password}
 Given User Navigates to Publish Page
 Then Verify the prices of each plan
 And The prices for each confirm purchase pages should match
*** Keywords ***
Verify the price
 [Arguments] ${whole_number_locator} ${decimal_locator} ${expected_price}
 ${whole_number} = Get Text ${whole_number_locator}
 ${decimal} = Get Text ${decimal_locator}
 ${actual_price} = Set Variable ${whole_number}${decimal}
 Should Be Equal ${expected_price} ${actual_price}
 Log ${actual_price}
Verify the prices of each plan
 FOR ${plan} IN @{plans}
 Log ${plan.name}
 Verify the price ${plan.whole} ${plan.decimal} ${plan.expected}
 END

I didn't include the variables and the step definition in Katalon Studio to avoid making this post longer.

asked Jun 30, 2020 at 7:11

1 Answer 1

1

The closest you can get to your Katalon example is using Templates with embedded arguments:

Verify Prices of All Plans
 [Template] Account ${account} and ${plan} Should Have Price ${price}
 Free Android 19.79
 Free IOS 19.79
 Free Both 24.99

All other logic would be inside Account ${account} and ${plan} Should Have Price ${price} keyword.

answered Jun 30, 2020 at 10:58
1
  • There's also datadriver library which extends test templates by providing the ability to read your testdata from external sources like database, excel sheets, csv files and such: github.com/Snooz82/robotframework-datadriver Commented Oct 13, 2020 at 7:44

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.