Completed
Last Updated: 07 Jul 2016 10:09 by ADMIN
rashmi
Created on: 08 Jun 2016 06:57
Type: Bug Report
0
executionContext.ExecutingTestAsStep returning wrong value for nested test
Hi Team,
I am using "executionContext.ExecutingTestAsStep" to differentiate between main test and executingtestasstep .
In one of the below scenario its giving wrong value for "executionContext.ExecutingTestAsStep",
eg:
Test case started
step1
step2
Test As a step1
step3
Test As step2
step4
---
Test case ends

Test As a step1 starts
step1
Test As a step1a 
step2
step3
Test As a step1 ends

Test As a step1a starts
test as a step1aa
step1
step2
Test As a step1a  ends

In the above structured test case when test "test as astep1aa" ends ,its  going inside the below loop,
if (!executionContext.ExecutingTestAsStep && !executionContext.RunFromHereStepExecuted)
                {}
which should not happened as its ExecutingTestAsStep=true .

Do I missing anything?

Thanks,
3 comments
ADMIN
Daniel Djambov
Posted on: 07 Jul 2016 10:09
Telerik: We have implemented a change to cover your case and now only for the parent test you will get the flag ExecutionContext.ExecutingTestAsStep = false, for all internal test as steps it will return 'true'. The fix will be available in our next product release expected to be out by the end of July 2016.
rashmi
Posted on: 13 Jun 2016 07:05
Thanks for the reply Daniel.
Is there any other way to differentiate main parent test and child tests.I have some code to be run only for parent test.I was using ExecutionContext.ExecutingTestAsStep and executionContext.RunFromHereStepExecuted for the purpose but for nested tests its not working as expected, its blocking my work.

Thanks,
ADMIN
Daniel Djambov
Posted on: 09 Jun 2016 06:59
Telerik: actually you are not missing anything, the behavior you describe is what happens - if you have a parent with single child test, then the above code is not triggered, but if the child test has another child (test as step), then the code is triggered for both master and first child test, as the latter is actually a parent of another test also. But IMO this behavior should be revised and I have filed an internal report to investigate it and process it. Thank you for the feedback and please follow this item to monitor the progress of the feedback.