How to check the style of a cell

Oct 16, 2012 at 6:51 AM
Edited Oct 16, 2012 at 7:10 AM

In my HMTL code, there are 2 cells that have the same title but one cell is displayed and the another one is not displayed. So how can I find the cell that is displayed to click?

Thank you.

Coordinator
Oct 16, 2012 at 7:22 AM
Edited Oct 16, 2012 at 7:23 AM

Are you experiencing an error when trying to use CUITe to click on the cell?

Do you have some sample html/js code and Coded UI test that can reproduce the issue?

There is a sample unit test from the latest source code in Sample_CUITeTestProject\HtmlControlTests.cs called HtmlTable_GetCellValueWithHeaderCell_Succeeds:

 

[TestMethod]
public void HtmlTable_GetCellValueWithHeaderCell_Succeeds()
{
    CUITe_BrowserWindow bWin = CUITe_BrowserWindow.Launch(CurrentDirectory + "/TestHtmlPage.html", "A Test");

    CUITe_HtmlTable termTable = bWin.Get<CUITe_HtmlTable>("Id=calcWithHeaderCells");

    Assert.AreEqual("3", termTable.GetCellValue(1, 1));

    bWin.Close();
}

Try using the FindCellAndClick method of the CUITe_HtmlTable class.

Coordinator
Oct 16, 2012 at 7:29 AM

See these related discussions:

http://cuite.codeplex.com/discussions/391915

http://cuite.codeplex.com/discussions/362712

Basically, use GetChildren() and ControlDefinition.