5 Answers, 1 is accepted
0
Hello,
You can use this code to achieve that:
Note, you may need to add assembly reference to System.Runtime.Serialization.dll. On my Win 7 machine it is located here:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Runtime.Serialization.dll
Regards,
Konstantin Petkov
Telerik
You can use this code to achieve that:
[CodedStep(@
"New Coded Step"
)]
public
void
WebTest1_CodedStep()
{
ArtOfTest.WebAii.Design.IntrinsicTranslators.Descriptors.LoopLogicalDescriptor loop = ExecutionContext.CurrentStep.AutoStep
as
ArtOfTest.WebAii.Design.IntrinsicTranslators.Descriptors.LoopLogicalDescriptor;
Log.WriteLine(
"LoopCurrent: "
+ loop.LoopCurrent);
}
Note, you may need to add assembly reference to System.Runtime.Serialization.dll. On my Win 7 machine it is located here:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\System.Runtime.Serialization.dll
Regards,
Konstantin Petkov
Telerik
0
neutcomp
Top achievements
Rank 2
answered on 08 Apr 2015, 02:37 PM
Hello,
This is just what i also want to use but I don't get it to work. I added the assembly and put the use statements in my code. It runs but I get an error see below.
Hope you can help me out.
Thanks
Exception thrown executing coded step:
'[EnergieDirectScraper_DoAllYears] : Amount of Loops'
.
InnerException:
System.NullReferenceException: Object reference not
set
to an instance of an
object
.
at EnergieScraper.EnergieDirectScraper.EnergieDirectScraper_DoAllYears()
in
d:\TFS\Tools\RegressionTests\EnergieScraper\Energie direct\EnergieDirectScraper.tstest.cs:line 264
using
System.Runtime.Serialization;
using
ArtOfTest.WebAii.Design.IntrinsicTranslators.Descriptors;
[CodedStep(@
"Amount of Loops"
)]
public
void
EnergieDirectScraper_DoAllYears()
{
LoopLogicalDescriptor loop = ExecutionContext.CurrentStep.AutoStep
as
LoopLogicalDescriptor;
Log.WriteLine(
"LoopCurrent: "
+ loop.LoopCurrent);
}
0
Hello Bjorn,
This is a known issue which we currently fixed.
We've added executionContext.CurrentLogicalStep so that you can access both the coded and the logical parent/container step.
This will be included in the next internal build we are going to release at the end of this month.
Thank you for your patience and understanding.
Regards,
Ivaylo
Telerik
This is a known issue which we currently fixed.
We've added executionContext.CurrentLogicalStep so that you can access both the coded and the logical parent/container step.
This will be included in the next internal build we are going to release at the end of this month.
Thank you for your patience and understanding.
Regards,
Ivaylo
Telerik
0
neutcomp
Top achievements
Rank 2
answered on 10 Apr 2015, 07:27 AM
Thanks for your feedback!
0
Hello Bjorn,
You are most welcome.
Regards,
Ivaylo
Telerik
You are most welcome.
Regards,
Ivaylo
Telerik