Recording dependency DDT

Best practices, code snippets for common functionality, examples, and guidelines.
csolanki
Posts: 73
Joined: Thu Mar 22, 2018 8:51 am

Recording dependency DDT

Post by csolanki » Fri Sep 21, 2018 8:04 am

HI Team,

If I want to give dependency of my current recording on previous recording. How I can implement it. I tried doing it by creating smart folders and giving "If" to it, but not able to figure out how to proceed further.

I want to create something like

- recording 1
if recording 1 passes
go to execute recording 2.
else
go to recording 3


is this possible ?

User avatar
Stub
Posts: 173
Joined: Fri Jul 15, 2016 1:35 pm

Re: Recording dependency DDT

Post by Stub » Fri Sep 21, 2018 8:43 am

You might be able to achieve this by structuring your tests with nested smart folders and using the Error Behaviour options such as continue with sibling and continue with parent.

csolanki
Posts: 73
Joined: Thu Mar 22, 2018 8:51 am

Re: Recording dependency DDT

Post by csolanki » Fri Sep 21, 2018 9:08 am

Okay, Thanks. Is there any good documentation available over error behaviour usage ?

McTurtle
Posts: 191
Joined: Thu Feb 23, 2017 10:37 am
Location: Benedikt, Slovenia

Re: Recording dependency DDT

Post by McTurtle » Fri Sep 21, 2018 9:17 am

Hi csolanki,

You'll need the following setup:
  • You need to put each recording in its own Smart Folder so that you can use the conditional execution for the 2nd and 3rd recordings.
  • You need a teardown after Rec1 so that you can check if the Smart Folder failed or passed.
  • The check cannot be done before the teardown because the information of failure/success is not final before that.
  • You need a global parameter that you can assign the value of the following line of code to in the code module in the teardown:
varCurrentTestContainerStatus=TestReport.CurrentTestContainerActivity.Status.ToString();
You then use the value of this global parameter in the conditional execution of the 2nd and 3rd Smart Folder.

The sample is attached:
ConditionalExample.zip
(20.25 KiB) Downloaded 3 times
Please let me know if this helps.

Regards,
McTurtle

csolanki
Posts: 73
Joined: Thu Mar 22, 2018 8:51 am

Re: Recording dependency DDT

Post by csolanki » Mon Sep 24, 2018 9:37 am

Hey, I got it.

One more doubt, this variable is only storing last played smart recording folder output status ,right?

McTurtle
Posts: 191
Joined: Thu Feb 23, 2017 10:37 am
Location: Benedikt, Slovenia

Re: Recording dependency DDT

Post by McTurtle » Mon Sep 24, 2018 12:50 pm

Hi csolanki,

A teardown can only be assigned to one test container (test case/smart folder). The code will always indicate the failure/success of this container. Please note, if a child container fails it also means that the parent container fails. The rest should be clear :)

Regards,
McTurtle

csolanki
Posts: 73
Joined: Thu Mar 22, 2018 8:51 am

Re: Recording dependency DDT

Post by csolanki » Tue Sep 25, 2018 8:02 am

Thanks a lot. It worked.