This is a migrated thread and some comments may be shown as answers.

Issues with created code file

3 Answers 85 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Alan
Top achievements
Rank 2
Alan asked on 17 Apr 2012, 04:01 PM
Hello,

I viewed this post and it seems that the solution that will fit my needs will be to create my own C# code file and include within the project.  I am stuck on a couple minor (hopefully) issues.

- I am using a step to grab data from the data bind, however I am getting a compile error: "The name 'Data' does not exist in the current context."  Am I missing a USING statement?  I had this step working when using a Script Step, so I copied all of the using statements from that file, but the error still exists.
string Environment = (string)Data["Environment"];

- Same issue as above for 'ActiveBrowser'.

- In a Script Step, to access the methods and properties from my created code file, what is the proper call?  I have experimented with several options and just can't figure it out.  (i.e. would it be CodeFileName.ClassName.MethodName() or do i need a seperate USING statement?

EDIT 2:30pm CT -- I solved my third bullet by declaring all methods static in my code file.  I'm still stuck on the first two errors, of which now 'Log.WriteLine' has been added to the list! 

3 Answers, 1 is accepted

Sort by
0
Accepted
Plamen
Telerik team
answered on 20 Apr 2012, 01:35 PM
Hi Alan,

To be able to use ActiveBrowser and Data you need have inherit from the BaseWebAiiTest class contained in the ArtOfTest.WebAii.Design namespace. This means that you also need to add a using statement to that namespace. See the attached screenshot for more information.

All the best,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Leon
Top achievements
Rank 1
answered on 24 Apr 2012, 05:05 PM
Thanks for the help!  The inheritance is what I was missing.
0
Alan
Top achievements
Rank 2
answered on 24 Apr 2012, 05:08 PM
Thanks for the help!  The inheritance is what I was missing.
Tags
General Discussions
Asked by
Alan
Top achievements
Rank 2
Answers by
Plamen
Telerik team
Leon
Top achievements
Rank 1
Alan
Top achievements
Rank 2
Share this question
or