Issues with created code file

4 posts, 1 answers
  1. Alan
    Alan avatar
    6 posts
    Member since:
    Aug 2011

    Posted 17 Apr 2012 Link to this post

    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! 
  2. Answer
    Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 20 Apr 2012 Link to this post

    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
  3. Leon
    Leon avatar
    5 posts
    Member since:
    Jul 2012

    Posted 24 Apr 2012 Link to this post

    Thanks for the help!  The inheritance is what I was missing.
  4. Alan
    Alan avatar
    6 posts
    Member since:
    Aug 2011

    Posted 24 Apr 2012 Link to this post

    Thanks for the help!  The inheritance is what I was missing.
Back to Top