[MUSIC PLAYING]
VIKRAM PAROLKAR: Hey, guys, Vikram Parolkar
from the test automation team here.
And in today's session, we're going
to be talking about behavior-driven development,
or the BDD framework.
What exactly is behavior-driven development?
Well, it's a technique for agile software development.
In BDD, test cases are written in a natural language that's
easy to understand.
That, typically, is a format where you'll
have a given when and a then.
The given is going to be, typically, reserved
for prerequisites of a test case.
The when is going to be the actual steps of a test case.
You can have a bunch of ors and ands
and other logic wording in the when sequence.
And the then sequence is going to be the assertion.
What is actually being tested, and any tear-down
steps that you might have after a test-case assertion is
completed.
Now, the main question is, does UiPath
have built in BDD support?
And the answer is a resounding yes.
Two of the features that we'll see in today's demo
is the given when then file templates,
and the ability to take each of these sequences
and make them into reusable components
such that you can separate and reuse different sequences
and prerequisite steps, tear-down steps,
or even individual steps that build upon one another
as you get more complex test scenarios.
Now, the BDD framework typically starts with a business user
writing out these test cases.
And one of the easiest ways to write out these test cases
is simply just input the data into an Excel.
Here, I have an Excel template of six different test
scenarios, and I've separated the given
when then into different columns.
The prerequisite can be found in column C.
It's going to be the same for each of these test scenarios.
I want to open the UiBank website.
The when sequence is going to be different steps.
I need to click a product dropdown.
I need to click loans.
I need to apply for a loan and enter different test
data into my workflow.
The then sequence is going to be the specific assertion
that I need to make depending on the test data and test scenario
that I've defined.
UiPath actually recently had a test suite community hackathon.
In this hackathon, the winner created a project
where you could simply run an attended RPA
automation to ingest that Excel template and output the studio
files, at least skeletons of them,
so that a developer has a head start.
Now, here, all a user needs to do
is download the Excel template and fill it out
and then upload that completed template.
I'll go ahead and do that here.
And where do I want the files to output?
I'll go ahead and choose the same folder.
Then I'll simply generate the studio files.
We'll see that, right now, there are no files, but if I refresh,
the files have now been generated.
The format of these files is going to use our out-of-the-box
given when then BDD framework file template.
And you can see here, the prerequisites of the given
are already populated for me.
The when is simply annotated that I can drag and drop
any activities, and the then sequence
has my verifications already there for me.
I just need to define the required expressions
and the output expression for my when sequence.
Now, if I were starting from scratch,
and I didn't have this really cool automatic generator
automation, I could simply say new test case
and choose the BDD test case framework.
If I wanted to customize it at all,
UiPath allows customization of these file templates as well.
As I automate different sequences, for example,
if I create a open UiBank sequence, any time I want
to replicate this sequence in another test case,
I can simply right click it and say, extract as a workflow.
What this does is it makes it a reusable component
within the same workflow that I can simply drag and drop.
I can store these different sequences
in their own different project folders,
and so if I drag this up to the given components,
you'll see it here as an available drag and drop
component now.
And if I wanted to use one of these,
I can simply drag it, pass in different data arguments,
and quickly build out the relevant workflow.
And so I've invoked my given sequence.
If I return to my main workflow, I
can do the same of dragging in a when sequence and dragging
in a then sequence.
So to answer the question, does UiPath support BDD?
The answer is a resounding yes.
Until next time, bye.
[MUSIC PLAYING]