Pages not defined

6 posts, 0 answers
  1. john
    john avatar
    13 posts
    Member since:
    Aug 2011

    Posted 11 Aug 2011 Link to this post

    After converting steps to code, I see an error and that error is that type Pages is not defined.  Do we need to define it and where do we define and to what?

     

    Thanks,

    John

  2. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 11 Aug 2011 Link to this post

    Hi John,

    Which version of Test Studio are using? Try to upgrade to our latest release in which this problem should be solved. You can download it from your Telerik account (see screenshot).

    Hope this helps!

    Greetings,
    Plamen
    the Telerik team
    Vote for Telerik Test Studio at the Annual Automation Honors Voting!
  3. Satyajeet
    Satyajeet avatar
    8 posts
    Member since:
    Jun 2012

    Posted 03 Jan 2012 Link to this post

    Hi Plamen,
     
    I have downloaded the latest release as suggested from Telerik account.
    But i still see the error Type 'Pages' is not defined.

    Regards,
    Satya
  4. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 04 Jan 2012 Link to this post

    Hello,

    The most common reason for the error "Pages is not defined" is a namespace mismatch. Please make sure that the namespace for any .cs files are the same as the project name. For example, if my VS project is named "TestStudioProject51" then Test Studio generates a Pages.g.cs file having that namespace:
    //------------------------------------------------------------------------------
    // <auto-generated>
    //   This code was generated by a tool.
    //   Runtime Version:4.0.30319.239
    //
    //   Changes to this file may cause incorrect behavior and will be lost if
    //   the code is regenerated.
    // </auto-generated>
    //------------------------------------------------------------------------------
      
    namespace TestStudioProject51
    {
        using ArtOfTest.WebAii.Core;
        using ArtOfTest.WebAii.ObjectModel;
        using ArtOfTest.WebAii.TestAttributes;
        using ArtOfTest.WebAii.TestTemplates;
        using ArtOfTest.WebAii.Controls.HtmlControls;
          
        public class Pages
        {



    If your code behind files are not using the same namespace you will get the "Pages is not defined" error. This is how a code behind file should resemble for the project "TestStudioProject51"

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Linq;
      
    using ArtOfTest.Common.UnitTesting;
    using ArtOfTest.WebAii.Core;
    using ArtOfTest.WebAii.Controls.HtmlControls;
    using ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts;
    using ArtOfTest.WebAii.Design;
    using ArtOfTest.WebAii.Design.Execution;
    using ArtOfTest.WebAii.ObjectModel;
    using ArtOfTest.WebAii.Silverlight;
    using ArtOfTest.WebAii.Silverlight.UI;
    using Telerik.WebAii.Controls.Html;
    using Telerik.WebAii.Controls.Xaml;
      
    namespace TestStudioProject51
    {

    If this is not the case, please put your entire test project into a .zip file and attach it to a support ticket, which is confidential unlike this forum thread. We'll try to find what cause this error and fix it for you (We don't need to run the tests, we'll just fix the compile error).

    All the best,
    Plamen
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. John
    John avatar
    8 posts
    Member since:
    Jul 2012

    Posted 05 Jan 2012 Link to this post

    Can you please show us the VB version?  Also, I was told to exit out after converting the steps to code and then come back in to rebuild.  This is a known issue.

    Thanks,
    John
  6. Plamen
    Admin
    Plamen avatar
    8 posts

    Posted 06 Jan 2012 Link to this post

    Hi John,

    That is correct, this is a known issue. You can track the progress and vote for this PITS Item here: Public URL .  

    The workaround is to close all project files and reload the VB project. Open the problematic test again and build the project. Here's a video demonstrating that: http://screencast.com/t/FjUPrZIdYGAi .

    All the best,
    Plamen
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top