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

Pages does not contain a definition for PageTitle

5 Answers 130 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 2
John asked on 21 Jul 2012, 07:09 PM
I see the following error: 

c:\JCRDocs\AutomationLocal\PortalC_Sharp\Activation Test by tag\Find Active Edition Csharp.tstest.cs: Line 103: (CS1061) 'PortalC_Sharp.Pages' does not contain a definition for 'PageTitle' and no extension method 'PageTitle' accepting a first argument of type 'PortalC_Sharp.Pages' could be found (are you missing a using directive or an assembly reference?)

Here is the code entered, I do not follow what is wrong. 

HtmlDiv gridDiv = Find.ById<HtmlDiv>("ctl00_cphApp_rdProducts_C_grdMyProducts");  // HTML ID = id="ctl00_cphApp_rdProducts_C_grdMyProducts"
HtmlDiv content = gridDiv.Find.ByAttributes<HtmlDiv>("rdCenter"); // class=rdCenter
  
HtmlTable table = content.Find.ByTagIndex<HtmlTable>("table", 0);
Log.WriteLine("Rows Count: " + table.Rows.Count.ToString());
  
foreach (HtmlTableRow row in table.AllRows)
{
    foreach (HtmlTableCell cell in row.Cells)
    {
        Log.WriteLine(cell.InnerText);
 
    }
}

5 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 25 Jul 2012, 01:34 PM
Hi John,

It seems that the "PageTitle" element is missing in the Elements Explorer, but there is an existing reference to that element in one of the code behind files used in your project - "Find Active Edition Csharp.tstest.cs". Please see this article on how to resolve missing page elements error.

If you continue to have difficulty, please place your project folder in a zip file and attach it here. If you deem that information too sensitive for a public forum, please attach it to a new support ticket (which is confidential) and reference this thread.

Regards,
Plamen
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Deepeka
Top achievements
Rank 1
answered on 04 Dec 2013, 10:37 AM
Hi Team,

I am facing same issue when upgraded to latest 2013 R2 version (for now i am using the trial version and found this issue  , will be upgrading to licensed version after 10th dec.2013)

c:\Platform\Priority 1 Regression Tests\Content Management\Files\Verify_Create File Group_Files_Content ManagementTest.tstest.cs: Line 80: (CS1061) 'Regression_Project.Pages.EDGE6iContentManagement20Page' does not contain a definition for 'FileGroupNameText' and no extension method 'FileGroupNameText' accepting a first argument of type 'Edge_Regression_Project.Pages.EDGE6iContentManagement20Page' could be found (are you missing a using directive or an assembly reference?)

For most of my coded test cases this issue occuring when upgarded to latest version.
Please suggest with the solution steps or do i have to go in each test case and add the missing element ??


Thanks,
D
0
Ivaylo
Telerik team
answered on 09 Dec 2013, 10:33 AM
Hello,

In order to solve this problem, I am afraid that you should proceed as advised below and following the steps in this article.
If you continue to have difficulty, please place your project folder in a zip file and attach it so we can review it further, please note that this thread is public available and it will be better to open a support ticket for providing your project, where all the information remains private.

Thank you for your understanding.

Regards,
Ivaylo
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Deepeka
Top achievements
Rank 1
answered on 23 Jan 2014, 03:38 PM
Thanks Ivaylo.

Had tried with the provided solution but still facing the same issue. Whenever i open the tests its builds the elements and creates a new one instaed of existing
 c:\edgePlatform\Priority 2 Regression Tests\System Admin\Catalog\Add_Warranty Types Coverage_ItemTypes_System AdminTest.tstest.cs: Line 88: (CS1061) 'Edge_Regression_Project.Pages.EDGE6iAdmin210Page' does not contain a definition for 'WarrantyCoverageNameText' and no extension method 'WarrantyCoverageNameText' accepting a first argument of type 'Edge_Regression_Project.Pages.EDGE6iAdmin210Page' could be found (are you missing a using directive or an assembly reference?)

so it shows error for line -
 Actions.SetText(Pages.EDGE6iAdmin210.WarrantyCoverageNameText, ((string)(System.Convert.ChangeType(Data["Name"]+date, typeof(string)))));

and in actual it builds element with EDGE6iAdmin2100 " , and then have to substitute manually from Pages.EDGE6iAdmin210.WarrantyCoverageNameText to Pages.EDGE6iAdmin2100.WarrantyCoverageNameText.

Many of my test cases are failing due to this reason. Please let me know how this issue can be avoided and as each time the tests gets load and it shows different compilation error , seems building elements change each time.




0
Ivaylo
Telerik team
answered on 28 Jan 2014, 12:20 PM
Hello,

Please note that I will need your project as stated in my previous reply in order to investigate further.

Looking forward to hearing from you.

Regards,
Ivaylo
Telerik
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
John
Top achievements
Rank 2
Answers by
Plamen
Telerik team
Deepeka
Top achievements
Rank 1
Ivaylo
Telerik team
Share this question
or