RPA testing | Test suite | Containers Given, Then and When

Hi there,

Apologies for the long post. :slight_smile:
I have queries related to following article from Uipath website.
RPA testing

  1. I failed to understand the three containers i.e. Given, When, Then. I am not bale to fine how to use them , for which type of scenario, its significance.
    What goes in Given container
    What goes in When container
    What goes in Then container
  2. It has been mentioned that a test case can be created by clicking right click on a workflow xaml file and then click create test case => a sequence with Given, Then and when containers will be generated. When I instead click Add → Test case , it generates a test case which is totally different in appearance than the one created with Given,Then and When containers i.e. a blank sequence. Why so? and what’s the difference between the two?

How can I execute a simple gmail login scenario using all this wherein I keep my credentials in a text file or excel file, login to gmail and then get the results as PASS or FAIL.

1 Like

Hi @Tarun_Bajpai

This is because only the Test Cases created from project xaml files using this option will result in the three contains:
image

1 Like

Hi Tarun!
We support 2 different types of Test cases, or concepts of testing:

  • Application Testing
  • RPA Testing

When you create a Test case from a Workflow, this is an RPA Test case, as it wraps your Workflow, allows you to set arguments, as well as run those separately.
Creating a Test case in any other way is an Application Test case, meant for testing applications, not the workflows themselves.

Could you create this manually as well:
Yes, right now you could build RPA Test cases from “Application Test cases”, we do not recommend it though, especially as we might add additional features in the future.

Regarding “Given/When/Then”:
This is based on BDD. In the Given section you add everything that is necessary for initializing your test case, e.g. setup the environment, changing/assigning variables and so on. Everything that the When section needs to correctly function. The When section should contain your test scope, so the sets of steps executing the necessary steps so you can test your workflow (in case of RPA Testing). In the Then section you ideally do the Verifications, the real test that this Test case should do. Remember - a Test case without a Verification is not a Test case.

Of course all this is just a recommendation, you can build those RPA Test cases the way you want. Sometimes it is not even possible to do all the Verification only at the end (e.g. testing the state of a button), or it is at least not feasible in terms of effort. We want to bring certain best-practices to you, not forcefully push you into concepts.

As there are more different types of testing for Application testing, we did decide not to go with “Given/When/Then” for Test cases in Application Testing. Especially as we plan with one of the next versions to introduce the selection of a template you can choose, either templates that we deliver or even templates you can create yourself.

I hope that helps,
Thanks,
Bye,
Chris

4 Likes

@Christian_Mayer
Hi Christian,
Thank you for the detailed response. It helped.

Thanks @loginerror

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.