Table methods not working

Aug 10, 2011 at 8:24 PM
Edited Aug 10, 2011 at 8:30 PM

Cuite looks pretty slick with the object recording stuff, however i am hungup on this 1 problem that's making me worried..

I get a  System.InvalidCastException: Unable to cast object of type 'Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlControl' to type 'Microsoft.VisualStudio.TestTools.UITesting.HtmlControls.HtmlRow'.

when i'm trying to call any of the table methods FindCellValue, FindRow...

In my object declaration i have a

public class SomeMainPage : CUITe_BrowserWindow
    {
        public new string sWindowTitle = "XYZ";
        public CUITe_HtmlTable tblCalculator = new CUITe_HtmlTable("Id=calculator");

    }

And in my script i'm making the call

public void TestMethod1()
     {

            SomeNamespace.SomeMainPage mainPage = CUITe_BrowserWindow.GetBrowserWindow<Namespace.SomeMainPage>();
            mainPage.tblCalculator.FindCellAndClick(3, 3);

     }

What am I doing wrong? Please advice!

NOTE: I am using Cuite 1.02.

Coordinator
Aug 11, 2011 at 3:29 AM
Edited Aug 11, 2011 at 3:51 AM

Thanks for using CUITe!

The issue may be due to nested tables. I will need the html code of the table to have a look. Please post it here.

Aug 11, 2011 at 3:54 PM

Thanks for the response. That's the code format of the table.

<div id="calculatorContainer">
    <div class="clear">
        <h2>calculator</h2>
    </div>
    <table id="calc">
        <thead>
            <tr>
                <th>Header1</th>
                <th>Header2</th>
                <th>Header2</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>Value1</td>
                <td>Value2</td>
                <td>Value3</td>               
            </tr>
            <tr>
                <td>Value4</td>
                <td>Value5</td>
                <td>Value6</td>               
            </tr>
        </tbody>
    </table>
</div>

Coordinator
Aug 16, 2011 at 2:20 PM

Able to reproduce the issue. Working on this.

Sep 7, 2011 at 9:17 AM

Hi,

Any news on this? We are having the same problem.

Coordinator
Oct 11, 2011 at 2:24 PM

Hi, this is fixed and will be available from v1.04.

Feb 8, 2012 at 5:07 PM

Hi,

I seem to be having the exact same problem in 1.0.4. The table I'm using is indeed complex (not testing friendly really) so that's probably the reason. Is there any updates on this or any possible workaround?

Coordinator
Feb 12, 2012 at 5:01 AM

Can you please try with 1.05? I have fixed some issues with CUITe_HtmlTable. If it doesn't work for you even with 1.05, please share the html code of your table. I will have a look.

--Suresh Balasubramanian

Feb 12, 2012 at 5:04 AM

I'll try tomorrow or on Friday. Thanks, I didn't know the project was back online.