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

Error 1 The type 'PortalC_Sharp.ExpDates.HtmlTable' cannot be used as type parameter 'TControl'

1 Answer 83 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 2
John asked on 08 Aug 2012, 05:38 PM

When pasting the sample code from the demo code, I see the following error:
http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/code-samples/html/table-search-and-paging.aspx


Exception thrown executing coded step: '[Row_Index] : @"Indxing through Active'.
InnerException:
System.NullReferenceException: Object reference not set to an instance of an object.
   at PortalC_Sharp.ExpDate_Extract.Row_Index() in C:\MyProjects\PortalC_Sharp\ExpDates\ExpDate Extract.tstest.cs:line 119
------------------------------------------------------------
'8/8/2012 9:23:57 AM' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.

Error 1 The type 'PortalC_Sharp.ExpDates.HtmlTable' cannot be used as type parameter 'TControl' in the generic type or method 'ArtOfTest.WebAii.Core.Find.ByExpression<TControl>(params string[])'. There is no implicit reference conversion from 'PortalC_Sharp.ExpDates.HtmlTable' to 'ArtOfTest.WebAii.Controls.Control'. C:\MyProjects\PortalC_Sharp\ExpDates\HtmlTable.tstest.cs 76 31 PortalC_Sharp

Code Entered:

HtmlTable table = Find.ByExpression<HtmlTable>("id=Grid", "|", "tagIndex=table:1");
HtmlSpan next = Find.ByExpression<HtmlSpan>("class=t-icon t-arrow-next");
HtmlAnchor a = Find.ByExpression<HtmlAnchor>("href=/aspnet-mvc/Grid?ajax=True&Grid-page=2");



1 Answer, 1 is accepted

Sort by
0
Jasper
Telerik team
answered on 09 Aug 2012, 06:46 PM
Hello John,

I just took a look at this, and it looks like there might be a bug in our find logic. I've submitted a bug here: http://www.telerik.com/support/pits.aspx#/public/test-studio/12240

In the interim, you can work around this issue by changing the manner in which the HtmlAnchor is found:

HtmlAnchor a = next.Parent<HtmlAnchor>()

Try applying that code change to the example and see if things work better for you.

Regards,
the Telerik team
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
Jasper
Telerik team
Share this question
or