Completed
Last Updated: 26 Aug 2015 13:12 by ADMIN
ADMIN
Ivaylo
Created on: 03 Apr 2015 08:22
Type: Feature Request
1
Get iteration index of a loop step throws object reference exception
Steps to reproduce:

1. Execute the test in the attached project.

Expected behavior: Test passes

Actual behavior: The coded step throws the following exeption:

Failure Information:
~~~~~~~~~~~~~~~
Exception thrown executing coded step: '[WebTest1_CodedStep] : New Coded Step'.
InnerException:
System.NullReferenceException: Object reference not set to an instance of an object.
   at TestProject.WebTest_1_.WebTest1_CodedStep() in c:\Users\ittodorov\Desktop\work files\3.04.2015\TestProject\WebTest(1).tstest.cs:line 54
3 comments
ADMIN
Ivaylo
Posted on: 26 Aug 2015 13:12
We have no reliable repro for the behavior you are describing. Everything on my end works as expected. Please submit a support ticket with more information and sample test for repro so we can investigate further. Thank you.
Shashi
Posted on: 26 Aug 2015 03:11
If I have multiple steps inside the LOOP statement, and each of these steps have the code to get current iteration index (that means all steps are coded steps), it appears that ExecutinContext.CurrentLogicalStep returns a valid value only for the first step inside the loop - the Object reference exception occurs in all other steps inside the loop.  

Is there a way for all the steps to know the current iteration index? (other than using a global variable to store the iteration index)?
ADMIN
Ivaylo
Posted on: 10 Apr 2015 07:58
Telerik:

This is because ExecutionContext.CurrentStep returns the Coded step users need as well, We added ExecutionContext.CurrentLogicalStep so that users can access both the coded and the logical parent/container step. This fix will be included in the internal build by the end of April 2015.